diff --git a/.gitattributes b/.gitattributes index dfe0770424..ac1e451d56 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,7 @@ # Auto detect text files and perform LF normalization * text=auto + +# Checkout NPM package files with forced LF lineendings +# to prevent git conflicts when running npm commands +package.json text eol=lf +package-lock.json text eol=lf diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a769c20dfc..f3343415f0 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,7 @@ +# This file is generated. +# Add yourself to the "Definitions by:" list instead. +# See https://github.com/DefinitelyTyped/DefinitelyTyped#edit-an-existing-package + /types/abbrev/ @BendingBender /types/abs/ @AyaMorisawa /types/absolute/ @AyaMorisawa @@ -37,7 +41,7 @@ /types/adm-zip/ @jvilk @abner /types/adone/ @s0m3on3 @maxveres /types/aframe/ @devpaul @bertoritger -/types/agenda/ @meirgottlieb +/types/agenda/ @meirgottlieb @princjef /types/aggregate-error/ @BendingBender /types/alertify/ @jjeffery /types/alexa-sdk/ @petebeegle @hoo29 @pascalwhoop @blforce @rk-7 @alexmalcoci @@ -47,13 +51,17 @@ /types/alt/ @Shearerbeard /types/amazon-product-api/ @MattiLehtinen @alien35 /types/amcharts/ @ldrick +/types/amp/ @jewbre +/types/amp-message/ @jewbre +/types/amphtml-validator/ @kevincharm /types/amplify/ @joeriks /types/amplify-deferred/ @joeriks @laurentiustamate94 /types/amplitude-js/ @Asido /types/amqp/ @seikho @jonnysparkplugs /types/amqp-rpc/ @wokim -/types/amqplib/ @mnahkies @abreits @nfantone +/types/amqplib/ @mnahkies @abreits @nfantone @zelein /types/analytics-node/ @fongandrew @thomasthiebaud +/types/anchor-js/ @xt0rted /types/angular/ @diegovilar @thorn0 @calebstdenis @leonard-thieu /types/angular-agility/ @rolandzwaga /types/angular-animate/ @michelsalib @adidahiya @rasch @codyschaaf @@ -65,6 +73,7 @@ /types/angular-cookie/ @borislavjivkov /types/angular-cookies/ @diegovilar @aciccarello /types/angular-deferred-bootstrap/ @Ritzlgrmft +/types/angular-desktop-notification/ @Dona278 /types/angular-dialog-service/ @wcomartin /types/angular-dynamic-locale/ @stephenlautier /types/angular-environment/ @terrawheat @@ -110,7 +119,6 @@ /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 @mikehaas763 @@ -164,6 +172,7 @@ /types/array-find-index/ @samverschueren /types/array-foreach/ @skysteve /types/array-uniq/ @DanielRosenwasser +/types/array-unique/ @CSLTech /types/arrify/ @wanganjun /types/artillery/ @kmccoan-allocadia /types/asana/ @tkqubo @@ -179,11 +188,11 @@ /types/async-cache/ @BendingBender /types/async-lock/ @elisee @afharo @rhymmor /types/async-polling/ @Goldsmith42 -/types/async-retry/ @albertywu +/types/async-retry/ @albertywu @MeLlamoPablo /types/async.nexttick/ @pyrho /types/asynciterator/ @rubensworks /types/atlaskit__button/ @dijimsta -/types/atmosphere.js/ @toedter @Mory1879 +/types/atmosphere.js/ @toedter @Mory1879 @Scipion /types/atom/ @GlenCFL @smhxx @lierdakil /types/atom-keymap/ @GlenCFL /types/atom-mocha-test-runner/ @GlenCFL @@ -204,7 +213,7 @@ /types/autosuggest-highlight/ @senukartur /types/awesomplete/ @webbiesdk @bmdixon @tbekolay /types/aws-iot-device-sdk/ @niik @mlamp -/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 @OrthoDex @MichaelMarner @daniel-cottone @kostya-misura @coderbyheart @palmithor @daniloraisi @simonbuchan @Haydabase +/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 @OrthoDex @MichaelMarner @daniel-cottone @kostya-misura @coderbyheart @palmithor @daniloraisi @simonbuchan @Haydabase @repl-chris /types/aws-serverless-express/ @threesquared @jcaffey @mattmeye @albertovasquez /types/aws4/ @ajcrites /types/axel/ @ruslan-molodyko @@ -221,6 +230,7 @@ /types/babel-traverse/ @yortus @marvinhagemeister /types/babel-types/ @yortus @baxtersa @marvinhagemeister @bcherny /types/babel-webpack-plugin/ @j-f1 +/types/babel__code-frame/ @mohsen1 @ForbesLindesay /types/babelify/ @TeamworkGuy2 @marvinhagemeister /types/babylon/ @yortus @marvinhagemeister /types/babylon-walk/ @czbuchi @@ -231,7 +241,7 @@ /types/backbone-relational/ @eirikhm /types/backbone.layoutmanager/ @hejiang2000 /types/backbone.localstorage/ @lgrignon -/types/backbone.marionette/ @zhamid @nvivo @sventschui +/types/backbone.marionette/ @zhamid @nvivo @sventschui @razorness /types/backbone.paginator/ @Nyamazing /types/backbone.radio/ @alphaleonis /types/backgrid/ @jlujan @@ -245,6 +255,7 @@ /types/base-x/ @chrootsu /types/base16/ @alechill /types/base64-js/ @pe8ter +/types/base64-url/ @urish /types/base64topdf/ @lucasriondel /types/bases/ @harikv /types/bash-glob/ @mrmlnc @@ -255,6 +266,7 @@ /types/bcryptjs/ @RafaelKr /types/beats/ @urish /types/bech32/ @micksatana +/types/bell/ @SimonSchick /types/bem-cn/ @selkinvitaly /types/better-curry/ @pocesar /types/better-sqlite3/ @Morfent @matrumz @@ -269,7 +281,6 @@ /types/binary-parser/ @riggs @dolanmiu /types/bind-ponyfill/ @skysteve /types/bindings/ @unindented -/types/bingmaps/ @rbrundritt /types/bintrees/ @CjS77 /types/bip21/ @stefanhuber /types/bip38/ @micksatana @@ -300,11 +311,12 @@ /types/bonjour/ @quentin-ol @octo-sniffle /types/bookshelf/ @arcticwaters @vesse /types/boom/v3/ @rogatty -/types/boom/v4/ @rogatty @AJamesPhillips @jineshshah36 -/types/boom/ @rogatty @AJamesPhillips @jineshshah36 @TimonVS +/types/boom/v4/ @rogatty @AJamesPhillips @jineshshah36 @danielmachado +/types/boom/ @rogatty @AJamesPhillips @jineshshah36 @TimonVS @danielmachado /types/bootbox/ @vbortone @konpikwastaken @kanup @icereed @trodi @stannynuytkens @renjfk /types/bootpag/ @rdeneau -/types/bootstrap/ @borisyankov +/types/bootstrap/v3/ @borisyankov +/types/bootstrap/ @denisname /types/bootstrap-3-typeahead/ @AndersonFriaca /types/bootstrap-datepicker/ @borisyankov /types/bootstrap-fileinput/ @CheCoxshall @@ -322,6 +334,7 @@ /types/bootstrap.timepicker/ @derikwhittaker @heatherbooker /types/bootstrap.v3.datetimepicker/v3/ @bayitajesi /types/bootstrap.v3.datetimepicker/ @katonap +/types/bootstrap3-dialog/ @nakupanda @cnboland /types/bounce.js/ @cherrry /types/box2d/ @jbaldwin /types/brace-expansion/ @BendingBender @@ -348,7 +361,7 @@ /types/bufferstream/ @Bartvds /types/builtin-modules/ @ajafff /types/bull/v2/ @bgrieder @JProgrammer -/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold +/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga /types/bump-regex/ @silkentrance /types/bunnymq/ @cyrilschumacher /types/bunyan/ @amikhalev @@ -363,8 +376,8 @@ /types/bwip-js/ @MugeSo /types/byline/ @reppners /types/bytebuffer/ @cappellin -/types/bytes/ @danny8002 -/types/c3/ @mcliment @gerinjacob @denyo @dmitryshindin +/types/bytes/ @danny8002 @believer +/types/c3/ @mcliment @gerinjacob @denyo @dmitryshindin @timn /types/cache-manager/ @GausSim /types/cal-heatmap/ @RetroChrisB /types/callsite/ @newclear @@ -385,8 +398,7 @@ /types/caseless/ @downace @mastermatt /types/cash/ @akvlko /types/casperjs/ @jedmao @urielch -/types/cassandra-driver/ @Svjard -/types/catalog/ @grossbart @wereHamster +/types/cassandra-driver/ @Svjard @pc-jedi /types/catbox/v7/ @jasonswearingen @AJamesPhillips /types/catbox/ @jasonswearingen @AJamesPhillips @saboya /types/cbor/ @pushplay @@ -409,7 +421,7 @@ /types/chai-subset/ @delta62 @AGBrown /types/chai-webdriverio/ @sherlock1982 /types/chai-xml/ @jedigo -/types/chance/ @cbowdon @brikou +/types/chance/ @cbowdon @brikou @cafesanu /types/change-emitter/ @iskandersierra /types/charm/ @Xananax /types/charset/ @cspotcode @@ -429,6 +441,7 @@ /types/chroma-js/v0/ @invliD /types/chroma-js/ @invliD @mpacholec /types/chrome/ @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 +/types/circuit-breaker-js/ @DeTeam /types/circular-json/ @jpevarnek /types/ckeditor/ @wittwert /types/clamp-js/ @Hikariii @@ -439,6 +452,9 @@ /types/clean-stack/ @BendingBender /types/clean-webpack-plugin/ @j-f1 /types/clear-require/ @dan-j +/types/clearbladejs-client/ @ClearBlade +/types/clearbladejs-node/ @ClearBlade +/types/clearbladejs-server/ @ClearBlade /types/cleave.js/ @clentfort @jasongi-at-sportsbet @sashashakun /types/cli/ @kayahr /types/cli-color/ @ChaosinaCan @@ -475,7 +491,6 @@ /types/color-namer/ @in19farkt /types/color-string/ @BendingBender @danmarshall /types/colorbrewer/ @mtraynham -/types/colors/ @Bartvds @staeke /types/com.darktalker.cordova.screenshot/ @akarienta /types/combine-source-map/ @TeamworkGuy2 /types/combined-stream/ @felixge @tlaziuk @@ -483,6 +498,7 @@ /types/cometd/ @derekcicerone /types/command-line-args/ @CzBuCHi /types/command-line-commands/ @CzBuCHi +/types/command-line-usage/ @Dvorsky /types/commangular/ @hiraash /types/comment-json/ @Jason3S /types/common-tags/ @zuzusik @tzupengwang @@ -492,7 +508,7 @@ /types/component-emitter/ @psnider /types/compose-function/ @denis-sokolov /types/compressible/ @BendingBender -/types/compression/ @santialbo +/types/compression/ @santialbo @rburgt /types/compression-webpack-plugin/ @dublicator /types/compute-stdev/ @mrmlnc /types/concat-stream/ @jmarianer @@ -502,6 +518,7 @@ /types/confidence/ @jppellerin /types/config/ @RWander @forrestbice @jndonald3 @albertovasquez /types/configstore/ @ArcticLight +/types/configurable/ @jewbre /types/confit/ @ethanresnick /types/connect/ @SomaticIT /types/connect-busboy/ @pinguet62 @@ -559,6 +576,7 @@ /types/cordova_app_version_plugin/ @larrybahr /types/cordovarduino/ @hendrikmaus /types/core-js/ @rbuckton @mfdeveloper +/types/cosmiconfig/ @ozum /types/cote/ @makepost /types/couchbase/ @maouida /types/countdown/ @gjuchault @@ -579,7 +597,7 @@ /types/createjs-lib/ @evilangelist @gyohk /types/credential/ @phuvo /types/credit-card-type/ @LKay -/types/cron/ @horiuchi +/types/cron/ @horiuchi @winup /types/cropperjs/ @stepancar /types/croppie/ @connor4312 @dklmuc @sarunint /types/cross-spawn/ @Alorel @@ -598,6 +616,7 @@ /types/csurf/ @horiuchi /types/csv-parse/ @davidm77 @obi-jan-kenobi /types/csv-stringify/ @rogierschouten @arjenvanderende +/types/csv2json/ @dex4er /types/csvrow/ @codeanimal /types/csvtojson/ @EricByers @wcarson /types/cucumber/v1/ @abraaoalves @jan-molak @isoung @BendingBender @@ -665,8 +684,11 @@ /types/dat.gui/ @gyohk @sonic3d @rroylance /types/data-driven/ @mrhen /types/datadog-metrics/ @pushplay +/types/datadog-tracer/ @dineshsaravanan /types/datatables.net/ @Silver-Connection @omidkrad @pragmatrix @CNBoland +/types/datatables.net-autofill/ @andy-maca /types/datatables.net-buttons/ @Silver-Connection @SammyG4Free @jimhartford +/types/datatables.net-colreorder/ @andy-maca /types/datatables.net-fixedheader/ @szechyjs @Silver-Connection /types/datatables.net-rowgroup/ @maixiu /types/datatables.net-rowreorder/ @baywet @@ -697,14 +719,14 @@ /types/deep-freeze/ @Bartvds @aluanhaddad /types/deep-freeze-es6/ @mattbishop /types/deep-freeze-strict/ @mhegazy -/types/deepmerge/ @marvinscharle @syy1125 +/types/deepmerge/ @marvinscharle @syy1125 @AppLover69 /types/defaults/ @IbtihelCHNAB /types/defer-promise/ @niklasf /types/define-lazy-prop/ @BendingBender /types/defined/ @BendingBender /types/deku/ @pocka /types/del/v2/ @AyaMorisawa -/types/del/ @AyaMorisawa @BendingBender +/types/del/ @AyaMorisawa @BendingBender @bitjson /types/delaunator/ @DenisCarriere /types/delay/ @BendingBender /types/denodeify/ @joaomoreno @@ -729,11 +751,13 @@ /types/dhtmlxscheduler/ @mkozhukh /types/di-lite/ @dcrusader /types/diacritics/ @otociulis -/types/diff/ @vvakame +/types/diff/ @vvakame @szdc /types/diff2html/ @rtfpessoa /types/dir-resolve/ @andy-ms /types/discontinuous-range/ @OiCMudkips +/types/dispatchr/ @Ragg- /types/disposable-email-domains/ @geoffreak +/types/dnssd/ @angelmerino /types/doccookies/ @jonegerton /types/dockerode/ @seikho @nlaplante @isac322 @lazarusx @meisenzahl @thegecko /types/docopt/ @giggio @@ -758,14 +782,15 @@ /types/dotenv/v2/ @jussikinnula @borekb @enaeseth /types/dotenv/ @jussikinnula @borekb @enaeseth /types/dotenv-safe/ @krenor +/types/dotenv-webpack/ @karol-majewski /types/dotfile-regex/ @mrmlnc /types/dottie/ @domarmstrong /types/double-ended-queue/ @dsagal /types/doublearray/ @mzsm -/types/doubleclick-gpt/ @johngeorgewright +/types/doubleclick-gpt/ @johngeorgewright @steven-joyce /types/download/ @nicojs /types/downloadjs/ @cwmoo740 -/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar +/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar @sulf /types/drag-timetable/ @chinkan /types/draggabilly/ @jaydubu /types/dragster/ @zskovacs @@ -784,11 +809,11 @@ /types/dvtng-jss/ @Ptival /types/dw-bxslider-4/ @namerci /types/dwt/v12/ @yushulx -/types/dwt/ @yushulx @jbh +/types/dwt/ @yushulx @jbh @lincoln2018 @Tom-Dynamsoft /types/dygraphs/ @danvk /types/dymo-label-framework/ @thijskuipers /types/dynatable/ @francoismassart -/types/dynogels/ @SpartanLabs +/types/dynogels/ @SpartanLabs @ramondeklein @stephentuso /types/each/ @misak113 /types/earcut/ @NaridaL /types/easeljs/ @evilangelist @@ -811,7 +836,7 @@ /types/ejs/ @benliddicott /types/ejs-locals/ @jt000 /types/ejson/ @shantanubhadoria -/types/elasticsearch/ @CasperSkydt @bfsmith @ddunkin @pushplay @mlamp @ahmadferdous @SimonSchick +/types/elasticsearch/ @CasperSkydt @bfsmith @ddunkin @pushplay @mlamp @ahmadferdous @SimonSchick @brabster @deerawan /types/electron-config/ @mrfunkycold @unindented /types/electron-debug/ @unindented /types/electron-devtools-installer/ @gamesmaxed @@ -833,7 +858,7 @@ /types/elm/ @thSoft /types/email-templates/ @cyrilschumacher @gurisko @blankstar85 /types/ember/v1/ @jedmao -/types/ember/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie +/types/ember/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie @alexlafroscia /types/ember-data/ @dwickern @mike-north @chriskrycho /types/ember-feature-flags/ @tansongyang /types/ember-mocha/ @dwickern @@ -852,6 +877,7 @@ /types/engine.io-client/ @KentarouTakeda /types/enhanced-resolve/ @e-cloud @onigoetz /types/enigma.js/ @konne +/types/enquire.js/ @screendriver /types/ent/ @rogierschouten /types/entities/ @aliceklipper /types/env-to-object/ @MugeSo @@ -873,6 +899,7 @@ /types/es6-weak-map/ @pine /types/escape-html/ @elisee /types/escape-latex/ @olsio +/types/escape-regexp/ @jewbre /types/escape-string-regexp/ @kruncher @faergeek /types/escodegen/ @simondel /types/eslint/ @pmdartus @j-f1 @@ -888,33 +915,40 @@ /types/estraverse/ @sanex3339 /types/estree/ @RReverser /types/etag/ @BendingBender +/types/ethereumjs-util/ @cortopy /types/ethjs-signer/ @doppio /types/eureka-js-client/ @Schnillz /types/evaporate/ @kookster @chrisrhoden /types/event-emitter/ @LKay +/types/event-emitter-es6/ @ahstro /types/event-kit/ @GlenCFL /types/event-loop-lag/ @rogierschouten /types/event-stream/ @flcdrg /types/event-to-promise/ @flying-sheep /types/events/ @yasupeke +/types/eventsource/ @scottleedavis /types/evernote/ @corps +/types/excel-style-dataformatter/ @SanderDeWaal1992 /types/exceljs/ @rogierschouten @alitaheri /types/execa/ @douglasduteil @BendingBender @borekb @mickdekkers +/types/exenv/ @christianchown /types/exit/ @Bartvds /types/exit-hook/ @BendingBender /types/exorcist/ @TeamworkGuy2 /types/expect/ @jmreidy @merrywhether +/types/expect-puppeteer/ @JoshuaKGoldberg /types/expect.js/ @teppeis /types/expectations/ @vvakame /types/expo/v23/ @KonstantinKai /types/expo/v24/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger -/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger +/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov /types/expo__vector-icons/ @incleaf /types/express/ @borisyankov /types/express-brute/ @cyrilschumacher /types/express-brute-memcached/ @cyrilschumacher /types/express-brute-mongo/ @cyrilschumacher /types/express-brute-redis/ @scottharwell +/types/express-bunyan-logger/ @shreyjain1994 /types/express-busboy/ @pinguet62 /types/express-cluster/ @nenadalm /types/express-debug/ @federicobond @@ -922,12 +956,13 @@ /types/express-ejs-layouts/ @erikma /types/express-enforces-ssl/ @kevinstubbs /types/express-fileupload/ @Naktibalda +/types/express-flash/ @iMobs /types/express-flash-2/ @mathsalmi /types/express-flash-notification/ @Mister4Eyes /types/express-formidable/ @tdolsen @evanshortiss -/types/express-graphql/ @isman-usoh @nitintutlani @hubel @zya +/types/express-graphql/ @isman-usoh @nitintutlani @hubel @zya @mlamp @firede /types/express-handlebars/ @stpettersens @yhaskell -/types/express-jwt/ @wokim @kacepe @Sl1MBoy +/types/express-jwt/ @wokim @kacepe @Sl1MBoy @milan-mimra /types/express-less/ @xieyubo /types/express-minify/ @borislavjivkov /types/express-mongo-sanitize/ @ericbyers @@ -952,8 +987,10 @@ /types/extract-text-webpack-plugin/ @flying-sheep @katyo /types/extract-zip/ @mizunashi-mana /types/eyes/ @brynbellomy +/types/ez-plus/ @AndersonFriaca /types/f1/ @neolwc -/types/fabric/ @oklemencic @joewashear007 @mrand01 @NotWoods +/types/fabric/ @oklemencic @joewashear007 @mrand01 @NotWoods @bmartinson +/types/facebook-instant-games/ @menushka /types/facebook-js-sdk/ @amritk /types/facebook-pixel/ @noctishsu /types/faker/v3/ @Kuniwak @@ -974,6 +1011,7 @@ /types/fastclick/ @shinnn /types/favico.js/ @drowse314-dev-ymat /types/fb/ @JoshStrobl +/types/fb-watchman/ @whtsky /types/fbemitter/ @kmxz /types/featherlight/ @xStrom /types/feathersjs__authentication/ @AbraaoAlves @j2L4e @@ -984,7 +1022,7 @@ /types/feathersjs__authentication-oauth2/ @j2L4e /types/feathersjs__configuration/ @j2L4e /types/feathersjs__errors/ @j2L4e -/types/feathersjs__express/ @j2L4e +/types/feathersjs__express/ @j2L4e @DadUndead /types/feathersjs__feathers/ @j2L4e @AbraaoAlves /types/feathersjs__primus/ @j2L4e /types/feathersjs__primus-client/ @j2L4e @@ -995,7 +1033,7 @@ /types/feedme/ @codeanimal /types/feedparser/ @cortopy /types/fetch-jsonp/ @tkrotoff -/types/fetch-mock/ @asvetliakov @tamird @merrywhether @chrissinclair +/types/fetch-mock/ @asvetliakov @tamird @merrywhether @chrissinclair @matttennison @quentinbouygues /types/fetch.io/ @newraina /types/ffi/ @loyd /types/ffmpeg-static/ @iamstevetran @@ -1038,10 +1076,11 @@ /types/flux/ @stkb @GiedriusGrabauskas /types/fluxxor/ @mrk21 /types/fm-websync/ @markusmauch +/types/fnv-lite/ @marcind /types/fontfaceobserver/ @RandScullard /types/fontoxml/ @rolandzwaga /types/forever-agent/ @yavanosta -/types/forever-monitor/ @shuntksh +/types/forever-monitor/ @shuntksh @wrboyce /types/forge-di/ @adamcarr /types/form-data/ @soywiz @leonyu @BendingBender /types/form-serializer/ @flqw @@ -1060,7 +1099,8 @@ /types/freeport/ @atd-schubert /types/fresh/ @BendingBender /types/friendly-errors-webpack-plugin/ @bahlo -/types/frisby/ @johnny4753 +/types/frisby/v0/ @johnny4753 +/types/frisby/ @cwoodland @johnny4753 /types/from/ @Bartvds /types/from2/ @BendingBender /types/fromjs/ @glenndierckx @@ -1233,8 +1273,9 @@ /types/gaussian/ @scttcper /types/geetest/ @plantain-00 /types/gen-readlines/ @CodeAnimal +/types/generate-changelog/ @ffflorian /types/generic-functions/ @stpettersens -/types/generic-pool/ @jerray +/types/generic-pool/ @jerray @wrboyce /types/gently/ @bonnici /types/geodesy/ @DenisCarriere @HandyG52 @excelulous /types/geojson/ @cobster @atd-schubert @JeffJacobson @@ -1257,6 +1298,7 @@ /types/git-config/ @stpettersens /types/git-remote-origin-url/ @janslow /types/github-username-regex/ @BehindTheMath +/types/gitlab/ @yanqing6628780 @Arylo /types/gl-matrix/ @mattijskneppers @tatchx @nbabanov @auzmartist @surtr-isaz /types/gldatepicker/ @qcz /types/glidejs/ @milanjaros @@ -1270,6 +1312,7 @@ /types/globalize-compiler/ @iclanton /types/globby/ @douglasduteil @ikatyang /types/globule/ @durad +/types/glue/ @garfty /types/gm/ @ChaosinaCan @maartenvanvliet /types/go/ @NorthwoodsSoftware /types/google-adwords-scripts/ @jafaircl @@ -1297,9 +1340,10 @@ /types/graceful-fs/ @Bartvds @BendingBender /types/graham_scan/ @hberntsen /types/graphite-udp/ @EricByers -/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio +/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz /types/graphql-date/ @enaeseth /types/graphql-iso-date/ @jwaldrip +/types/graphql-list-fields/ @filipows /types/graphql-relay/ @arvitaly @nitintutlani @Grelinfo /types/graphql-resolve-batch/ @nayni /types/graphql-type-json/ @schfkt @@ -1396,7 +1440,8 @@ /types/hapi/v16/ @jasonswearingen @AJamesPhillips /types/hapi/ @BorntraegerMarc @rafaelsouzaf @jhsimms /types/hapi-auth-basic/ @AJamesPhillips @saboya -/types/hapi-auth-jwt2/ @warrenseymour +/types/hapi-auth-jwt2/v7/ @warrenseymour +/types/hapi-auth-jwt2/ @warrenseymour @SimonSchick /types/hapi-decorators/ @kenhowardpdx /types/har-format/ @micmro /types/hard-rejection/ @BendingBender @@ -1448,6 +1493,7 @@ /types/html-minifier/ @tkrotoff @rikuayanokozy /types/html-pdf/ @westy92 /types/html-to-text/ @erykwarren +/types/html-void-elements/ @rhysd /types/html-webpack-plugin/ @deevus @bumbleblym @tlaziuk /types/html-webpack-template/ @bumbleblym /types/html2canvas/ @rwhepburn @tan9 @@ -1521,7 +1567,7 @@ /types/iniparser/ @chrootsu /types/inline-css/ @philipisapain /types/inline-style-prefixer/ @ahz @dpetrezselyova -/types/inquirer/ @tkQubo @ppathan @jouderianjr +/types/inquirer/ @tkQubo @ppathan @jouderianjr @bang88 @bitjson @synarque @jrockwood /types/insert-module-globals/ @leonard-thieu /types/insight/ @vvakame /types/integer/ @Morfent @@ -1551,7 +1597,9 @@ /types/is-archive/ @mhegazy /types/is-array/ @pine /types/is-binary-path/ @DanielRosenwasser +/types/is-color/ @VitorLuizC /types/is-compressed/ @mhegazy +/types/is-empty/ @termosa /types/is-finite/ @mhegazy /types/is-glob/ @mrmlnc /types/is-hotkey/ @petester42 @@ -1579,7 +1627,7 @@ /types/iso-3166-2/ @sicilica /types/iso8601-localizer/ @avielfedida /types/isomorphic-fetch/ @toddlucas -/types/isotope-layout/ @avidenic +/types/isotope-layout/ @avidenic @malinushj /types/istanbul/ @tkrotoff /types/istanbul-lib-coverage/ @jason0x43 /types/istanbul-lib-hook/ @jason0x43 @@ -1590,6 +1638,7 @@ /types/istanbul-reports/ @jason0x43 /types/ityped/ @DanielRosenwasser /types/ix.js/ @Igorbek +/types/jackrabbit/ @elvisvoer /types/jade/ @panuhorsmalahti /types/jalaali-js/ @alitaheri /types/japanese-holidays/ @syamatoo @@ -1617,14 +1666,17 @@ /types/jdataview/ @RReverser /types/jdenticon/ @mtr /types/jest/v16/ @NoHomey @jwbay -/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @AhnpGit +/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @AhnpGit @joshuakgoldberg @bradleyayers /types/jest-diff/ @myabc /types/jest-docblock/ @ikatyang +/types/jest-environment-puppeteer/ @joshuakgoldberg /types/jest-get-type/ @myabc +/types/jest-image-snapshot/ @dawnmist /types/jest-in-case/ @geovanisouza92 /types/jest-json-schema/ @deadNightTiger /types/jest-matcher-utils/ @myabc /types/jest-matchers/ @joscha +/types/jest-specific-snapshot/ @dawnmist /types/jest-validate/ @ikatyang /types/jfs/ @tlaziuk /types/jjv/ @Nemo157 @@ -1633,7 +1685,7 @@ /types/johnny-five/ @nakakura @ujvzolee @workshop2 /types/joi/v6/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW /types/joi/v10/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku -/types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun +/types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun @rafaelkallis /types/joigoose/ @boothwhack /types/josa/ @vichyssoise /types/jpeg-js/ @DanielRosenwasser @@ -1648,8 +1700,10 @@ /types/jquery-awesome-cursor/ @zskovacs /types/jquery-backstretch/ @dkulyk /types/jquery-countdown/ @AndersonFriaca +/types/jquery-countto/ @AndersonFriaca /types/jquery-cropbox/ @PerKastman /types/jquery-deparam/ @patsissons +/types/jquery-drawer/ @pine /types/jquery-easy-loading/ @delphinus35 /types/jquery-editable-select/ @baywet /types/jquery-fullscreen/ @bgrieder @@ -1676,10 +1730,12 @@ /types/jquery-urlparam/ @stpettersens /types/jquery-validation-unobtrusive/ @EnableSoftware /types/jquery.address/ @martinduparc @mardaneus86 +/types/jquery.appear/ @AndersonFriaca /types/jquery.are-you-sure/ @jonegerton /types/jquery.autosize/ @kingdango /types/jquery.bbq/ @sunetos /types/jquery.bootstrap.wizard/ @niemyjski @dennisahlin +/types/jquery.browser/ @AndersonFriaca /types/jquery.cleditor/ @pushplay /types/jquery.clientsidelogging/ @diullei /types/jquery.color/ @derekcicerone @@ -1709,6 +1765,7 @@ /types/jquery.notifybar/ @zaneli /types/jquery.noty/ @kingdango @thelfensdrfer /types/jquery.payment/ @ejsmith @johnrutherford +/types/jquery.pin/ @AndersonFriaca /types/jquery.pjax/ @lijunle /types/jquery.placeholder/ @majorsilence @EnableSoftware /types/jquery.pnotify/ @DavidSichau @FUNExtreme @@ -1752,10 +1809,12 @@ /types/js-fixtures/ @kazimanzurrashid /types/js-git/ @Bartvds /types/js-md5/ @mwmccarthy +/types/js-money/ @kanatkubash /types/js-quantities/ @wrummler /types/js-schema/ @marcinporebski @roblabat /types/js-search/ @guoyunhe /types/js-sha512/ @nicojs +/types/js-string-escape/ @viralpickaxe /types/js-to-java/ @skyitachi /types/js-url/ @pine613 /types/js-yaml/ @Bartvds @sclausen @@ -1780,13 +1839,15 @@ /types/json-pointer/ @Bartvds /types/json-query/ @mtraynham /types/json-rpc-ws/ @npenin @mlamp -/types/json-schema/ @bcherny @cyrilletuzi +/types/json-schema/ @bcherny @cyrilletuzi @lucianbuzzo /types/json-socket/ @svi3c /types/json-stable-stringify/ @mhfrantz /types/json-stringify-safe/ @BendingBender +/types/json2csv/ @juanjoDiaz /types/json2md/ @MartynasZilinskas /types/jsonata/ @nick121212 /types/jsoneditor/ @alejo90 +/types/jsoneditor-for-react/ @joshuakgoldberg /types/jsoneditoronline/ @vbortone /types/jsonfile/ @dbowring /types/jsonminify/ @no23reason @@ -1801,13 +1862,17 @@ /types/jsqrcode/ @lordazzi /types/jsrender/ @zakki /types/jsreport-core/ @taoqf +/types/jsreport-html-to-xlsx/ @me +/types/jsreport-jsrender/ @taoqf +/types/jsreport-phantom-pdf/ @taoqf +/types/jsreport-xlsx/ @taoqf /types/jsrp/ @harryshipton -/types/jss/ @appsforartists @kof +/types/jss/ @appsforartists @kof @pelotom /types/jssha/ @randombk @SrTobi /types/jstimezonedetect/ @olamothe /types/jstorage/ @dflor003 /types/jstree/ @adaskothebeast -/types/jsts/ @StephaneAlie +/types/jsts/ @StephaneAlie @jrocha /types/jsuite/ @darrenhillconsulting /types/jsuri/ @coldacid @flqw /types/jsurl/ @agorshkov23 @@ -1818,11 +1883,12 @@ /types/jui-core/ @easylogic /types/jui-grid/ @easylogic /types/jweixin/ @taoqf @gomydodo -/types/jwplayer/ @martinduparc @kutomer @philippguertler +/types/jwplayer/ @martinduparc @kutomer @philippguertler @danielmcgraw /types/jws/ @JustinBeckwith /types/jwt-client/ @timoteoponce /types/jwt-decode/v1/ @QuatroDevOfficial /types/jwt-decode/ @GiedriusGrabauskas @madsmadsen +/types/jwt-express/ @nickp10 /types/jwt-simple/ @kenfdev @GaelMagnan /types/kafka-node/ @dansitu @bkim54 @sfrooster @amiram /types/karma/ @tkrotoff @43081j @@ -1831,6 +1897,7 @@ /types/karma-coverage/ @tkrotoff /types/karma-fixture/ @evictor /types/karma-jasmine/ @michelsalib +/types/karma-viewport/ @karak /types/karma-webpack/ @mtraynham /types/katex/ @mrand01 /types/kcors/ @Xstoudi @izayoiko @@ -1844,12 +1911,13 @@ /types/keypress.js/ @rcchen /types/keysym/ @harryshipton /types/keytar/ @miniak @shiftkey @juturu +/types/keyv/ @Arylo /types/kik-browser/ @joelday /types/klaw/v1/ @mceachen /types/klaw/ @mceachen /types/klaw-sync/ @shiftkey /types/kms-json/ @sunnyone -/types/knex/ @tkQubo @baronfel @MeLlamoPablo @mastermatt @micksatana +/types/knex/ @tkQubo @baronfel @MeLlamoPablo @mastermatt @micksatana @shreyjain1994 /types/knex-postgis/ @vesse /types/knockback/ @borisyankov /types/knockout/ @borisyankov @Igorbek @moonpyk @EnableSoftware @BenjaminEckardt @ffMathy @@ -1914,7 +1982,7 @@ /types/kramed/ @tonicblue /types/kss/ @giladgray /types/kue/ @drudge @amiram @pc-jedi -/types/kurento-utils/ @nenadalm +/types/kurento-utils/ @nenadalm @riggs /types/kuromoji/ @mzsm @kgtkr /types/lab/ @prashaantt /types/ladda/ @dflor003 @leemicw @@ -1973,6 +2041,7 @@ /types/line-by-line/ @etomsen /types/line-reader/ @stpettersens /types/linkify-it/ @praxxis +/types/listr/ @durad /types/lls/ @borislavjivkov /types/load-json-file/ @SamVerschueren /types/loader-runner/ @e-cloud @@ -2311,6 +2380,7 @@ /types/mailcheck/ @pocesar /types/maildev/ @cyrilschumacher @zbarbuto /types/mailgen/ @vothanhkiet @jordanfarrer +/types/mailgun-js/ @sampsonjoliver /types/mailparser/ @psnider /types/main-bower-files/ @k-kagurazaka /types/make-dir/ @ikatyang @BendingBender @@ -2323,7 +2393,7 @@ /types/mapnik/ @ipv4sec /types/mapsjs/ @davismj /types/mariasql/ @bennett000 -/types/mark.js/ @renjfk +/types/mark.js/ @renjfk @RomanGotsiy /types/markdown-it/ @rapropos /types/markdown-it-anchor/ @seryl /types/markdown-it-container/ @hronex @@ -2375,12 +2445,13 @@ /types/media-typer/ @BendingBender /types/medium-editor/ @keika299 /types/mem/ @SamVerschueren +/types/mem-fs/ @MyFoodBag /types/memcached/ @KentarouTakeda /types/memoizee/ @juanpicado /types/memory-cache/ @jedigo @thieman /types/memory-fs/ @e-cloud /types/memwatch-next/ @cyrilschumacher -/types/meow/ @KnisterPeter @praxxis +/types/meow/ @KnisterPeter @praxxis @bitjson /types/merge-descriptors/ @danny8002 /types/merge-stream/ @k-kagurazaka @daniel-zazula /types/merge2/ @tkrotoff @smac89 @@ -2396,7 +2467,7 @@ /types/meteor-persistent-session/ @vangorra /types/meteor-prime8consulting-oauth2/ @vangorra /types/meteor-publish-composite/ @vangorra -/types/meteor-roles/ @vangorra +/types/meteor-roles/ @vangorra @mattmm3d /types/method-override/ @santialbo /types/methods/ @cprecioso /types/metric-suffix/ @davidm77 @@ -2416,10 +2487,11 @@ /types/mime-types/ @Perlmint /types/mimos/ @AJamesPhillips /types/mina/ @lhk @mattanja @kant2002 +/types/mini-css-extract-plugin/ @JounQin /types/minimatch/ @vvakame @shantmarouti /types/minimist/ @Bartvds @Necroskillz @kamranayub /types/minimist-options/ @ikatyang -/types/minio/ @barinbritva +/types/minio/ @barinbritva @castorw /types/minipass/ @BendingBender /types/mirrorx/ @aaronphy /types/mithril/ @spacejack @andraaspar @isiahmeadows @@ -2430,7 +2502,7 @@ /types/mkdirp/ @Bartvds @mrmlnc /types/mkpath/ @optical /types/mobx-apollo/ @pselden -/types/mocha/ @kazimanzurrashid @otiai10 @jt000 @enlight +/types/mocha/ @kazimanzurrashid @otiai10 @jt000 @enlight @cspotcode /types/mocha-each/ @magnostherobot /types/mocha-phantomjs/ @ErikSchierboom /types/mocha-steps/ @Arylo @@ -2456,9 +2528,9 @@ /types/moment-timezone/ @michelsalib @alanblins /types/mongo-sanitize/ @CedricCazin /types/mongodb/v2/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi -/types/mongodb/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi +/types/mongodb/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker @julien-c /types/mongoose/v4/ @simonxca @horiuchi @sindrenm @lukasz-zak -/types/mongoose/ @simonxca @horiuchi @sindrenm @lukasz-zak @Alorel @jendrikw @ethanresnick +/types/mongoose/ @horiuchi @sindrenm @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab /types/mongoose-auto-increment/ @AyaMorisawa /types/mongoose-deep-populate/ @AyaMorisawa /types/mongoose-geojson-schema/ @bondz @@ -2469,6 +2541,7 @@ /types/mongoose-sequence/ @linusbrolin /types/mongoose-simple-random/ @rsxdalv /types/mongoose-unique-validator/ @stevehipwell +/types/mongorito/ @pinguet62 /types/moo/ @deltaidea @MofX /types/moonjs/ @DanielRosenwasser /types/morgan/ @staticfunction @pscanf @@ -2487,6 +2560,7 @@ /types/msportalfx-test/ @julioct /types/mssql/ @jaminfarr @buzinas @mrrichar @elhaard @pkeuter /types/mu2/ @jedigo +/types/muicss/ @samuelneff /types/multer/ @jt000 @DavidBR-SW @mxl @hyunseob /types/multer-gridfs-storage/v1/ @devconcept /types/multer-gridfs-storage/ @devconcept @@ -2502,9 +2576,10 @@ /types/musicmetadata/ @Xstoudi /types/mustache/ @markashleybell /types/mv/ @nenadalm -/types/mysql/ @wjohnsto @kacepe @kpping +/types/mysql/ @wjohnsto @kacepe @kpping @jdmunro /types/mz/ @ThomasHickman /types/n3/ @phreed +/types/named-regexp-groups/ @jewbre /types/nano/ @timjacobi @vincekovacs /types/nanoajax/ @nathancahill /types/nanoid/ @bash @@ -2515,9 +2590,10 @@ /types/natsort/ @mgroenhoff /types/natural/ @dmoonfire /types/natural-sort/ @a-morales +/types/navermaps/ @ckboyjiy /types/navigation/ @grahammendick /types/navigation-react/ @grahammendick -/types/navigo/ @aersamkull @dancespiele +/types/navigo/ @aersamkull @dancespiele @deini /types/nblas/ @erikgerrits /types/nconf/ @jedigo @jmthibault /types/ncp/ @bartvds @@ -2559,16 +2635,17 @@ /types/ngstorage/ @kubiq /types/ngtoaster/ @btesser /types/ngwysiwyg/ @patrick-mackay -/types/nightmare/ @horiuchi @samyang-au +/types/nightmare/ @horiuchi @samyang-au @Bleser92 /types/nightwatch/ @rkavalap @schlesiger -/types/noble/ @swook @wind-rider @shantanubhadoria @lukel99 @bioball @keton +/types/nivo-slider/ @AndersonFriaca +/types/noble/ @swook @wind-rider @shantanubhadoria @lukel99 @bioball @keton @thegecko /types/nock/ @bonnici @horiuchi @afharo @mastermatt @damour /types/nodal/ @charrondev /types/node/v4/ @eps1lon /types/node/v6/ @WilcoBakker @inlined @eps1lon @Alorel /types/node/v7/ @parambirs @tellnes @WilcoBakker @eps1lon -/types/node/v8/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 -/types/node/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 +/types/node/v8/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e +/types/node/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e /types/node-7z/ @erkie /types/node-array-ext/ @Beng89 /types/node-cache/ @chrootsu @dthunell @useltmann @@ -2585,7 +2662,7 @@ /types/node-gcm/ @horiuchi /types/node-geocoder/ @rosek86 /types/node-getopt/ @kcauchy -/types/node-hid/ @mhegazy @ert78gb +/types/node-hid/ @mhegazy @ert78gb @thegecko /types/node-horseman/ @apratheek /types/node-hue-api/ @fjmorel /types/node-int64/ @x3cion @kevin-greene-ck @@ -2596,9 +2673,10 @@ /types/node-notifier/ @tkQubo /types/node-polyglot/ @timjk /types/node-powershell/ @rodrigoff +/types/node-pushnotifications/ @menushka /types/node-ral/ @ssddi456 /types/node-red/ @andersea -/types/node-rsa/ @alitaheri +/types/node-rsa/ @alitaheri @xm /types/node-schedule/ @cyrilschumacher @flowpl /types/node-slack/ @tkQubo /types/node-snap7/ @heilingbrunner @@ -2614,6 +2692,7 @@ /types/node-xmpp-core/ @PJakcson /types/node-zookeeper-client/ @plantain-00 @jessezhang91 /types/node_redis/ @borisyankov +/types/nodecredstash/ @migstopheles /types/nodegit/ @dolanmiu /types/nodemailer/v3/ @rogierschouten /types/nodemailer/ @rogierschouten @dex4er @@ -2687,7 +2766,8 @@ /types/onoff/ @marcel-ernst /types/open/ @Bartvds /types/opener/ @tikurahul -/types/openfin/ @chrisbarker +/types/openfin/v17/ @chrisbarker +/types/openfin/ @chrisbarker @rdepena /types/openjscad/ @danmarshall /types/openlayers/v2/ @bolhovsky /types/openlayers/v3/ @osechet @matthiasdailey-ccri @@ -2758,11 +2838,12 @@ /types/papaparse/ @torpedro @rainshen49 @jfloff @johnnyreilly /types/paper/ @clark-stevenson @Xakaloz /types/paralleljs/ @jbaldwin +/types/parcel-env/ @fathyb /types/parent-package-json/ @sgmccli /types/parity-pmd/ @leovujanic @jewbre /types/parity-pmr/ @leovujanic /types/parity-poe/ @leovujanic -/types/parse/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes +/types/parse/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas /types/parse-git-config/ @leonard-thieu /types/parse-glob/ @glen-84 /types/parse-json/ @mrmlnc @@ -2803,6 +2884,7 @@ /types/path-exists/v1/ @shiwano /types/path-exists/ @shiwano @BendingBender /types/path-is-absolute/ @mhegazy +/types/path-is-inside/ @aomarks /types/pathfinding/ @BNedry /types/pathjs/ @lokeshpeta /types/pathwatcher/ @GlenCFL @@ -2864,8 +2946,9 @@ /types/platform/ @JakeH /types/playcanvas/ @Neoflash1979 /types/playerframework/ @ricardosabino +/types/playmusic/ @nickp10 /types/pleasejs/ @nakakura -/types/plotly.js/ @chrisgervang @martinduparc @frederikaalund @taoqf @Dadstart +/types/plotly.js/ @chrisgervang @martinduparc @frederikaalund @taoqf @Dadstart @szechyjs /types/plugapi/ @BNedry /types/plugin-error/ @rogierschouten /types/plupload/ @patrickbussmann @@ -2882,6 +2965,7 @@ /types/popcorn/ @grapswiz /types/portscanner/ @douglasduteil /types/postal/ @lokeshpeta @myitcv +/types/postman-collection/ @kbuzby /types/postmark/ @benbayard /types/pouch-redux-middleware/ @charrondev /types/pouchdb/ @AGBrown @geppy @fredgalvao @@ -2913,6 +2997,7 @@ /types/pretty-ms/ @BendingBender /types/printf/ @AluisioASG /types/priorityqueuejs/ @geoffreak +/types/prismic-dom/ @nickw444 /types/prismjs/ @eriklieben @andrewiggins @mmiszy /types/private-ip/ @coderslagoon /types/procfs-stats/ @cyrilschumacher @@ -2970,11 +3055,11 @@ /types/puppeteer/ @marvinhagemeister @cdeutsch @jwbay /types/pure-render-decorator/ @seansfkelley /types/purl/ @danfma -/types/pusher-js/ @tkqubo +/types/pusher-js/ @tkqubo @cainlevy /types/pvutils/ @microshine /types/python-shell/ @dolanmiu @WORMSS /types/q/v0/ @bnemetchek @johnnyreilly -/types/q/ @bnemetchek @AndrewGaspar @johnnyreilly @mboudreau +/types/q/ @bnemetchek @AndrewGaspar @johnnyreilly @mboudreau @TeamworkGuy2 /types/q-io/ @Bartvds /types/q-retry/ @vilic /types/qhistory/ @Kovensky @@ -2997,7 +3082,7 @@ /types/rabbit.js/ @wokim /types/radium/ @alexgorbatchev @nupplaphil @asvetliakov @mihe /types/radius/ @codeanimal -/types/ramda/ @donnut @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @charlespwd @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick +/types/ramda/ @donnut @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @charlespwd @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman /types/random-js/ @pistacchio /types/random-number/ @OpenByteDev /types/random-seed/ @endel @@ -3019,7 +3104,7 @@ /types/raspi-soft-pwm/ @nebrius /types/ratelimiter/ @AyaMorisawa /types/raty/ @terrawheat -/types/raven/ @scttcper @1999 +/types/raven/ @scttcper @1999 @shreyjain1994 /types/raven-for-redux/ @chiubaka /types/raygun4js/ @xt0rted @BenjaminHarding /types/rbac-a/ @tlaziuk @@ -3031,16 +3116,17 @@ /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 @theruther4d +/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @joshuakgoldberg @jrakotoharisoa /types/react-alert/ @ssyrell /types/react-alice-carousel/ @endigo /types/react-app/ @prakarshpandey /types/react-aria-menubutton/ @forabi @crohlfs /types/react-autosuggest/ @nicolas-schmitt @pjo256 @robessog @tbayne @cdeutsch @rosskevin -/types/react-beautiful-dnd/ @varHarrie @bradleyayers +/types/react-avatar-editor/ @diogocorrea @gabsprates +/types/react-beautiful-dnd/ @varHarrie @bradleyayers @paustint /types/react-big-calendar/ @piotrwitek @paustint @pikpok /types/react-body-classname/ @mhegazy -/types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall +/types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall @jrakotoharisoa /types/react-bootstrap-date-picker/ @LKay @ssi-hu-antal-bodnar /types/react-bootstrap-daterangepicker/ @ianks /types/react-bootstrap-table/v2/ @flaub @alelode @UJosue10 @@ -3098,7 +3184,7 @@ /types/react-flexr/ @pushplay /types/react-fontawesome/ @timurrustamov @dublicator @vincaslt @gavingregory /types/react-form/v1/ @cameron-mcateer -/types/react-form/ @cameron-mcateer +/types/react-form/ @cameron-mcateer @TiuSh /types/react-foundation/ @danielearwicker /types/react-geosuggest/ @brmenchl /types/react-google-recaptcha/ @KoalaHuman @@ -3121,6 +3207,7 @@ /types/react-image-gallery/ @adamwpc /types/react-imageloader/ @stephenjelfs /types/react-infinite/ @rhysd +/types/react-infinite-calendar/ @christianchown /types/react-infinite-scroller/ @Lapanti @psrebniak /types/react-input-calendar/ @stepancar /types/react-input-mask/ @apare @@ -3136,8 +3223,10 @@ /types/react-lazyload/ @m0a /types/react-leaflet/ @danzel @davschne @yuit /types/react-list/ @buptyyf @tomshen -/types/react-loadable/ @Kovensky @odensc @ianks @tlaziuk +/types/react-loadable/ @Kovensky @odensc @ianks @tlaziuk @iMobs /types/react-loader/ @artfuldev +/types/react-mailchimp-subscribe/ @osdiab +/types/react-map-gl/ @rimig /types/react-maskedinput/ @LKay @lavoaster @CarlosBonetti /types/react-mce/ @morphologue /types/react-mdl/ @bradzacher @@ -3147,19 +3236,23 @@ /types/react-monaco-editor/ @jnetterf /types/react-motion/ @stepancar @asvetliakov @dimitarnestorov /types/react-motion-slider/ @asvetliakov -/types/react-native/ @alloy @huhuanming @iRoachie @timwangdev @kamal @nelyousfi -/types/react-native-collapsible/ @iRoachie +/types/react-native/ @alloy @huhuanming @iRoachie @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software +/types/react-native-android-taskdescription/ @christianchown +/types/react-native-auth0/ @ascariandrea +/types/react-native-collapsible/ @iRoachie @umidbekkarimov /types/react-native-communications/ @huhuanming @PaitoAnderson /types/react-native-datepicker/ @jacobbaskin /types/react-native-doc-viewer/ @iRoachie /types/react-native-document-picker/ @plantain-00 /types/react-native-drawer/ @jnbt /types/react-native-drawer-layout/ @jmfirth +/types/react-native-elevated-view/ @fhelwanger /types/react-native-fabric/ @josephroque /types/react-native-fbsdk/ @ifiokjr /types/react-native-fetch-blob/ @MNBuyskih /types/react-native-fs/ @pocesar @josephroque /types/react-native-google-signin/ @j-fro +/types/react-native-i18n/ @VincentLanglet /types/react-native-keep-awake/ @huhuanming /types/react-native-linear-gradient/ @j-fro /types/react-native-loading-spinner-overlay/ @fhelwanger @@ -3170,23 +3263,29 @@ /types/react-native-modalbox/ @iRoachie /types/react-native-navigation/ @egorshulga /types/react-native-orientation/ @MoLow +/types/react-native-permissions/ @vincentlanglet +/types/react-native-photo-view/ @christianchown /types/react-native-popup-dialog/ @PaitoAnderson @connectdotz /types/react-native-push-notification/ @PaitoAnderson @tomSawkins /types/react-native-qrcode/ @plantain-00 /types/react-native-safari-view/ @mrand01 /types/react-native-scrollable-tab-view/ @CaiHuan @egorshulga /types/react-native-sensor-manager/ @SahinVardar -/types/react-native-snap-carousel/ @jnbt @j-fro +/types/react-native-snap-carousel/ @jnbt @j-fro @gazaret /types/react-native-sortable-grid/ @j-fro /types/react-native-sortable-list/ @sivolobov +/types/react-native-sqlite-storage/ @dryganets +/types/react-native-star-rating/ @iRoachie /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-text-input-mask/ @RodrigoAWeber +/types/react-native-touch-id/ @huhuanming @gazaret /types/react-native-vector-icons/ @iRoachie @timwangdev -/types/react-native-video/ @huhuanming @abrahambotros -/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @abrahambotros @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver +/types/react-native-version-number/ @VincentLanglet +/types/react-native-video/ @huhuanming +/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman /types/react-notification-system/ @GiedriusGrabauskas @DeividasBakanas @LKay @sztobar /types/react-notification-system-redux/ @LKay /types/react-numeric-input/ @heatherbooker @@ -3195,6 +3294,7 @@ /types/react-onsenui/ @salim7 @jemmyw /types/react-overlays/ @aaronbeall @vitosamson /types/react-paginate/ @deevus @wouterhardeman @pegel03 @archy-bold +/types/react-places-autocomplete/ @guilhermehubner /types/react-pointable/ @istefo @mdibyo /types/react-portal/ @shuntksh /types/react-props-decorators/ @tkqubo @@ -3204,25 +3304,27 @@ /types/react-redux-i18n/ @clementdevos /types/react-redux-toastr/ @Smiche @artyomsv @kulmajaba /types/react-relay/ @graphcool @voxmatt @alloy @npirotte +/types/react-resize-detector/ @matthew-matvei /types/react-resolver/ @forabi /types/react-responsive/v1/ @asvetliakov /types/react-responsive/ @asvetliakov @alechill @xaviergonz +/types/react-rnd/ @Ragg- /types/react-router/v2/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov /types/react-router/v3/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @ssorallen -/types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga @neuoy +/types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga @neuoy @rraina /types/react-router-bootstrap/ @vlesierse @LKay @olmobrutall /types/react-router-config/ @lith-light-g -/types/react-router-dom/ @tkrotoff @huy-nguyen -/types/react-router-native/ @ezintz +/types/react-router-dom/ @tkrotoff @huy-nguyen @p-jackson +/types/react-router-native/ @ezintz @fhelwanger /types/react-router-navigation/ @kaoDev /types/react-router-navigation-core/ @kaoDev /types/react-router-redux/v3/ @isman-usoh @noah79 @rosendi /types/react-router-redux/v4/ @isman-usoh @noah79 @rosendi @LKay @DovydasNavickas -/types/react-router-redux/ @huy-nguyen @8398a7 +/types/react-router-redux/ @huy-nguyen @8398a7 @mykolas /types/react-s-alert/ @mitsuruog /types/react-scroll/ @sudoplz @GiedriusGrabauskas /types/react-scrollbar/ @stephenjelfs -/types/react-select/ @Hesquibet @giladgray @iebaker @skirsdeda @vujevits @devrelm @MartynasZilinskas @onatm @ninjaferret @tehbi4 @misantronic +/types/react-select/ @Hesquibet @giladgray @iebaker @skirsdeda @vujevits @devrelm @MartynasZilinskas @onatm @ninjaferret @tehbi4 @misantronic @darkartur /types/react-side-effect/ @remojansen /types/react-sidebar/ @jeroenvervaeke /types/react-sketchapp/ @ricokahler @DomiR @@ -3234,7 +3336,8 @@ /types/react-spinkit/v1/ @tkqubo @mleko @pelotom /types/react-spinkit/ @tkqubo @mleko @pelotom @zzanol /types/react-sticky/ @curtisw0 -/types/react-stripe-elements/ @dan-j @santiagodoldan @sonnysangha +/types/react-stripe-elements/ @dan-j @santiagodoldan @sonnysangha @9y5 @thchia +/types/react-svg/ @viccrubs /types/react-svg-pan-zoom/ @huy-nguyen /types/react-swf/ @stepancar /types/react-swipe/ @DeividasBakanas @@ -3265,8 +3368,9 @@ /types/react-twitter-auth/ @paulfasola /types/react-user-tour/ @ccancellieri /types/react-virtual-keyboard/ @bsurai -/types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx @kraenhansen +/types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx @kraenhansen @Stevearzh @mgoszcz2 /types/react-virtualized-select/ @seansfkelley +/types/react-webcam/ @squat /types/react-weui/ @tairan /types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya /types/react-widgets-moment/ @dawnmist @@ -3274,7 +3378,7 @@ /types/reactable/ @spielc /types/reactcss/ @chrisgervang @LKay /types/reactstrap/v4/ @alihammad @mfal @danilobjr @fabiopaiva -/types/reactstrap/ @alihammad @mfal @danilobjr @fabiopaiva @FaithForHumans @KurtPreston @kraenhansen @timc13 +/types/reactstrap/ @alihammad @mfal @danilobjr @fabiopaiva @FaithForHumans @KurtPreston @timc13 /types/read/ @timjk /types/read-chunk/ @crispybee /types/read-package-tree/ @mgroenhoff @@ -3286,12 +3390,13 @@ /types/readline-transform/ @dex4er /types/reapop/ @Barrokgl /types/recase/ @18steps -/types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 -/types/recompose/ @iskandersierra @mrapogee @clayne11 +/types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan +/types/recluster/ @dex4er +/types/recompose/ @iskandersierra @mrapogee @clayne11 @Pajn /types/reconnectingwebsocket/ @nguarracino /types/recursive-readdir/v1/ @elisee /types/recursive-readdir/ @elisee @MicahZoltu -/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j +/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j @barnski /types/redis-errors/ @43081j /types/redis-mock/ @BendingBender /types/redis-rate-limiter/ @westy92 @@ -3315,7 +3420,7 @@ /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 @alsiola @tehbi4 +/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin /types/redux-immutable/ @oizie @sebald @gavingregory /types/redux-immutable-state-invariant/ @remojansen @highflying /types/redux-infinite-scroll/ @silkyfray @@ -3338,6 +3443,7 @@ /types/redux-storage/ @asvetliakov /types/redux-storage-engine-jsurl/ @screendriver /types/redux-storage-engine-localstorage/ @screendriver +/types/redux-test-utils/ @huwmartin /types/redux-ui/ @andyshuxin /types/ref/ @loyd /types/ref-array/ @loyd @@ -3380,7 +3486,7 @@ /types/restler/ @cyrilschumacher /types/restling/ @loghorn /types/resumablejs/ @DanielMcAssey -/types/rethinkdb/ @alexgorbatchev +/types/rethinkdb/ @alexgorbatchev @AdrianFarmadin /types/retry/ @krenor /types/retry-as-promised/ @Raigen /types/rev-hash/ @ikatyang @@ -3396,14 +3502,16 @@ /types/riot/ @Stubb0rn /types/riot-api-nodejs/ @zafixlrp /types/riot-games-api/ @xstoudi +/types/riot-route/ @karak /types/riotcontrol/ @chrootsu /types/riotjs/ @vvakame /types/rison/ @impworks /types/rivets/ @TrevorDev @matjanos /types/roads/ @dancespiele +/types/roads-server/ @dancespiele /types/rollup-plugin-json/ @asmockler /types/ronomon__crypto-async/ @BendingBender -/types/rosie/ @abner @subvertallchris +/types/rosie/ @abner @subvertallchris @abukurov /types/roslib/ @Pro @skycoop @dgorobopec /types/rot-js/ @atiaxi /types/route-parser/ @ianks @bobbuehler @@ -3411,7 +3519,6 @@ /types/royalslider/ @csrakowski /types/rpio/ @DominikPalo @Pencl /types/rrc/ @DeividasBakanas -/types/rrule/ @waratuman /types/rsmq/ @MugeSo /types/rsmq-worker/ @MugeSo /types/rss/ @secondwtq @@ -3448,7 +3555,7 @@ /types/saml20/ @HackerUndKoch /types/samlp/ @horiuchi /types/sammy/ @borisyankov @oising -/types/sanctuary/ @davidchambers @cortopy +/types/sanctuary/ @davidchambers @cortopy @piq9117 /types/sandboxed-module/ @svi3c /types/sane/ @BendingBender /types/sanitize-filename/ @Nemo157 @@ -3472,8 +3579,10 @@ /types/scryptsy/ @micksatana /types/seamless/ @danmana /types/seamless-immutable/ @alex3165 @xsburg @geirsagberg +/types/seededshuffle/ @urish /types/seedrandom/ @kernhanda /types/segment-analytics/ @fongandrew +/types/select2/v3/ @borisyankov /types/select2/ @borisyankov /types/selectables/ @renjfk /types/selectize/ @adidahiya @naBausch @@ -3506,9 +3615,9 @@ /types/semver-diff/ @chrismbarr /types/sencha_touch/ @brian428 /types/send/ @MikeJerred -/types/seneca/ @psnider +/types/seneca/ @psnider @kevynb /types/sequelize/v3/ @samuelneff @codeanimal @drinchev @morpheusxaut @torhal -/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @oktapodia @morpheusxaut @TitaneBoy @zjy01 @nidzov @Raigen @todd +/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @oktapodia @morpheusxaut @TitaneBoy @zjy01 @nidzov @Raigen @todd @nrschultz /types/sequelize-fixtures/ @cschwarz /types/sequencify/ @npenin /types/sequester/ @Strate @@ -3522,12 +3631,13 @@ /types/session-file-store/ @blendsdk @rokt33r /types/set-cookie-parser/ @nickp10 /types/set-value/ @DanielRosenwasser +/types/settings/ @shreyjain1994 /types/sha1/ @arcdev1 /types/shallowequal/ @seansfkelley /types/shapefile/ @DenisCarriere /types/sharedworker/ @nakakura /types/sharepoint/ @gandjustas @andrei-markeev @baywet @teroarvola @dennispg -/types/sharp/ @lith-light-g +/types/sharp/ @lith-light-g @wooseopkim /types/sheetify/ @toddself /types/shell-escape/ @nenadalm /types/shell-quote/ @jason0x43 @@ -3539,7 +3649,7 @@ /types/shortid/ @stpettersens @despairblue /types/shot/ @AJamesPhillips /types/should-sinon/ @Arylo -/types/showdown/ @cbowdon @tan9 +/types/showdown/ @cbowdon @tan9 @arielsaldana /types/shrink-ray/ @forabi /types/siema/ @Irmiz @0x6368656174 @samnau /types/siesta/ @bquarmby @@ -3556,6 +3666,7 @@ /types/simple-oauth2/ @mad-mike /types/simple-peer/ @tlaziuk /types/simple-url-cache/ @a-lucas +/types/simple-websocket/ @dex4er /types/simple-xml/ @notVitaliy /types/simplebar/v1/ @gregonnet @leonard-thieu /types/simplebar/ @gregonnet @leonard-thieu @@ -3566,7 +3677,7 @@ /types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j /types/sinon-as-promised/ @igrayson /types/sinon-chai/ @kazimanzurrashid @jedmao -/types/sinon-chrome/ @pimterry @crimx +/types/sinon-chrome/ @pimterry @crimx @kobanyan /types/sinon-express-mock/ @jpchip @tlaziuk /types/sinon-mongoose/ @stevehipwell /types/sinon-stub-promise/ @vintem @tstackhouse @@ -3614,6 +3725,7 @@ /types/sort-array/ @mrmlnc /types/sortablejs/ @Maw-Fox /types/soundmanager2/ @elton2048 +/types/soupbintcp/ @jewbre /types/source-list-map/ @e-cloud /types/source-map-support/ @Bartvds @jason0x43 /types/space-pen/ @vvakame @@ -3637,8 +3749,9 @@ /types/spotify-web-playback-sdk/ @Festify @mraerino @NeoLegends /types/sprintf/ @soywiz @BendingBender /types/sprintf-js/ @jasonswearingen @BendingBender +/types/sql-bricks/ @adn05 @paleo /types/sql.js/ @Hozuki -/types/sqlite3/ @nmalaguti @dpyro +/types/sqlite3/ @nmalaguti @dpyro @BehindTheMath /types/sqlstring/ @marvinhagemeister /types/squirejs/ @bradleyayers /types/srp/ @Patman64 @@ -3660,7 +3773,11 @@ /types/statuses/ @tkrotoff @BendingBender /types/std-mocks/ @jdxcode /types/steam/ @kant2002 +/types/steam-client/ @Slessi +/types/steam-totp/ @phenomax +/types/steamid/ @Slessi /types/steed/ @Paul-Isache +/types/stellar-sdk/ @carl-foster @tristonj /types/stemmer/ @will-ockmore /types/sticky-cluster/ @paustint /types/stompjs/ @jimic @Dr4k4n @@ -3681,9 +3798,11 @@ /types/stream-series/ @k-kagurazaka /types/stream-to-array/v0/ @Bartvds /types/stream-to-array/ @Bartvds @BendingBender +/types/stream-to-promise/ @Alorel /types/streaming-json-stringify/ @BendingBender /types/streamjs/ @erosb /types/strftime/ @cyrilschumacher +/types/strict-uri-encode/ @hoishin /types/string/ @basp /types/string-hash/ @ethanrubio /types/string-similarity/ @ragtime @@ -3693,11 +3812,12 @@ /types/strip-ansi/ @mhegazy /types/strip-bom/ @mhegazy /types/strip-json-comments/ @dmoonfire -/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi +/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun /types/stripe-checkout/ @cgwrench /types/stripe-v2/ @ejsmith @amritk @adamcmiel @jleider @galuszkak /types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak /types/strong-cluster-control/ @shuntksh +/types/strong-error-handler/ @blankstar85 /types/strong-log-transformer/ @azasypkin /types/strophe/ @DavidKDeutsch /types/structured-source/ @azu @@ -3709,7 +3829,7 @@ /types/succinct/ @EnableSoftware /types/sudo-block/ @BendingBender /types/suitescript/ @darrenhillconsulting -/types/sumo-logger/ @forabi +/types/sumo-logger/ @forabi @clementallen /types/superagent/v2/ @varju @NicoZelaya @mxl /types/superagent/ @NicoZelaya @mxl @paplorinc @shreyjain1994 /types/superagent-no-cache/ @mxl @@ -3729,6 +3849,7 @@ /types/swag/ @shiwano /types/swagger-express-middleware/ @alexandreroba /types/swagger-express-mw/ @micmro +/types/swagger-express-validator/ @pinguet62 /types/swagger-hapi/ @micmro /types/swagger-jsdoc/ @drGrove /types/swagger-node-runner/ @micmro @@ -3755,6 +3876,7 @@ /types/tabris-plugin-firebase/ @eclipsesource /types/tabtab/ @vojtechhabarta /types/tabulator/ @euginio +/types/tapable/v0/ @e-cloud /types/tapable/ @e-cloud /types/tape/ @Bartvds @sodatea @DennisSchwartz @mikehenrty /types/tar/ @SomaticIT @connor4312 @@ -3775,6 +3897,7 @@ /types/text-buffer/ @GlenCFL /types/text-encoding/ @pine613 /types/text-encoding-utf-8/ @trxcllnt +/types/textarea-caret/ @shiftkey /types/three/ @gyohk @florentpoujol @SereznoKot @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @s093294 @Pro @efokschaner @PsychoSTS @dhritzkiv @apurvaojas /types/thrift/ @kamek-pf @kevin-greene-ck @jessezhang91 /types/throng/ @cyrilschumacher @tatethurston @@ -3792,10 +3915,11 @@ /types/timer-machine/ @dolanmiu /types/timezone-js/ @bonnici /types/tinder/ @pingec +/types/tiny-slider-react/ @screendriver /types/tinycolor2/ @M-Zuber @geertjansen @nvh /types/tinycopy/ @vvatanabe /types/tinymce/ @martinduparc @ipoul @nicohartto -/types/titanium/ @cyounkins +/types/titanium/ @appcelerator @janvennemann /types/title/ @fa7ad /types/tldjs/ @geoffreak /types/tmp/ @optical @Perlmint @@ -3806,7 +3930,7 @@ /types/toastr/ @borisyankov /types/tocktimer/ @evanshortiss /types/tooltipster/ @stephenlautier @pjmagee @VorobeY1326 @leonard-thieu @janhi @joeskeen -/types/topojson/ @ricardo-mello @chenzhutian +/types/topojson/ @ricardo-mello @chenzhutian @denisname /types/torrent-stream/ @xstoudi /types/touch/ @mizunashi-mana @BendingBender /types/touch-events/ @kevinb7 @@ -3815,13 +3939,14 @@ /types/tracking/ @pimterry /types/transducers-js/ @colinkahn @dphilipson @NaridaL /types/transducers.js/ @dphilipson -/types/trash/ @matthew-matvei +/types/trash/ @matthew-matvei @hoishin /types/traverse/ @newclear /types/traverson/ @marcinporebski /types/trayballoon/ @korve /types/tress/ @sindilevich /types/trim/ @skysteve /types/trunk8/ @niemyjski +/types/tryer/ @bengry /types/tspromise/ @soywiz /types/tunnel/ @BendingBender /types/tus-js-client/ @kevhiggins @@ -3847,9 +3972,11 @@ /types/typescript-deferred/ @DirtyHairy /types/tz-format/ @samverschueren /types/ua-parser-js/ @superduper @legendecas @MeLlamoPablo -/types/uglify-js/ @tkrotoff +/types/uglify-js/v2/ @tkrotoff +/types/uglify-js/ @alan-agius4 @tkrotoff /types/uglifycss/ @blendsdk -/types/ui-grid/ @btesser @joeskeen +/types/uglifyjs-webpack-plugin/ @vajkayrene +/types/ui-grid/ @btesser @joeskeen @pbojanczyk /types/ui-router-extras/ @mputters @marcel-k @LaserUnicorns /types/ui-select/ @nkovacic /types/uid-safe/ @geoffreak @@ -3858,7 +3985,7 @@ /types/ultra-strftime/ @dex4er /types/umbraco/ @DeCareSystemsIreland /types/umd/ @TeamworkGuy2 -/types/umzug/ @drinchev @mlamp +/types/umzug/ @drinchev @mlamp @trodi /types/underscore/ @borisyankov @jbaldwin @ccurrens @clottman /types/underscore-ko/ @MagicMau /types/underscore.string/ @rygine @@ -3878,7 +4005,7 @@ /types/unzip/ @coding2012 /types/unzipper/ @s73obrien /types/update-notifier/v1/ @vvakame @nchen63 -/types/update-notifier/ @vvakame @nchen63 +/types/update-notifier/ @vvakame @nchen63 @bitjson /types/upng-js/ @plantain-00 /types/uppercamelcase/ @plantain-00 /types/urbanairship-cordova/ @Justin-Credible @@ -3909,13 +4036,13 @@ /types/uuid-1345/ @mugeso /types/uuid-js/ @mhegazy /types/uuid-validate/ @HiromiShikata -/types/uws/ @plantain-00 +/types/uws/ @plantain-00 @orblazer /types/valdr/ @ilbertz /types/valdr-message/ @ilbertz /types/valerie/ @conficient /types/vali-date/ @SamVerschueren /types/valid-url/ @stevehipwell -/types/validator/ @tgfjt @chrootsu @IOAyman @louy @kacepe @deptno +/types/validator/ @tgfjt @chrootsu @IOAyman @louy @kacepe @deptno @builtinnya /types/validatorjs/ @LKay @danmana /types/vanilla-modal/ @samnau /types/vanilla-tilt/ @BrunnerLivio @@ -3963,6 +4090,7 @@ /types/w2ui/ @Ptival /types/w3c-generic-sensor/ @kenchris /types/w3c-image-capture/ @cosium +/types/w3c-permissions/ @jberube /types/w3c-screen-orientation/ @kenchris /types/w3c-web-usb/ @larsgk /types/waitme/ @totpero @@ -3987,12 +4115,14 @@ /types/webcl/ @NCARalph /types/webcomponents.js/ @adidahiya /types/webcrypto/ @iislucas -/types/webdriverio/ @nmalaguti @timbru31 @fsmedberg-tc @tanvirislam06 +/types/webdriverio/ @nmalaguti @timbru31 @fsmedberg-tc @tanvirislam06 @phil-lgr /types/webfontloader/ @doskallemaskin /types/webgl-ext/ @zenmumbler /types/webgl2/ @nkemnitz +/types/webidl2/ @saschanaz /types/webmidi/ @lostfictions -/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 +/types/webpack/v3/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 +/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 @dennispg /types/webpack-bundle-analyzer/ @kryops /types/webpack-chain/ @eirikurn @psachs21 /types/webpack-chunk-hash/ @mtraynham @@ -4017,12 +4147,14 @@ /types/webspeechapi/ @saschanaz /types/websql/ @TeamworkGuy2 /types/webtorrent/ @niieani @tlaziuk -/types/webvr-api/ @lostfictions +/types/webvr-api/ @efokschaner /types/week/ @sindrenm /types/weighted/ @ccitro -/types/weixin-app/ @taoqf +/types/weixin-app/ @taoqf @AlexStacker /types/wellknown/ @yairtawil +/types/whatwg-mimetype/ @petejohanson /types/whatwg-streams/ @saschanaz +/types/whatwg-url/ @aomarks /types/wheel/ @BTOdell /types/when/ @derekcicerone @Nemo157 /types/which/ @vvakame @cspotcode @@ -4039,19 +4171,22 @@ /types/winrt-uwp/ @saschanaz @taylor224 /types/winston/ @bonnici @codeanimal @DABH /types/winston-dynamodb/ @nickiannone +/types/winston-syslog/ @cjbarth /types/wiring-pi/ @NoHomey /types/wnumb/ @acoreyj /types/wonder.js/ @yyc-git /types/word-list-json/ @dovidm /types/wordcloud/ @joeskeen /types/words-to-numbers/ @James-Frowen +/types/wpapi/ @guoyunhe +/types/wrap-ansi/v2/ @kayahr /types/wrap-ansi/ @kayahr /types/wreck/ @marcinporebski /types/wrench/ @soywiz /types/write-file-atomic/ @BendingBender /types/write-json-file/ @DenisCarriere /types/write-pkg/ @azasypkin -/types/ws/ @loyd @elithrar @mlamp @TitaneBoy +/types/ws/ @loyd @elithrar @mlamp @TitaneBoy @orblazer /types/wtfnode/ @dex4er /types/wu/ @phiresky /types/wx-js-sdk-dt/ @agasbzj @@ -4086,6 +4221,7 @@ /types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC /types/yauzl/ @ffflorian /types/yayson/ @Codesleuth +/types/yazl/ @taoqf /types/ydn-db/ @yathit @gabrielmaldi /types/yeoman-generator/ @armorik83 @janslow @ikatyang /types/yeoman-test/ @ikatyang diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 79793c16c1..b1a1039f82 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -10,7 +10,7 @@ Please fill in this template. Select one of these and delete the others: If adding a new definition: -- [ ] The package does not provide its own types, and you can not add them. +- [ ] The package does not already provide its own types, or cannot have its `.d.ts` files generated via `--declaration` - [ ] 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`, `strictNullChecks`, and `strictFunctionTypes` set to `true`. diff --git a/README.md b/README.md index cc59284394..7c58fe8901 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ If it doesn't, you can do so yourself in the comment associated with the PR. #### Create a new package -If you are the library author, or can make a pull request to the library, [bundle types](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) instead of publishing to DefinitelyTyped. +If you are the library author and your package is written in TypeScript, [bundle the autogenerated declaration files](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) in your package instead of publishing to DefinitelyTyped. If you are adding typings for an NPM package, create a directory with the same name. If the package you are adding typings for is not on NPM, make sure the name you choose for it does not conflict with the name of a package on NPM. @@ -239,7 +239,8 @@ If types are part of a web standard, they should be contributed to [TSJS-lib-gen #### A package uses `export =`, but I prefer to use default imports. Can I change `export =` to `export default`? -If default imports work in your environment, consider turning on the [`--allowSyntheticDefaultImports`](http://www.typescriptlang.org/docs/handbook/compiler-options.html) compiler option. +If you are using TypeScript 2.7 or later, use `--esModuleInterop` in your project. +Otherwise, if default imports work in your environment (e.g. Webpack, SystemJS, esm), consider turning on the [`--allowSyntheticDefaultImports`](http://www.typescriptlang.org/docs/handbook/compiler-options.html) compiler option. Do not change the type definition if it is accurate. For an NPM package, `export =` is accurate if `node -p 'require("foo")'` is the export, and `export default` is accurate if `node -p 'require("foo").default'` is the export. diff --git a/glue/index.d.ts b/glue/index.d.ts deleted file mode 100644 index 5f40ba924b..0000000000 --- a/glue/index.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Type definitions for glue -// Project: https://github.com/hapijs/glue -// Definitions by: Gareth Parker -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.7 - -declare module "glue" { - - import { Server, ServerOptions } from "hapi"; - - export interface Options { - relativeTo: string; - preConnections?: (Server:Server, next:(err:any)=>void ) => void; - preRegister?: (Server:Server, next:(err:any)=>void ) => void; - } - - interface Plugin { - plugin: string | { - register:string; - options?:any; - }; - options?: any; - routes?: any - } - - interface Manifest { - server: ServerOptions; - register?: { - plugins: Array - } - } - - export function compose(manifest: Manifest, options?: Options): Server; - -} diff --git a/notNeededPackages.json b/notNeededPackages.json index 8c587f7c43..0f318582a8 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -174,7 +174,7 @@ "sourceRepoURL": "https://github.com/MikeMcl/bignumber.js/", "asOfVersion": "5.0.0" }, - { + { "libraryName": "bingmaps", "typingsPackageName": "bingmaps", "sourceRepoURL": "https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions", @@ -210,6 +210,12 @@ "sourceRepoURL": "https://github.com/blakeembrey/camel-case", "asOfVersion": "1.2.1" }, + { + "libraryName": "catalog", + "typingsPackageName": "catalog", + "sourceRepoURL": "https://github.com/interactivethings/catalog", + "asOfVersion": "3.5.0" + }, { "libraryName": "chalk", "typingsPackageName": "chalk", @@ -234,6 +240,12 @@ "sourceRepoURL": "https://github.com/saltyrtc/chunked-dc-js", "asOfVersion": "0.2.2" }, + { + "libraryName": "colors.js (colors)", + "typingsPackageName": "colors", + "sourceRepoURL": "https://github.com/Marak/colors.js", + "asOfVersion": "1.2.1" + }, { "libraryName": "commander", "typingsPackageName": "commander", @@ -1266,6 +1278,12 @@ "sourceRepoURL": "https://github.com/router5/router5", "asOfVersion": "5.0.0" }, + { + "libraryName": "rrule", + "typingsPackageName": "rrule", + "sourceRepoURL": "https://github.com/jakubroztocil/rrule", + "asOfVersion": "2.2.9" + }, { "libraryName": "rvo2", "typingsPackageName": "rvo2", diff --git a/types/actions-on-google/assistant-app.d.ts b/types/actions-on-google/assistant-app.d.ts index d835915259..76a206122c 100644 --- a/types/actions-on-google/assistant-app.d.ts +++ b/types/actions-on-google/assistant-app.d.ts @@ -1,6 +1,7 @@ import * as express from 'express'; -import { BasicCard, Carousel, ImageDisplays, List, OptionItem, RichResponse } from './response-builder'; +import { BasicCard, BrowseCarousel, BrowseItem, Carousel, ImageDisplays, List, MediaObject, + MediaResponse, MediaValues, OptionItem, RichResponse, SimpleResponse } from './response-builder'; import { ActionPaymentTransactionConfig, Cart, GooglePaymentTransactionConfig, LineItem, Location, Order, OrderUpdate, TransactionDecision, TransactionValues } from './transactions'; @@ -30,6 +31,8 @@ export enum StandardIntents { DELIVERY_ADDRESS, /** App fires TRANSACTION_DECISION intent when action asks for transaction decision. */ TRANSACTION_DECISION, + /** App fires PLACE intent when action asks for place. */ + PLACE, /** App fires CONFIRMATION intent when requesting affirmation from user. */ CONFIRMATION, /** App fires DATETIME intent when requesting date/time from user. */ @@ -45,7 +48,11 @@ export enum StandardIntents { /** App fires REGISTER_UPDATE intent when requesting user to register for proactive updates. */ REGISTER_UPDATE, /** App receives CONFIGURE_UPDATES intent to indicate a REGISTER_UPDATE intent should be sent. */ - CONFIGURE_UPDATES + CONFIGURE_UPDATES, + /** App fires LINK intent to request user to open to link. */ + LINK, + /** App receives MEDIA_STATUS intent when the MediaResponse status is updated from user. */ + MEDIA_STATUS } /** @@ -101,6 +108,10 @@ export enum BuiltInArgNames { * Transactions decision argument. */ TRANSACTION_DECISION_VALUE, + /** + * Place value argument. + */ + PLACE, /** * Confirmation argument. */ @@ -126,7 +137,11 @@ export enum BuiltInArgNames { */ NEW_SURFACE, /** Update registration value argument. */ - REGISTER_UPDATE + REGISTER_UPDATE, + /** Link request result argument. */ + LINK, + /** MediaStatus value argument. */ + MEDIA_STATUS } /** @@ -173,6 +188,14 @@ export enum SurfaceCapabilities { * The ability to output on a screen */ SCREEN_OUTPUT, + /** + * The ability to output a MediaResponse + */ + MEDIA_RESPONSE_AUDIO, + /** + * The ability to open a web URL + */ + WEB_BROWSER } /** @@ -223,6 +246,18 @@ export enum SignInStatus { ERROR } +/** + * SKU (Stock Keeping Units) types for Play Package Entitlements. + */ +export enum EntitlementSkuTypes { + /** In app purchase */ + IN_APP, + /** In app subscription */ + SUBSCRIPTION, + /** Paid app. */ + APP +} + /** * Possible update trigger time context frequencies. */ @@ -259,10 +294,15 @@ export interface UserName { familyName: string; } +export interface LocationCoordinates { + latitude: number; + longitude: number; +} + /** - * User's permissioned device location. + * Location information. */ -export interface DeviceLocation { +export interface Location { /** Coordinates: {latitude, longitude}. Requested with SupportedPermissions.DEVICE_PRECISE_LOCATION. */ coordinates: Coordinates; /** Full, formatted street address. Requested with SupportedPermissions.DEVICE_PRECISE_LOCATION. */ @@ -273,6 +313,22 @@ export interface DeviceLocation { city: string; } +/** + * User's permissioned device location. + */ +export type DeviceLocation = Location; + +/** + * Place information. + */ +export interface Place extends Location { + /** + * Used with Places API to fetch details of a place. + * See {@link https://developers.google.com/places/web-service/place-id} + */ + placeId: string; +} + /** * Coordinates containing latitude and longitude */ @@ -309,6 +365,33 @@ export interface User { userStorage: string; } +/** + * Google Play Android App Package Entitlements. + */ +export interface PackageEntitlement { + /** Name of the Android app package. */ + packageName: string; + /** List of entitlements for a given app. */ + entitlements: Entitlement[]; +} + +/** + * A user's digital entitlement. + */ +export interface Entitlement { + /** Product SKU. Matches getSku() in Google Play InApp Billing API. */ + sku: string; + /** The type of SKU. One of EntitlementSkuType. */ + skuType: string; + /** For in app purchases/subscriptions, relevant details. */ + inAppDetails: { + /** JSON data of the in app purchase. */ + inAppPurchaseData: object; + /** Matches IN_APP_DATA_SIGNATURE from getPurchases() method in Play InApp Billing API. */ + inAppDataSignature: object; + }; +} + /** * Actions on Google Surface. */ @@ -437,6 +520,16 @@ export class AssistantApp { */ readonly Transactions: typeof TransactionValues; + /** + * Values related to supporting {@link Media}. + */ + readonly Media: typeof MediaValues; + + /** + * SKU (Stock Keeping Units) types for Play Package Entitlements. + */ + readonly EntitlementSkuTypes: typeof EntitlementSkuTypes; + /** * Possible update trigger time context frequencies. */ @@ -923,6 +1016,80 @@ export class AssistantApp { */ askForDeliveryAddress(reason: string, dialogState?: object): express.Response | null; + /** + * Asks user to provide a geo-located place, possibly using contextual information, + * like a store near the user's location or a contact's address. + * + * Developer provides custom text prompts to tailor the request handled by Google. + * + * @example + * // For DialogflowApp: + * + * // Dialogflow Actions + * const Actions = { + * WELCOME: 'input.welcome', + * PLACE: 'get.place' // Create Dialogflow Action with actions_intent_PLACE event + * }; + * + * const app = new DialogflowApp({request, response}); + * + * function handleWelcome (app) { + * const requestPrompt = 'Where do you want to get picked up?'; + * const permissionContext = 'To find a place to pick you up'; + * app.askForPlace(requestPrompt, permissionContext); + * } + * + * function handlePlace (app) { + * const place = app.getPlace(); + * if (place) { + * app.tell(`Ah, I see. You want to get picked up at ${place.address}`); + * } else { + * app.tell(`Sorry, I couldn't find where you want to get picked up`); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(Actions.WELCOME, handleWelcome); + * actionMap.set(Actions.PLACE, handlePlace); + * app.handleRequest(actionMap); + * + * // For ActionsSdkApp: + * const app = new ActionsSdkApp({ request, response }); + * + * function handleWelcome (app) { + * const requestPrompt = 'Where do you want to get picked up?'; + * const permissionContext = 'To find a place to pick you up'; + * app.askForPlace(requestPrompt, permissionContext); + * } + * + * function handlePlace (app) { + * const place = app.getPlace(); + * if (place) { + * app.tell(`Ah, I see. You want to get picked up at ${place.address}`); + * } else { + * app.tell(`Sorry, I couldn't find where you want to get picked up`); + * } + * } + * + * const actionsMap = new Map(); + * actionsMap.set(app.StandardIntents.MAIN, handleWelcome); + * actionsMap.set(app.StandardIntents.PLACE, handlePlace); + * app.handleRequest(actionsMap); + * + * @param requestPrompt This is the initial response by location sub-dialog. + * For example: "Where do you want to get picked up?" + * @param permissionContext This is the context for seeking permissions. + * For example: "To find a place to pick you up" + * Prompt to user: "*To find a place to pick you up*, I just need to check your location. + * Can I get that from Google?". + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. + * @return HTTP response. + * @actionssdk + * @dialogflow + */ + askForPlace(requestPrompt: string, permissionContext: string, dialogState?: object): express.Response | null; + /** * Asks user for a confirmation. * @@ -1131,6 +1298,72 @@ export class AssistantApp { */ askToRegisterDailyUpdate(intent: string, intentArguments: IntentArgument[], dialogState?: object): express.Response | null; + /** + * Requests the user to transfer to a linked out Android app intent. Using this feature + * requires verifying the linked app in the (Actions console)[console.actions.google.com]. + * + * @example + * // For DialogflowApp: + * + * // Dialogflow Actions + * const WELCOME_ACTION = 'input.welcome'; + * const HANDLE_LINK = 'handle.link'; // Create Dialogflow Action with actions_intent_LINK event + * + * const app = new DialogflowApp({ request, response }); + * + * console.log('Request headers: ' + JSON.stringify(request.headers)); + * console.log('Request body: ' + JSON.stringify(request.body)); + * + * function requestLink (app) { + * app.askToDeepLink('Great! Looks like we can do that in the app.', 'Google', + * 'example://gizmos', 'com.example.gizmos', 'handle this for you'); + * } + * + * function handleLink (app) { + * const linkStatus = app.getLinkStatus(); + * app.tell('Okay maybe we can take care of that another time.'); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_ACTION, requestLink); + * actionMap.set(HANDLE_LINK, handleLink); + * app.handleRequest(actionMap); + * + * // For ActionsSdkApp + * const app = new ActionsSdkApp({ request, response }); + * + * console.log('Request headers: ' + JSON.stringify(request.headers)); + * console.log('Request body: ' + JSON.stringify(request.body)); + * + * function requestLink (app) { + * app.askToDeepLink('Great! Looks like we can do that in the app.', 'Google', + * 'example://gizmos', 'com.example.gizmos', 'handle this for you.'); + * } + * + * function handleLink (app) { + * const linkStatus = app.getLinkStatus(); + * app.tell('Okay maybe we can take care of that another time.'); + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.MAIN, requestLink); + * actionMap.set(app.StandardIntents.LINK, handleLink); + * app.handleRequest(actionMap); + * + * @param prompt A simple response to prepend to the link request. + * @param destinationName The name of the link destination. + * @param url URL of Android deep link. + * @param packageName Android app package name to which to link. + * @param reason The reason to transfer the user. This may be appended to a + * Google-specified prompt. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkApp}. + * @return HTTP response. + * @dialogflow + * @actionssdk + */ + askToDeepLink(prompt: string | SimpleResponse | null, destinationName: string, url: string, packageName: string, reason?: string | null, dialogState?: object): express.Response | null; + /** * Gets the {@link User} object. * The user object contains information about the user, including @@ -1209,6 +1442,20 @@ export class AssistantApp { */ getLastSeen(): Date | null; + /** + * Get the the list of all digital goods that your user purchased from + * your published Android apps. To enable this feature, see the instructions + * in the (documentation)[https://developers.google.com/actions/identity/digital-goods]. + * + * @example + * const app = new DialogflowApp({request, response}); + * const packageEntitlements = app.getPackageEntitlements(); + * + * @return The list of digital goods purchased by the user in + * any verified Android app package. Null if no Package Entitlements present in the request. + */ + getPackageEntitlements(): PackageEntitlement[] | null; + /** * If granted permission to device's location in previous intent, returns device's * location (see {@link AssistantApp#askForPermissions|askForPermissions}). @@ -1273,6 +1520,15 @@ export class AssistantApp { */ getTransactionDecision(): TransactionDecision; + /** + * Gets the user provided place. Use after askForPlace. + * + * @return Place information given by the user. Null if no place given. + * @dialogflow + * @actionssdk + */ + getPlace(): Place | null; + /** * Gets confirmation decision. Use after askForConfirmation. * @@ -1304,6 +1560,31 @@ export class AssistantApp { */ getSignInStatus(): string; + /** + * Get status of MEDIA_STATUS intent. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * + * function mediaStatusIntent (app) { + * const status = app.getMediaStatus(); + * if (status === app.Media.Status.FINISHED) { + * app.tell('Oh, I see you are done playing the media!'); + * } else { + * app.tell(`I don't understand the current media status: ${status}`); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.MEDIA_STATUS, mediaStatusIntent); + * app.handleRequest(actionMap); + * + * @return Result of media status intent. + * @dialogflow + * @actionssdk + */ + getMediaStatus(): MediaValues.Status | null; + /** * Returns true if user device has a given surface capability. * @@ -1464,6 +1745,16 @@ export class AssistantApp { */ isUpdateRegistered(): boolean; + /** + * Returns the status of a link request. Used with + * {@link AssistantApp#askToDeepLink} + * + * @return The status code of the request to link. + * @dialogflow + * @actionssdk + */ + getLinkStatus(): number; + // --------------------------------------------------------------------------- // Response Builders // --------------------------------------------------------------------------- @@ -1500,6 +1791,13 @@ export class AssistantApp { */ buildCarousel(): Carousel; + /** + * Constructs a Browse Carousel with chainable property setters. + * + * @return Constructed Browse Carousel. + */ + buildBrowseCarousel(): BrowseCarousel; + /** * Constructs OptionItem with chainable property setters. * @@ -1512,6 +1810,15 @@ export class AssistantApp { */ buildOptionItem(key?: string, synonyms?: string | string[]): OptionItem; + /** + * Constructs BrowseItem for the Browse Carousel with chainable property setters. + * + * @param title The displayed title of the Browse Carousel card. + * @param url The URL linked to by clicking the card. + * @return Constructed BrowseItem. + */ + buildBrowseItem(title?: string, url?: string): BrowseItem; + // --------------------------------------------------------------------------- // Transaction Builders // --------------------------------------------------------------------------- @@ -1552,4 +1859,24 @@ export class AssistantApp { * @return Constructed OrderUpdate. */ buildOrderUpdate(orderId: string, isGoogleOrderId: boolean): OrderUpdate; + + // --------------------------------------------------------------------------- + // Media Builders + // --------------------------------------------------------------------------- + + /** + * Constructs Media Response with chainable property setters. + * + * @return Constructed Media Response. + */ + buildMediaResponse(): MediaResponse; + + /** + * Constructs MediaObject with chainable property setters. + * + * @param name Name of media file. + * @param contentUrl Location of media file. + * @return Constructed MediaObject. + */ + buildMediaObject(name: string, contentUrl: string): MediaObject; } diff --git a/types/actions-on-google/index.d.ts b/types/actions-on-google/index.d.ts index 937943e1f0..943554586f 100644 --- a/types/actions-on-google/index.d.ts +++ b/types/actions-on-google/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for actions-on-google 1.8 +// Type definitions for actions-on-google 1.10 // Project: https://github.com/actions-on-google/actions-on-google-nodejs // Definitions by: Joel Hegg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/actions-on-google/response-builder.d.ts b/types/actions-on-google/response-builder.d.ts index 227d102958..9844fe45c1 100644 --- a/types/actions-on-google/response-builder.d.ts +++ b/types/actions-on-google/response-builder.d.ts @@ -27,6 +27,53 @@ export enum ImageDisplays { CROPPED } +/** + * Values related to supporting media. + */ +export namespace MediaValues { + /** + * Type of the media within a MediaResponse. + */ + enum Type { + /** + * Unspecified. + */ + MEDIA_TYPE_UNSPECIFIED, + /** + * Audio stream. + */ + AUDIO + } + + /** + * List of media control status' returned. + */ + enum Status { + /** + * Unspecified. + */ + UNSPECIFIED, + /** + * Finished. + */ + FINISHED + } + + /** + * List of possible item types. + */ + enum ImageType { + /** + * Icon. + */ + ICON, + /** + * Large image. + */ + LARGE + } +} + /** * Simple Response type. */ @@ -155,6 +202,22 @@ export class RichResponse { */ addBasicCard(basicCard: BasicCard): RichResponse; + /** + * Adds media to this response. + * + * @param mediaResponse MediaResponse to include in response. + * @return Returns current constructed RichResponse. + */ + addMediaResponse(mediaResponse: MediaResponse): RichResponse; + + /** + * Adds a Browse Carousel to list of items. + * + * @param browseCarousel Browse Carousel to present to user + * @return Returns current constructed RichResponse. + */ + addBrowseCarousel(browseCarousel: string | BrowseCarousel): RichResponse; + /** * Adds a single suggestion or list of suggestions to list of items. * @@ -325,6 +388,43 @@ export class List { addItems(optionItems: OptionItem | OptionItem[]): List; } +/** + * Class for initializing and constructing BrowseCarousel with chainable interface. + */ +export class BrowseCarousel { + /** + * Constructor for BrowseCarousel. Accepts optional BrowseCarousel to + * clone or list of items to copy. + * + * @param carousel Either a carousel to clone + * or an array of BrowseItem to initialize a new carousel + */ + constructor(carousel?: BrowseCarousel | BrowseItem[]); + + /** + * List of 2-20 items to show in this carousel. Required. + */ + items: BrowseItem[]; + + /** + * Adds a single item or list of items to the carousel. + * + * @param browseItems BrowseItems to add. + * @return Returns current constructed BrowseCarousel. + */ + addItems(browseItems: BrowseItem | BrowseItem[]): BrowseCarousel; + + /** + * Sets the display options for the images in this carousel. + * Use one of the image display constants. If none is chosen, + * ImageDisplays.DEFAULT will be enforced. + * + * @param option The option for displaying the image. + * @return Returns current constructed BrowseCarousel. + */ + setImageDisplay(option: ImageDisplays): BrowseCarousel; +} + /** * Class for initializing and constructing Carousel with chainable interface. */ @@ -350,6 +450,120 @@ export class Carousel { * @return Returns current constructed Carousel. */ addItems(optionItems: OptionItem | OptionItem[]): Carousel; + + /** + * Sets the display options for the images in this carousel. + * Use one of the image display constants. If none is chosen, + * ImageDisplays.DEFAULT will be enforced. + * + * @param option The option for displaying the image. + * @return Returns current constructed Carousel. + */ + setImageDisplay(option: ImageDisplays): Carousel; +} + +/** + * Class for initializing and constructing Option Items with chainable interface. + */ +export class BrowseItem { + /** + * Constructor for BrowseItem. Accepts a title and URL for the Browse Item + * card. + * + * @param title The title of the Browse Item card. + * @param url The URL of the link opened by clicking the Browse Item card. + */ + constructor(title?: string, url?: string); + + /** + * Title of the browse item. Required. + */ + title: string; + + /** + * Description text of the item. Optional. + */ + description?: string; + + /** + * Footer text of the item. Optional. + */ + footer?: string; + + /** + * Image to show on item. Optional. + */ + image?: Image; + + /** + * Url to that clicking the card opens. Optional. + */ + openUrlAction?: object; + + /** + * @return Returns the possible valid values for URL type hints + */ + urlTypeHints(): object; + + /** + * Sets the title for this Browse Item. + * + * @param title Title to show on item. + * @return Returns current constructed BrowseItem. + */ + setTitle(title: string): BrowseItem; + + /** + * Sets the description for this Browse Item. + * + * @param description Description to show on item. + * @return Returns current constructed BrowseItem. + */ + setDescription(description: string): BrowseItem; + + /** + * Sets the footer for this Browse Item. + * + * @param footerText text to show on item. + * @return Returns current constructed BrowseItem. + */ + setFooter(footerText: string): BrowseItem; + + /** + * Sets the image for this Browse 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 BrowseItem. + */ + setImage(url: string, accessibilityText: string, width?: number, height?: number): BrowseItem; + + /** + * Sets the Open URL action - which includes the url and possibly the typeHint + * + * @param url Image source URL. + * @param urlTypeHint One of the typeHints enumerated by this.urlTypeHints() + * @return Returns the current constructed BrowseItem + */ + setOpenUrlAction(url: string, urlTypeHint?: string): BrowseItem; + + /** + * Sets the URL target of the BrowseItem card + * + * @param url Image source URL. + * @return Returns the current constructed BrowseItem + */ + setUrl(url: string): BrowseItem; + + /** + * Sets the URL type hint for the BrowseItem card + * + * @param urlTypeHint One of the typeHints enumerated by this.urlTypeHints() + * @return Returns the current constructed BrowseItem + */ + setUrlTypeHint(urlTypeHint: string): BrowseItem; } /** @@ -430,6 +644,90 @@ export class OptionItem { addSynonyms(synonyms: string | string[]): OptionItem; } +/** + * Class for initializing and constructing MediaResponse with chainable interface. + */ +export class MediaResponse { + /** + * Constructor for MediaResponse. + * @param mediaType Type of the media which defaults to MediaValues.Type.AUDIO + */ + constructor(mediaType: MediaValues.Type); + + /** + * Array of MediaObject held in the MediaResponse. + */ + mediaObjects: MediaObject[]; + + /** + * Type of the media within this MediaResponse + */ + mediaType: MediaValues.Type; + + /** + * Adds a single media file or list of media files to the cart. + * + * @param items Single or Array of MediaObject to add. + * @return Returns current constructed MediaResponse. + */ + addMediaObjects(items: MediaObject | MediaObject[]): MediaResponse; +} + +/** + * Class for initializing and constructing MediaObject with chainable interface. + */ +export class MediaObject { + /** + * Constructor for MediaObject. + * + * @param name Name of the MediaObject. + * @param contentUrl URL of the MediaObject. + */ + constructor(name: string, contentUrl: string); + + /** + * Name of the MediaObject. + */ + name: string; + + /** + * MediaObject URL. + */ + contentUrl: string; + + /** + * Description of the MediaObject. + */ + description?: string; + + /** + * Large image. + */ + largeImage?: Image; + + /** + * Icon image. + */ + icon?: Image; + + /** + * Set the description of the item. + * + * @param description Description of the item. + * @return Returns current constructed MediaObject. + */ + setDescription(description: string): MediaObject; + + /** + * Sets the image for this item. + * + * @param url Image source URL. + * @param type Type of image (LARGE or ICON). + * @return Returns current constructed MediaObject. + */ + setImage(url: string, type: MediaValues.ImageType): MediaObject; +} + /** * Check if given text contains SSML. * @param text Text to check. diff --git a/types/activex-wia/activex-wia-tests.ts b/types/activex-wia/activex-wia-tests.ts index c33385af14..8fc7dcfd2e 100644 --- a/types/activex-wia/activex-wia-tests.ts +++ b/types/activex-wia/activex-wia-tests.ts @@ -11,6 +11,9 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { return results; }; +WScript.Echo('Hello, world'); +WScript.Quit(); + // source -- https://msdn.microsoft.com/en-us/library/windows/desktop/ms630826(v=vs.85).aspx { const cd = new ActiveXObject('WIA.CommonDialog'); @@ -51,7 +54,7 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { { const dev = cd.ShowSelectDevice(); if (dev) { - collectionToArray(dev.Properties).forEach(p => { + for (const p of collectionToArray(dev.Properties)) { let s = `${p.Name} (${p.PropertyID}) = `; if (p.IsVector) { s += '[vector of data]'; @@ -84,7 +87,7 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { } WScript.Echo(s); - }); + } } } @@ -112,7 +115,7 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { { const img = cd.ShowAcquireImage(); if (img) { - collectionToArray(img.Properties).forEach(p => { + for (const p of collectionToArray(img.Properties)) { let contents = ''; if (p.IsVector) { contents = '[vector data not emitted]'; @@ -124,7 +127,7 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { contents = p.Value; } WScript.Echo(`${p.Name} (${p.PropertyID}) = ${contents}`); - }); + } } } @@ -133,12 +136,12 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { const dev = cd.ShowSelectDevice(); if (dev) { const actionEvent = WIA.WiaEventFlag.ActionEvent; - collectionToArray(dev.Events).forEach(e => { + for (const e of collectionToArray(dev.Events)) { const msg = (e.Type & actionEvent) === actionEvent ? `${e.Name} is an Action event` : `${e.Name} is not an Action event`; WScript.Echo(msg); - }); + } } } @@ -208,14 +211,14 @@ Frame count = ${img.FrameCount}} // Create an imageprocess object and enumerate filters { const ip = new ActiveXObject('WIA.ImageProcess'); - collectionToArray(ip.FilterInfos).forEach(fi => { + for (const fi of collectionToArray(ip.FilterInfos)) { const s = [ fi.Name, new Array(51).join('='), fi.Description ].join('\n'); WScript.Echo(s); - }); + } } // Create an imageprocess object and create one of each available filter @@ -269,11 +272,11 @@ Frame count = ${img.FrameCount}} WScript.Echo(s); }; - collectionToArray(ip.FilterInfos).forEach(fi => { + for (const fi of collectionToArray(ip.FilterInfos)) { ip.Filters.Add(fi.FilterID); listProperties(ip.Filters(1)); ip.Filters.Remove(1); - }); + } } // List the supported transfer formats @@ -308,14 +311,14 @@ Frame count = ${img.FrameCount}} { const dev = cd.ShowSelectDevice(); if (dev) { - collectionToArray(dev.Items).forEach(item => { + for (const item of collectionToArray(dev.Items)) { let s: string = item.Properties("Item Name").Value; if (item.Properties.Exists("Item Time Stamp")) { const v: WIA.Vector = item.Properties("Item Time Stamp").Value; if (v.Count === 8) { s += ` (${v.Date})`; } } WScript.Echo(s); - }); + } } } @@ -340,16 +343,16 @@ Frame count = ${img.FrameCount}} } // List all available devices by name and deviceid - collectionToArray(dm.DeviceInfos).forEach(di => { + for (const di of collectionToArray(dm.DeviceInfos)) { const name: string = di.Properties("Name").Value; WScript.Echo(`${name} (${di.DeviceID})`); - }); + } // Display all the properties for the selected device { const dev = cd.ShowSelectDevice(); if (dev) { - collectionToArray(dev.Properties).forEach(p => { + for (const p of collectionToArray(dev.Properties)) { const name = `${p.Name} (${p.PropertyID})`; let contents: string; if (p.IsVector) { @@ -360,7 +363,7 @@ Frame count = ${img.FrameCount}} contents = p.Value; } WScript.Echo(`${name} = ${contents}`); - }); + } } } @@ -430,7 +433,7 @@ Frame count = ${img.FrameCount}} if (args[0] === 'connect') { const deviceID = args[1].substr(12); const device = dm.DeviceInfos(deviceID).Connect(); - collectionToArray(device.Items).forEach(item => { + for (const item of collectionToArray(device.Items)) { const img = item.Transfer(); img.SaveFile(`C:\\${item.Properties('Item Name').Value}.${img.FileExtension}`); @@ -445,7 +448,7 @@ Frame count = ${img.FrameCount}} WScript.Echo(error); } } - }); + } WScript.Quit(); } break; diff --git a/types/adal-angular/adal-angular-tests.ts b/types/adal-angular/adal-angular-tests.ts index 272591d56e..81293de159 100644 --- a/types/adal-angular/adal-angular-tests.ts +++ b/types/adal-angular/adal-angular-tests.ts @@ -1,10 +1,6 @@ -import AuthenticationContext, { - AuthenticationContextOptions, - TokenCallback, - UserCallback -} from "adal-angular"; +import AuthenticationContext = require("adal-angular"); -const onLogin: TokenCallback = (errorDescription, idToken, error) => { +const onLogin: AuthenticationContext.TokenCallback = (errorDescription, idToken, error) => { if (error) { console.error(errorDescription, error); return; @@ -14,7 +10,7 @@ const onLogin: TokenCallback = (errorDescription, idToken, error) => { } }; -const onToken: TokenCallback = (errorDesc, token, error) => { +const onToken: AuthenticationContext.TokenCallback = (errorDesc, token, error) => { if (error) { console.error(error); return; @@ -22,7 +18,7 @@ const onToken: TokenCallback = (errorDesc, token, error) => { console.log('Making request with token:', token); }; -const onUser: UserCallback = (error, user) => { +const onUser: AuthenticationContext.UserCallback = (error, user) => { if (error) { console.error(error); return; @@ -57,7 +53,7 @@ const acquireAnAccessToken = () => { ); }; -const config: AuthenticationContextOptions = { +const config: AuthenticationContext.Options = { clientId: "7cee0f68-5051-41f6-9e45-80463d21d65d", redirectUri: "http://localhost:16969/", instance: "https://login.microsoftonline.com/", @@ -70,6 +66,7 @@ const config: AuthenticationContextOptions = { }; const authenticationContext = new AuthenticationContext(config); +window.Logging.level = authenticationContext.CONSTANTS.LOGGING_LEVEL.ERROR; if (authenticationContext.isCallback(window.location.hash)) { authenticationContext.handleWindowCallback(); @@ -79,6 +76,11 @@ if (authenticationContext.isCallback(window.location.hash)) { acquireAnAccessToken(); } +const injectedContext = AuthenticationContext.inject({ + clientId: "7cee0f68-5051-41f6-9e45-80463d21d65d", +}); +injectedContext.handleWindowCallback(); + setTimeout(() => { authenticationContext.logOut(); }, 60000); diff --git a/types/adal-angular/index.d.ts b/types/adal-angular/index.d.ts index 00dc813ee8..ea4963b6d2 100644 --- a/types/adal-angular/index.d.ts +++ b/types/adal-angular/index.d.ts @@ -1,142 +1,28 @@ // Type definitions for adal-angular 1.0 // Project: https://github.com/AzureAD/azure-activedirectory-library-for-js#readme // Definitions by: Daniel Perez Alvarez +// Anthony Ciccarello // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export enum LoggingLevel { - ERROR = 0, - WARNING = 1, - INFO = 2, - VERBOSE = 3 -} +// In module contexts the class constructor function is the exported object +export = AuthenticationContext; -export type RequestType = "LOGIN" | "RENEW_TOKEN" | "UNKNOWN"; +// This class is defined globally in not in a module context +declare class AuthenticationContext { + instance: string; + config: AuthenticationContext.Options; + callback: AuthenticationContext.TokenCallback; + popUp: boolean; + isAngular: boolean; -export type ResponseType = "id_token token" | "token"; + /** + * Enum for request type + */ + REQUEST_TYPE: AuthenticationContext.RequestType; + RESPONSE_TYPE: AuthenticationContext.ResponseType; + CONSTANTS: AuthenticationContext.Constants; -export interface RequestInfo { - /** - * Object comprising of fields such as id_token/error, session_state, state, e.t.c. - */ - parameters: any; - /** - * Request type. - */ - requestType: RequestType; - /** - * Whether state is valid. - */ - stateMatch: boolean; - /** - * Unique guid used to match the response with the request. - */ - stateResponse: string; - /** - * Whether `requestType` contains `id_token`, `access_token` or error. - */ - valid: boolean; -} - -export interface UserInfo { - /** - * Username assigned from UPN or email. - */ - userName: string; - /** - * Properties parsed from `id_token`. - */ - profile: any; -} - -export type TokenCallback = ( - errorDesc: string | null, - token: string, - error: any -) => void; - -export type UserCallback = (errorDesc: string | null, user: UserInfo) => void; - -export interface AuthenticationContextOptions { - /** - * Client ID assigned to your app by Azure Active Directory. - */ - clientId: string; - /** - * Endpoint at which you expect to receive tokens.Defaults to `window.location.href`. - */ - redirectUri: string; - /** - * Azure Active Directory instance. Defaults to `https://login.microsoftonline.com/`. - */ - instance?: string; - /** - * Your target tenant. Defaults to `common`. - */ - tenant?: string; - /** - * Query parameters to add to the authentication request. - */ - extraQueryParameter?: string; - /** - * Unique identifier used to map the request with the response. Defaults to RFC4122 version 4 guid (128 bits). - */ - correlationId?: string; - /** - * User defined function of handling the navigation to Azure AD authorization endpoint in case of login. - */ - displayCall?: (url: string) => void; - /** - * Set this to true to enable login in a popup winodow instead of a full redirect. Defaults to `false`. - */ - popUp?: boolean; - /** - * Set this to the resource to request on login. Defaults to `clientId`. - */ - loginResource?: string; - /** - * Set this to redirect the user to a custom login page. - */ - localLoginUrl?: string; - /** - * Redirects to start page after login. Defaults to `true`. - */ - navigateToLoginRequestUrl?: boolean; - /** - * Set this to redirect the user to a custom logout page. - */ - logOutUri?: string; - /** - * Redirects the user to postLogoutRedirectUri after logout. Defaults to `redirectUri`. - */ - postLogoutRedirectUri?: string; - /** - * Sets browser storage to either 'localStorage' or sessionStorage'. Defaults to `sessionStorage`. - */ - cacheLocation?: "localStorage" | "sessionStorage"; - /** - * Array of keywords or URIs. Adal will attach a token to outgoing requests that have these keywords or URIs. - */ - endpoints?: { [resource: string]: string }; - /** - * Array of keywords or URIs. Adal will not attach a token to outgoing requests that have these keywords or URIs. - */ - anonymousEndpoints?: string[]; - /** - * If the cached token is about to be expired in the expireOffsetSeconds (in seconds), Adal will renew the token instead of using the cached token. Defaults to 300 seconds. - */ - expireOffsetSeconds?: number; - /** - * The number of milliseconds of inactivity before a token renewal response from AAD should be considered timed out. Defaults to 6 seconds. - */ - loadFrameTimeout?: number; - /** - * Callback to be invoked when a token is acquired. - */ - callback?: TokenCallback; -} - -export default class AuthenticationContext { - constructor(options: AuthenticationContextOptions); + constructor(options: AuthenticationContext.Options); /** * Initiates the login process by redirecting the user to Azure AD authorization endpoint. */ @@ -153,7 +39,7 @@ export default class AuthenticationContext { /** * If user object exists, returns it. Else creates a new user object by decoding `id_token` from the cache. */ - getCachedUser(): UserInfo; + getCachedUser(): AuthenticationContext.UserInfo; /** * Adds the passed callback to the array of callbacks for the specified resource. * @param resource A URI that identifies the resource for which the token is requested. @@ -163,14 +49,14 @@ export default class AuthenticationContext { registerCallback( expectedState: string, resource: string, - callback: TokenCallback + callback: AuthenticationContext.TokenCallback ): void; /** * Acquires token from the cache if it is not expired. Otherwise sends request to AAD to obtain a new token. * @param resource Resource URI identifying the target resource. * @param callback The callback provided by the caller. It will be called with token or error. */ - acquireToken(resource: string, callback: TokenCallback): void; + acquireToken(resource: string, callback: AuthenticationContext.TokenCallback): void; /** * Acquires token (interactive flow using a popup window) by sending request to AAD to obtain a new token. * @param resource Resource URI identifying the target resource. @@ -182,7 +68,7 @@ export default class AuthenticationContext { resource: string, extraQueryParameters: string | null | undefined, claims: string | null | undefined, - callback: TokenCallback + callback: AuthenticationContext.TokenCallback ): void; /** * Acquires token (interactive flow using a redirect) by sending request to AAD to obtain a new token. In this case the callback passed in the authentication request constructor will be called. @@ -217,7 +103,7 @@ export default class AuthenticationContext { * Calls the passed in callback with the user object or error message related to the user. * @param callback The callback provided by the caller. It will be called with user or error. */ - getUser(callback: UserCallback): void; + getUser(callback: AuthenticationContext.UserCallback): void; /** * Checks if the URL fragment contains access token, id token or error description. * @param hash Hash passed from redirect page. @@ -230,11 +116,11 @@ export default class AuthenticationContext { /** * Creates a request info object from the URL fragment and returns it. */ - getRequestInfo(hash: string): RequestInfo; + getRequestInfo(hash: string): AuthenticationContext.RequestInfo; /** * Saves token or error received in the response from AAD in the cache. In case of `id_token`, it also creates the user object. */ - saveTokenFromHash(requestInfo: RequestInfo): void; + saveTokenFromHash(requestInfo: AuthenticationContext.RequestInfo): void; /** * Gets resource for given endpoint if mapping is provided with config. * @param endpoint Resource URI identifying the target resource. @@ -252,7 +138,7 @@ export default class AuthenticationContext { * @param message Message to log. * @param error Error to log. */ - log(level: LoggingLevel, message: string, error: any): void; + log(level: AuthenticationContext.LoggingLevel, message: string, error: any): void; /** * Logs messages when logging level is set to 0. * @param message Message to log. @@ -274,4 +160,221 @@ export default class AuthenticationContext { * @param message Message to log. */ verbose(message: string): void; + + /** + * Logs Pii messages when Logging Level is set to 0 and window.piiLoggingEnabled is set to true. + * @param message Message to log. + * @param error Error to log. + */ + errorPii(message: string, error: any): void; + + /** + * Logs Pii messages when Logging Level is set to 1 and window.piiLoggingEnabled is set to true. + * @param message Message to log. + */ + warnPii(message: string): void; + + /** + * Logs messages when Logging Level is set to 2 and window.piiLoggingEnabled is set to true. + * @param message Message to log. + */ + infoPii(message: string): void; + + /** + * Logs messages when Logging Level is set to 3 and window.piiLoggingEnabled is set to true. + * @param message Message to log. + */ + verbosePii(message: string): void; +} + +declare namespace AuthenticationContext { + function inject(config: Options): AuthenticationContext; + + type LoggingLevel = 0 | 1 | 2 | 3; + + type RequestType = "LOGIN" | "RENEW_TOKEN" | "UNKNOWN"; + + type ResponseType = "id_token token" | "token"; + + interface RequestInfo { + /** + * Object comprising of fields such as id_token/error, session_state, state, e.t.c. + */ + parameters: any; + /** + * Request type. + */ + requestType: RequestType; + /** + * Whether state is valid. + */ + stateMatch: boolean; + /** + * Unique guid used to match the response with the request. + */ + stateResponse: string; + /** + * Whether `requestType` contains `id_token`, `access_token` or error. + */ + valid: boolean; + } + + interface UserInfo { + /** + * Username assigned from UPN or email. + */ + userName: string; + /** + * Properties parsed from `id_token`. + */ + profile: any; + } + + type TokenCallback = ( + errorDesc: string | null, + token: string | null, + error: any + ) => void; + + type UserCallback = (errorDesc: string | null, user: UserInfo | null) => void; + + /** + * Configuration options for Authentication Context + */ + interface Options { + /** + * Client ID assigned to your app by Azure Active Directory. + */ + clientId: string; + /** + * Endpoint at which you expect to receive tokens.Defaults to `window.location.href`. + */ + redirectUri?: string; + /** + * Azure Active Directory instance. Defaults to `https://login.microsoftonline.com/`. + */ + instance?: string; + /** + * Your target tenant. Defaults to `common`. + */ + tenant?: string; + /** + * Query parameters to add to the authentication request. + */ + extraQueryParameter?: string; + /** + * Unique identifier used to map the request with the response. Defaults to RFC4122 version 4 guid (128 bits). + */ + correlationId?: string; + /** + * User defined function of handling the navigation to Azure AD authorization endpoint in case of login. + */ + displayCall?: (url: string) => void; + /** + * Set this to true to enable login in a popup winodow instead of a full redirect. Defaults to `false`. + */ + popUp?: boolean; + /** + * Set this to the resource to request on login. Defaults to `clientId`. + */ + loginResource?: string; + /** + * Set this to redirect the user to a custom login page. + */ + localLoginUrl?: string; + /** + * Redirects to start page after login. Defaults to `true`. + */ + navigateToLoginRequestUrl?: boolean; + /** + * Set this to redirect the user to a custom logout page. + */ + logOutUri?: string; + /** + * Redirects the user to postLogoutRedirectUri after logout. Defaults to `redirectUri`. + */ + postLogoutRedirectUri?: string; + /** + * Sets browser storage to either 'localStorage' or sessionStorage'. Defaults to `sessionStorage`. + */ + cacheLocation?: "localStorage" | "sessionStorage"; + /** + * Array of keywords or URIs. Adal will attach a token to outgoing requests that have these keywords or URIs. + */ + endpoints?: { [resource: string]: string }; + /** + * Array of keywords or URIs. Adal will not attach a token to outgoing requests that have these keywords or URIs. + */ + anonymousEndpoints?: string[]; + /** + * If the cached token is about to be expired in the expireOffsetSeconds (in seconds), Adal will renew the token instead of using the cached token. Defaults to 300 seconds. + */ + expireOffsetSeconds?: number; + /** + * The number of milliseconds of inactivity before a token renewal response from AAD should be considered timed out. Defaults to 6 seconds. + */ + loadFrameTimeout?: number; + /** + * Callback to be invoked when a token is acquired. + */ + callback?: TokenCallback; + } + + interface LoggingConfig { + level: LoggingLevel; + log: (message: string) => void; + piiLoggingEnabled: boolean; + } + + /** + * Enum for storage constants + */ + interface Constants { + ACCESS_TOKEN: 'access_token'; + EXPIRES_IN: 'expires_in'; + ID_TOKEN: 'id_token'; + ERROR_DESCRIPTION: 'error_description'; + SESSION_STATE: 'session_state'; + STORAGE: { + TOKEN_KEYS: 'adal.token.keys'; + ACCESS_TOKEN_KEY: 'adal.access.token.key'; + EXPIRATION_KEY: 'adal.expiration.key'; + STATE_LOGIN: 'adal.state.login'; + STATE_RENEW: 'adal.state.renew'; + NONCE_IDTOKEN: 'adal.nonce.idtoken'; + SESSION_STATE: 'adal.session.state'; + USERNAME: 'adal.username'; + IDTOKEN: 'adal.idtoken'; + ERROR: 'adal.error'; + ERROR_DESCRIPTION: 'adal.error.description'; + LOGIN_REQUEST: 'adal.login.request'; + LOGIN_ERROR: 'adal.login.error'; + RENEW_STATUS: 'adal.token.renew.status'; + }; + RESOURCE_DELIMETER: '|'; + LOADFRAME_TIMEOUT: '6000'; + TOKEN_RENEW_STATUS_CANCELED: 'Canceled'; + TOKEN_RENEW_STATUS_COMPLETED: 'Completed'; + TOKEN_RENEW_STATUS_IN_PROGRESS: 'In Progress'; + LOGGING_LEVEL: { + ERROR: 0; + WARN: 1; + INFO: 2; + VERBOSE: 3; + }; + LEVEL_STRING_MAP: { + 0: 'ERROR:'; + 1: 'WARNING:'; + 2: 'INFO:'; + 3: 'VERBOSE:'; + }; + POPUP_WIDTH: 483; + POPUP_HEIGHT: 600; + } +} + +declare global { + interface Window { + Logging: AuthenticationContext.LoggingConfig; + } } diff --git a/types/adal-angular/tsconfig.json b/types/adal-angular/tsconfig.json index 9052e3fc04..f297baa423 100644 --- a/types/adal-angular/tsconfig.json +++ b/types/adal-angular/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "adal-angular-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/agenda/agenda-tests.ts b/types/agenda/agenda-tests.ts index bbf945bd62..a7031d2ef8 100644 --- a/types/agenda/agenda-tests.ts +++ b/types/agenda/agenda-tests.ts @@ -5,8 +5,8 @@ var mongoConnectionString = "mongodb://127.0.0.1/agenda"; var agenda = new Agenda({ db: { address: mongoConnectionString } }); -agenda.define('delete old users', (job, done) => { - +agenda.define<{ foo: Error }>('delete old users', (job, done) => { + done(job.attrs.data.foo) }); agenda.on('ready', () => { @@ -62,7 +62,7 @@ agenda.schedule('tomorrow at noon', ['printAnalyticsReport', 'sendNotifications' agenda.now('do the hokey pokey'); -var job = agenda.create('printAnalyticsReport', { userCount: 100 }); +var job = agenda.create<{ userCount: number }>('printAnalyticsReport', { userCount: 100 }); job.save(function(err) { console.log("Job successfully saved"); }); diff --git a/types/agenda/index.d.ts b/types/agenda/index.d.ts index 12b0b76c38..b29158983d 100644 --- a/types/agenda/index.d.ts +++ b/types/agenda/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Agenda v1.0.0 -// Project: https://github.com/rschmukler/agenda +// Type definitions for Agenda v1.0.3 +// Project: https://github.com/agenda/agenda // Definitions by: Meir Gottlieb +// Jeff Principe // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -89,14 +90,14 @@ declare class Agenda extends EventEmitter { * @param name The name of the job. * @param data Data to associated with the job. */ - create(name: string, data?: any): Agenda.Job; + create(name: string, data?: T): Agenda.Job; /** * Find all Jobs matching `query` and pass same back in cb(). * @param query * @param cb */ - jobs(query: any, cb: ResultCallback): void; + jobs(query: any, cb: ResultCallback[]>): void; /** * Removes all jobs in the database without defined behaviors. Useful if you change a definition name and want @@ -113,8 +114,8 @@ declare class Agenda extends EventEmitter { * @param options The options for the job. * @param handler The handler to execute. */ - define(name: string, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void; - define(name: string, options: Agenda.JobOptions, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void; + define(name: string, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void; + define(name: string, options: Agenda.JobOptions, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void; /** * Runs job name at the given interval. Optionally, data and options can be passed in. @@ -124,8 +125,8 @@ declare class Agenda extends EventEmitter { * @param options An optional argument that will be passed to job.repeatEvery. * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - every(interval: number | string, names: string, data?: any, options?: any, cb?: ResultCallback): Agenda.Job; - every(interval: number | string, names: string[], data?: any, options?: any, cb?: ResultCallback): Agenda.Job[]; + every(interval: number | string, names: string, data?: T, options?: any, cb?: ResultCallback>): Agenda.Job; + every(interval: number | string, names: string[], data?: T, options?: any, cb?: ResultCallback[]>): Agenda.Job[]; /** * Schedules a job to run name once at a given time. @@ -134,8 +135,8 @@ declare class Agenda extends EventEmitter { * @param data An optional argument that will be passed to the processing function under job.attrs.data. * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - schedule(when: Date | string, names: string, data?: any, cb?: ResultCallback): Agenda.Job; - schedule(when: Date | string, names: string[], data?: any, cb?: ResultCallback): Agenda.Job[]; + schedule(when: Date | string, names: string, data?: T, cb?: ResultCallback>): Agenda.Job; + schedule(when: Date | string, names: string[], data?: T, cb?: ResultCallback[]>): Agenda.Job[]; /** * Schedules a job to run name once immediately. @@ -143,7 +144,7 @@ declare class Agenda extends EventEmitter { * @param data An optional argument that will be passed to the processing function under job.attrs.data. * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - now(name: string, data?: any, cb?: ResultCallback): Agenda.Job; + now(name: string, data?: T, cb?: ResultCallback>): Agenda.Job; /** * Cancels any jobs matching the passed mongodb-native query, and removes them from the database. @@ -242,10 +243,14 @@ declare namespace Agenda { } } + interface JobAttributesData { + [key: string]: any; + } + /** * The database record associated with a job. */ - interface JobAttributes { + interface JobAttributes { /** * The record identity. */ @@ -264,7 +269,7 @@ declare namespace Agenda { /** * The job details. */ - data: { [name: string]: any }; + data: T; /** * The priority of the job. @@ -330,12 +335,12 @@ declare namespace Agenda { /** * A scheduled job. */ - interface Job { + interface Job { /** * The database record associated with the job. */ - attrs: JobAttributes; + attrs: JobAttributes; /** * The agenda that created the job. @@ -348,54 +353,54 @@ declare namespace Agenda { * @param options An optional argument that can include a timezone field. The timezone should be a string as * accepted by moment-timezone and is considered when using an interval in the cron string format. */ - repeatEvery(interval: string | number, options?: { timezone?: string }): Job + repeatEvery(interval: string | number, options?: { timezone?: string }): Job /** * Specifies a time when the job should repeat. [Possible values](https://github.com/matthewmueller/date#examples). * @param time */ - repeatAt(time: string): Job + repeatAt(time: string): Job /** * Disables the job. */ - disable(): Job; + disable(): Job; /** * Enables the job. */ - enable(): Job; + enable(): Job; /** * Ensure that only one instance of this job exists with the specified properties * @param value The properties associated with the job that must be unqiue. * @param opts */ - unique(value: any, opts?: { insertOnly?: boolean }): Job; + unique(value: any, opts?: { insertOnly?: boolean }): Job; /** * Specifies the next time at which the job should run. * @param time The next time at which the job should run. */ - schedule(time: string | Date): Job; + schedule(time: string | Date): Job; /** * Specifies the priority weighting of the job. * @param value The priority of the job (lowest|low|normal|high|highest|number). */ - priority(value: string | number): Job; + priority(value: string | number): Job; /** * Sets job.attrs.failedAt to now, and sets job.attrs.failReason to reason. * @param reason A message or Error object that indicates why the job failed. */ - fail(reason: string | Error): Job; + fail(reason: string | Error): Job; /** * Runs the given job and calls callback(err, job) upon completion. Normally you never need to call this manually * @param cb Called when the job is completed. */ - run(cb?: ResultCallback): Job; + run(cb?: ResultCallback>): Job; /** * Returns true if the job is running; otherwise, returns false. @@ -406,7 +411,7 @@ declare namespace Agenda { * Saves the job into the database. * @param cb Called when the job is saved. */ - save(cb?: ResultCallback): Job; + save(cb?: ResultCallback>): Job; /** * Removes the job from the database and cancels the job. @@ -424,7 +429,7 @@ declare namespace Agenda { /** * Calculates next time the job should run */ - computeNextRunAt(): Job; + computeNextRunAt(): Job; } interface JobOptions { diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index 5c7026d70e..3304ad579d 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -805,11 +805,7 @@ declare namespace algoliasearch { * @param err() error callback * https://www.algolia.com/doc/api-reference/api-methods/search-for-facet-values/ */ - searchForFacetValues({ - facetName, - facetQuery, - ...qp, - }: { + searchForFacetValues(options: { facetName: string; facetQuery: string; } & AlgoliaQueryParameters): Promise; @@ -820,12 +816,7 @@ declare namespace algoliasearch { * @param err() error callback * https://www.algolia.com/doc/api-reference/api-methods/search-for-facet-values/ */ - searchForFacetValues( - { - facetName, - facetQuery, - ...qp, - }: { + searchForFacetValues(options: { facetName: string; facetQuery: string; } & AlgoliaQueryParameters, diff --git a/types/amp-message/amp-message-tests.ts b/types/amp-message/amp-message-tests.ts new file mode 100644 index 0000000000..003949f3b7 --- /dev/null +++ b/types/amp-message/amp-message-tests.ts @@ -0,0 +1,57 @@ +import Message = require('amp-message'); + +// $ExpectType Message +new Message(new Buffer('aaa')); + +// $ExpectType Message +new Message([new Buffer('aaa'), new Buffer('bbb')]); + +const message = new Message([new Buffer('aaa'), new Buffer('bbb')]); + +// $ExpectType string +message.inspect(); + +// $ExpectType Buffer +message.toBuffer(); + +// $ExpectType number +message.push(new Buffer('ccc')); + +// $ExpectType Buffer | undefined +message.pop(); + +// $ExpectType Buffer | undefined +message.shift(); + +// $ExpectType number +message.unshift(new Buffer('ddd')); + +// $ExpectError +new Message(); + +// $ExpectError +new Message(1); + +// $ExpectError +new Message({}); + +// $ExpectError +new Message('aaa'); + +// $ExpectError +message.push(1); + +// $ExpectError +message.push({}); + +// $ExpectError +message.push('aaa'); + +// $ExpectError +message.unshift(1); + +// $ExpectError +message.unshift({}); + +// $ExpectError +message.unshift('aaa'); diff --git a/types/amp-message/index.d.ts b/types/amp-message/index.d.ts new file mode 100644 index 0000000000..f1ca520ae7 --- /dev/null +++ b/types/amp-message/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for amp-message 0.1 +// Project: https://github.com/visionmedia/node-amp-message +// Definitions by: Vilim Stubičan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +declare class Message { + constructor(args: Buffer | Buffer[]); + + inspect(): string; + + toBuffer(): Buffer; + + push(...items: Buffer[]): number; + + pop(): Buffer | undefined; + + shift(): Buffer | undefined; + + unshift(...items: Buffer[]): number; +} + +export = Message; diff --git a/types/amp-message/tsconfig.json b/types/amp-message/tsconfig.json new file mode 100644 index 0000000000..7b1826a6d8 --- /dev/null +++ b/types/amp-message/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", + "amp-message-tests.ts" + ] +} diff --git a/types/colors/tslint.json b/types/amp-message/tslint.json similarity index 100% rename from types/colors/tslint.json rename to types/amp-message/tslint.json diff --git a/types/amp/amp-tests.ts b/types/amp/amp-tests.ts new file mode 100644 index 0000000000..1e17bc8507 --- /dev/null +++ b/types/amp/amp-tests.ts @@ -0,0 +1,44 @@ +import { decode, encode, Stream } from 'amp'; + +// $ExpectType Buffer[] +decode(new Buffer('something')); + +// $ExpectType Buffer +encode([new Buffer('something'), new Buffer('something')]); + +// $ExpectError +decode(''); + +// $ExpectError +decode(1); + +// $ExpectError +decode(); + +// $ExpectError +encode(''); + +// $ExpectError +encode(1); + +// $ExpectError +encode(); + +// $ExpectType Stream +new Stream({}); + +// $ExpectType Stream +new Stream({ + highWaterMark: 1, + decodeStrings: true, + objectMode: true, + destroy: (error?: Error) => { + return 'handle error'; + }, + final: (callback: (error?: Error) => void) => { + // do nothing + } +}); + +// $ExpectError +new Stream({somethingNoneExisting: true}); diff --git a/types/amp/index.d.ts b/types/amp/index.d.ts new file mode 100644 index 0000000000..99b9fc7f45 --- /dev/null +++ b/types/amp/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for amp 0.3 +// Project: https://github.com/visionmedia/node-amp +// Definitions by: Vilim Stubičan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +import * as stream from 'stream'; + +export function decode(buf: Buffer): Buffer[]; + +export function encode(args: Buffer[]): Buffer; + +export class Stream extends stream.Writable { + constructor(opts: stream.WritableOptions); + + _write(chunk: any, encoding: string, fn: () => void): void; +} diff --git a/types/amp/tsconfig.json b/types/amp/tsconfig.json new file mode 100644 index 0000000000..4bb6a171ad --- /dev/null +++ b/types/amp/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", + "amp-tests.ts" + ] +} diff --git a/types/amp/tslint.json b/types/amp/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/amp/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/angular-material/angular-material-tests.ts b/types/angular-material/angular-material-tests.ts index ad79cff2db..f29de44222 100644 --- a/types/angular-material/angular-material-tests.ts +++ b/types/angular-material/angular-material-tests.ts @@ -8,7 +8,8 @@ myApp.config(( $mdAriaProvider: ng.material.IAriaProvider, $mdThemingProvider: ng.material.IThemingProvider, $mdIconProvider: ng.material.IIconProvider, - $mdProgressCircularProvider: ng.material.IProgressCircularProvider) => { + $mdProgressCircularProvider: ng.material.IProgressCircularProvider, + $mdDialogProvider: ng.material.IDialogProvider) => { $mdThemingProvider.alwaysWatchTheme(true); const neonRedMap: ng.material.IPalette = $mdThemingProvider.extendPalette('red', { 500: 'ff0000' @@ -56,6 +57,23 @@ myApp.config(( // Globally disables all ARIA warnings. $mdAriaProvider.disableWarnings(); + + // Add custom dialog preset + $mdDialogProvider.addPreset('testPreset', { + methods: ['entityName'], + options: () => { + return { + template: + '' + + 'This is a custom preset' + + '', + controllerAs: 'dialog', + bindToController: true, + clickOutsideToClose: true, + escapeToClose: true + }; + } + }); }); myApp.controller('BottomSheetController', ($scope: TestScope, $mdBottomSheet: ng.material.IBottomSheetService, $q: ng.IQService) => { @@ -192,6 +210,11 @@ myApp.controller('DialogController', ($scope: TestScope, $mdDialog: ng.material. onComplete: (scope, element) => { }, onRemoving: (element, removePromise) => { }, }); + + // Show custom dialog preset + $mdDialog.show( + $mdDialog['testPreset']().entityName('Product #6') + ); }); class IconDirective implements ng.IDirective { diff --git a/types/angular-material/index.d.ts b/types/angular-material/index.d.ts index d77f5ae7ce..6885916e8a 100644 --- a/types/angular-material/index.d.ts +++ b/types/angular-material/index.d.ts @@ -125,6 +125,11 @@ declare module 'angular' { } interface IDialogService { + // indexer used to call preset dialog created with $mdDialogProvider + // see: https://material.angularjs.org/latest/api/service/$mdDialog#custom-presets + // tslint:disable-next-line:ban-types + [presetName: string]: Function; + show(dialog: IDialogOptions | IAlertDialog | IConfirmDialog | IPromptDialog): IPromise; confirm(): IConfirmDialog; alert(): IAlertDialog; @@ -133,6 +138,10 @@ declare module 'angular' { cancel(response?: any): void; } + interface IDialogProvider { + addPreset(presetName: string, presetOptions: { methods?: ReadonlyArray, options: () => IDialogOptions }): IDialogProvider; + } + type IIcon = (id: string) => IPromise; // id is a unique ID or URL interface IIconProvider { @@ -223,7 +232,7 @@ declare module 'angular' { contrastDefaultColor?: string; contrastDarkColors?: string | string[]; contrastLightColors?: string | string[]; - contrastStrongLightColors?: string|string[]; + contrastStrongLightColors?: string | string[]; } interface IThemeHues { diff --git a/types/aphrodite/aphrodite-tests.tsx b/types/aphrodite/aphrodite-tests.tsx index 685a9a4283..feb35c8c7c 100644 --- a/types/aphrodite/aphrodite-tests.tsx +++ b/types/aphrodite/aphrodite-tests.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { StyleSheet, css, StyleSheetServer, StyleSheetTestUtils } from "aphrodite"; +import { StyleSheet, css, StyleSheetServer, StyleSheetTestUtils, FontFamily } from "aphrodite"; const styles = StyleSheet.create({ red: { @@ -20,7 +20,7 @@ const styles = StyleSheet.create({ } }); -const coolFont = { +const coolFont: FontFamily = { fontFamily: "CoolFont", fontStyle: "normal", fontWeight: "normal", diff --git a/types/aphrodite/index.d.ts b/types/aphrodite/index.d.ts index 00d1908d9f..583e84e996 100644 --- a/types/aphrodite/index.d.ts +++ b/types/aphrodite/index.d.ts @@ -4,13 +4,36 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 -import * as React from "react"; +import * as CSS from "csstype"; + +type BaseCSSProperties = CSS.Properties; + +type FontFamily = + | BaseCSSProperties['fontFamily'] + | CSS.FontFace; + +// Replace with Exclude once on 2.8+ +type Diff = ( + & { [P in T]: P } + & { [P in U]: never } + & { [x: string]: never } +)[T]; +type Omit = Pick>; + +type CSSProperties = Omit & { + fontFamily?: FontFamily | FontFamily[]; +}; + +// For pseudo selectors and media queries +interface OpenCSSProperties extends CSSProperties { + [k: string]: CSSProperties[keyof CSSProperties] | CSSProperties; +} /** * Aphrodite style declaration */ export interface StyleDeclaration { - [key: string]: React.CSSProperties; + [key: string]: OpenCSSProperties; } interface StyleSheetStatic { diff --git a/types/aphrodite/package.json b/types/aphrodite/package.json new file mode 100644 index 0000000000..e6696d08e7 --- /dev/null +++ b/types/aphrodite/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "csstype": "^2.2.0" + } +} diff --git a/types/archiver/archiver-tests.ts b/types/archiver/archiver-tests.ts index 752d9cc944..dbb1df1de7 100644 --- a/types/archiver/archiver-tests.ts +++ b/types/archiver/archiver-tests.ts @@ -64,6 +64,6 @@ archiver.setModule(() => {}); archiver.pointer(); archiver.use(() => {}); -archiver.finalize().then(); +archiver.finalize(); archiver.symlink('./path', './target'); diff --git a/types/archiver/index.d.ts b/types/archiver/index.d.ts index df15f9ff65..d33e8ec6dd 100644 --- a/types/archiver/index.d.ts +++ b/types/archiver/index.d.ts @@ -35,7 +35,7 @@ declare namespace archiver { 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; + finalize(): void; setFormat(format: string): this; setModule(module: Function): this; diff --git a/types/arrify/arrify-tests.ts b/types/arrify/arrify-tests.ts index 319e86897a..12995781bf 100644 --- a/types/arrify/arrify-tests.ts +++ b/types/arrify/arrify-tests.ts @@ -1,4 +1,4 @@ -import arrify = require("arrify"); +import * as arrify from 'arrify'; arrify(null); arrify(null); diff --git a/types/arrify/index.d.ts b/types/arrify/index.d.ts index a1dda1b9ec..43c06af05f 100644 --- a/types/arrify/index.d.ts +++ b/types/arrify/index.d.ts @@ -14,4 +14,5 @@ * arrify([2, 3]) // returns [2, 3] */ declare function arrify(val: undefined | null | T | T[]): T[]; +declare namespace arrify {} export = arrify; diff --git a/types/async-retry/async-retry-tests.ts b/types/async-retry/async-retry-tests.ts index 29c90b36c8..68327b66bd 100644 --- a/types/async-retry/async-retry-tests.ts +++ b/types/async-retry/async-retry-tests.ts @@ -1,4 +1,5 @@ -import { Options, RetryFunction, retry } from 'async-retry'; +import { Options, RetryFunction } from 'async-retry'; +import retry = require("async-retry"); const o: Options = { retries: 1, diff --git a/types/async-retry/index.d.ts b/types/async-retry/index.d.ts index 38d0d8aeec..a2f65e00a4 100644 --- a/types/async-retry/index.d.ts +++ b/types/async-retry/index.d.ts @@ -1,17 +1,25 @@ -// Type definitions for async-retry 1.1 +// Type definitions for async-retry 1.2 // Project: https://github.com/zeit/async-retry#readme // Definitions by: Albert Wu +// Pablo Rodríguez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export function retry(fn: RetryFunction, opts: Options): Promise; +declare function AsyncRetry( + fn: AsyncRetry.RetryFunction, + opts: AsyncRetry.Options +): Promise; -export interface Options { - retries?: number; - factor?: number; - minTimeout?: number; - maxTimeout?: number; - randomize?: boolean; - onRetry?: (e: Error) => any; +declare namespace AsyncRetry { + interface Options { + retries?: number; + factor?: number; + minTimeout?: number; + maxTimeout?: number; + randomize?: boolean; + onRetry?: (e: Error) => any; + } + + type RetryFunction = (bail: (e: Error) => A, attempt: number) => A|Promise; } -export type RetryFunction = (bail: (e: Error) => A, attempt: number) => A|Promise; +export = AsyncRetry; diff --git a/types/async/index.d.ts b/types/async/index.d.ts index e2ecb522bc..961dd73ebb 100644 --- a/types/async/index.d.ts +++ b/types/async/index.d.ts @@ -168,8 +168,8 @@ export function forever(next: (next : ErrorCallback) => void, errBack: Err export function waterfall(tasks: Function[], callback?: AsyncResultCallback): void; export function compose(...fns: Function[]): Function; export function seq(...fns: Function[]): Function; -export function applyEach(fns: Function[], argsAndCallback: any[]): void; // applyEach(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional. -export function applyEachSeries(fns: Function[], argsAndCallback: any[]): void; // applyEachSeries(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional. +export function applyEach(fns: Function[], ...argsAndCallback: any[]): void; // applyEach(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional. +export function applyEachSeries(fns: Function[], ...argsAndCallback: any[]): void; // applyEachSeries(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional. export function queue(worker: AsyncWorker, concurrency?: number): AsyncQueue; export function queue(worker: AsyncResultIterator, concurrency?: number): AsyncQueue; export function priorityQueue(worker: AsyncWorker, concurrency: number): AsyncPriorityQueue; diff --git a/types/atom/atom-tests.ts b/types/atom/atom-tests.ts index f21fab1114..5396338e9c 100644 --- a/types/atom/atom-tests.ts +++ b/types/atom/atom-tests.ts @@ -3310,7 +3310,7 @@ const pathWatcherPromise = Atom.watchPath("/var/test", {}, (events) => { for (const event of events) { str = event.path; str = event.action; - if (event.oldPath) str = event.oldPath; + if (event.action === "renamed") str = event.oldPath; } }); diff --git a/types/atom/autocomplete-plus/index.d.ts b/types/atom/autocomplete-plus/index.d.ts index 2e91a81262..8f23911540 100644 --- a/types/atom/autocomplete-plus/index.d.ts +++ b/types/atom/autocomplete-plus/index.d.ts @@ -30,11 +30,20 @@ export interface SuggestionInsertedEvent { suggestion: TextSuggestion|SnippetSuggestion; } +/** + * COMPATIBILITY STUB. WILL BE REMOVED + */ +// tslint:disable-next-line:no-empty-interface +export interface Suggestion< + T extends { text: string }|{ snippet: string } + > extends SuggestionBase {} +// TODO: Remove on next minor version + /** * An autocompletion suggestion for the user. * Primary data type for the Atom Autocomplete+ service. */ -export interface Suggestion { +export interface SuggestionBase { /** * A string that will show in the UI for this suggestion. * When not set, snippet || text is displayed. @@ -91,14 +100,20 @@ export interface Suggestion { * When specified, a More.. link will be displayed in the description area. */ descriptionMoreURL?: string; + + /** + * (experimental) Description with Markdown formatting. + * Takes precedence over plaintext description. + */ + descriptionMarkdown?: string; } -export interface TextSuggestion extends Suggestion { +export interface TextSuggestion extends SuggestionBase { /** The text which will be inserted into the editor, in place of the prefix. */ text: string; } -export interface SnippetSuggestion extends Suggestion { +export interface SnippetSuggestion extends SuggestionBase { /** * A snippet string. This will allow users to tab through function arguments * or other options. @@ -106,7 +121,8 @@ export interface SnippetSuggestion extends Suggestion { snippet: string; } -export type Suggestions = Array; +export type AnySuggestion = TextSuggestion|SnippetSuggestion; +export type Suggestions = AnySuggestion[]; /** The interface that all Autocomplete+ providers must implement. */ export interface AutocompleteProvider { @@ -154,4 +170,13 @@ export interface AutocompleteProvider { /** Will be called if your provider is being destroyed by autocomplete+ */ dispose?(): void; + + /** + * (experimental) Is called when a suggestion is selected by the user for + * the purpose of loading more information about the suggestion. Return a + * Promise of the new suggestion to replace it with or return null if + * no change is needed. + */ + getSuggestionDetailsOnSelect?: + (suggestion: AnySuggestion) => Promise | AnySuggestion | null; } diff --git a/types/atom/index.d.ts b/types/atom/index.d.ts index e673ada530..e46ee9d0cf 100644 --- a/types/atom/index.d.ts +++ b/types/atom/index.d.ts @@ -5647,19 +5647,28 @@ export interface FileSavedEvent { path: string; } -export type FilesystemChangeEvent = Array<{ +export interface FilesystemChangeBasic< + Action extends "created"|"modified"|"deleted"|"renamed" + = "created"|"modified"|"deleted" +> { /** A string describing the filesystem action that occurred. */ - action: "created"|"modified"|"deleted"|"renamed"; + action: Action; /** The absolute path to the filesystem entry that was acted upon. */ path: string; +} +export interface FilesystemChangeRename extends FilesystemChangeBasic<"renamed"> { /** * For rename events, a string containing the filesystem entry's former * absolute path. */ - oldPath?: string; -}>; + oldPath: string; +} + +export type FilesystemChange = FilesystemChangeBasic|FilesystemChangeRename; + +export type FilesystemChangeEvent = FilesystemChange[]; export interface FullKeybindingMatchEvent { /** The string of keystrokes that matched the binding. */ diff --git a/types/auth0-lock/auth0-lock-tests.ts b/types/auth0-lock/auth0-lock-tests.ts index 3ef12e327b..b3b2c81339 100644 --- a/types/auth0-lock/auth0-lock-tests.ts +++ b/types/auth0-lock/auth0-lock-tests.ts @@ -124,7 +124,9 @@ const otherOptions : Auth0LockConstructorOptions = { configurationBaseUrl: "https://cdn.auth0.com", languageBaseUrl: "http://www.example.com", hashCleanup: false, - leeway: 30 + leeway: 30, + _enableImpersonation: true, + _enableIdPInitiatedLogin: false }; new Auth0Lock(CLIENT_ID, DOMAIN, otherOptions); diff --git a/types/auth0-lock/index.d.ts b/types/auth0-lock/index.d.ts index 7dd99af9e6..fec943ce02 100644 --- a/types/auth0-lock/index.d.ts +++ b/types/auth0-lock/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for auth0-lock 10.16 +// Type definitions for auth0-lock 11.4 // Project: http://auth0.com // Definitions by: Brian Caruso // Dan Caddigan @@ -118,7 +118,7 @@ interface Auth0LockConstructorOptions { auth?: Auth0LockAuthOptions; autoclose?: boolean; autofocus?: boolean; - avatar?: Auth0LockAvatarOptions; + avatar?: Auth0LockAvatarOptions | null; clientBaseUrl?: string; closable?: boolean; configurationBaseUrl?: string; @@ -143,6 +143,8 @@ interface Auth0LockConstructorOptions { socialButtonStyle?: "big" | "small"; theme?: Auth0LockThemeOptions; usernameStyle?: string; + _enableImpersonation?: boolean; + _enableIdPInitiatedLogin?: boolean; } interface Auth0LockFlashMessageOptions { diff --git a/types/autobahn/index.d.ts b/types/autobahn/index.d.ts index 969c703478..59bb2c404d 100644 --- a/types/autobahn/index.d.ts +++ b/types/autobahn/index.d.ts @@ -25,7 +25,7 @@ declare namespace autobahn { leave(reason: string, message: string): void; - call(procedure: string, args?: any[], kwargs?: any, options?: ICallOptions): When.Promise; + call(procedure: string, args?: any[] | any, kwargs?: any, options?: ICallOptions): When.Promise; publish(topic: string, args?: any[], kwargs?: any, options?: IPublishOptions): When.Promise; @@ -96,7 +96,7 @@ declare namespace autobahn { kwargs: any; } - type SubscribeHandler = (args?: any[], kwargs?: any, details?: IEvent) => void; + type SubscribeHandler = (args?: any[] | any, kwargs?: any, details?: IEvent) => void; interface ISubscription { topic: string; @@ -206,7 +206,7 @@ declare namespace autobahn { type DeferFactory = () => When.Promise; - type OnChallengeHandler = (session: Session, method: string, extra: any) => string; + type OnChallengeHandler = (session: Session, method: string, extra: any) => string | When.Promise; interface IConnectionOptions { use_es6_promises?: boolean; diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 2b7b375576..dc16eca58f 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -260,9 +260,27 @@ statement = { }; statement = { + Sid: str, Action: [str, str], Effect: str, - Resource: [str, str] + Resource: [str, str], + Condition: { + condition1: { key: "value" }, + condition2: [{ + key1: "value", + key2: "value" + }, { + key3: "value" + }] + }, + Principal: [str, str], + NotPrincipal: [str, str] +}; + +statement = { + Effect: str, + NotAction: str, + NotResource: str }; policyDocument = { @@ -270,6 +288,11 @@ policyDocument = { Statement: [statement] }; +policyDocument = { + Version: str, + Statement: [statement, statement] +}; + authResponse = { principalId: str, policyDocument, @@ -572,6 +595,28 @@ const CloudFrontResponseEvent: AWSLambda.CloudFrontResponseEvent = { ] }; +/* Kinesis Data Stream Events */ +declare let kinesisStreamEvent: AWSLambda.KinesisStreamEvent; +declare let kinesisStreamRecord: AWSLambda.KinesisStreamRecord; +declare let kinesisStreamRecordPayload: AWSLambda.KinesisStreamRecordPayload; + +kinesisStreamRecord = kinesisStreamEvent.Records[0]; + +str = kinesisStreamRecord.awsRegion; +str = kinesisStreamRecord.eventID; +str = kinesisStreamRecord.eventName; +str = kinesisStreamRecord.eventSource; +str = kinesisStreamRecord.eventSourceARN; +str = kinesisStreamRecord.eventVersion; +str = kinesisStreamRecord.invokeIdentityArn; +kinesisStreamRecordPayload = kinesisStreamRecord.kinesis; + +num = kinesisStreamRecordPayload.approximateArrivalTimestamp; +str = kinesisStreamRecordPayload.data; +str = kinesisStreamRecordPayload.kinesisSchemaVersion; +str = kinesisStreamRecordPayload.partitionKey; +str = kinesisStreamRecordPayload.sequenceNumber; + /* Compatibility functions */ context.done(); context.done(error); @@ -585,8 +630,27 @@ context.fail(str); /* Handler */ let handler: AWSLambda.Handler = (event: any, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; -// async methods return Promise, test assignability -let asyncHandler: AWSLambda.Handler = async (event: any, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; +/* In node8.10 runtime, handlers may return a promise for the result value, so existing async + * handlers that return Promise before calling the callback will now have a `null` result. + * Be safe and make that badly typed with a major verson bump to 8.10 so users expect the breaking change, + * since the upgrade effort should be pretty low in most cases, and it points them at a nicer solution. + */ +// $ExpectError +let legacyAsyncHandler: AWSLambda.APIGatewayProxyHandler = async ( + event: AWSLambda.APIGatewayProxyEvent, + context: AWSLambda.Context, + cb: AWSLambda.Callback, +) => { + cb(null, { statusCode: 200, body: 'No longer valid' }); +}; + +let node8AsyncHandler: AWSLambda.APIGatewayProxyHandler = async ( + event: AWSLambda.APIGatewayProxyEvent, + context: AWSLambda.Context, + cb: AWSLambda.Callback, +) => { + return { statusCode: 200, body: 'Is now valid!' }; +}; let inferredHandler: AWSLambda.S3Handler = (event, context, cb) => { // $ExpectType S3Event @@ -661,3 +725,5 @@ let customHandler: AWSLambda.Handler = (event, contex // $ExpectError cb(null, { resultString: bool }); }; + +let kinesisStreamHandler: AWSLambda.KinesisStreamHandler = (event: AWSLambda.KinesisStreamEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index 5802913c37..c060bc10ee 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for AWS Lambda +// Type definitions for AWS Lambda 8.10 // Project: http://docs.aws.amazon.com/lambda // Definitions by: James Darbyshire // Michael Skarum @@ -16,6 +16,8 @@ // Danilo Raisi // Simon Buchan // David Hayden +// Chris Redekop +// Aneil Mallavarapu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -437,28 +439,52 @@ export interface CustomAuthorizerResult { principalId: string; policyDocument: PolicyDocument; context?: AuthResponseContext; + usageIdentifierKey?: string; } export type AuthResponse = CustomAuthorizerResult; /** * API Gateway CustomAuthorizer AuthResponse.PolicyDocument. - * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output + * https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html + * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html#Condition */ export interface PolicyDocument { Version: string; - Statement: [Statement]; + Id?: string; + Statement: Statement[]; +} + +/** + * API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Condition. + * https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-policy-language-overview.html + * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html + */ +export interface ConditionBlock { + [condition: string]: Condition | Condition[]; +} + +export interface Condition { + [key: string]: string | string[]; } /** * API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement. - * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output + * https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-policy-language-overview.html + * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html */ -export interface Statement { - Action: string | string[]; +export type Statement = BaseStatement & StatementAction & StatementResource; + +export interface BaseStatement { Effect: string; - Resource: string | string[]; + Sid?: string; + Condition?: ConditionBlock; + Principal?: string | string[]; + NotPrincipal?: string | string[]; } +export type StatementAction = { Action: string | string[] } | { NotAction: string | string[] }; +export type StatementResource = { Resource: string | string[] } | { NotResource: string | string[] }; + /** * API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement. * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output @@ -529,6 +555,31 @@ export interface CloudFrontRequestEvent { export type CloudFrontResponseResult = undefined | null | CloudFrontResultResponse; +// Kinesis Streams +// https://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-kinesis-streams +export interface KinesisStreamRecordPayload { + approximateArrivalTimestamp: number; + data: string; + kinesisSchemaVersion: string; + partitionKey: string; + sequenceNumber: string; +} + +export interface KinesisStreamRecord { + awsRegion: string; + eventID: string; + eventName: string; + eventSource: string; + eventSourceARN: string; + eventVersion: string; + invokeIdentityArn: string; + kinesis: KinesisStreamRecordPayload; +} + +export interface KinesisStreamEvent { + Records: KinesisStreamRecord[]; +} + /** * AWS Lambda handler function. * http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html @@ -536,8 +587,13 @@ export type CloudFrontResponseResult = undefined | null | CloudFrontResultRespon * @param event – event data. * @param context – runtime information of the Lambda function that is executing. * @param callback – optional callback to return information to the caller, otherwise return value is null. + * @return In the node8.10 runtime, a promise for the lambda result. */ -export type Handler = (event: TEvent, context: Context, callback: Callback) => void; +export type Handler = ( + event: TEvent, + context: Context, + callback: Callback, +) => void | Promise; /** * Optional callback parameter. @@ -595,7 +651,9 @@ export type CloudFrontRequestCallback = Callback; export type CloudFrontResponseHandler = Handler; export type CloudFrontResponseCallback = Callback; -// TODO: Kinesis (should be very close to DynamoDB stream?) +export type KinesisStreamHandler = Handler; + +// TODO: Kinesis Firehose export type CustomAuthorizerHandler = Handler; export type CustomAuthorizerCallback = Callback; diff --git a/types/axon/axon-tests.ts b/types/axon/axon-tests.ts new file mode 100644 index 0000000000..a7f2a95a87 --- /dev/null +++ b/types/axon/axon-tests.ts @@ -0,0 +1,173 @@ +import * as axon from 'axon'; +import { Socket as NetSocket } from 'net'; + +const PubEmitterSocket = axon.PubEmitterSocket; +const PubSocket = axon.PubSocket; +const RepSocket = axon.RepSocket; +const ReqSocket = axon.ReqSocket; +const Socket = axon.Socket; +const SubSocket = axon.SubSocket; + +const pubSocket = new PubSocket(); +const pubEmitterSocket = new PubEmitterSocket(); +const repSocket = new RepSocket(); +const reqSocket = new ReqSocket(); +const netSocket = new NetSocket(); +const socket = new Socket(); +const subSocket = new SubSocket(); + +// $ExpectType PubSocket +pubSocket.send('anything'); + +// $ExpectType PubSocket +pubSocket.send('anything', {w: 100, h: 200}); + +// $ExpectType PubSocket +pubEmitterSocket.send('anything'); + +// $ExpectType PubSocket +pubEmitterSocket.send('anything', {w: 100, h: 200}); + +// $ExpectType Socket +pubEmitterSocket.bind(3000); + +// $ExpectError +pubEmitterSocket.bind({a, b, c}); + +// $ExpectError +pubEmitterSocket.bind(); + +// $ExpectType Socket +pubEmitterSocket.connect(3000); + +// $ExpectError +pubEmitterSocket.connect({a, b, c}); + +// $ExpectError +pubEmitterSocket.connect(); + +// $ExpectType (args: Buffer | Buffer[]) => void +repSocket.onmessage(netSocket); + +// $ExpectError +repSocket.onmessage(); + +// $ExpectError +repSocket.onmessage(''); + +// $ExpectError +repSocket.onmessage(1); + +// $ExpectError +repSocket.onmessage({}); + +// $ExpectType string +reqSocket.id(); + +// $ExpectType (args: Buffer | Buffer[]) => void +reqSocket.onmessage(); + +// $ExpectType void +reqSocket.send('anything'); + +// $ExpectType void +reqSocket.send('anything', {w: 100, h: 200}); + +// $ExpectType Socket +socket.set('name', 'aaa'); + +// $ExpectError +socket.set(1, 'aaa'); + +// $ExpectError +socket.set({}, 'aaa'); + +// $ExpectError +socket.set('name'); + +// $ExpectType any +socket.get('name'); + +// $ExpectError +socket.get(1); + +// $ExpectError +socket.get({}); + +// $ExpectType Socket +socket.enable('name'); + +// $ExpectError +socket.enable(1); + +// $ExpectError +socket.enable({}); + +// $ExpectType Socket +socket.disable('name'); + +// $ExpectError +socket.disable(1); + +// $ExpectError +socket.disable({}); + +// $ExpectType boolean +socket.enabled('name'); + +// $ExpectError +socket.enabled(1); + +// $ExpectError +socket.enabled({}); + +// $ExpectType boolean +socket.disabled('name'); + +// $ExpectError +socket.disabled(1); + +// $ExpectError +socket.disabled({}); + +// $ExpectType boolean +subSocket.hasSubscriptions(); + +// $ExpectType boolean +subSocket.matches('name'); + +// $ExpectError +subSocket.matches(1); + +// $ExpectError +subSocket.matches({}); + +// $ExpectType RegExp +subSocket.subscribe(/some regex/); + +// $ExpectType RegExp +subSocket.subscribe('some string'); + +// $ExpectError +subSocket.subscribe(1); + +// $ExpectError +subSocket.subscribe({}); + +// $ExpectError +subSocket.subscribe(); + +// $ExpectType void +subSocket.unsubscribe(/some regex/); + +// $ExpectType void +subSocket.unsubscribe('some string'); + +// $ExpectError +subSocket.unsubscribe(1); + +// $ExpectError +subSocket.unsubscribe({}); + +// $ExpectError +subSocket.unsubscribe(); diff --git a/types/axon/index.d.ts b/types/axon/index.d.ts new file mode 100644 index 0000000000..2449b83eb4 --- /dev/null +++ b/types/axon/index.d.ts @@ -0,0 +1,134 @@ +// Type definitions for axon 2.0 +// Project: https://github.com/visionmedia/axon#readme +// Definitions by: Vilim Stubičan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +import { EventEmitter } from "events"; +import { Socket as NetSocket } from "net"; + +export class Socket extends EventEmitter { + set(name: string, val: any): Socket; + + get(name: string): any; + + enable(name: string): Socket; + + disable(name: string): Socket; + + enabled(name: string): boolean; + + disabled(name: string): boolean; + + use(plugin: (socket: Socket) => any): Socket; + + pack(args: Buffer | Buffer[]): Buffer; + + closeSockets(): void; + + close(): void; + + closeServer(fn: () => any): void; + + address(): { port: number; family: string; address: string; string: string } | undefined; + + removeSocket(sock: Socket): void; + + addSocket(sock: Socket): void; + + handleErrors(sock: Socket): void; + + onmessage(sock: NetSocket): (args: Buffer | Buffer[]) => void; + + connect(port: ConnectionPort, host?: string | (() => void), fn?: () => void): Socket; + + onconnect(sock: Socket): void; + + bind(port: ConnectionPort, host?: string | (() => void), fn?: () => void): Socket; +} + +export class SubSocket extends Socket { + hasSubscriptions(): boolean; + + matches(topic: string): boolean; + + onmessage(sock: NetSocket): (args: Buffer | Buffer[]) => void; + + subscribe(re: RegExp | string): RegExp; + + unsubscribe(re: RegExp | string): void; + + clearSubscriptions(): void; + + /** + * @throws {Error} + */ + send(): void; +} + +export class SubEmitterSocket { + onmessage(): (args: Buffer | Buffer[]) => void; + + on(event: string, fn: (...args: any[]) => void): SubEmitterSocket; + + off(event: string): SubEmitterSocket; + + bind(port: ConnectionPort, host?: string | (() => void), fn?: () => void): Socket; + + connect(port: ConnectionPort, host?: string | (() => void), fn?: () => void): Socket; + + close(): void; +} + +export class PubSocket extends Socket { + send(...args: any[]): PubSocket; +} + +export class PubEmitterSocket { + sock: PubSocket; + + send(...args: any[]): PubSocket; + + bind(port: ConnectionPort, host?: string | (() => void), fn?: () => void): Socket; + + connect(port: ConnectionPort, host?: string | (() => void), fn?: () => void): Socket; + + close(): void; +} + +export class PushSocket extends Socket { + send(...args: any[]): void; + enqueue(msg: any): void; +} + +export class ReqSocket extends Socket { + id(): string; + + onmessage(): (args: Buffer | Buffer[]) => void; + + send(...args: any[]): void; +} + +export class RepSocket extends Socket { + onmessage(sock: NetSocket): (args: Buffer | Buffer[]) => void; +} + +export class PullSocket extends Socket { + /** + * @throws {Error} + */ + send(): void; +} + +export type ConnectionPort = + number + | string + | { protocol?: string, hostname?: string, pathname: string, port: string | number }; + +export function socket(type: string, options?: any): Socket; + +export const types: { + [propName: string]: { new(): PubEmitterSocket | SubEmitterSocket | PushSocket | PullSocket | PubSocket | SubSocket | ReqSocket | RepSocket | Socket }; +}; diff --git a/types/axon/tsconfig.json b/types/axon/tsconfig.json new file mode 100644 index 0000000000..2025639930 --- /dev/null +++ b/types/axon/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", + "axon-tests.ts" + ] +} diff --git a/types/axon/tslint.json b/types/axon/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/axon/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/azure-sb/azure-sb-tests.ts b/types/azure-sb/azure-sb-tests.ts index 411862a3b2..14d2ba9054 100644 --- a/types/azure-sb/azure-sb-tests.ts +++ b/types/azure-sb/azure-sb-tests.ts @@ -14,14 +14,14 @@ function ResponseCallback(err: Error | null, response: Azure.ServiceBus.Response const ServiceBus = AzureSB.createServiceBusService('connectionstring'); // Queues -ServiceBus.listQueues('', createResultCallback()); +ServiceBus.listQueues(createResultCallback()); ServiceBus.createQueue('test', createResultCallback()); ServiceBus.createQueueIfNotExists('test', createResultCallback()); ServiceBus.getQueue('test', createResultCallback()); ServiceBus.deleteQueue('test', ResponseCallback); // Topics -ServiceBus.listTopics('', createResultCallback()); +ServiceBus.listTopics(createResultCallback()); ServiceBus.createTopic('test', createResultCallback()); ServiceBus.createTopicIfNotExists('test', createResultCallback()); ServiceBus.getTopic('test', createResultCallback()); diff --git a/types/azure-sb/index.d.ts b/types/azure-sb/index.d.ts index ba92395c0f..9f9d07d3dc 100644 --- a/types/azure-sb/index.d.ts +++ b/types/azure-sb/index.d.ts @@ -214,15 +214,15 @@ export namespace Azure.ServiceBus { // [x: string]: string | Dictionary; // } + export const ActiveMessageCount = 'd2p1:ActiveMessageCount'; + export const DeadLetterMessageCount = 'd2p1:DeadLetterMessageCount'; + export const ScheduledMessageCount = 'd2p1:ScheduledMessageCount'; + export const TransferMessageCount = 'd2p1:TransferMessageCount'; + export const TransferDeadLetterMessageCount = 'd2p1:TransferDeadLetterMessageCount'; + export interface Topic extends ExtendedBase { AccessedAt: DateString; - CountDetails: { - 'd2p1:ActiveMessageCount': string; - 'd2p1:DeadLetterMessageCount': string; - 'd2p1:ScheduledMessageCount': string; - 'd2p1:TransferMessageCount': string; - 'd2p1:TransferDeadLetterMessageCount': string; - }; + CountDetails: { [key: string]: string }; EnableSubscriptionPartitioning: string; FilteringMessagesBeforePublishing: string; IsExpress: string; @@ -242,13 +242,7 @@ export namespace Azure.ServiceBus { } export interface Subscription extends ExtendedBase { - CountDetails: { - 'd3p1:ActiveMessageCount': string; - 'd3p1:DeadLetterMessageCount': string; - 'd3p1:ScheduledMessageCount': string; - 'd3p1:TransferMessageCount': string; - 'd3p1:TransferDeadLetterMessageCount': string; - }; + CountDetails: { [key: string]: string }; DeadLetteringOnFilterEvaluationExceptions: string; DeadLetteringOnMessageExpiration: string; LockDuration: string; @@ -315,6 +309,8 @@ export namespace Azure.ServiceBus { export type CreateSubscriptionOptions = Partial; export type ListSubscriptionsOptions = Partial; export type ListRulesOptions = Partial; + export type ListTopicsOptions = Partial; + export type ListQueuesOptions = Partial; export type CreateRuleOptions = Partial; export type CreateNotificationHubOptions = Partial; export type ListNotificationHubsOptions = Partial; diff --git a/types/azure-sb/lib/servicebusservice.d.ts b/types/azure-sb/lib/servicebusservice.d.ts index 44f2b2c522..45600a1661 100644 --- a/types/azure-sb/lib/servicebusservice.d.ts +++ b/types/azure-sb/lib/servicebusservice.d.ts @@ -11,6 +11,8 @@ import CreateTopicOptions = Azure.ServiceBus.CreateTopicOptions; import ListNotificationHubsOptions = Azure.ServiceBus.ListNotificationHubsOptions; import ListRulesOptions = Azure.ServiceBus.ListRulesOptions; import ListSubscriptionsOptions = Azure.ServiceBus.ListSubscriptionsOptions; +import ListTopicsOptions = Azure.ServiceBus.ListTopicsOptions; +import ListQueuesOptions = Azure.ServiceBus.ListQueuesOptions; import MessageOrName = Azure.ServiceBus.MessageOrName; import Queue = Azure.ServiceBus.Results.Models.Queue; import ReceiveQueueMessageOptions = Azure.ServiceBus.ReceiveQueueMessageOptions; @@ -88,7 +90,8 @@ declare class ServiceBusService extends ServiceBusServiceBase { public getQueue(queuePath: string, callback: TypedResultAndResponseCallback): void; - public listQueues(queuePath: string, + public listQueues(callback: TypedResultAndResponseCallback): void; + public listQueues(options: ListQueuesOptions, callback: TypedResultAndResponseCallback): void; /* @@ -115,7 +118,8 @@ declare class ServiceBusService extends ServiceBusServiceBase { public getTopic(topicPath: string, callback: TypedResultAndResponseCallback): void; - public listTopics(topicPath: string, + public listTopics(callback: TypedResultAndResponseCallback): void; + public listTopics(options: ListTopicsOptions, callback: TypedResultAndResponseCallback): void; /* diff --git a/types/azure-sb/lib/servicebusserviceclient.d.ts b/types/azure-sb/lib/servicebusserviceclient.d.ts index c97b1e3107..1730b642c3 100644 --- a/types/azure-sb/lib/servicebusserviceclient.d.ts +++ b/types/azure-sb/lib/servicebusserviceclient.d.ts @@ -1,14 +1,13 @@ -/// -import EventEmitter = NodeJS.EventEmitter; +import ServiceClient = require('azure-sb/lib/serviceclient'); -declare class ServiceBusServiceClient extends EventEmitter { +declare class ServiceBusServiceClient extends ServiceClient { constructor(accessKey?: string, issuer?: string, sharedAccessKeyName?: string, sharedAccessKeyValue?: string, host?: string, acsHost?: string, - authenticationProvider?: object); + authenticationProvider?: object); } export = ServiceBusServiceClient; diff --git a/types/azure-sb/lib/serviceclient.d.ts b/types/azure-sb/lib/serviceclient.d.ts new file mode 100644 index 0000000000..3e39052235 --- /dev/null +++ b/types/azure-sb/lib/serviceclient.d.ts @@ -0,0 +1,8 @@ +/// +import EventEmitter = NodeJS.EventEmitter; +declare class ServiceClient extends EventEmitter { + public host: string; + public port: number; + public protocol: string; +} +export = ServiceClient; diff --git a/types/azure-sb/tsconfig.json b/types/azure-sb/tsconfig.json index 6e015480dc..61e37ac754 100644 --- a/types/azure-sb/tsconfig.json +++ b/types/azure-sb/tsconfig.json @@ -30,6 +30,7 @@ "lib/models/subscriptionresult.d.ts", "lib/models/notificationhubresult.d.ts", "lib/models/resourceresult.d.ts", + "lib/serviceclient.d.ts", "lib/servicebusserviceclient.d.ts", "lib/gcmservice.d.ts", "lib/wnsservice.d.ts", @@ -38,4 +39,4 @@ "azure-sb-tests.ts", "index.d.ts" ] -} \ No newline at end of file +} diff --git a/types/backbone.marionette/index.d.ts b/types/backbone.marionette/index.d.ts index cd8ccd3821..7626d60d56 100644 --- a/types/backbone.marionette/index.d.ts +++ b/types/backbone.marionette/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for Marionette 3.3 // Project: https://github.com/marionettejs/ -// Definitions by: Zeeshan Hamid , Natan Vivo , Sven Tschui +// Definitions by: Zeeshan Hamid , +// Natan Vivo , +// Sven Tschui , +// Volker Nauruhn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -1394,27 +1397,27 @@ export class CollectionView, childView: TView): void; /** * This callback function allows you to know when a child / child view * instance has been added to the collection view. It provides access to * the view instance for the child that was added. */ - onAddChild(childView: TView): void; + onAddChild(collectionView: CollectionView, childView: TView): void; /** * This callback function allows you to know when a childView instance is * about to be removed from the collectionView. It provides access to the * view instance for the child that was removed. */ - onBeforeRemoveChild(childView: TView): void; + onBeforeRemoveChild(collectionView: CollectionView, childView: TView): void; /** * This callback function allows you to know when a child / childView * instance has been deleted or removed from the collection. */ - onRemoveChild(childView: TView): void; + onRemoveChild(collectionView: CollectionView, childView: TView): void; /** * Automatically destroys this Collection's children and cleans up diff --git a/types/base64-url/base64-url-tests.ts b/types/base64-url/base64-url-tests.ts new file mode 100644 index 0000000000..fd5c07cac0 --- /dev/null +++ b/types/base64-url/base64-url-tests.ts @@ -0,0 +1,9 @@ +import * as base64url from 'base64-url'; + +base64url.encode('Node.js is awesome.'); // $ExpectType string +base64url.decode('Tm9kZS5qcyBpcyBhd2Vzb21lLg'); // $ExpectType string +base64url.escape('This+is/goingto+escape=='); // $ExpectType string +base64url.unescape('This-is_goingto-escape'); // $ExpectType string + +base64url.encode('string to encode', 'ascii'); // $ExpectType string +base64url.decode('string to decode', 'ascii'); // $ExpectType string diff --git a/types/base64-url/index.d.ts b/types/base64-url/index.d.ts new file mode 100644 index 0000000000..1065cb9115 --- /dev/null +++ b/types/base64-url/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for base64-url 2.2 +// Project: https://github.com/joaquimserafim/base64-url +// Definitions by: Uri Shaked +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function decode(value: string, encoding?: string): string; +export function encode(value: string, encoding?: string): string; +export function escape(value: string): string; +export function unescape(value: string): string; diff --git a/types/base64-url/tsconfig.json b/types/base64-url/tsconfig.json new file mode 100644 index 0000000000..26ccd93511 --- /dev/null +++ b/types/base64-url/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", + "base64-url-tests.ts" + ] +} diff --git a/types/base64-url/tslint.json b/types/base64-url/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/base64-url/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bell/bell-tests.ts b/types/bell/bell-tests.ts new file mode 100644 index 0000000000..65b3e5f4d5 --- /dev/null +++ b/types/bell/bell-tests.ts @@ -0,0 +1,106 @@ +import { RequestQuery, Server } from 'hapi'; +import * as bell from 'bell'; + +async function run() { + const server = new Server({ port: 8000 }); + await server.register(bell); + + server.auth.strategy('arcgisonline', 'bell', { + provider: 'twitter', + password: 'some cookie password', + location: 'http://example.com/oauth', + clientId: '', + clientSecret: '', + scope(request) { + const scopes = ['public_profile', 'email']; + if (( request.query).wantsSharePermission) { + scopes.push('publish_actions'); + } + return scopes; + } + }); + + const providers: bell.BellOptions[] = [{ + provider: 'discord', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + location: () => '', + }, + { + provider: 'facebook', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + location: server.info.uri + }, + { + provider: 'google', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + location: server.info.uri + }, + { + provider: 'linkedin', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + providerParams: { + redirect_uri: server.info.uri + '/bell/door' + } + }, + { + provider: 'meetup', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + scope: ['basic', 'ageless', 'group_edit', 'reporting'], + }, + { + provider: 'nest', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '' + }, + { + provider: 'office365', + clientId: '', + clientSecret: '', + password: 'cookie_encryption_password_secure', + providerParams: { + response_type: 'code' + }, + scope: ['openid', 'offline_access', 'profile'] + }, + { + provider: 'okta', + config: { uri: 'https://your-organization.okta.com' }, + password: 'cookie_encryption_password_secure', + isSecure: false, + location: 'http://127.0.0.1:8000', + clientId: '', + clientSecret: '' + }, + { + provider: 'slack', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '' + }, + { + provider: 'twitch', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + scope: ['user_read', 'channel_read'] + }]; +} diff --git a/types/bell/index.d.ts b/types/bell/index.d.ts new file mode 100644 index 0000000000..14cdc65cb9 --- /dev/null +++ b/types/bell/index.d.ts @@ -0,0 +1,269 @@ +// Type definitions for bell 9.1 +// Project: https://github.com/hapijs/bell +// Definitions by: Simon Schick +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +import { Server, Request, Plugin, AuthCredentials } from 'hapi'; + +declare module 'hapi' { + interface ServerAuth { + strategy(name: string, scheme: 'bell', options: BellOptions): void; + strategy( + name: string, + scheme: 'bell', + mode: boolean | 'required' | 'optional' | 'try', + options: BellOptions, + ): void; + } +} + +export interface StringLikeMap { + [key: string]: string | number; +} +export type Provider = + 'arcgisonline' | + 'auth0' | + 'azuread' | + 'bitbucket' | + 'digitalocean' | + 'discord' | + 'dropbox' | + 'dropboxV2' | + 'facebook' | + 'fitbit' | + 'foursquare' | + 'github' | + 'gitlab' | + 'google' | + 'googleplus' | + 'instagram' | + 'linkedin' | + 'live' | + 'medium' | + 'meetup' | + 'mixer' | + 'nest' | + 'office365' | + 'okta' | + 'phabricator' | + 'pingfed' | + 'pinterest' | + 'reddit' | + 'salesforce' | + 'slack' | + 'spotify' | + 'stripe' | + 'trakt' | + 'tumblr' | + 'twitch' | + 'twitter' | + 'vk' | + 'wordpress' | + 'yahoo'; + +export type RequestPassThrough = ( + request: Request, + next: (err: Error | null, credentials: AuthCredentials) => void, +) => void; + +export interface OptionalOptions { + /** + * the name of the cookie used to manage the temporary state. + * Defaults to 'bell-provider' where 'provider' is the provider name (or 'custom' for custom providers). + * For example, the Twitter cookie name defaults to 'bell-twitter'. + */ + cookie?: string; + /** + * sets the cookie secure flag. + * Defaults to true. + */ + isSecure?: boolean; + /** + * sets the cookie HTTP only flag. + * Defaults to true. + */ + isHttpOnly?: boolean; + /** + * cookie time-to-live in milliseconds. + * Defaults to null (session time-life - cookies are deleted when the browser is closed). + */ + ttl?: number; + /** + * the domain scope. + * Defaults to null (no domain). + */ + domain?: string; + /** + * provider-specific query parameters for the authentication endpoint. + * It may be passed either as an object to merge into the query string, + * or a function which takes the client's request and returns an object. + * Each provider supports its own set of parameters which customize the user's login experience. + * For example: + * * Facebook supports `display` ('page', 'popup', or 'touch'), `auth_type`, `auth_nonce`. + * * Google supports `access_type`, `approval_prompt`, `prompt`, `login_hint`, `user_id`, `hd`. + * * Twitter supports `force_login`, `screen_name`. + * * Linkedin supports `fields`. + */ + providerParams?: StringLikeMap | ((request: Request) => StringLikeMap); + /** + * allows passing query parameters from a bell protected endpoint to the auth request. + * It will merge the query params you pass along with the providerParams and any other predefined ones. + * Be aware that this will override predefined query parameters! + * Default to false. + */ + allowRuntimeProviderParams?: StringLikeMap | boolean; + /** + * Each built-in vendor comes with the required scope for basic profile information. + * Use scope to specify a different scope as required by your application. + * It may be passed either as an object to merge into the query string, + * or a function which takes the client's request and returns an object. + * Consult the provider for their specific supported scopes. + */ + scope?: string[] | ((request: Request) => string[]); + /** + * skips obtaining a user profile from the provider. + * Useful if you need specific scopes, + * but not the user profile. + * Defaults to false. + */ + skipProfile?: boolean; + /** + * a configuration object used to customize the provider settings. + * The built-in 'twitter' provider accepts the `extendedProfile` & `getMethod` options. + * option which allows disabling the extra profile request when the provider + * returns the user information in the callback (defaults to true). + * The built-in 'github' and 'phabricator' providers accept the uri + * option which allows pointing to a private enterprise installation (e.g. 'https://vpn.example.com'). + * See Providers documentation for more information. + */ + config?: { extendedProfile?: boolean; getMethod?: string } | { uri?: string }; + /** + * an object of key-value pairs that specify additional + * URL query parameters to send with the profile request to the provider. + * The built-in facebook provider, + * for example, could have fields specified to determine the fields returned from the user's graph, + * which would then be available to you in the auth.credentials.profile.raw object. + */ + profileParams?: StringLikeMap; + /** + * allows passing additional OAuth state from initial request. + * This must be a function returning a string, + * which will be appended to the bell internal state parameter for OAuth code flow. + */ + runtimeStateCallback?(req: Request): string; + + // THESE ARE IN THE *REQUIRED* section but are actually not... + /** + * A boolean indicating whether or not you want the redirect_uri to be forced to https. + * Useful if your hapi application runs as http, but is accessed through https. + */ + forceHttps?: boolean; + /** + * Set the base redirect_uri manually if it cannot be inferred properly from server settings. + * Useful to override port, protocol, and host if proxied or forwarded. + */ + location?: string | ((req: Request) => string); +} + +export interface RequiredProviderOptions { + /** + * the cookie encryption password. + * Used to encrypt the temporary state cookie used by the module in + * between the authorization protocol steps. + */ + password: string; + /** + * the OAuth client identifier (consumer key). + */ + clientId: string; + /** + * the OAuth client secret (consumer secret) + */ + clientSecret: string; +} + +export interface KnownProviderOptions extends RequiredProviderOptions, OptionalOptions { + provider: Provider; +} + +/** + * @param uri the requested resource URI (bell will add the token or authentication header as needed). + * @param params any URI query parameters (cannot include them in the URI due to signature requirements). + */ +export type AuthedRequest = (uri: string, params: { [key: string]: string } | null) => Promise; + +export interface CustomProtocol { + /** + * the authorization protocol used. + */ + protocol: 'oauth' | 'oauth2'; + /** + * the OAuth signature method (OAuth 1.0a only). Must be one of: + * * 'HMAC-SHA1' - default + * * 'RSA-SHA1' - in that case, the clientSecret is your RSA private key + */ + signatureMethod?: 'HMAC-SHA1' | 'RSA-SHA1'; + /** + * the temporary credentials (request token) endpoint (OAuth 1.0a only). + */ + temporary?: string; + /** + * boolean that determines if OAuth client id and client secret will be sent + * as parameters as opposed to an Authorization header (OAuth 2.0 only). + * Defaults to false. + */ + useParamsAuth?: boolean; + /** + * the authorization endpoint URI. + */ + auth: string; + /** + * the access token endpoint URI. + */ + token: string; + /** + * the OAuth version. + */ + version?: string; + /** + * an array of scope strings (OAuth 2.0 only). + */ + scope?: string[] | ((query: StringLikeMap) => string[]); + /** + * the scope separator character (OAuth 2.0 only). Only required when a provider has a broken OAuth 2.0 implementation. Defaults to space (Facebook and GitHub default to comma). + */ + scopeSeparator?: string; + /** + * a headers object with additional headers required by the provider + * (e.g. GitHub required the 'User-Agent' header which is set by default). + */ + headers?: { + [key: string]: string; + }; + /** + * a function used to obtain user profile information and normalize it. + * @param credentials the credentials object. + * Change the object directly within the function (profile information is typically stored under credentials.profile). + * @param params the parsed information received from the provider (e.g. token, secret, and other custom fields). + * @param get an OAuth helper function to make authenticated requests using the credentials received. + */ + profile(credentials: any, params: { [key: string]: string }, get: AuthedRequest): Promise; +} + +export interface CustomProviderOptions extends RequiredProviderOptions, OptionalOptions { + provider: CustomProtocol; +} + +export type BellOptions = CustomProviderOptions | KnownProviderOptions; + +export const plugin: Plugin; +/** + * Enables simulation mode. + */ +export function simulate(credentialsFunc: RequestPassThrough): void; +/** + * [See docs](https://github.com/hapijs/bell/blob/master/API.md#simulated-authentication) + * Disables simulation mode + */ +export function simulate(state: false): void; diff --git a/types/bell/tsconfig.json b/types/bell/tsconfig.json new file mode 100644 index 0000000000..4db30822b8 --- /dev/null +++ b/types/bell/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "strictFunctionTypes": true, + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bell-tests.ts" + ] +} diff --git a/types/bell/tslint.json b/types/bell/tslint.json new file mode 100644 index 0000000000..843d627f89 --- /dev/null +++ b/types/bell/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "unified-signatures": false // Disabling as it prevents me from using overloaded doctags + } +} diff --git a/types/big.js/index.d.ts b/types/big.js/index.d.ts index 405622f7ee..8b61c73d37 100644 --- a/types/big.js/index.d.ts +++ b/types/big.js/index.d.ts @@ -102,6 +102,12 @@ export interface BigConstructor { export interface Big { /** Returns a Big number whose value is the absolute value, i.e. the magnitude, of this Big number. */ abs(): Big; + /** + * Returns a Big number whose value is the value of this Big number plus n - alias for .plus(). + * + * @throws `NaN` if n is invalid. + */ + add(n: BigSource): Big; /** * Compare the values. * @@ -162,6 +168,12 @@ export interface Big { * @throws `NaN` if n is negative or otherwise invalid. */ mod(n: BigSource): Big; + /** + * Returns a Big number whose value is the value of this Big number times n - alias for .times(). + * + * @throws `NaN` if n is invalid. + */ + mul(n: BigSource): Big; /** * Returns a Big number whose value is the value of this Big number plus n. * @@ -196,6 +208,12 @@ export interface Big { * @throws `NaN` if this Big number is negative. */ sqrt(): Big; + /** + * Returns a Big number whose value is the value of this Big number minus n - alias for .minus(). + * + * @throws `NaN` if n is invalid. + */ + sub(n: BigSource): Big; /** * Returns a Big number whose value is the value of this Big number times n. * diff --git a/types/big.js/test/big.js-global-tests.ts b/types/big.js/test/big.js-global-tests.ts index 578391de7b..a57e748fbf 100644 --- a/types/big.js/test/big.js-global-tests.ts +++ b/types/big.js/test/big.js-global-tests.ts @@ -86,6 +86,7 @@ function minusTests() { 0.3 - 0.1; // 0.19999999999999998 const x = new Big(0.3); x.minus(0.1); // '0.2' + x.sub(0.1); // '0.2' } function modTests() { @@ -99,6 +100,7 @@ function plusTests() { const x = new Big(0.1); const y = x.plus(0.2); // '0.3' Big(0.7).plus(x).plus(y); // '1' + Big(0.7).add(x).add(y); // '1' } function powTests() { @@ -138,6 +140,7 @@ function timesTests() { const x = new Big(0.6); const y = x.times(3); // '1.8' Big('7e+500').times(y); // '1.26e+501' + Big('7e+500').mul(y); // '1.26e+501' } function toExponentialTests() { diff --git a/types/big.js/test/big.js-module-tests.ts b/types/big.js/test/big.js-module-tests.ts index 056d41727b..62e5ba491e 100644 --- a/types/big.js/test/big.js-module-tests.ts +++ b/types/big.js/test/big.js-module-tests.ts @@ -88,6 +88,7 @@ function minusTests() { 0.3 - 0.1; // 0.19999999999999998 const x = new Big(0.3); x.minus(0.1); // '0.2' + x.sub(0.1); // '0.2' } function modTests() { @@ -101,6 +102,7 @@ function plusTests() { const x = new Big(0.1); const y = x.plus(0.2); // '0.3' Big(0.7).plus(x).plus(y); // '1' + Big(0.7).add(x).add(y); // '1' } function powTests() { @@ -140,6 +142,7 @@ function timesTests() { const x = new Big(0.6); const y = x.times(3); // '1.8' Big('7e+500').times(y); // '1.26e+501' + Big('7e+500').mul(y); // '1.26e+501' } function toExponentialTests() { diff --git a/types/bigi/bigi-tests.ts b/types/bigi/bigi-tests.ts index ef9d7421d3..0e4822aeb6 100644 --- a/types/bigi/bigi-tests.ts +++ b/types/bigi/bigi-tests.ts @@ -7,3 +7,10 @@ const b3 = b1.multiply(b2); console.log(b3.toHex()); // => ae499bfe762edfb416d0ce71447af67ff33d1760cbebd70874be1d7a5564b0439a59808cb1856a91974f7023f72132 + +const b4 = BigInteger.valueOf(42); +const b5 = BigInteger.valueOf(10); +const b6 = b4.multiply(b5); + +console.log(b6); +// => BigInteger { '0': 420, '1': 0, t: 1, s: 0 } diff --git a/types/bigi/index.d.ts b/types/bigi/index.d.ts index c991b13fac..7b44ff75e4 100644 --- a/types/bigi/index.d.ts +++ b/types/bigi/index.d.ts @@ -87,7 +87,7 @@ declare class bigi { static fromDERInteger(byteArray?: any): number; static fromHex(hex: string): bigi; static isBigInteger(obj: any, check_ver: any): obj is bigi; - static valueOf(i: any): number; + static valueOf(i: any): bigi; } declare namespace bigi { interface Constants { diff --git a/types/bitcoinjs-lib/index.d.ts b/types/bitcoinjs-lib/index.d.ts index 11d311a276..920df43d6e 100644 --- a/types/bitcoinjs-lib/index.d.ts +++ b/types/bitcoinjs-lib/index.d.ts @@ -71,6 +71,10 @@ export class ECPair { d: BigInteger; + readonly compressed: boolean; + + readonly network: Network; + getAddress(): string; getNetwork(): Network; diff --git a/types/bl/index.d.ts b/types/bl/index.d.ts index 5d34052b80..8ad01671fd 100644 --- a/types/bl/index.d.ts +++ b/types/bl/index.d.ts @@ -11,7 +11,7 @@ import stream = require('stream'); declare class BufferList extends stream.Duplex { constructor(callback?: (err: Error, buffer: Buffer) => void); - append(buffer: Buffer): void; + append(buffer: Buffer | Buffer[] | BufferList | BufferList[] | string): void; get(index: number): number; slice(start?: number, end?: number): Buffer; copy(dest: Buffer, destStart?: number, srcStart?: number, srcEnd?: number): void; diff --git a/types/bootstrap-datepicker/index.d.ts b/types/bootstrap-datepicker/index.d.ts index dfe358854e..b841fe07ab 100644 --- a/types/bootstrap-datepicker/index.d.ts +++ b/types/bootstrap-datepicker/index.d.ts @@ -10,7 +10,20 @@ type DatepickerEvents = "show"|"hide"|"clearDate"|"changeDate"|"changeMonth"|"ch type DatepickerViewModes = 0|"days"|1|"months"|2|"years"|3|"decades"|4|"centuries"|"millenium"; -type DatepickerOrientations = "auto"|"left top"|"left bottom"|"right top"|"right bottom"; +type DatepickerOrientations = + "auto" + | "left top" + | "left bottom" + | "right top" + | "right bottom" + | "top auto" + | "bottom auto" + | "auto left" + | "top left" + | "bottom left" + | "auto right" + | "top right" + | "bottom right" /** * All options that take a “Date” can handle a Date object; a String diff --git a/types/bootstrap/bootstrap-tests.ts b/types/bootstrap/bootstrap-tests.ts index 21286ad5f4..f0a353889c 100755 --- a/types/bootstrap/bootstrap-tests.ts +++ b/types/bootstrap/bootstrap-tests.ts @@ -43,10 +43,15 @@ $("#carousel").on("slide.bs.carousel", function(ev) { $("#carousel").carousel({ interval: 5000, keyboard: true, + slide: false, pause: "hover", wrap: true, }); +$("#carousel").carousel({ + slide: "prev", +}); + $("#carousel").carousel({ pause: false, }); @@ -96,6 +101,8 @@ $("#dropdown").dropdown({ offset: 10, flip: false, boundary: "window", + reference: "toggle", + display: "dynamic", }); $("#dropdown").dropdown({ @@ -114,6 +121,10 @@ $("#dropdown").dropdown({ boundary: document.body, }); +$("#dropdown").dropdown({ + reference: document.body, +}); + // -------------------------------------------------------------------------------------- // Modal // -------------------------------------------------------------------------------------- diff --git a/types/bootstrap/index.d.ts b/types/bootstrap/index.d.ts index 88bcc66af8..2f43555a73 100755 --- a/types/bootstrap/index.d.ts +++ b/types/bootstrap/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Bootstrap 4.0 +// Type definitions for Bootstrap 4.1 // Project: https://github.com/twbs/bootstrap/ // Definitions by: denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -55,6 +55,14 @@ export interface CarouselOption { */ keyboard?: boolean; + /** + * Use to easily control the position of the carousel. It accepts the keywords prev or next, which alters the slide position + * relative to its current position. Alternatively, use `data-slide-to` to pass a raw slide index to the carousel. + * + * @default false + */ + slide?: "next" | "prev" | false; + /** * If set to "hover", pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave. * If set to false, hovering over the carousel won't pause it. @@ -116,6 +124,21 @@ export interface DropdownOption { * @default "scrollParent" */ boundary?: Popper.Boundary | HTMLElement; + + /** + * Reference element of the dropdown menu. Accepts the values of 'toggle', 'parent', or an HTMLElement reference. + * For more information refer to Popper.js's referenceObject docs. + * + * @default "toggle" + */ + reference?: "toggle" | "parent" | HTMLElement; + + /** + * By default, we use Popper.js for dynamic positioning. Disable this with 'static'. + * + * @default "dynamic" + */ + display?: "dynamic" | "static"; } export interface ModalOption { @@ -154,6 +177,8 @@ export interface PopoverOption extends TooltipOption { * Default content value if data-content attribute isn't present. * If a function is given, it will be called with its this reference * set to the element that the popover is attached to. + * + * @default "" */ content?: string | Element | ((this: Element) => string | Element); } @@ -226,7 +251,7 @@ export interface TooltipOption { * the tooltip or popover DOM node as its first argument and the triggering element DOM node as its second. * The this context is set to the tooltip or popover instance. * - * @default "top" + * @default tooltip: "top", popover: "right" */ placement?: Placement | ((this: TooltipInstance, node: HTMLElement, trigger: Element) => Placement); diff --git a/types/browser-sync/browser-sync-tests.ts b/types/browser-sync/browser-sync-tests.ts index bcd829367a..613f8aee25 100644 --- a/types/browser-sync/browser-sync-tests.ts +++ b/types/browser-sync/browser-sync-tests.ts @@ -8,11 +8,98 @@ import browserSync = require("browser-sync"); })(); browserSync({ - server: { - baseDir: "./" + ui: true +}); + +browserSync({ + ui: { + port: 9000, + weinre: { + port: 9001 + } } }); +browserSync({ + files: "app/css/style.css" +}); + +browserSync({ + files: [ + "app/css/style.css", + "app/js/*.js" + ] +}); + +browserSync({ + files: [ + "app/css/style.css", + "!app/js/*.js" + ] +}); + +browserSync({ + files: [ + "wp-content/themes/**/*.css", + { + match: ["wp-content/themes/**/*.css"], + fn: function (event, file) { + /** Custom event handler **/ + } + } + ] +}); + +browserSync({ + watchEvents: [ + "change", + "add", + "unlink", + "addDir", + "unlinkDir" + ] +}); + +browserSync({ + watch: true +}); + +browserSync({ + ignore: [ + "app/js/*.js" + ] +}); + +browserSync({ + single: true +}); + +browserSync({ + watchOptions: { + ignoreInitial: true, + ignored: '*.txt' + }, + files: ['./app'] +}); + +browserSync({ + files: [ + { + match: ["wp-content/themes/**/*.php"], + fn: function (event, file) { + /** Custom event handler **/ + }, + options: { + ignored: '*.txt' + } + } + ] +}); + +browserSync({ + server: "app" +}); + // multiple base directory browserSync({ server: { @@ -20,6 +107,39 @@ browserSync({ } }); +browserSync({ + server: true +}); + +browserSync({ + server: { + baseDir: "./" + } +}); + +browserSync({ + server: { + baseDir: "./", + index: "index.htm" + } +}); + +browserSync({ + server: { + baseDir: "./", + directory: true + } +}); + +browserSync({ + server: { + baseDir: "app", + serveStaticOptions: { + extensions: ["html"] + } + } +}); + browserSync({ proxy: "yourlocal.dev" }); @@ -27,8 +147,8 @@ browserSync({ browserSync({ proxy: { target: "http://yourlocal.dev", - proxyReq: function(proxyReq) { - console.log(proxyReq); + proxyReq: function (proxyReq) { + console.log(proxyReq); } } }); @@ -37,7 +157,7 @@ browserSync({ proxy: { target: "http://yourlocal.dev", proxyReq: [ - function(proxyReq) { + function (proxyReq) { console.log(proxyReq); } ] @@ -47,7 +167,7 @@ browserSync({ browserSync({ proxy: { target: "http://yourlocal.dev", - proxyRes: function(proxyRes, req, res) { + proxyRes: function (proxyRes, req, res) { console.log(proxyRes); } } @@ -57,13 +177,137 @@ browserSync({ proxy: { target: "http://yourlocal.dev", proxyRes: [ - function(proxyRes, req, res) { + function (proxyRes, req, res) { console.log(proxyRes); } ] } }); +browserSync({ + proxy: "https://yourlocal.dev", + https: { + key: "./path/to/the/key/file.key", + cert: "./path/to/the/cert/file.cer" + } +}); + +browserSync({ + port: 3000 +}); + +browserSync({ + proxy: "http://yourlocal.dev", + serveStatic: ['.', './app/css'] +}); + +browserSync({ + proxy: "http://yourlocal.dev", + serveStatic: [{ + route: '/assets', + dir: 'tmp' + }] +}); + +browserSync({ + proxy: "http://yourlocal.dev", + serveStatic: [{ + route: ['/assets', '/content'], + dir: 'tmp' + }] +}); + +browserSync({ + proxy: "http://yourlocal.dev", + serveStatic: [{ + route: '/assets', + dir: ['./tmp', './app'] + }] +}); + +browserSync({ + serveStatic: ['.', './app', './temp'], + serveStaticOptions: { + extensions: ['html'] // pretty urls + } +}); + +browserSync({ + https: true +}); + +browserSync({ + server: "./app", + https: true +}); + +browserSync({ + server: "./app", + https: { + key: "./path/to/the/key/file.key", + cert: "./path/to/the/cert/file.cer" + } +}); + +browserSync({ + httpModule: "http2" +}); + +browserSync({ + ghostMode: { + clicks: true, + scroll: true, + forms: { + inputs: true, + submit: true, + toggles: true + } + }, + proxy: "https://yourlocal.dev" +}); + +/** + * Not testing a bunch because they are either only string or boolean types. + * ....Also just got lazy and tired of writing the simple ones. + */ + +browserSync({ + snippetOptions: { + + // Ignore all HTML files within the templates folder + blacklist: [ + "templates/*.html" + ], + // Provide a custom Regex for inserting the snippet. + rule: { + match: /<\/body>/i, + fn: function (snippet, match) { + return snippet + match; + } + } + } +}); + +browserSync({ + rewriteRules: [ + { + match: /Browsersync/g, + fn: function (req, res, match) { + return 'kittenz'; + } + } + ] +}); + +browserSync({ + rewriteRules: [ + { + match: /(cats|kitten[sz]) are mediocre/g, + replace: "$1 are excellent" + } + ] +}); + var config = { server: { baseDir: "./" @@ -84,13 +328,13 @@ browserSync(config, function (err, bs) { browserSync.reload(); // single file -browserSync.reload( "styles.css" ); +browserSync.reload("styles.css"); // multiple files -browserSync.reload( ["styles.css", "ie.css"] ); +browserSync.reload(["styles.css", "ie.css"]); // streams support -browserSync.reload( { stream: true } ); +browserSync.reload({ stream: true }); browserSync.notify("Compiling, please wait!"); @@ -143,19 +387,19 @@ browser.exit(); browser.stream(); // -- "once" option. -browser.stream({once: true}); +browser.stream({ once: true }); // -- "match" option (string). -browser.stream({match: "**/*.js"}); +browser.stream({ match: "**/*.js" }); // -- "match" option (RegExp). -browser.stream({match: /\.js$/}); +browser.stream({ match: /\.js$/ }); // -- "match" option (function). -browser.stream({match: (testString) => true}); +browser.stream({ match: (testString) => true }); // -- "match" option (array). -browser.stream({match: ["**/*.js", /\.js$/, (testString) => true]}); +browser.stream({ match: ["**/*.js", /\.js$/, (testString) => true] }); // -- Both options. -browser.stream({once: true, match: ["**/*.js", /\.js$/, (testString) => true]}); +browser.stream({ once: true, match: ["**/*.js", /\.js$/, (testString) => true] }); diff --git a/types/browser-sync/index.d.ts b/types/browser-sync/index.d.ts index b22054c367..3b97fc8616 100644 --- a/types/browser-sync/index.d.ts +++ b/types/browser-sync/index.d.ts @@ -1,16 +1,21 @@ // Type definitions for browser-sync // Project: http://www.browsersync.io/ -// Definitions by: Asana , Joe Skeen +// Definitions by: Asana , +// Joe Skeen // Thomas "Thasmo" Deinhamer +// Kiyotoshi Ichikawa // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// /// +/// import * as chokidar from "chokidar"; import * as fs from "fs"; import * as http from "http"; import * as mm from "micromatch"; +import { ServeStaticOptions } from "serve-static"; declare namespace browserSync { interface Options { @@ -20,7 +25,7 @@ declare namespace browserSync { * * port - Default: 3001 * weinre.port - Default: 8080 - * Note: requires at least version 2.0.0 + * Note: Requires at least version 2.0.0. */ ui?: UIOptions | boolean; /** @@ -29,20 +34,40 @@ declare namespace browserSync { * patterns. * Default: false */ - files?: string | (string | FileCallback)[]; + files?: string | (string | FileCallback | object)[]; + /** + * Specify which file events to respond to. + * Available events: `add`, `change`, `unlink`, `addDir`, `unlinkDir` + */ + watchEvents?: string[]; + /** + * Watch files automatically. + */ + watch?: boolean; + /** + * Patterns for any watchers to ignore. + * Anything provided here will end up inside 'watchOptions.ignored'. + */ + ignore?: string[]; + /** + * Serve an index.html file for all non-asset routes. + * Useful when using client-routers. + */ + single?: boolean; /** * File watching options that get passed along to Chokidar. Check their docs for available options * Default: undefined - * Note: requires at least version 2.6.0 + * Note: Requires at least version 2.6.0. */ watchOptions?: chokidar.WatchOptions; /** * Use the built-in static server for basic HTML/JS/CSS websites. * Default: false */ - server?: ServerOptions; + server?: string | boolean | string[] | ServerOptions; /** * Proxy an EXISTING vhost. Browsersync will wrap your vhost with a proxy URL to view your site. + * Passing only a URL as a string equates to passing only target property of ProxyOptions type. * target - Default: undefined * ws - Default: undefined * middleware - Default: undefined @@ -50,25 +75,40 @@ declare namespace browserSync { * proxyRes - Default: undefined * proxyReq - Default: undefined */ - proxy?: string | boolean | ProxyOptions; + proxy?: string | ProxyOptions; /** * Use a specific port (instead of the one auto-detected by Browsersync) * Default: 3000 */ port?: number; + /** + * Functions or actual plugins used as middleware. + */ + middleware?: MiddlewareHandler | PerRouteMiddleware | (MiddlewareHandler | PerRouteMiddleware)[]; /** * Add additional directories from which static files should be served. * Should only be used in proxy or snippet mode. * Default: [] - * Note: requires at least version 2.8.0 + * Note: Requires at least version 2.8.0. */ - serveStatic?: string[]; + serveStatic?: (string | { route?: string | string[], dir?: string | string[]})[]; + /** + * Options that are passed to the serve-static middleware when you use the + * string[] syntax: eg: `serveStatic: ['./app']`. + * Please see [serve-static](https://github.com/expressjs/serve-static) for details. + */ + serveStaticOptions?: ServeStaticOptions; /** * Enable https for localhost development. - * Note - this is not needed for proxy option as it will be inferred from your target url. - * Note: requires at least version 1.3.0 + * Note: This may not be needed for proxy option as it will try to infer from your target url. + * Note: If privacy error is encountered please see HttpsOptions below, setting those will resolve. + * Note: Requires at least version 1.3.0. */ - https?: boolean; + https?: boolean | HttpsOptions; + /** + * Override http module to allow using 3rd party server modules (such as http2). + */ + httpModule?: string; /** * Clicks, Scrolls & Form inputs on any device will be mirrored to all others. * clicks - Default: true @@ -84,7 +124,7 @@ declare namespace browserSync { /** * Change the console logging prefix. Useful if you're creating your own project based on Browsersync * Default: BS - * Note: requires at least version 1.5.1 + * Note: Requires at least version 1.5.1. */ logPrefix?: string; /** @@ -100,19 +140,19 @@ declare namespace browserSync { /** * Log the snippet to the console when you're in snippet mode (no proxy/server) * Default: true - * Note: requires at least version 1.5.2 + * Note: Requires at least version 1.5.2. */ logSnippet?: boolean; /** * You can control how the snippet is injected onto each page via a custom regex + function. * You can also provide patterns for certain urls that should be ignored from the snippet injection. - * Note: requires at least version 2.0.0 + * Note: Requires at least version 2.0.0. */ snippetOptions?: SnippetOptions; /** * Add additional HTML rewriting rules. * Default: false - * Note: requires at least version 2.4.0 + * Note: Requires at least version 2.4.0. */ rewriteRules?: boolean | RewriteRules[]; /** @@ -139,7 +179,7 @@ declare namespace browserSync { /** * Add HTTP access control (CORS) headers to assets served by Browsersync. * Default: false - * Note: requires at least version 2.16.0 + * Note: Requires at least version 2.16.0. */ cors?: boolean; /** @@ -177,12 +217,12 @@ declare namespace browserSync { /** * Sync the scroll position of any element on the page. Add any amount of CSS selectors * Default: [] - * Note: requires at least version 2.9.0 + * Note: Requires at least version 2.9.0. */ scrollElements?: string[]; /** * Default: [] - * Note: requires at least version 2.9.0 + * Note: Requires at least version 2.9.0. * Sync the scroll position of any element on the page - where any scrolled element will cause * all others to match scroll position. This is helpful when a breakpoint alters which element * is actually scrolling @@ -197,13 +237,18 @@ declare namespace browserSync { /** * Restrict the frequency in which browser:reload events can be emitted to connected clients * Default: 0 - * Note: requires at least version 2.6.0 + * Note: Requires at least version 2.6.0. */ reloadDebounce?: number; + /** + * Emit only the first event during sequential time windows of a specified duration. + * Note: Requires at least version 2.13.0. + */ + reloadThrottle?: number; /** * User provided plugins * Default: [] - * Note: requires at least version 2.6.0 + * Note: Requires at least version 2.6.0. */ plugins?: any[]; /** @@ -224,6 +269,10 @@ declare namespace browserSync { * Override host detection if you know the correct IP to use */ host?: string; + /** + * Support environments where dynamic hostnames are not required (ie: electron). + */ + localOnly?: boolean; /** * Send file-change events to the browser * Default: true @@ -234,10 +283,16 @@ declare namespace browserSync { * Default: true */ timestamps?: boolean; + /** + * ¯\_(ツ)_/¯ + * Best guess, when ghostMode (or SocketIO?) is setup the events + * listed here will be emitted and able to hook into. + */ + clientEvents?: string[]; /** * Alter the script path for complete control over where the Browsersync Javascript is served * from. Whatever you return from this function will be used as the script path. - * Note: requires at least version 1.5.0 + * Note: Requires at least version 1.5.0. */ scriptPath?: (path: string) => string; /** @@ -248,10 +303,21 @@ declare namespace browserSync { * domain - Default: undefined * port - Default: undefined * clients.heartbeatTimeout - Default: 5000 - * Note: requires at least version 1.6.2 + * Note: Requires at least version 1.6.2. */ socket?: SocketOptions; - middleware?: MiddlewareHandler | PerRouteMiddleware | (MiddlewareHandler | PerRouteMiddleware)[]; + /** + * ¯\_(ツ)_/¯ + */ + tagNames?: TagNamesOptions; + /** + * ¯\_(ツ)_/¯ + */ + injectFileTypes?: string[]; + /** + * ¯\_(ツ)_/¯ + */ + excludeFileTypes?: string[]; } interface Hash { @@ -287,6 +353,7 @@ declare namespace browserSync { routes?: Hash; /** configure custom middleware */ middleware?: (MiddlewareHandler | PerRouteMiddleware)[]; + serveStaticOptions?: ServeStaticOptions } interface ProxyOptions { @@ -298,6 +365,11 @@ declare namespace browserSync { proxyReq?: ((res: http.ServerRequest) => any)[] | ((res: http.ServerRequest) => any); } + interface HttpsOptions { + key?: string; + cert?: string; + } + interface MiddlewareHandler { (req: http.IncomingMessage, res: http.ServerResponse, next: Function): any; } @@ -310,11 +382,17 @@ declare namespace browserSync { interface GhostOptions { clicks?: boolean; scroll?: boolean; - forms?: boolean; + forms?: boolean | { + submit?: boolean; + inputs?: boolean; + toggles?: boolean; + }; } interface SnippetOptions { - ignorePaths?: string; + async?: boolean, + whitelist?: string[], + blacklist?: string[], rule?: { match?: RegExp; fn?: (snippet: string, match: string) => any }; } @@ -327,9 +405,22 @@ declare namespace browserSync { clients?: { heartbeatTimeout?: number; }; } + interface TagNamesOptions { + less?: string; + scss?: string; + css?: string; + jpg?: string; + jpeg?: string; + png?: string; + svg?: string; + gif?: string; + js?: string; + } + interface RewriteRules { match: RegExp; - fn: (match: string) => string; + replace?: string; + fn?: (req: http.IncomingMessage, res: http.ServerResponse, match: string) => string; } interface StreamOptions { @@ -342,7 +433,7 @@ declare namespace browserSync { * Start the Browsersync service. This will launch a server, proxy or start the snippet mode * depending on your use-case. */ - (config?: Options, callback?: (err: Error, bs: Object) => any): BrowserSyncInstance; + (config?: Options, callback?: (err: Error, bs: object) => any): BrowserSyncInstance; /** * Create a Browsersync instance * @param name an identifier that can used for retrieval later @@ -367,7 +458,7 @@ declare namespace browserSync { * Start the Browsersync service. This will launch a server, proxy or start the snippet mode * depending on your use-case. */ - init(config?: Options, callback?: (err: Error, bs: Object) => any): BrowserSyncInstance; + init(config?: Options, callback?: (err: Error, bs: object) => any): BrowserSyncInstance; /** * Reload the browser * The reload method will inform all browsers about changed files and will either cause the browser diff --git a/types/bson/bson-tests.ts b/types/bson/bson-tests.ts index ebdd8a19c3..b3173053c8 100644 --- a/types/bson/bson-tests.ts +++ b/types/bson/bson-tests.ts @@ -6,7 +6,7 @@ bson.ObjectID.cacheHexString = true let BSON = new bson.BSON(); let Long = bson.Long; -let doc = {long: Long.fromNumber(100)} +let doc = { long: Long.fromNumber(100) } // Serialize a document let data = BSON.serialize(doc, false, true, false); @@ -19,3 +19,10 @@ console.log("doc_2:", doc_2); BSON = new bson.BSON(); data = BSON.serialize(doc); doc_2 = BSON.deserialize(data); + + +// Calculate Object Size +BSON = new bson.BSON(); +console.log("Calculated Object size - no options object:", BSON.calculateObjectSize(doc)); +console.log("Calculated Object size - empty options object:", BSON.calculateObjectSize(doc, {})); +console.log("Calculated Object size - custom options object:", BSON.calculateObjectSize(doc, { ignoreUndefined: false, serializeFunctions: true })); diff --git a/types/bson/index.d.ts b/types/bson/index.d.ts index 24372ff0f5..3b0feb0113 100644 --- a/types/bson/index.d.ts +++ b/types/bson/index.d.ts @@ -16,6 +16,14 @@ export interface DeserializeOptions { /** {Boolean, default:false}, deserialize Binary data directly into node.js Buffer object. */ promoteBuffers?: boolean; } + +export interface CalculateObjectSizeOptions { + /** {Boolean, default:false}, serialize the javascript functions */ + serializeFunctions?: boolean; + /** {Boolean, default:true}, ignore undefined fields. */ + ignoreUndefined?: boolean; +} + export class BSON { /** * @param {Object} object the Javascript object to serialize. @@ -26,6 +34,14 @@ export class BSON { */ serialize(object: any, checkKeys?: boolean, asBuffer?: boolean, serializeFunctions?: boolean): Buffer; deserialize(buffer: Buffer, options?: DeserializeOptions, isArray?: boolean): any; + /** + * Calculate the bson size for a passed in Javascript object. + * + * @param {Object} object the Javascript object to calculate the BSON byte size for. + * @param {CalculateObjectSizeOptions} Options + * @return {Number} returns the number of bytes the BSON object will take up. + */ + calculateObjectSize(object: any, options?: CalculateObjectSizeOptions): number; } export class Binary { diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index c07c938630..15de8adfde 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -42,7 +42,7 @@ declare namespace Bull { * 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; + createClient?(type: 'client' | 'subscriber' | 'bclient', redisOpts?: Redis.RedisOptions): Redis.Redis; /** * Prefix to use for all redis keys diff --git a/types/c3/c3-tests.ts b/types/c3/c3-tests.ts index 7ac2f0ccd8..f2e630cd09 100644 --- a/types/c3/c3-tests.ts +++ b/types/c3/c3-tests.ts @@ -1798,6 +1798,26 @@ function legend_custom() { }); } +function legend_tiles() { + const chart = c3.generate({ + data: { + columns: [ + ["sample", 30, 200, 100, 400, 150, 250] + ] + }, + legend: { + // amount of padding to put between each legend element + padding: 5, + // define custom height and width for the legend item tile + item: { + tile: { + width: 15, + height: 2 + } + } + }}); +} + ///////////////////// // Tooltip Tests ///////////////////// diff --git a/types/c3/index.d.ts b/types/c3/index.d.ts index 28f301237c..6c466458e3 100644 --- a/types/c3/index.d.ts +++ b/types/c3/index.d.ts @@ -1,11 +1,12 @@ -// Type definitions for C3js 0.4 +// Type definitions for C3js 0.6 // Project: http://c3js.org/ // Definitions by: Marc Climent // Gerin Jacob // Bernd Hacker // Dzmitry Shyndzin +// Tim Niemueller // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 import * as d3 from "d3"; @@ -28,7 +29,7 @@ export interface ChartConfiguration { * Note: When chart is not binded, c3 starts observing if chart.element is binded by MutationObserver. In this case, polyfill is required in IE9 and IE10 becuase they do not support * MutationObserver. On the other hand, if chart always will be binded, polyfill will not be required because MutationObserver will never be called. */ - bindto?: string | HTMLElement | d3.Selection | null; + bindto?: string | HTMLElement | d3.Selection | null; size?: { /** * The desired width of the chart element. @@ -172,16 +173,18 @@ export interface ChartConfiguration { /** * Change the width of bar chart. If ratio is specified, change the width of bar chart by ratio. */ - width?: number | { - /** - * Set the width of each bar by ratio - */ - ratio: number, - /** - * Set max width of each bar - */ - max?: number - }; + width?: + | number + | { + /** + * Set the width of each bar by ratio + */ + ratio: number; + /** + * Set max width of each bar + */ + max?: number; + }; /** * Set if min or max value will be 0 on bar chart. */ @@ -205,7 +208,7 @@ export interface ChartConfiguration { /** * Set threshold to show/hide labels. */ - threshold?: number + threshold?: number; }; /** * Enable or disable expanding pie pieces. @@ -226,7 +229,7 @@ export interface ChartConfiguration { /** * Set threshold to show/hide labels. */ - threshold?: number + threshold?: number; }; /** * Enable or disable expanding pie pieces. @@ -280,7 +283,17 @@ export interface ChartConfiguration { /** * Set custom spline interpolation */ - type?: 'linear' | 'linear-closed' | 'basis' | 'basis-open' | 'basis-closed' | 'bundle' | 'cardinal' | 'cardinal-open' | 'cardinal-closed' | 'monotone'; + type?: + | "linear" + | "linear-closed" + | "basis" + | "basis-open" + | "basis-closed" + | "bundle" + | "cardinal" + | "cardinal-open" + | "cardinal-closed" + | "monotone"; }; }; } @@ -309,7 +322,7 @@ export interface Data { /** * Choose which JSON object keys correspond to desired data. */ - keys?: { x?: string; value: string[]; }; + keys?: { x?: string; value: string[] }; /** * Specify the key of x values in the data. * We can show the data with non-index x values by this option. This option is required when the type of x axis is timeseries. If this option is set on category axis, the values of the data @@ -365,9 +378,7 @@ export interface Data { * - j is the sub index of the data point where the label is shown. * Formatter function can be defined for each data by specifying as an object and D3 formatter function can be set (e.g. d3.format('$')) */ - labels?: boolean | - { format: FormatFunction } | - { format: { [key: string]: FormatFunction } }; + labels?: boolean | { format: FormatFunction } | { format: { [key: string]: FormatFunction } }; /** * Define the order of the data. * This option changes the order of stacking the data and pieces of pie/donut. If null specified, it will be the order the data loaded. If function specified, it will be used to sort the data @@ -387,11 +398,11 @@ export interface Data { * This option should a function and the specified function receives color (e.g. '#ff0000') and d that has data parameters like id, value, index, etc. And it must return a string that * represents color (e.g. '#00ff00'). */ - color?(color: string, d: any): string | d3.Rgb; + color?(color: string, d: any): string | d3.RGBColor; /** * Set color for each data. */ - colors?: { [key: string]: string | d3.Rgb | ((d: any) => string | d3.Rgb) }; + colors?: { [key: string]: string | d3.RGBColor | ((d: any) => string | d3.RGBColor) }; /** * Hide each data when the chart appears. * If true specified, all of data will be hidden. If multiple ids specified as an array, those will be hidden. @@ -690,6 +701,10 @@ export interface LegendOptions { y?: number; step?: number; }; + /** + * Padding between legend elements. + */ + padding?: number; item?: { /** @@ -704,6 +719,19 @@ export interface LegendOptions { * Set mouseout event handler to the legend item. */ onmouseout?(id: any): void; + /** + * Tile settings for legend color display. + */ + tile?: { + /** + * Tile width. + */ + width?: number; + /** + * Tile height + */ + height?: number; + } }; } @@ -813,7 +841,7 @@ export interface PointOptions { /** * The radius size of each point on focus. */ - r?: number + r?: number; }; }; @@ -877,7 +905,7 @@ export interface ChartAPI { load(args: { url?: string; json?: {}; - keys?: { x?: string; value: string[]; } + keys?: { x?: string; value: string[] }; rows?: PrimitiveArray[]; columns?: PrimitiveArray[]; xs?: { [key: string]: string }; @@ -885,7 +913,7 @@ export interface ChartAPI { classes?: { [key: string]: string }; categories?: string[]; axes?: { [key: string]: string }; - colors?: { [key: string]: string | d3.Rgb }; + colors?: { [key: string]: string | d3.RGBColor }; type?: string; types?: { [key: string]: string }; unload?: boolean | ArrayOrString; @@ -911,7 +939,7 @@ export interface ChartAPI { */ flow(args: { json?: {}; - keys?: { x?: string; value: string[]; } + keys?: { x?: string; value: string[] }; rows?: PrimitiveArray[]; columns?: PrimitiveArray[]; to?: any; @@ -997,7 +1025,7 @@ export interface ChartAPI { * Get and set colors of the data loaded in the chart. * @param colors If this argument is given, the colors of data will be updated. If not given, the current colors will be returned. The format of this argument is the same as data.colors. */ - colors(colors?: { [key: string]: string | d3.Rgb }): { [key: string]: string }; + colors(colors?: { [key: string]: string | d3.RGBColor }): { [key: string]: string }; /** * Get and set axes of the data loaded in the chart. * @param axes If this argument is given, the axes of data will be updated. If not given, the current axes will be returned. The format of this argument is the same as data.axes. @@ -1040,22 +1068,25 @@ export interface ChartAPI { * Get and set axis labels. * @param labels If labels is given, specified axis' label will be updated. */ - labels(labels?: { [key: string]: string }): { [key: string]: string } + labels(labels?: { [key: string]: string }): { [key: string]: string }; /** * Get and set axis min value. * @param min If min is given, specified axis' min value will be updated. If no argument is given, the current min values for each axis will be returned. */ - min(min?: number | { [key: string]: number }): number | { [key: string]: number } + min(min?: number | { [key: string]: number }): number | { [key: string]: number }; /** * Get and set axis max value. * @param max If max is given, specified axis' max value will be updated. If no argument is given, the current max values for each axis will be returned. */ - max(max?: number | { [key: string]: number }): number | { [key: string]: number } + max(max?: number | { [key: string]: number }): number | { [key: string]: number }; /** * Get and set axis min and max value. * @param range If range is given, specified axis' min and max value will be updated. If no argument is given, the current min and max values for each axis will be returned. */ - range(range?: { min?: number | { [key: string]: number }; max?: number | { [key: string]: number } }): { min: number | { [key: string]: number }; max: number | { [key: string]: number } } + range(range?: { + min?: number | { [key: string]: number }; + max?: number | { [key: string]: number }; + }): { min: number | { [key: string]: number }; max: number | { [key: string]: number } }; }; legend: { diff --git a/types/c3/tsconfig.json b/types/c3/tsconfig.json index fe3b00c503..aa923e91c0 100644 --- a/types/c3/tsconfig.json +++ b/types/c3/tsconfig.json @@ -1,29 +1,20 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6", - "dom" - ], + "lib": ["es6", "dom"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": false, "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": ["../"], "types": [], "paths": { - "d3": [ - "d3/v3" - ] + "d3-scale": ["d3-scale/v1"], + "d3": ["d3/v4"] }, "noEmit": true, "forceConsistentCasingInFileNames": true }, - "files": [ - "index.d.ts", - "c3-tests.ts" - ] -} \ No newline at end of file + "files": ["index.d.ts", "c3-tests.ts"] +} diff --git a/types/cassandra-driver/index.d.ts b/types/cassandra-driver/index.d.ts index 5c0578ccf2..33a9f5988f 100644 --- a/types/cassandra-driver/index.d.ts +++ b/types/cassandra-driver/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for cassandra-driver v3.2.2 +// Type definitions for cassandra-driver v3.4.1 // Project: https://github.com/datastax/nodejs-driver // Definitions by: Marc Fisher +// Christian D // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -115,7 +116,11 @@ export namespace policies { interface RetryPolicyStatic { new (): RetryPolicy; - retryDecision: any; + retryDecision: { + rethrow: number, + retry: number, + ignore: number + }; } interface RetryPolicy { @@ -126,15 +131,55 @@ export namespace policies { retryResult(): { decision: retryDecision, consistency: types.consistencies, useCurrentHost: boolean }; } } + + namespace speculativeExecution { + let NoSpeculativeExecutionPolicy: NoSpeculativeExecutionPolicyStatic + + interface SpeculativeExecutionPolicy { + init(client: Client): void; + newPlan(keyspace: string, queryInfo: string | Array): { + nextExecution: Function + } + } + + interface NoSpeculativeExecutionPolicyStatic { + new (): NoSpeculativeExecutionPolicy + } + + interface NoSpeculativeExecutionPolicy extends SpeculativeExecutionPolicy { } + + interface ConstantSpeculativeExecutionPolicyStatic { + new (delay: number, maxSpeculativeExecutions: number): ConstantSpeculativeExecutionPolicy + } + + interface ConstantSpeculativeExecutionPolicy extends SpeculativeExecutionPolicy { } + } + + namespace timestampGeneration { + let MonotonicTimestampGenerator: MonotonicTimestampGeneratorStatic + + interface TimestampGenerator { + next(client: Client): null | number | _Long + } + + interface MonotonicTimestampGeneratorStatic { + new (warningThreshold?: number, minLogInterval?: number): MonotonicTimestampGeneratorStatic + } + + interface MonotonicTimestampGenerator extends TimestampGenerator { + getDate(): number + } + } } export namespace types { let BigDecimal: BigDecimalStatic; + let Duration: DurationStatic; + let Long: _Long; let InetAddress: InetAddressStatic; let Integer: IntegerStatic; let LocalDate: LocalDateStatic; let LocalTime: LocalTimeStatic; - let Long: _Long; let ResultSet: ResultSetStatic; // let ResultStream: ResultStreamStatic; let Row: RowStatic; @@ -221,6 +266,19 @@ export namespace types { toJSON(): string; } + interface DurationStatic { + new (month: number, days: number, nanoseconds: number | _Long): Duration; + + fromBuffer(buffer: Buffer): Duration; + fromString(input: string): Duration; + } + + interface Duration { + equals(other: Duration): boolean; + toBuffer(): Buffer; + toString(): string; + } + interface InetAddressStatic { new (buffer: Buffer): InetAddress; @@ -336,13 +394,14 @@ export namespace types { } interface ResultSetStatic { - new (response: any, host: string, triedHost: { [key: string]: any }, consistency: consistencies): ResultSet; + new (response: any, host: string, triedHost: { [key: string]: any }, speculativeExecutions: number, consistency: consistencies): ResultSet; } interface ResultSet { info: { queriedHost: Host, triedHosts: { [key: string]: string; }, + speculativeExecutions: number, achievedConsistency: consistencies, traceId: Uuid, warnings: Array, @@ -352,11 +411,13 @@ export namespace types { rowLength: number; columns: Array<{ [key: string]: string; }>; pageState: string; - nextPage: any; // function + nextPage: Function; first(): Row; getPageState(): string; getColumns(): Array<{ [key: string]: string; }>; + wasApplied(): boolean; + [Symbol.iterator](): Iterator; } interface ResultStreamStatic { @@ -442,40 +503,50 @@ export let Encoder: EncoderStatic; export interface ClientOptions { contactPoints: Array, keyspace?: string, + refreshSchemaDelay?: number, + isMetadataSyncEnabled?: boolean, + prepareOnAllHosts?: boolean, + rePrepareOnUp?: boolean, + maxPrepared?: number, policies?: { - addressResolution?: policies.addressResolution.AddressTranslator, loadBalancing?: policies.loadBalancing.LoadBalancingPolicy, + retry?: policies.retry.RetryPolicy, reconnection?: policies.reconnection.ReconnectionPolicy, - retry?: policies.retry.RetryPolicy + addressResolution?: policies.addressResolution.AddressTranslator, + speculativeExecution?: policies.speculativeExecution.SpeculativeExecutionPolicy, + timestampGeneration?: policies.timestampGeneration.TimestampGenerator, }, queryOptions?: QueryOptions, pooling?: { - heartBeatInterval: number, - coreConnectionsPerHost: { [key: number]: number; }, - warmup: boolean; + heartBeatInterval?: number, + coreConnectionsPerHost?: { [key: number]: number; }, + maxRequestsPerConnection?: number, + warmup?: boolean; }, protocolOptions?: { - port: number, - maxSchemaAgreementWaitSeconds: number, - maxVersion: number + port?: number, + maxSchemaAgreementWaitSeconds?: number, + maxVersion?: number }, socketOptions?: { - connectTimeout: number, - defunctReadTimeoutThreshold: number, - keepAlive: boolean, - keepAliveDelay: number, - readTimeout: number, - tcpNoDelay: boolean, - coalescingThreshold: number + connectTimeout?: number, + defunctReadTimeoutThreshold?: number, + keepAlive?: boolean, + keepAliveDelay?: number, + readTimeout?: number, + tcpNoDelay?: boolean, + coalescingThreshold?: number }, authProvider?: auth.AuthProvider, sslOptions?: tls.ConnectionOptions, encoding?: { - map: Function, - set: Function, - copyBuffer: boolean, - useUndefinedAsUnset: boolean - } + map?: Function, + set?: Function, + copyBuffer?: boolean, + useUndefinedAsUnset?: boolean + }, + profiles?: Array, + promiseFactory?: Function, } export interface QueryOptions { @@ -483,8 +554,11 @@ export interface QueryOptions { captureStackTrace?: boolean; consistency?: number; customPayload?: any; + executionProfile?: string | ExecutionProfile; fetchSize?: number; hints?: Array | Array>; + isIdempotent?: boolean; + keyspace?: string; logged?: boolean; pageState?: Buffer | string; prepare?: boolean; @@ -520,6 +594,7 @@ export interface Client extends events.EventEmitter { execute(query: string, callback: ResultCallback): void; execute(query: string, params?: any, options?: QueryOptions): Promise; getReplicas(keyspace: string, token: Buffer): Array; // TODO: Should this be a more explicit return? + getState(): metadata.ClientState; shutdown(callback?: Callback): void; shutdown(): Promise; stream(query: string, params?: any, options?: QueryOptions, callback?: Callback): NodeJS.ReadableStream; @@ -548,6 +623,7 @@ export interface HostMapStatic { export interface HostMap extends events.EventEmitter { length: number; + clear(): Array; forEach(callback: Callback): void; get(key: string): Host; keys(): Array; @@ -566,6 +642,22 @@ export interface Encoder { encode(value: any, typeInfo?: string | number | { code: number, info?: any }): Buffer; } +interface ExecutionProfileOptions { + consistency: number, + loadBalancing: policies.loadBalancing.LoadBalancingPolicy, + name: string, + readTimeout: number, + retry: policies.retry.RetryPolicy, + serialConsistency: number +} + +export interface ExecutionProfileStatic { + new (name: string, options: ExecutionProfileOptions): ExecutionProfile +} + +export interface ExecutionProfile extends ExecutionProfileOptions { +} + export namespace auth { let Authenticator: AuthenticatorStatic; let PlainTextAuthProvider: PlainTextAuthProviderStatic; @@ -649,6 +741,17 @@ export namespace metadata { stateFunction: string; stateType: string; } + + interface ClientStateStatic { + new (): ClientState; + } + + interface ClientState { + getConnectedHosts(): Array; + getInFlightQueries(host: Host): number; + getOpenConnections(host: Host): number; + toString(): string; + } interface DataTypeInfo { code: number, diff --git a/types/catalog/catalog-tests.tsx b/types/catalog/catalog-tests.tsx deleted file mode 100644 index 37a87540d1..0000000000 --- a/types/catalog/catalog-tests.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import * as React from "react"; -import { Config, render, markdown, Catalog, ReactSpecimen, Page } from "catalog"; - -const config: Config = { - title: 'Test', - pages: [ - { - path: '/', - title: 'Introduction', - content: '/patd/to/file.md', - }, - { - path: '/materials', - title: 'Materials', - pages: [ - { - path: '/materials/typeface', - title: 'Typeface', - component: , - }, - ], - }, - ], - useBrowserHistory: true, - basePath: '/doc', - responsiveSizes: [ - { name: 'large', width: 978, height: 1100 }, - { name: 'medium', width: 640, height: 900 }, - { name: 'small', width: 471, height: 700 }, - ], -}; - -render(config, document.body); -; - -markdown` -# Test - -${ -
-} -`; diff --git a/types/catalog/index.d.ts b/types/catalog/index.d.ts deleted file mode 100644 index 3476e86641..0000000000 --- a/types/catalog/index.d.ts +++ /dev/null @@ -1,109 +0,0 @@ -// Type definitions for catalog 3.2 -// Project: https://github.com/interactivethings/catalog/ -// Definitions by: Peter Gassner , Tomas Carnecky -// Definitions: https://github.com/interactivethings/catalog/ -// TypeScript Version: 2.6 - -import * as React from "react"; - -// Configuration - -// XXX: Can not name this 'Page' because there's already a 'Page' -// component here. -export interface ConfigPage { - path: string; - title: string; - - content?: any; - component?: any; - pages?: ConfigPage[]; -} - -export interface ConfigResponsiveSize { - name: string; - width: number; - height: number; -} - -export interface Config { - title: string; - pages: ConfigPage[]; - - useBrowserHistory?: boolean; - basePath?: string; - responsiveSizes?: ConfigResponsiveSize[]; -} - -export function render(config: Config, element: HTMLElement): void; -export function configure(config: any): any; -export function configureRoutes(config: any): any; -export function configureJSXRoutes(config: any): any; - -export function pageLoader(f: () => Promise): any; -export function markdown(...x: any[]): JSX.Element; - -// Components -export interface DefaultCatalogProps extends React.Props<{}> { - span?: number; - theme?: any; -} - -export class Card extends React.Component {} -export class Page extends React.Component {} -export interface SpanProps extends DefaultCatalogProps { - style?: any; -} -export class Span extends React.Component {} - -// Specimens -export class AudioSpecimen extends React.Component {} - -export interface CodeSpecimenProps extends DefaultCatalogProps { - rawBody: string; - collapsed: boolean; - lang: string; - raw: boolean; -} -export class CodeSpecimen extends React.Component {} - -export interface ColorSpecimenProps extends DefaultCatalogProps { - value: string; - name: string; -} -export class ColorSpecimen extends React.Component {} - -export interface ColorPaletteSpecimenProps extends DefaultCatalogProps { - colors: Array<{name?: string, value: string}>; - horizontal?: boolean; -} -export class ColorPaletteSpecimen extends React.Component {} - -export class HtmlSpecimen extends React.Component {} -export class HintSpecimen extends React.Component {} -export class ImageSpecimen extends React.Component {} - -export interface TypeSpecimenProps extends DefaultCatalogProps { - color?: string; - font: string; - headings: string[] | number[]; - style?: string; - weight: string; -} -export class TypeSpecimen extends React.Component {} -export class DownloadSpecimen extends React.Component {} - -export interface ReactSpecimenProps extends DefaultCatalogProps { - noSource?: boolean; - plain?: boolean; - light?: boolean; - dark?: boolean; - frame?: boolean; - state?: any; - responsive?: boolean | string | string[]; - sourceText?: string; -} -export class ReactSpecimen extends React.Component {} - -export class VideoSpecimen extends React.Component {} - -export class Catalog extends React.Component {} diff --git a/types/catalog/tslint.json b/types/catalog/tslint.json deleted file mode 100644 index b4b47a0378..0000000000 --- a/types/catalog/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "dtslint/dt.json" -} diff --git a/types/chai-string/index.d.ts b/types/chai-string/index.d.ts index bc990104be..fcf0fb9c23 100644 --- a/types/chai-string/index.d.ts +++ b/types/chai-string/index.d.ts @@ -49,4 +49,5 @@ declare global { } declare function chaiString(chai: any, utils: any): void; +declare namespace chaiString { } export = chaiString; diff --git a/types/chai-things/chai-things-tests.ts b/types/chai-things/chai-things-tests.ts index ecb7294dd2..b3549ab192 100644 --- a/types/chai-things/chai-things-tests.ts +++ b/types/chai-things/chai-things-tests.ts @@ -1,8 +1,7 @@ -import chai = require('chai'); -import chaiThings = require('chai-things'); - +import * as chai from 'chai'; +import * as chaiThings from 'chai-things'; chai.use(chaiThings); function test_somethingSyntax() { diff --git a/types/chai-things/index.d.ts b/types/chai-things/index.d.ts index 11ad20ede3..e0b3d0f0ec 100644 --- a/types/chai-things/index.d.ts +++ b/types/chai-things/index.d.ts @@ -60,5 +60,6 @@ interface Array { declare module "chai-things" { function chaiThings(chai: any, utils: any): void; + namespace chaiThings { } export = chaiThings; } diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index 6041889b66..d0f6ebc684 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -21,6 +21,12 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { hover: { intersect: true }, + onHover(ev: MouseEvent, points: any[]) { + return; + }, + title: { + text: ["foo", "bar"] + }, tooltips: { filter: data => Number(data.yLabel) > 0, intersect: true, @@ -52,6 +58,7 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { padding: 40 } }, + devicePixelRatio: 2, } }); chart.update(); diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index c637164d30..2c5de28962 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -9,6 +9,7 @@ // Dan Manastireanu // Guillaume Rodriguez // Sergey Rubanov +// Simon Archer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -126,6 +127,10 @@ declare namespace Chart { pointStyle?: PointStyle; } + interface ChartLegendLabelItem extends ChartLegendItem { + datasetIndex: number; + } + interface ChartTooltipItem { xLabel?: string; yLabel?: string; @@ -184,6 +189,7 @@ declare namespace Chart { aspectRatio?: number; maintainAspectRatio?: boolean; events?: string[]; + onHover?(this: Chart, event: MouseEvent, activeElements: Array<{}>): any; onClick?(event?: MouseEvent, activeElements?: Array<{}>): any; title?: ChartTitleOptions; legend?: ChartLegendOptions; @@ -198,6 +204,7 @@ declare namespace Chart { cutoutPercentage?: number; circumference?: number; rotation?: number; + devicePixelRatio?: number; // Plugins can require any options plugins?: { [plugin: string]: any }; } @@ -218,15 +225,15 @@ declare namespace Chart { fontColor?: ChartColor; fontStyle?: string; padding?: number; - text?: string; + text?: string | string[]; } interface ChartLegendOptions { display?: boolean; position?: PositionType; fullWidth?: boolean; - onClick?(event: MouseEvent, legendItem: ChartLegendItem): void; - onHover?(event: MouseEvent, legendItem: ChartLegendItem): void; + onClick?(event: MouseEvent, legendItem: ChartLegendLabelItem): void; + onHover?(event: MouseEvent, legendItem: ChartLegendLabelItem): void; labels?: ChartLegendLabelOptions; reverse?: boolean; } @@ -239,7 +246,7 @@ declare namespace Chart { fontFamily?: string; padding?: number; generateLabels?(chart: any): any; - filter?(item: ChartLegendItem, data: ChartData): any; + filter?(legendItem: ChartLegendLabelItem, data: ChartData): any; usePointStyle?: boolean; } @@ -291,7 +298,7 @@ declare namespace Chart { mode?: string; animationDuration?: number; intersect?: boolean; - onHover?(active: any): void; + onHover?(this: Chart, event: MouseEvent, activeElements: Array<{}>): any; } interface ChartAnimationObject { @@ -395,6 +402,10 @@ declare namespace Chart { interface TickOptions { autoSkip?: boolean; autoSkipPadding?: number; + backdropColor?: ChartColor; + backdropPaddingX?: number; + backdropPaddingY?: number; + beginAtZero?: boolean; callback?(value: any, index: any, values: any): string|number; display?: boolean; fontColor?: ChartColor; @@ -402,14 +413,17 @@ declare namespace Chart { fontSize?: number; fontStyle?: string; labelOffset?: number; + max?: any; maxRotation?: number; + maxTicksLimit?: number; + min?: any; minRotation?: number; mirror?: boolean; padding?: number; reverse?: boolean; - min?: any; - max?: any; + showLabelBackdrop?: boolean; } + interface AngleLineOptions { display?: boolean; color?: ChartColor; @@ -424,26 +438,15 @@ declare namespace Chart { fontStyle?: string; } - interface TickOptions { - backdropColor?: ChartColor; - backdropPaddingX?: number; - backdropPaddingY?: number; - maxTicksLimit?: number; - showLabelBackdrop?: boolean; - } interface LinearTickOptions extends TickOptions { - beginAtZero?: boolean; - min?: number; - max?: number; maxTicksLimit?: number; stepSize?: number; suggestedMin?: number; suggestedMax?: number; } + // tslint:disable-next-line no-empty-interface interface LogarithmicTickOptions extends TickOptions { - min?: number; - max?: number; } type ChartColor = string | CanvasGradient | CanvasPattern | string[]; diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index d12bf94302..8c953aaca1 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -1678,6 +1678,17 @@ declare namespace chrome.devtools.inspectedWindow { * Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression. */ export function eval(expression: string, callback?: (result: T, exceptionInfo: EvaluationExceptionInfo) => void): void; + /** + * Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown. The eval function can report either a DevTools-side error or a JavaScript exception that occurs during evaluation. In either case, the result parameter of the callback is undefined. In the case of a DevTools-side error, the isException parameter is non-null and has isError set to true and code set to an error code. In the case of a JavaScript error, isException is set to true and value is set to the string value of thrown object. + * @param expression An expression to evaluate. + * @param options The options parameter can contain one or more options. + * @param callback A function called when evaluation completes. + * If you specify the callback parameter, it should be a function that looks like this: + * function(object result, object exceptionInfo) {...}; + * 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, options: EvalOptions, 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. @@ -1690,6 +1701,15 @@ declare namespace chrome.devtools.inspectedWindow { export var onResourceAdded: ResourceAddedEvent; /** Fired when a new revision of the resource is committed (e.g. user saves an edited version of the resource in the Developer Tools). */ export var onResourceContentCommitted: ResourceContentCommittedEvent; + + export interface EvalOptions { + /** If specified, the expression is evaluated on the iframe whose URL matches the one specified. By default, the expression is evaluated in the top frame of the inspected page. */ + frameURL?: string; + /** Evaluate the expression in the context of the content script of the calling extension, provided that the content script is already injected into the inspected page. If not, the expression is not evaluated and the callback is invoked with the exception parameter set to an object that has the isError field set to true and the code field set to E_NOTFOUND. */ + useContentScriptContext?: boolean; + /** Evaluate the expression in the context of a content script of an extension that matches the specified origin. If given, contextSecurityOrigin overrides the 'true' setting on userContentScriptContext. */ + contextSecurityOrigin?: string; + } } //////////////////// diff --git a/types/circuit-breaker-js/circuit-breaker-js-tests.ts b/types/circuit-breaker-js/circuit-breaker-js-tests.ts new file mode 100644 index 0000000000..b9a3c70a63 --- /dev/null +++ b/types/circuit-breaker-js/circuit-breaker-js-tests.ts @@ -0,0 +1,20 @@ +import CircuitBreaker = require('circuit-breaker-js'); + +const breaker = new CircuitBreaker(); +breaker.isOpen(); + +const options: CircuitBreaker.Options = {}; + +let status: number = CircuitBreaker.CLOSED; +status = CircuitBreaker.OPEN; + +breaker.forceOpen(); +breaker.forceClose(); + +breaker.run((success, failure) => { + if (Math.random() > 0.5) { + success(); + } else { + failure(); + } +}); diff --git a/types/circuit-breaker-js/index.d.ts b/types/circuit-breaker-js/index.d.ts new file mode 100644 index 0000000000..7b6854e61f --- /dev/null +++ b/types/circuit-breaker-js/index.d.ts @@ -0,0 +1,44 @@ +// Type definitions for circuit-breaker-js 0.0 +// Project: http://yammer.github.io/circuit-breaker-js/ +// Definitions by: Timur Amirov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = CircuitBreaker; + +declare namespace CircuitBreaker { + interface Options { + windowDuration?: number; + numBuckets?: number; + timeoutDuration?: number; + errorThreshold?: number; + volumeThreshold?: number; + + onCircuitOpen?: (m: Metrics) => void; + onCircuitClose?: (m: Metrics) => void; + } + + interface Metrics { + totalCount: number; + errorCount: number; + errorPercentage: number; + } +} + +declare class CircuitBreaker { + static OPEN: 0; + static HALF_OPEN: 1; + static CLOSED: 2; + + constructor(options?: CircuitBreaker.Options); + run( + command: ( + success: () => void, + failure: () => void, + ) => void, + fallback?: () => void + ): void; + forceClose(): void; + forceOpen(): void; + unforce(): void; + isOpen(): boolean; +} diff --git a/types/circuit-breaker-js/tsconfig.json b/types/circuit-breaker-js/tsconfig.json new file mode 100644 index 0000000000..67d9c57cc0 --- /dev/null +++ b/types/circuit-breaker-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", + "circuit-breaker-js-tests.ts" + ] +} diff --git a/types/circuit-breaker-js/tslint.json b/types/circuit-breaker-js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/circuit-breaker-js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ckeditor/ckeditor-tests.ts b/types/ckeditor/ckeditor-tests.ts index dd0ec92164..03f8a1ab3e 100644 --- a/types/ckeditor/ckeditor-tests.ts +++ b/types/ckeditor/ckeditor-tests.ts @@ -323,7 +323,11 @@ function test_adding_dialog_by_definition() { title: 'Abbreviation Properties', minWidth: 400, minHeight: 200, - + onLoad: () => {}, + onOk: () => {}, + onCancel: () => {}, + onShow: () => {}, + onHide: () => {}, contents: [ { id: 'tab-basic', @@ -506,3 +510,9 @@ function test_editor_instance_event() { } }); } + +function test_dtd() { + var brConsideredEmptyTag = CKEDITOR.dtd.$empty["br"]; + var spanCanContainText = CKEDITOR.dtd["span"]["#"]; + var divCanContainSpan = CKEDITOR.dtd["div"]["span"]; +} diff --git a/types/ckeditor/index.d.ts b/types/ckeditor/index.d.ts index cf7cd0cc27..e26abd16b4 100644 --- a/types/ckeditor/index.d.ts +++ b/types/ckeditor/index.d.ts @@ -24,8 +24,8 @@ declare namespace CKEDITOR { var DIALOG_RESIZE_HEIGHT: number; var DIALOG_RESIZE_NONE: number; var DIALOG_RESIZE_WIDTH: number; - var DIALOG_STATE_IDLE: number; - var DIALOG_STATE_BUSY: number; + var DIALOG_STATE_IDLE: number; + var DIALOG_STATE_BUSY: number; var ELEMENT_MODE_APPENDTO: number; var ELEMENT_MODE_INLINE: number; var ELEMENT_MODE_NONE: number; @@ -44,10 +44,10 @@ declare namespace CKEDITOR { var NODE_DOCUMENT_FRAGMENT: number; var NODE_ELEMENT: number; var NODE_TEXT: number; - var POSITION_BEFORE_START: number; - var POSITION_BEFORE_END: number; - var POSITION_AFTER_START: number; - var POSITION_AFTER_END: number; + var POSITION_BEFORE_START: number; + var POSITION_BEFORE_END: number; + var POSITION_AFTER_START: number; + var POSITION_AFTER_END: number; var SELECTION_ELEMENT: number; var SELECTION_NONE: number; var SELECTION_TEXT: number; @@ -55,9 +55,9 @@ declare namespace CKEDITOR { var SHRINK_ELEMENT: number; var SHRINK_TEXT: number; var START: number; - var STYLE_BLOCK: string; - var STYLE_INLINE: string; - var STYLE_OBJECT: string; + var STYLE_BLOCK: string; + var STYLE_INLINE: string; + var STYLE_OBJECT: string; var TRISTATE_DISABLED: number; var TRISTATE_OFF: number; var TRISTATE_ON: number; @@ -288,7 +288,7 @@ declare namespace CKEDITOR { class elementPath { constructor(startNode: element, root: element); - constructor(startNode: element); + constructor(startNode: element); block: element; blockLimit: element; root: element; @@ -342,7 +342,7 @@ declare namespace CKEDITOR { setStartAt(node: node, position: number): void; setEndAt(node: node, position: number): void; fixBlock(isStart: boolean, blockTag: Object): Object; - select(): selection; + select(): selection; splitBlock(blockTag: Object): Object; splitElement(toSplit: element): element; removeEmptyBlocksAtEnd(atEnd: boolean): void; @@ -836,7 +836,7 @@ declare namespace CKEDITOR { templates_files?: Object; templates_replaceContent?: boolean; title?: string | boolean; - toolbar?: string | (string | string[] | { name: string, items?: string[], groups?: string[] })[] | null; + toolbar?: string | (string | string[] | { name: string, items?: string[], groups?: string[] })[] | null; toolbarCanCollapse?: boolean; toolbarGroupCycling?: boolean; toolbarGroups?: (toolbarGroups | string)[]; @@ -869,19 +869,19 @@ declare namespace CKEDITOR { } module skin { - var icons: { [name: string]: { path: string } }; - function addIcon(name: string, path: string, offset?: number, bgsize?: string): void; - } + var icons: { [name: string]: { path: string } }; + function addIcon(name: string, path: string, offset?: number, bgsize?: string): void; + } class style { - constructor(something: { element: string, attributes: { [att: string]: string } }); - applyToRange(range: Range, editor: editor): void; - } + constructor(something: { element: string, attributes: { [att: string]: string } }); + applyToRange(range: Range, editor: editor): void; + } interface editable extends dom.element { - hasFocus: boolean; - attachListener(obj: event | editable, eventName: string, listenerFunction: (ei: eventInfo) => void, - scopeobj?: {}, listenerData?: any, priority?: number): listenerRegistration; + hasFocus: boolean; + attachListener(obj: event | editable, eventName: string, listenerFunction: (ei: eventInfo) => void, + scopeobj?: {}, listenerData?: any, priority?: number): listenerRegistration; } @@ -978,7 +978,7 @@ declare namespace CKEDITOR { destroy(widget: CKEDITOR.plugins.widget, offline?: boolean): void; destroyAll(offline?: boolean): void; finalizeCreation(container: any): void; - focused: widget; + focused: widget; fire(eventName: string, data: Object, editor: editor): any; // should be boolean | Object getByElement(element: any, checkWrapperOnly: boolean): CKEDITOR.plugins.widget; hasListeners(eventName: string): boolean; @@ -1089,7 +1089,7 @@ declare namespace CKEDITOR { interface IMenuItemDefinition { label:string, command:string, - icon: string + icon: string group:string, order:number } @@ -1142,7 +1142,7 @@ declare namespace CKEDITOR { createFakeParserElement(realElement: Object, className: Object, realElementType: Object, isResizable: Object): void; createRange(): dom.range; destroy(noUpdate?: boolean): void; - editable(): editable | null; + editable(): editable | null; editable(elementOrEditable: dom.element): void; editable(elementOrEditable: editable): void; elementPath(startNode?: dom.node): dom.elementPath; @@ -1300,14 +1300,14 @@ declare namespace CKEDITOR { stop(): void; } - module filter { - interface allowedContentRules { + module filter { + interface allowedContentRules { - } - } + } + } class filter { - allow(newRules: CKEDITOR.filter.allowedContentRules, featureName?: string, overrideCustom?: boolean): boolean; + allow(newRules: CKEDITOR.filter.allowedContentRules, featureName?: string, overrideCustom?: boolean): boolean; } @@ -1370,10 +1370,28 @@ declare namespace CKEDITOR { } - class dtd { - + interface dtdDefinition { + [outerTagName: string]: {[innerTagName: string]: 1}; + $block: {[tagName: string]: 1}; + $blockLimit: {[tagName: string]: 1}; + $cdata: {[tagName: string]: 1}; + $editable: {[tagName: string]: 1}; + $empty: {[tagName: string]: 1}; + $inline: {[tagName: string]: 1}; + $intermediate: {[tagName: string]: 1}; + $list: {[tagName: string]: 1}; + $listItem: {[tagName: string]: 1}; + $nonBodyContent: {[tagName: string]: 1}; + $nonEditable: {[tagName: string]: 1}; + $object: {[tagName: string]: 1}; + $removeEmpty: {[tagName: string]: 1}; + $tabIndex: {[tagName: string]: 1}; + $tableContent: {[tagName: string]: 1}; + $transparent: {[tagName: string]: 1}; } + var dtd: dtdDefinition; + class ui extends event { constructor(editor: editor); @@ -1717,6 +1735,7 @@ declare namespace CKEDITOR { onLoad?: Function; onOk?: Function; onShow?: Function; + onHide?: Function; resizable?: number; title?: string; width?: number; @@ -1819,7 +1838,7 @@ declare namespace CKEDITOR { children: any[]; type: number; add(node: node): number; - add(node: node, index: number): void; + add(node: node, index: number): void; clone(): element; filter(filter: filter): boolean; filterChildren(filter: filter): void; diff --git a/types/clearbladejs-client/clearbladejs-client-tests.ts b/types/clearbladejs-client/clearbladejs-client-tests.ts new file mode 100644 index 0000000000..bce39bee2a --- /dev/null +++ b/types/clearbladejs-client/clearbladejs-client-tests.ts @@ -0,0 +1,193 @@ +// Testing type definitions for clearbladejs-client 1.0 +// Project: https://github.com/ClearBlade/JavaScript-API +// Definitions by: Jim Bouquet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +let genericCallback = (error: boolean, response: Resp) => {}; + +/////////////////////////////////////// +// ClearBlade object API invocations +/////////////////////////////////////// +ClearBlade.init({ + systemKey: "abcdef", + systemSecret: "abcdefg", + callback: genericCallback +}); + +ClearBlade.setUser("test@test.com", "password"); +ClearBlade.registerUser("test@test.com", "password", genericCallback); +ClearBlade.isCurrentUserAuthenticated(genericCallback); +ClearBlade.logoutUser(genericCallback); +ClearBlade.loginAnon(genericCallback); +ClearBlade.loginUser("test@test.com", "password", genericCallback); +ClearBlade.loginUserMqtt("test@test.com", "password", genericCallback); +ClearBlade.sendPush(["user1", "user2"], {data: "Test"}, "appId: string", genericCallback); +ClearBlade.getAllCollections(genericCallback); + +let coll1 = ClearBlade.Collection("collectionID"); +let coll2 = ClearBlade.Collection({ collectionName: "collectionName" }); +let coll3 = ClearBlade.Collection({ collectionID: "collectionID" }); + +let query1 = ClearBlade.Query("collectionID"); +let query2 = ClearBlade.Query({ offset: 5, limit: 5, collectionID: "collectionID" }); +let query3 = ClearBlade.Query({ collectionName: "collectionName" }); + +let item1 = ClearBlade.Item({}, "collectionID"); +let item2 = ClearBlade.Item({}, { collectionID: "collectionID" }); + +let code = ClearBlade.Code(); +let user = ClearBlade.User(); + +let messaging = ClearBlade.Messaging({}, genericCallback); +let stats = ClearBlade.MessagingStats(); + +let edge = ClearBlade.Edge(); +let metrics = ClearBlade.Metrics(); +let device = ClearBlade.Device(); +let analytics = ClearBlade.Analytics(); +let portal = ClearBlade.Portal("MyPortal"); +let triggers = ClearBlade.Triggers(); + +ClearBlade.getEdges(query1.query, genericCallback); + +/////////////////////////////////////// +// Collection API invocations +/////////////////////////////////////// +coll1.fetch(query1.query, genericCallback); +coll1.create(ClearBlade.Item({}, ""), genericCallback); +coll1.update(query1.query, {}, genericCallback); +coll1.remove(query1.query, genericCallback); +coll1.columns(genericCallback); +coll1.count(query1.query, genericCallback); + +/////////////////////////////////////// +// Query API invocations +/////////////////////////////////////// +query1.addSortToQuery( + query1, + QuerySortDirections.QUERY_SORT_ASCENDING, + "column1" +); +query1.addFilterToQuery( + query1, + QueryConditions.QUERY_GREATERTHAN, + "key", + "value" +); +query1.ascending("string"); +query1.descending("string"); +query1.equalTo("string", "string"); +query1.greaterThan("string", 2); +query1.greaterThanEqualTo("string", false); +query1.lessThan("string", "string"); +query1.lessThanEqualTo("string", "string"); +query1.notEqualTo("string", "string"); +query1.matches("string", new RegExp(/.*/)); +query1.or(query2); +query1.setPage(1, 1); +query1.fetch(genericCallback); +query1.update({}, genericCallback); +query1.columns([]); +query1.remove(genericCallback); + +/////////////////////////////////////// +// Item API invocations +/////////////////////////////////////// +item1.save(genericCallback); +item1.refresh(genericCallback); +item1.destroy(genericCallback); + +/////////////////////////////////////// +// Code API invocations +/////////////////////////////////////// +code.create("codeName", "body: string", genericCallback); +code.update("codeName", "body: string", genericCallback); +code.delete("codeName", genericCallback); +code.execute("codeName", {}, genericCallback); +code.getCompletedServices(genericCallback); +code.getFailedServices(genericCallback); +code.getAllServices(genericCallback); + +/////////////////////////////////////// +// User API invocations +/////////////////////////////////////// +user.getUser(genericCallback); +user.setUser({}, genericCallback); +user.allUsers(query1.query, genericCallback); +user.setPassword("old_password", "new_password", genericCallback); +user.count(query1.query, genericCallback); + +/////////////////////////////////////// +// Messaging API invocations +/////////////////////////////////////// +messaging.getMessageHistoryWithTimeFrame("topic", 5, 10, 15, 20, genericCallback); +messaging.getMessageHistory("topic", 5, 15, genericCallback); +messaging.getAndDeleteMessageHistory("topic", 5, 10, 1, 20, genericCallback); +messaging.currentTopics(genericCallback); +messaging.publish("topic", {}); +messaging.publishREST("topic", { payload: Object }, genericCallback); +let mcb = (message: string) => {}; +messaging.subscribe("topic", {}, mcb); +messaging.unsubscribe("topic", {}); +messaging.disconnect(); + +/////////////////////////////////////// +// MessagingStats API invocations +/////////////////////////////////////// +stats.getAveragePayloadSize("topic: string", 5, 5, genericCallback); +stats.getOpenConnections(genericCallback); +stats.getCurrentSubscribers("topic: string", genericCallback); + +/////////////////////////////////////// +// Edge API invocations +/////////////////////////////////////// +edge.updateEdgeByName("edgename", {changedColumn: "New value"}, genericCallback); +edge.deleteEdgeByName("edgename", genericCallback); +edge.create({newEdge: Object}, "edgename", genericCallback); +edge.columns(genericCallback); +edge.count(query1.query, genericCallback); + +/////////////////////////////////////// +// Metrics API invocations +/////////////////////////////////////// +metrics.setQuery(query1.query); +metrics.getStatistics(genericCallback); +metrics.getStatisticsHistory(genericCallback); +metrics.getDBConnections(genericCallback); +metrics.getLogs(genericCallback); + +/////////////////////////////////////// +// Device API invocations +/////////////////////////////////////// +device.getDeviceByName("devicename", genericCallback); +device.updateDeviceByName("devicename", { object: Object }, true, genericCallback); +device.deleteDeviceByName("devicename", genericCallback); +device.fetch(query1.query, genericCallback); +device.update(query1.query, { object: Object }, false, genericCallback); +device.delete(query1.query, genericCallback); +device.create({ newDevice: Object }, genericCallback); +device.columns(genericCallback); +device.count(query1.query, genericCallback); + +/////////////////////////////////////// +// Analytics API invocations +/////////////////////////////////////// +analytics.getStorage({}, genericCallback); +analytics.getCount({}, genericCallback); +analytics.getEventList({}, genericCallback); +analytics.getEventTotals({}, genericCallback); +analytics.getUserEvents({}, genericCallback); + +/////////////////////////////////////// +// Portal API invocations +/////////////////////////////////////// +portal.fetch(genericCallback); +portal.update({data: Object}, genericCallback); + +/////////////////////////////////////// +// Triggers API invocations +/////////////////////////////////////// +triggers.fetchDefinitions(genericCallback); +triggers.create("triggername", {data: Object}, genericCallback); +triggers.update("triggername", {data: Object}, genericCallback); +triggers.delete("triggername", genericCallback); diff --git a/types/clearbladejs-client/global.d.ts b/types/clearbladejs-client/global.d.ts new file mode 100644 index 0000000000..d6e2e88a70 --- /dev/null +++ b/types/clearbladejs-client/global.d.ts @@ -0,0 +1,5 @@ +declare global { + var ClearBlade: ClearBladeGlobal; +} + +export {}; diff --git a/types/clearbladejs-client/index.d.ts b/types/clearbladejs-client/index.d.ts new file mode 100644 index 0000000000..4cb8c4744b --- /dev/null +++ b/types/clearbladejs-client/index.d.ts @@ -0,0 +1,436 @@ +// Type definitions for clearbladejs-client 1.0 +// Project: https://github.com/ClearBlade/JavaScript-API +// Definitions by: Jim Bouquet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +interface Resp { + error(msg: any): never; // todo: figure out if we can have the compiler throw an error if someone adds code after this + success(msg: any): never; +} + +declare enum MessagingQOS { + MESSAGING_QOS_AT_MOST_ONCE = 0, + MESSAGING_QOS_AT_LEAST_ONCE = 1, + MESSAGING_QOS_EXACTLY_ONCE = 2 +} + +interface InitOptions { + systemKey: string; + systemSecret: string; + masterSecret?: string; + logging?: boolean; + callback?: CbCallback; + email?: string; + password?: string; + registerUser?: boolean; + useUser?: APIUser; + URI?: string; + messagingURI?: string; + messagingPort?: number; + defaultQoS?: MessagingQOS; + callTimeout?: number; + messagingAuthPort?: number; +} + +interface RequestOptions { + method?: string; + endpoint?: string; + body?: string; + qs?: string; + URI?: string; + useUser?: boolean; + authToken?: string; + timeout?: number; + user?: APIUser; +} + +interface APIUser { + email: string; + authToken: string; +} + +type CbCallback = (error: boolean, response: Resp) => void; + +interface ClearBladeGlobal extends ClearBladeInt { + MESSAGING_QOS_AT_MOST_ONCE: MessagingQOS.MESSAGING_QOS_AT_MOST_ONCE; + MESSAGING_QOS_AT_LEAST_ONCE: MessagingQOS.MESSAGING_QOS_AT_LEAST_ONCE; + MESSAGING_QOS_EXACTLY_ONCE: MessagingQOS.MESSAGING_QOS_EXACTLY_ONCE; + + request(options: RequestOptions, callback: CbCallback): void; +} + +interface ClearBladeInt { + systemKey: string; + systemSecret: string; + masterSecret: string; + URI: string; + messagingURI: string; + messagingPort: number; + logging: boolean; + defaultQoS: MessagingQOS; + + init(options: InitOptions): void; + setUser(email: string, password: string): void; + registerUser(email: string, password: string, callback: CbCallback): void; + isCurrentUserAuthenticated(callback: CbCallback): void; + logoutUser(callback: CbCallback): void; + loginAnon(callback: CbCallback): void; + loginUser(email: string, password: string, callback: CbCallback): void; + loginUserMqtt(email: string, password: string, callback: CbCallback): void; + registerMasterCallback(callback: CbCallback): void; + Collection(options: string | CollectionOptionsWithName | CollectionOptionsWithID): Collection; + Query( + options: string | QueryOptionsWithName | QueryOptionsWithID + ): QueryObj; + Item(data: object, collectionID: string | ItemOptions): Item; + Code(): Code; + User(): AppUser; + Messaging(options: MessagingOptions, callback: CbCallback): Messaging; + MessagingStats(): MessagingStats; + sendPush( + users: string[], + payload: object, + appId: string, + callback: CbCallback + ): void; + getEdges(query: Query, callback: CbCallback): void; + Edge(): Edge; + Metrics(): Metrics; + Device(): Device; + Analytics(): Analytics; + Portal(name: string): Portal; + Triggers(): Triggers; + + getAllCollections(callback: CbCallback): void; +} +interface CollectionOptionsWithName { + collectionName: string; +} + +interface CollectionOptionsWithID { + collectionID: string; +} + +interface Collection { + name: string; + endpoint: string; + isUsingCollectionName: boolean; + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + fetch(query: Query, callback: CbCallback): void; + create(newItem: Item, callback: CbCallback): void; + update(query: Query, changes: object, callback: CbCallback): void; + remove(query: Query, callback: CbCallback): void; + columns(callback: CbCallback): void; + count(query: Query, callback: CbCallback): void; +} + +declare enum QuerySortDirections { + QUERY_SORT_ASCENDING = "ASC", + QUERY_SORT_DESCENDING = "DESC" +} + +declare enum QueryConditions { + QUERY_EQUAL = "EQ", + QUERY_NOTEQUAL = "NEQ", + QUERY_GREATERTHAN = "GT", + QUERY_GREATERTHAN_EQUAL = "GTE", + QUERY_LESSTHAN = "LT", + QUERY_LESSTHAN_EQUAL = "LTE", + QUERY_MATCHES = "RE" +} + +type QueryValue = string | number | boolean; + +interface QueryOptions { + offset?: number; + limit?: number; +} + +interface QueryOptionsWithName + extends CollectionOptionsWithName, + QueryOptions {} +interface QueryOptionsWithID extends CollectionOptionsWithID, QueryOptions {} + +interface Query { + SELECTCOLUMNS?: string[]; + SORT?: QuerySortDirections; + FILTERS?: QueryFilter[]; + PAGESIZE?: number; + PAGENUM?: number; +} + +interface QueryFilter { + [QueryConditions: string]: QueryFilterValue; +} + +interface QueryFilterValue { + [name: string]: QueryValue; +} + +interface QueryObj { + endpoint: string; + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + query: Query; + OR: Query[]; + offset: number; + limit: number; + + addSortToQuery( + query: QueryObj, + direction: QuerySortDirections, + column: string + ): void; + addFilterToQuery( + query: QueryObj, + condition: QueryConditions, + key: string, + value: QueryValue + ): void; + ascending(field: string): void; + descending(field: string): void; + equalTo(field: string, value: QueryValue): void; + greaterThan(field: string, value: QueryValue): void; + greaterThanEqualTo(field: string, value: QueryValue): void; + lessThan(field: string, value: QueryValue): void; + lessThanEqualTo(field: string, value: QueryValue): void; + notEqualTo(field: string, value: QueryValue): void; + matches(field: string, pattern: RegExp): void; + or(query: QueryObj): void; + setPage(pageSize: number, pageNum: number): void; + fetch(callback: CbCallback): void; + update(changes: object, callback: CbCallback): void; + columns(columnsArray: string[]): void; + remove(callback: CbCallback): void; +} + +interface ItemOptions extends CollectionOptionsWithID {} + +interface Item { + data: object; + + save(callback: CbCallback): void; + refresh(callback: CbCallback): void; + destroy(callback: CbCallback): void; +} + +interface Code { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + callTimeout: number; + + create(name: string, body: string, callback: CbCallback): void; + update(name: string, body: string, callback: CbCallback): void; + delete(name: string, callback: CbCallback): void; + execute(name: string, params: object, callback: CbCallback): void; + getCompletedServices(callback: CbCallback): void; + getFailedServices(callback: CbCallback): void; + getAllServices(callback: CbCallback): void; +} + +interface AppUser { + user: APIUser; + URI: string; + endpoint: string; + systemKey: string; + systemSecret: string; + callTimeout: number; + + getUser(callback: CbCallback): void; + setUser(data: object, callback: CbCallback): void; + allUsers(query: Query, callback: CbCallback): void; + setPassword( + old_password: string, + new_password: string, + callback: CbCallback + ): void; + count(query: Query, callback: CbCallback): void; +} + +interface Messaging { + user: APIUser; + URI: string; + endpoint: string; + systemKey: string; + systemSecret: string; + callTimeout: number; + client: Paho.MQTT.Client; + + getMessageHistoryWithTimeFrame( + topic: string, + count: number, + last: number, + start: number, + stop: number, + callback: CbCallback + ): void; + getMessageHistory( + topic: string, + last: number, + count: number, + callback: CbCallback + ): void; + getAndDeleteMessageHistory( + topic: string, + count: number, + last: number, + start: number, + stop: number, + callback: CbCallback + ): void; + currentTopics(callback: CbCallback): void; + publish(topic: string, payload: object): void; + publishREST(topic: string, payload: object, callback: CbCallback): void; + subscribe( + topic: string, + options: MessagingSubscribeOptions, + messageCallback: MessageCallback + ): void; + unsubscribe(topic: string, options: MessagingSubscribeOptions): void; + disconnect(): void; +} + +interface CommonMessagingProperties { + cleanSession?: boolean; + useSSL?: boolean; + hosts?: string; + ports?: string; + onSuccess?: Function; + onFailure?: Function; +} + +interface MessagingOptions extends CommonMessagingProperties { + qos?: MessagingQOS; +} + +interface MessagingConfiguration extends CommonMessagingProperties { + userName: string; + password: string; +} + +type MessageCallback = (message: string) => void; + +interface MessagingSubscribeOptions { + qos?: MessagingQOS; + invocationContext?: object; + onSuccess?: Function; + onFailure?: Function; + timeout?: number; +} + +interface MessagingStats { + user: APIUser; + URI: string; + endpoint: string; + systemKey: string; + + getAveragePayloadSize( + topic: string, + start: number, + stop: number, + callback: CbCallback + ): void; + getOpenConnections(callback: CbCallback): void; + getCurrentSubscribers(topic: string, callback: CbCallback): void; +} + +interface Edge { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + updateEdgeByName(name: string, object: object, callback: CbCallback): void; + deleteEdgeByName(name: string, callback: CbCallback): void; + create(newEdge: object, name: string, callback: CbCallback): void; + columns(callback: CbCallback): void; + count(query: Query, callback: CbCallback): void; +} + +interface Metrics { + user: APIUser; + URI: string; + systemKey: string; + + setQuery(query: Query): void; + getStatistics(callback: CbCallback): void; + getStatisticsHistory(callback: CbCallback): void; + getDBConnections(callback: CbCallback): void; + getLogs(callback: CbCallback): void; +} + +interface Device { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + getDeviceByName(name: string, callback: CbCallback): void; + updateDeviceByName( + name: string, + object: object, + trigger: boolean, + callback: CbCallback + ): void; + deleteDeviceByName(name: string, callback: CbCallback): void; + fetch(query: Query, callback: CbCallback): void; + update( + query: Query, + object: object, + trigger: boolean, + callback: CbCallback + ): void; + delete(query: Query, callback: CbCallback): void; + create(newDevice: object, callback: CbCallback): void; + columns(callback: CbCallback): void; + count(query: Query, callback: CbCallback): void; +} + +interface Analytics { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + getStorage(filter: QueryFilter, callback: CbCallback): void; + getCount(filter: QueryFilter, callback: CbCallback): void; + getEventList(filter: QueryFilter, callback: CbCallback): void; + getEventTotals(filter: QueryFilter, callback: CbCallback): void; + getUserEvents(filter: QueryFilter, callback: CbCallback): void; +} + +interface Portal { + name: string; + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + fetch(callback: CbCallback): void; + update(data: object, callback: CbCallback): void; +} + +interface Triggers { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + fetchDefinitions(callback: CbCallback): void; + create(name: string, data: object, callback: CbCallback): void; + update(name: string, data: object, callback: CbCallback): void; + delete(name: string, callback: CbCallback): void; +} + +declare var ClearBlade: ClearBladeGlobal; diff --git a/types/clearbladejs-client/tsconfig.json b/types/clearbladejs-client/tsconfig.json new file mode 100644 index 0000000000..7821d7db9e --- /dev/null +++ b/types/clearbladejs-client/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "target": "ES5", + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "clearbladejs-client-tests.ts", + "global.d.ts" + ], + "exclude": [ + "**/clearbladejs-node/*", + "**/clearbladejs-server/*" + ] +} \ No newline at end of file diff --git a/types/clearbladejs-client/tslint.json b/types/clearbladejs-client/tslint.json new file mode 100644 index 0000000000..d538486d5e --- /dev/null +++ b/types/clearbladejs-client/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "ban-types": false, + "no-empty-interface": false + } +} \ No newline at end of file diff --git a/types/clearbladejs-node/clearbladejs-node-tests.ts b/types/clearbladejs-node/clearbladejs-node-tests.ts new file mode 100644 index 0000000000..e9cb585d50 --- /dev/null +++ b/types/clearbladejs-node/clearbladejs-node-tests.ts @@ -0,0 +1,124 @@ +// Testing type definitions for clearbladejs-node 1.0 +// Project: https://github.com/ClearBlade/Node-SDK +// Definitions by: Jim Bouquet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { ClearBlade, Resp, QuerySortDirections, QueryConditions } from "."; + +// Sample code for clearbladejs Node SDK v1.0.0 used to test typescript definitions + +const genericCallback = (error: boolean, response: Resp) => {}; + +/////////////////////////////////////// +// ClearBlade object API invocations +/////////////////////////////////////// +ClearBlade.init({ + email: "a@a.com", + password: "a", + systemKey: "testkey", + systemSecret: "testsecret", + URI: "https://mycbplatform.com", + messagingURI: "mycbplatform.com", + callback: genericCallback +}); + +ClearBlade.setUser("test@test.com", "password"); +ClearBlade.registerUser("test@test.com", "password", genericCallback); +ClearBlade.isCurrentUserAuthenticated(genericCallback); +if (!ClearBlade.isObjectEmpty({prop: "test"})) { + ClearBlade.logger("Object is not empty"); +} + +ClearBlade.validateEmailPassword("test@test.com", "password"); + +ClearBlade.logoutUser(genericCallback); +ClearBlade.loginAnon(genericCallback); +ClearBlade.loginUser("test@test.com", "password", genericCallback); + +ClearBlade.sendPush([], {}, "appId: string", genericCallback); + +// execute(error: Object, response: Object, callback: ClearBladeCallback): void; +// makeKVPair(key: string, value: string): KeyValuePair; +// request(options: RequestOptions, callback: RequestCallback): void; + +const coll1 = ClearBlade.Collection("collectionID"); +const coll2 = ClearBlade.Collection({collectionName: "collectionName"}); +const coll3 = ClearBlade.Collection({collectionID: "collectionID"}); + +const query1 = ClearBlade.Query("collectionID"); +const query2 = ClearBlade.Query({offset: 5, limit: 5, collectionID: "collectionID"}); +const query3 = ClearBlade.Query({collectionName: "collectionName"}); +const query4 = ClearBlade.Query({collection: "collectionID"}); + +ClearBlade.addToQuery(query1, "key", "value"); +ClearBlade.addFilterToQuery(query1, QueryConditions.QUERY_GREATERTHAN, "key", "value"); +ClearBlade.addSortToQuery(query1, QuerySortDirections.QUERY_SORT_ASCENDING, "column1"); + +const opQueryStr = ClearBlade.parseOperationQuery(query1.query); +const parse1: string = ClearBlade.parseQuery(query1.query); +const parse2: string = ClearBlade.parseQuery(query1); + +const item1 = ClearBlade.Item({}, "hello"); +const item2 = ClearBlade.Item({}, {collectionID: "hello"}); + +const code = ClearBlade.Code(); +const user = ClearBlade.User(); + +const messaging = ClearBlade.Messaging({}, genericCallback); + +/////////////////////////////////////// +// Collection API invocations +/////////////////////////////////////// +coll1.fetch(query1, genericCallback); +coll1.create(ClearBlade.Item({}, ""), genericCallback); +coll1.update(query1.query, {}, genericCallback); +coll1.remove(query1.query, genericCallback); + +/////////////////////////////////////// +// Query API invocations +/////////////////////////////////////// +query1.ascending("string"); +query1.descending("string"); +query1.equalTo("string", "string"); +query1.greaterThan("string", 2); +query1.greaterThanEqualTo("string", false); +query1.lessThan("string", "string"); +query1.lessThanEqualTo("string", "string"); +query1.notEqualTo("string", "string"); +query1.or(query2); +query1.setPage(1, 1); +query1.fetch(genericCallback); +query1.update({}, genericCallback); +query1.remove(genericCallback); + +/////////////////////////////////////// +// Item API invocations +/////////////////////////////////////// +item1.save(); +item1.refresh(); +item1.destroy(); + +/////////////////////////////////////// +// Code API invocations +/////////////////////////////////////// +code.execute("codeName", {}, genericCallback); + +/////////////////////////////////////// +// User API invocations +/////////////////////////////////////// +user.getUser(genericCallback); +user.setUser({}, genericCallback); +user.allUsers(query1.query, genericCallback); + +/////////////////////////////////////// +// Messaging API invocations +/////////////////////////////////////// +messaging.getMessageHistory("topic: string", 5, 15, genericCallback); + +messaging.publish("topic: string", {}); + +messaging.subscribe("my/topic", {}, messageReceivedCb); + +function messageReceivedCb(message: string) { + messaging.unsubscribe("my/topic"); +} diff --git a/types/clearbladejs-node/index.d.ts b/types/clearbladejs-node/index.d.ts new file mode 100644 index 0000000000..192b1a97ee --- /dev/null +++ b/types/clearbladejs-node/index.d.ts @@ -0,0 +1,249 @@ +// Type definitions for clearbladejs-node 1.0 +// Project: https://github.com/ClearBlade/Node-SDK +// Definitions by: Jim Bouquet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +import { Response, RequestCallback } from "request/index"; +// import {//PacketCallback } from "mqtt"; + +export enum MessagingQOS { + MESSAGING_QOS_AT_MOST_ONCE = 0, + MESSAGING_QOS_AT_LEAST_ONCE = 1, + MESSAGING_QOS_EXACTLY_ONCE = 2 +} + +export interface Resp { + error(msg: any): never; + success(msg: any): never; +} + +export interface InitOptions { + systemKey: string; + systemSecret: string; + logging?: boolean; + callback?: CbCallback; + email?: string; + password?: string; + registerUser?: boolean; + useUser?: APIUser; + URI?: string; + messagingURI?: string; + messagingPort?: number; + defaultQoS?: MessagingQOS; + callTimeout?: number; +} + +export interface RequestOptions { + systemKey: string; + systemSecret: string; + method?: string; + endpoint?: string; + body?: string; + qs?: string; + URI?: string; + useUser?: boolean; + authToken?: string; + user?: APIUser; +} + +export interface APIUser { + email: string; + authToken: string; +} + +export interface KeyValuePair { + [key: string]: any; +} + +export type CbCallback = (error: boolean, response: Resp) => void; + +export default interface ClearBladeGlobal extends ClearBladeInt { + isCurrentUserAuthenticated(callback: CbCallback): void; +} + +export interface ClearBladeInt { + addToQuery(queryObj: QueryObj, key: string, value: string): void; + addFilterToQuery(queryObj: QueryObj, condition: QueryConditions, key: string, value: QueryValue): void; + addSortToQuery(queryObj: QueryObj, direction: QuerySortDirections, column: string): void; + Code(): Code; + Collection(options: string | CollectionOptionsWithName | CollectionOptionsWithID): Collection; + execute(error: object, response: object, callback: CbCallback): void; + init(options: InitOptions): void; + isObjectEmpty(obj: object): boolean; + Item(data: object, options: string | ItemOptions): Item; + logger(message: string): void; + loginAnon(callback: CbCallback): void; + loginUser(email: string, password: string, callback: CbCallback): void; + logoutUser(callback: CbCallback): void; + makeKVPair(key: string, value: string): KeyValuePair; + parseOperationQuery(query: Query): string; + parseQuery(query: Query | QueryObj): string; + Query(options: string | QueryOptionsWithCollection | QueryOptionsWithName | QueryOptionsWithID): QueryObj; + registerUser(email: string, password: string, callback: CbCallback): void; + request(options: RequestOptions, callback: RequestCallback): void; + setUser(email: string, password: string): void; + User(): AppUser; + Messaging(options: MessagingOptions, callback: CbCallback): Messaging; + sendPush(users: string[], payload: object, appId: string, callback: CbCallback): void; + validateEmailPassword(email: string, password: string): void; +} + +export interface CollectionOptionsWithName { + collectionName: string; +} + +export interface CollectionOptionsWithID { + collectionID: string; +} + +export interface Collection { + endpoint: string; + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + fetch(query: QueryObj, callback: CbCallback): void; + create(newItem: Item, callback: CbCallback): void; + update(query: Query, changes: object, callback: CbCallback): void; + remove(query: Query, callback: CbCallback): void; +} + +export enum QuerySortDirections { + QUERY_SORT_ASCENDING = 'ASC', + QUERY_SORT_DESCENDING = 'DESC' +} + +export enum QueryConditions { + QUERY_EQUAL = 'EQ', + QUERY_NOTEQUAL = 'NEQ', + QUERY_GREATERTHAN = 'GT', + QUERY_GREATERTHAN_EQUAL = 'GTE', + QUERY_LESSTHAN = 'LT', + QUERY_LESSTHAN_EQUAL = 'LTE', + QUERY_MATCHES = 'RE' +} + +export type QueryValue = string|number|boolean; + +export interface QueryOptions { + offset?: number; + limit?: number; +} + +export interface QueryOptionsWithCollection extends QueryOptions { + collection: string; +} + +export interface QueryOptionsWithName extends CollectionOptionsWithName, QueryOptions {} + +export interface QueryOptionsWithID extends CollectionOptionsWithID, QueryOptions {} + +export interface Query { + SELECTCOLUMNS?: string[]; + SORT?: QuerySortDirections; + FILTERS?: QueryFilter[]; + PAGESIZE?: number; + PAGENUM?: number; +} + +export interface QueryFilter { + [QueryConditions: string]: QueryFilterValue; +} + +export interface QueryFilterValue { + [name: string]: QueryValue; +} + +export interface QueryObj { + endpoint: string; + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + query: Query; + OR: Query[]; + offset: number; + limit: number; + + ascending(field: string): Query; + descending(field: string): Query; + equalTo(field: string, value: QueryValue): Query; + greaterThan(field: string, value: QueryValue): Query; + greaterThanEqualTo(field: string, value: QueryValue): Query; + lessThan(field: string, value: QueryValue): Query; + lessThanEqualTo(field: string, value: QueryValue): Query; + notEqualTo(field: string, value: QueryValue): Query; + matches(field: string, pattern: string): Query; + or(query: QueryObj): Query; + setPage(pageSize: number, pageNum: number): Query; + fetch(callback: CbCallback): void; + update(changes: object, callback: CbCallback): void; + remove(callback: CbCallback): void; +} + +export interface ItemOptions extends CollectionOptionsWithID {} + +export interface Item { + data: object; + + save(): void; + refresh(): void; + destroy(): void; +} + +export interface Code { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + callTimeout: number; + URIPrefix: string; + + execute(name: string, params: object, callback: CbCallback): void; +} + +export interface AppUser { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + getUser(callback: CbCallback): void; + setUser(data: object, callback: CbCallback): void; + allUsers(query: Query, callback: CbCallback): void; +} + +export interface Messaging { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + client: object; + + getMessageHistory(topic: string, startTime: number, count: number, callback: CbCallback): void; + publish(topic: string, payload: object): void; + subscribe(topic: string, options: MessagingSubscribeOptions, messageCallback: MessageCallback): void; + unsubscribe(topic: string, callback?: (error?: Error, packet?: object) => any): void; +} + +export interface CommonMessagingProperties { + hosts?: string; + ports?: string; +} + +export interface MessagingOptions extends CommonMessagingProperties { + qos?: MessagingQOS; +} + +export interface MessagingSubscribeOptions { + qos?: MessagingQOS; + timeout?: number; +} + +export type MessageCallback = (message: string) => void; + +export let ClearBlade: ClearBladeGlobal; diff --git a/types/clearbladejs-node/tsconfig.json b/types/clearbladejs-node/tsconfig.json new file mode 100644 index 0000000000..67aea82d3f --- /dev/null +++ b/types/clearbladejs-node/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compileOnSave": true, + "compilerOptions": { + "target": "ES5", + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "clearbladejs-node-tests.ts" + ], + "exclude": [ + "**/clearbladejs-client/*", + "**/clearbladejs-server/*" + ] +} \ No newline at end of file diff --git a/types/clearbladejs-node/tslint.json b/types/clearbladejs-node/tslint.json new file mode 100644 index 0000000000..2e3f95d861 --- /dev/null +++ b/types/clearbladejs-node/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-empty-interface": false, + "no-relative-import-in-test": false + } +} \ No newline at end of file diff --git a/types/clearbladejs-server/clearbladejs-server-tests.ts b/types/clearbladejs-server/clearbladejs-server-tests.ts new file mode 100644 index 0000000000..d240f181ea --- /dev/null +++ b/types/clearbladejs-server/clearbladejs-server-tests.ts @@ -0,0 +1,192 @@ +// Testing type definitions for clearbladejs-server 1.0 +// Project: https://github.com/ClearBlade/JavaScript-API +// Definitions by: Jim Bouquet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +const genericCallback = (error: boolean, response: Resp) => {}; + +/////////////////////////////////////// +// ClearBlade object API invocations +/////////////////////////////////////// +ClearBlade.init({ + systemKey: "abcdef", + systemSecret: "abcdefg", + callback: genericCallback +}); + +ClearBlade.init({request: { + isLogging: false, + params: { + param1: "1", + param2: 2 + }, + systemKey: "abcdef", + systemSecret: "abcdef", + userEmail: "test@test.com", + userToken: "abcdef", + userid: "abcdef", +}}); + +const about = ClearBlade.about(); +ClearBlade.setUser("test@test.com", "authtoken", "userId"); +ClearBlade.registerUser("test@test.com", "password", genericCallback); +ClearBlade.isCurrentUserAuthenticated(genericCallback); +ClearBlade.logoutUser(genericCallback); +ClearBlade.loginAnon(genericCallback); +ClearBlade.loginUser("test@test.com", "password", genericCallback); + +ClearBlade.getAllCollections(genericCallback); +const edgeID = ClearBlade.edgeId(); +const isEdge = ClearBlade.isEdge(genericCallback); +if (ClearBlade.isObjectEmpty({test: "test"})) { + ClearBlade.logger("Object is empty"); +} +const kvPair = ClearBlade.makeKVPair("key", "value"); + +const coll1 = ClearBlade.Collection("collectionID"); +const coll2 = ClearBlade.Collection({ collectionName: "collectionName" }); +const coll3 = ClearBlade.Collection({ collectionID: "collectionID" }); +const coll4 = ClearBlade.Collection({ collection: "collectionID" }); + +const query1 = ClearBlade.Query({ collectionID: "collectionID" }); +const query2 = ClearBlade.Query({ collectionName: "collectionName" }); +const query3 = ClearBlade.Query({ collection: "collectionID" }); + +const item1 = ClearBlade.Item({}, "collectionID"); +const item2 = ClearBlade.Item({}, { collectionID: "collectionID" }); + +const code = ClearBlade.Code(); +const deployment = ClearBlade.Deployment(); +const user = ClearBlade.User(); + +const messaging = ClearBlade.Messaging({}, genericCallback); + +const device = ClearBlade.Device(); + +ClearBlade.addToQuery(query1, "key", "value"); +ClearBlade.addSortToQuery( + query1, + QuerySortDirections.QUERY_SORT_ASCENDING, + "column1" +); +ClearBlade.addFilterToQuery( + query1, + QueryConditions.QUERY_GREATERTHAN, + "key", + "value" +); + +ClearBlade.newCollection("collectionName", genericCallback); + +const parseOperation = ClearBlade.parseOperationQuery(query1.query); +const parseQuery1 = ClearBlade.parseQuery(query1); +const parseQuery2 = ClearBlade.parseQuery(query1.query); + +ClearBlade.createDevice("devicename", {type: "devicetype"}, false, genericCallback); +ClearBlade.deleteDevice("devicename", true, genericCallback); +ClearBlade.updateDevice("devicename", {type: "devicetype"}, true, genericCallback); +ClearBlade.getDeviceByName("devicename", genericCallback); +ClearBlade.getAllDevicesForSystem(genericCallback); +ClearBlade.validateEmailPassword("test@test.com", "password"); + +/////////////////////////////////////// +// Collection API invocations +/////////////////////////////////////// +coll1.addColumn({name: "column1"}, genericCallback); +coll1.dropColumn("column1", genericCallback); +coll1.deleteCollection(genericCallback); +coll1.fetch(query1.query, genericCallback); +coll1.create(ClearBlade.Item({}, ""), genericCallback); +coll1.update(query1.query, {}, genericCallback); +coll1.remove(query1.query, genericCallback); +coll1.columns(genericCallback); +coll1.count(query1.query, genericCallback); + +/////////////////////////////////////// +// Query API invocations +/////////////////////////////////////// +query2.ascending("string"); +query1.descending("string"); +query1.equalTo("string", "string"); +query1.greaterThan("string", 2); +query1.greaterThanEqualTo("string", false); +query1.lessThan("string", "string"); +query1.lessThanEqualTo("string", "string"); +query1.notEqualTo("string", "string"); +query1.matches("string", ".*"); +query1.or(query2); +query1.setPage(1, 1); +query1.fetch(genericCallback); +query1.update({}, genericCallback); +query1.columns([]); +query1.remove(genericCallback); + +/////////////////////////////////////// +// Item API invocations +/////////////////////////////////////// +item1.save(); +item1.refresh(); +item1.destroy(); + +/////////////////////////////////////// +// Code API invocations +/////////////////////////////////////// +code.execute("codeName", {}, true, genericCallback); +code.getAllServices(genericCallback); + +/////////////////////////////////////// +// Deployment API invocations +/////////////////////////////////////// +deployment.create("deploymentname", "deployment description", {}, genericCallback); +deployment.update("deploymentname", {}, genericCallback); +deployment.delete("deploymentname", genericCallback); +deployment.read("deploymentname", genericCallback); +deployment.readAll(query1, genericCallback); + +/////////////////////////////////////// +// User API invocations +/////////////////////////////////////// +user.getUser(genericCallback); +user.setUser({}, genericCallback); +user.setUsers(query2, {name: "Fred"}, genericCallback); +user.allUsers(query1, genericCallback); +user.count(query1, genericCallback); + +/////////////////////////////////////// +// Messaging API invocations +/////////////////////////////////////// +messaging.getMessageHistoryWithTimeFrame("topic", 5, 10, 15, 20, genericCallback); +messaging.getMessageHistory("topic", 5, 15, genericCallback); +messaging.getAndDeleteMessageHistory("topic", 5, 10, 1, 20, genericCallback); +messaging.getCurrentTopics(genericCallback); +messaging.publish("topic", "payload"); + +/////////////////////////////////////// +// Device API invocations +/////////////////////////////////////// +device.fetch(query1.query, genericCallback); +device.update(query1.query, { object: Object }, genericCallback); +device.delete(query1.query, genericCallback); +device.create({ newDevice: Object }, genericCallback); + +/////////////////////////////////////// +// Triggers API invocations +/////////////////////////////////////// +ClearBlade.Trigger.Create( + "triggername", + { + system_key: "key", + name: "triggername", + def_module: TriggerModule.DEVICE, + def_name: "someName", + key_value_pairs: [], + service_name: "ServiceName" + }, + genericCallback); +ClearBlade.Trigger.Fetch("triggername", genericCallback); + +/////////////////////////////////////// +// Timers API invocations +/////////////////////////////////////// +ClearBlade.Timer.Create("timername", {}, genericCallback); +ClearBlade.Timer.Fetch("timername", genericCallback); diff --git a/types/clearbladejs-server/global.d.ts b/types/clearbladejs-server/global.d.ts new file mode 100644 index 0000000000..d6e2e88a70 --- /dev/null +++ b/types/clearbladejs-server/global.d.ts @@ -0,0 +1,5 @@ +declare global { + var ClearBlade: ClearBladeGlobal; +} + +export {}; diff --git a/types/clearbladejs-server/index.d.ts b/types/clearbladejs-server/index.d.ts new file mode 100644 index 0000000000..fb3ef065ce --- /dev/null +++ b/types/clearbladejs-server/index.d.ts @@ -0,0 +1,335 @@ +// Type definitions for clearbladejs-server 1.0 +// Project: https://docs.clearblade.com/v/3/4-developer_reference/platformsdk/ClearBlade.js/ +// Definitions by: Jim Bouquet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +interface BasicReq { + readonly isLogging: boolean; + readonly params: { + [id: string]: any; + }; + readonly systemKey: string; + readonly systemSecret: string; + readonly userEmail: string; + readonly userToken: string; + readonly userid: string; +} +type ReqTypes = BasicReq; +declare var req: ReqTypes; +interface Resp { + error(msg: any): never; + success(msg: any): never; +} +declare var resp: Resp; + +declare enum MessagingQOS { + MESSAGING_QOS_AT_MOST_ONCE = 0, + MESSAGING_QOS_AT_LEAST_ONCE = 1, + MESSAGING_QOS_EXACTLY_ONCE = 2 +} + +interface InitOptions { + systemKey: string; + systemSecret: string; + logging?: boolean; + callback?: CbCallback; + authToken?: string; + userToken?: string; + email?: string; + password?: string; + registerUser?: boolean; + useUser?: APIUser; + URI?: string; + messagingURI?: string; + messagingPort?: number; + defaultQoS?: MessagingQOS; + callTimeout?: number; +} + +interface APIUser { + email: string; + authToken: string; + user_id?: string; +} + +interface KeyValuePair { + [key: string]: any; +} + +type CbCallback = (error: boolean, response: Resp) => void; + +interface ClearBladeGlobal extends ClearBladeInt { + user: APIUser; +} + +interface ClearBladeInt { + Trigger: TriggerClass; + Timer: TimerClass; + + about(): string; + addToQuery(queryObj: QueryObj, key: string, value: string): void; + addFilterToQuery(queryObj: QueryObj, condition: QueryConditions, key: string, value: QueryValue): void; + addSortToQuery(queryObj: QueryObj, direction: QuerySortDirections, column: string): void; + Code(): Code; + Collection(options: string | CollectionOptionsWithName | CollectionOptionsWithID | CollectionOptionsWithCollection): Collection; + Deployment(): Deployment; + Device(): Device; + edgeId(): string; + execute(error: object, response: object, callback: CbCallback): any; + getAllCollections(callback: CbCallback): void; + http(): object; + init(options: InitOptions | {request: BasicReq}): void; + isEdge(callback: CbCallback): boolean; + isCurrentUserAuthenticated(callback: CbCallback): void; + isObjectEmpty(obj: object): boolean; + Item(data: object, options: string | ItemOptions): Item; + logger(message: string): void; + loginAnon(callback: CbCallback): void; + loginUser(email: string, password: string, callback: CbCallback): void; + logoutUser(callback: CbCallback): void; + makeKVPair(key: string, value: string): KeyValuePair; + Messaging(options: MessagingOptions, callback: CbCallback): Messaging; + newCollection(name: string, callback: CbCallback): void; + Query(options: QueryOptionsWithCollection | QueryOptionsWithName | QueryOptionsWithID): QueryObj; + parseOperationQuery(query: Query): string; + parseQuery(query: Query | QueryObj): string; + registerUser(email: string, password: string, callback: CbCallback): void; + setUser(email: string, authToken: string, userId: string): void; + User(): AppUser; + + createDevice(name: string, data: object, causeTrigger: boolean, callback: CbCallback): void; + deleteDevice(name: string, causeTrigger: boolean, callback: CbCallback): void; + updateDevice(name: string, data: object, causeTrigger: boolean, callback: CbCallback): void; + getDeviceByName(name: string, callback: CbCallback): void; + getAllDevicesForSystem(callback: CbCallback): void; + validateEmailPassword(email: string, password: string): void; +} + +interface CollectionOptionsWithCollection { + collection: string; +} + +interface CollectionOptionsWithName { + collectionName: string; +} + +interface CollectionOptionsWithID { + collectionID: string; +} + +interface Collection { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + addColumn(options: object, callback: CbCallback): void; + dropColumn(name: string, callback: CbCallback): void; + deleteCollection(callback: CbCallback): void; + fetch(query: Query, callback: CbCallback): void; + create(newItem: Item, callback: CbCallback): void; + update(query: Query, changes: object, callback: CbCallback): void; + remove(query: Query, callback: CbCallback): void; + columns(callback: CbCallback): void; + count(query: Query, callback: CbCallback): void; +} + +declare enum QuerySortDirections { + QUERY_SORT_ASCENDING = 'ASC', + QUERY_SORT_DESCENDING = 'DESC' +} + +declare enum QueryConditions { + QUERY_EQUAL = 'EQ', + QUERY_NOTEQUAL = 'NEQ', + QUERY_GREATERTHAN = 'GT', + QUERY_GREATERTHAN_EQUAL = 'GTE', + QUERY_LESSTHAN = 'LT', + QUERY_LESSTHAN_EQUAL = 'LTE', + QUERY_MATCHES = 'RE' +} + +type QueryValue = string|number|boolean; + +interface QueryOptions { + offset?: number; + limit?: number; +} + +interface QueryOptionsWithCollection extends CollectionOptionsWithCollection, QueryOptions {} + +interface QueryOptionsWithName extends CollectionOptionsWithName, QueryOptions {} + +interface QueryOptionsWithID extends CollectionOptionsWithID, QueryOptions {} + +interface Query { + SELECTCOLUMNS?: string[]; + SORT?: QuerySortDirections; + FILTERS?: QueryFilter[]; + PAGESIZE?: number; + PAGENUM?: number; +} + +interface QueryFilter { + [QueryConditions: string]: QueryFilterValue; +} + +interface QueryFilterValue { + [name: string]: QueryValue; +} + +interface QueryObj { + id: string; + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + query: Query; + OR: Query[]; + offset: number; + limit: number; + + ascending(field: string): void; + descending(field: string): void; + equalTo(field: string, value: QueryValue): void; + greaterThan(field: string, value: QueryValue): void; + greaterThanEqualTo(field: string, value: QueryValue): void; + lessThan(field: string, value: QueryValue): void; + lessThanEqualTo(field: string, value: QueryValue): void; + notEqualTo(field: string, value: QueryValue): void; + matches(field: string, pattern: QueryValue): void; + or(query: QueryObj): void; + setPage(pageSize: number, pageNum: number): void; + fetch(callback: CbCallback): void; + update(changes: object, callback: CbCallback): void; + columns(columnsArray: string[]): void; + remove(callback: CbCallback): void; +} + +interface ItemOptions extends CollectionOptionsWithID {} + +interface Item { + data: object; + + save(): void; + refresh(): void; + destroy(): void; +} + +interface Code { + user: APIUser; + systemKey: string; + systemSecret: string; + + execute(name: string, params: object, loggingEnabled: boolean, callback: CbCallback): void; + getAllServices(callback: CbCallback): void; +} + +interface DeploymentOptions {} + +interface Deployment { + user: APIUser; + systemKey: string; + systemSecret: string; + + create(name: string, description: string, options: DeploymentOptions, callback: CbCallback): void; + update(name: string, options: DeploymentOptions, callback: CbCallback): void; + delete(name: string, callback: CbCallback): void; + read(name: string, callback: CbCallback): void; + readAll(query: QueryObj, callback: CbCallback): void; +} + +interface AppUser { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + getUser(callback: CbCallback): void; + setUser(data: object, callback: CbCallback): void; + setUsers(query: QueryObj, data: object, callback: CbCallback): void; + allUsers(query: QueryObj, callback: CbCallback): void; + count(query: QueryObj, callback: CbCallback): void; +} + +interface Messaging { + user: APIUser; + systemKey: string; + systemSecret: string; + + getMessageHistoryWithTimeFrame(topic: string, count: number, last: number, start: number, stop: number, callback: CbCallback): void; + getMessageHistory(topic: string, start: number, count: number, callback: CbCallback): void; + getAndDeleteMessageHistory(topic: string, count: number, last: number, start: number, stop: number, callback: CbCallback): void; + getCurrentTopics(callback: CbCallback): void; + publish(topic: string, payload: string | ArrayBuffer): void; +} + +interface MessagingOptions {} + +interface Device { + URI: string; + systemKey: string; + systemSecret: string; + + fetch(query: Query, callback: CbCallback): void; + update(query: Query, changes: object, callback: CbCallback): void; + delete(query: Query, callback: CbCallback): void; + create(newDevice: object, callback: CbCallback): void; +} + +declare enum TriggerModule { + DEVICE = "Device", + Data = "Data", + MESSAGING = "Messaging", + USER = "User" +} + +interface TriggerCreateOptions { + system_key: string; + name: string; + def_module: TriggerModule; + def_name: string; + key_value_pairs: KeyValuePair[]; + service_name: string; +} + +interface TriggerClass { + Create(name: string, options: TriggerCreateOptions, callback: CbCallback): void; + Fetch(name: string, callback: CbCallback): void; +} + +interface TimerCreateOptions { + description?: string; + start_time?: Date; + repeats?: number; + frequency?: number; + service_name?: string; + user_id?: string; + user_token?: string; +} + +interface TimerClass { + Create(name: string, options: TimerCreateOptions, callback: CbCallback): void; + Fetch(name: string, callback: CbCallback): void; +} + +interface TriggerInstance { + name: string; + systemKey: string; + + Update(options: object, callback: CbCallback): void; + Delete(callback: CbCallback): void; +} + +interface TimerInstance { + name: string; + systemKey: string; + + Update(options: object, callback: CbCallback): void; + Delete(callback: CbCallback): void; +} + +declare var ClearBlade: ClearBladeGlobal; diff --git a/types/clearbladejs-server/tsconfig.json b/types/clearbladejs-server/tsconfig.json new file mode 100644 index 0000000000..b549e1c685 --- /dev/null +++ b/types/clearbladejs-server/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "target": "ES5", + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "clearbladejs-server-tests.ts", + "global.d.ts" + ], + "exclude": [ + "**/clearbladejs-client/*", + "**/clearbladejs-node/*" + ] +} \ No newline at end of file diff --git a/types/clearbladejs-server/tslint.json b/types/clearbladejs-server/tslint.json new file mode 100644 index 0000000000..6a6f758e67 --- /dev/null +++ b/types/clearbladejs-server/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-empty-interface": false + } +} \ No newline at end of file diff --git a/types/clmtrackr/clmtrackr-tests.ts b/types/clmtrackr/clmtrackr-tests.ts new file mode 100644 index 0000000000..8a38e4361c --- /dev/null +++ b/types/clmtrackr/clmtrackr-tests.ts @@ -0,0 +1,26 @@ +import clm from "clmtrackr"; + +const ctracker = new clm.tracker(); + +console.log(clm.version); + +ctracker.init({ + constantVelocity: true, + searchWindow: 11, + useWebGL: true, + scoreThreshold: 0.50, + stopOnConvergence: false, + /** object with parameters for facedetection : */ + faceDetection: { useWebWorkers: true} +}); + +const video = document.getElementsByTagName("video")[0]; +ctracker.start(video); +const positions = ctracker.getCurrentPosition(); +if (positions) { + const canvas = document.getElementsByTagName("canvas")[0]; + ctracker.draw(canvas); + positions.forEach(([x, y]) => { + const sum: number = x + y; + }); +} diff --git a/types/clmtrackr/index.d.ts b/types/clmtrackr/index.d.ts new file mode 100644 index 0000000000..a0c778ed00 --- /dev/null +++ b/types/clmtrackr/index.d.ts @@ -0,0 +1,55 @@ +// Type definitions for clmtrackr 1.1 +// Project: https://github.com/auduno/clmtrackr +// Definitions by: hellochar +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface TrackerParams { + /** whether to use constant velocity model when fitting (default is true) */ + constantVelocity?: boolean; + /** the size of the searchwindow around each point (default is 11) */ + searchWindow?: number; + /** whether to use webGL if it is available (default is true) */ + useWebGL?: boolean; + /** threshold for when to assume we've lost tracking (default is 0.50) */ + scoreThreshold?: number; + /** whether to stop tracking when the fitting has converged (default is false) */ + stopOnConvergence?: boolean; + /** object with parameters for facedetection : */ + faceDetection?: { + /** whether to use web workers for face detection (default is true) */ + useWebWorkers?: boolean; + }; +} + +type IPosition = [number, number]; + +type Model = any; + +declare namespace _default { + class tracker { + constructor(params?: TrackerParams); + + init(model?: Model): void; + + start(element: HTMLVideoElement | HTMLCanvasElement): void; + + track(element: HTMLVideoElement | HTMLCanvasElement): IPosition[] | false; + + reset(): void; + + getConvergence(): number; + + getCurrentParameters(): number[]; + + getCurrentPosition(): IPosition[] | false; + + getScore(): number; + + draw(canvas: HTMLCanvasElement): void; + + setResponseMode(type: "single" | "cycle" | "blend", list: Array<"raw" | "sobel" | "lbp">): void; + } + const version: string; +} + +export default _default; diff --git a/types/clmtrackr/tsconfig.json b/types/clmtrackr/tsconfig.json new file mode 100644 index 0000000000..54d471be5c --- /dev/null +++ b/types/clmtrackr/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "clmtrackr-tests.ts" + ] +} diff --git a/types/clmtrackr/tslint.json b/types/clmtrackr/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/clmtrackr/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/codemirror/index.d.ts b/types/codemirror/index.d.ts index ef075b9d45..06c3b39f96 100644 --- a/types/codemirror/index.d.ts +++ b/types/codemirror/index.d.ts @@ -669,7 +669,7 @@ declare namespace CodeMirror { /** Returns a {from, to} object (both holding document positions), indicating the current position of the marked range, or undefined if the marker is no longer in the document. */ - find(): CodeMirror.Range; + find(): {from: CodeMirror.Position, to: CodeMirror.Position}; /** Returns an object representing the options for the marker. If copyWidget is given true, it will clone the value of the replacedWith option, if any. */ getOptions(copyWidget: boolean): CodeMirror.TextMarkerOptions; diff --git a/types/colors/colors-tests.ts b/types/colors/colors-tests.ts deleted file mode 100644 index fcac0323f6..0000000000 --- a/types/colors/colors-tests.ts +++ /dev/null @@ -1,21 +0,0 @@ -import colors = require("colors"); -import { zalgo } from "colors/safe"; - -let str: string; - -str = zalgo(""); - -colors.enabled = true; - -str = colors.black.underline('test'); -str = colors.rainbow.black.blue.gray('test'); -str = colors.random.reset.bgWhite.dim('test'); -str = colors.random.reset.bgWhite.strip('test'); -str = 'test'.black.underline; -str = 'test'.rainbow.black.blue.gray; -str = 'test'.random.reset.bgWhite.dim; -str = 'test'.random.reset.bgWhite.dim.stripColors; - -colors.enabled = false; - -str = colors.black.underline('test'); diff --git a/types/colors/index.d.ts b/types/colors/index.d.ts deleted file mode 100644 index a5494aa945..0000000000 --- a/types/colors/index.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -// Type definitions for Colors.js 1.1 -// Project: https://github.com/Marak/colors.js -// Definitions by: Bart van der Schoor , Staffan Eketorp -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export interface Color { - (text: string): string; - - strip: Color; - stripColors: Color; - - black: Color; - red: Color; - green: Color; - yellow: Color; - blue: Color; - magenta: Color; - cyan: Color; - white: Color; - gray: Color; - grey: Color; - - bgBlack: Color; - bgRed: Color; - bgGreen: Color; - bgYellow: Color; - bgBlue: Color; - bgMagenta: Color; - bgCyan: Color; - bgWhite: Color; - - reset: Color; - bold: Color; - dim: Color; - italic: Color; - underline: Color; - inverse: Color; - hidden: Color; - strikethrough: Color; - - rainbow: Color; - zebra: Color; - america: Color; - trap: Color; - random: Color; - zalgo: Color; -} - -export function setTheme(theme: any): void; - -export let enabled: boolean; - -export const strip: Color; -export const stripColors: Color; - -export const black: Color; -export const red: Color; -export const green: Color; -export const yellow: Color; -export const blue: Color; -export const magenta: Color; -export const cyan: Color; -export const white: Color; -export const gray: Color; -export const grey: Color; - -export const bgBlack: Color; -export const bgRed: Color; -export const bgGreen: Color; -export const bgYellow: Color; -export const bgBlue: Color; -export const bgMagenta: Color; -export const bgCyan: Color; -export const bgWhite: Color; - -export const reset: Color; -export const bold: Color; -export const dim: Color; -export const italic: Color; -export const underline: Color; -export const inverse: Color; -export const hidden: Color; -export const strikethrough: Color; - -export const rainbow: Color; -export const zebra: Color; -export const america: Color; -export const trap: Color; -export const random: Color; -export const zalgo: Color; - -declare global { - interface String { - strip: string; - stripColors: string; - - black: string; - red: string; - green: string; - yellow: string; - blue: string; - magenta: string; - cyan: string; - white: string; - gray: string; - grey: string; - - bgBlack: string; - bgRed: string; - bgGreen: string; - bgYellow: string; - bgBlue: string; - bgMagenta: string; - bgCyan: string; - bgWhite: string; - - reset: string; - bold: string; - dim: string; - italic: string; - underline: string; - inverse: string; - hidden: string; - strikethrough: string; - - rainbow: string; - zebra: string; - america: string; - trap: string; - random: string; - zalgo: string; - } -} diff --git a/types/colors/safe.d.ts b/types/colors/safe.d.ts deleted file mode 100644 index 306b656b2b..0000000000 --- a/types/colors/safe.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -export const enabled: boolean; - -export function strip(str: string): string; -export function stripColors(str: string): string; - -export function black(str: string): string; -export function red(str: string): string; -export function green(str: string): string; -export function yellow(str: string): string; -export function blue(str: string): string; -export function magenta(str: string): string; -export function cyan(str: string): string; -export function white(str: string): string; -export function gray(str: string): string; -export function grey(str: string): string; - -export function bgBlack(str: string): string; -export function bgRed(str: string): string; -export function bgGreen(str: string): string; -export function bgYellow(str: string): string; -export function bgBlue(str: string): string; -export function bgMagenta(str: string): string; -export function bgCyan(str: string): string; -export function bgWhite(str: string): string; - -export function reset(str: string): string; -export function bold(str: string): string; -export function dim(str: string): string; -export function italic(str: string): string; -export function underline(str: string): string; -export function inverse(str: string): string; -export function hidden(str: string): string; -export function strikethrough(str: string): string; - -export function rainbow(str: string): string; -export function zebra(str: string): string; -export function america(str: string): string; -export function trap(str: string): string; -export function random(str: string): string; -export function zalgo(str: string): string; diff --git a/types/command-line-usage/command-line-usage-tests.ts b/types/command-line-usage/command-line-usage-tests.ts new file mode 100644 index 0000000000..05dfadc7f3 --- /dev/null +++ b/types/command-line-usage/command-line-usage-tests.ts @@ -0,0 +1,24 @@ +import commandLineUsage = require("command-line-usage"); + +const sections = [ + { + header: 'A typical app', + content: 'Generates something {italic very} important.' + }, + { + header: 'Options', + optionList: [ + { + name: 'input', + typeLabel: '{underline file}', + description: 'The input to process.' + }, + { + name: 'help', + description: 'Print this usage guide.' + } + ] + } +]; + +const usage = commandLineUsage(sections); diff --git a/types/command-line-usage/index.d.ts b/types/command-line-usage/index.d.ts new file mode 100644 index 0000000000..ac4f1d7606 --- /dev/null +++ b/types/command-line-usage/index.d.ts @@ -0,0 +1,48 @@ +// Type definitions for command-line-usage 5.0 +// Project: https://github.com/75lb/command-line-usage#readme +// Definitions by: Andrija Dvorski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare namespace commandLineUsage { + interface Section { + list: string[]; + + add(content: object): void; + emptyLine(): void; + header(text: string): void; + toString(): string; + } + + interface SectionData { + optionList?: OptionListData[]; + hide?: string[]; + group?: string[]; + header?: string; + reverseNameOrder?: boolean; + tableOptions?: any; + } + + interface OptionListData extends SectionData { + name: string; + typeLabel?: string; + description?: string; + } + + interface ContentSectionData extends SectionData { + content: string; + raw?: boolean; + } + + type CommandLineUsageInput = + SectionData + | SectionData[] + | OptionListData + | OptionListData[] + | ContentSectionData + | ContentSectionData[]; +} + +declare function commandLineUsage(sections: commandLineUsage.CommandLineUsageInput): string | undefined | commandLineUsage.Section; + +export = commandLineUsage; diff --git a/types/command-line-usage/tsconfig.json b/types/command-line-usage/tsconfig.json new file mode 100644 index 0000000000..9deee9ab63 --- /dev/null +++ b/types/command-line-usage/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", + "command-line-usage-tests.ts" + ] +} diff --git a/types/command-line-usage/tslint.json b/types/command-line-usage/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/command-line-usage/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/component-emitter/index.d.ts b/types/component-emitter/index.d.ts index 95682f6ca4..b55a1673ab 100644 --- a/types/component-emitter/index.d.ts +++ b/types/component-emitter/index.d.ts @@ -13,9 +13,9 @@ interface Emitter { hasListeners(event: string): boolean; } -declare const constructor: { +declare const Emitter: { (obj?: any): Emitter; new (obj?: any): Emitter; }; -export = constructor; +export = Emitter; diff --git a/types/cosmiconfig/cosmiconfig-tests.ts b/types/cosmiconfig/cosmiconfig-tests.ts new file mode 100644 index 0000000000..2676c58407 --- /dev/null +++ b/types/cosmiconfig/cosmiconfig-tests.ts @@ -0,0 +1,41 @@ +import cosmiconfig = require("cosmiconfig"); + +const asyncExplorer = cosmiconfig("yourModuleName", { + packageProp: "yourModuleName", + rc: ".yourModuleNamerc", + js: "yourModuleName.config.js", + rcStrictJson: false, + rcExtensions: false, + stopDir: "someDir", + cache: true, + sync: false, + transform: ({ config, filePath }) => ({ config, filePath }), + format: "js" +}); + +Promise.all([ + asyncExplorer.load(), + asyncExplorer.load("start/search/here"), + asyncExplorer.load(null, "load/this/file.json") +]).then(result => result); + +asyncExplorer.load().then(({ config, filePath }) => ({ config, filePath })); + +asyncExplorer.clearFileCache(); +asyncExplorer.clearDirectoryCache(); +asyncExplorer.clearCaches(); + +const syncExplorer = cosmiconfig("yourModuleName", { + packageProp: "yourModuleName", + rc: ".yourModuleNamerc", + js: "yourModuleName.config.js", + rcStrictJson: false, + rcExtensions: false, + stopDir: "someDir", + cache: true, + sync: true, + transform: ({ config, filePath }) => ({ config, filePath }), + format: "js" +}); + +const { config, filePath } = syncExplorer.load(); diff --git a/types/cosmiconfig/index.d.ts b/types/cosmiconfig/index.d.ts new file mode 100644 index 0000000000..032f570d6f --- /dev/null +++ b/types/cosmiconfig/index.d.ts @@ -0,0 +1,63 @@ +// Type definitions for cosmiconfig 4.0 +// Project: https://github.com/davidtheclark/cosmiconfig +// Definitions by: ozum +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +interface Result { + config: object; + filePath: string; +} + +interface Options { + packageProp?: string | false; + rc?: string | false; + js?: string | false; + rcStrictJson?: boolean; + rcExtensions?: boolean; + stopDir?: string; + cache?: boolean; + transform?: (result: Result) => Promise | Result; + configPath?: string; + format?: "json" | "yaml" | "js"; +} + +// Default is false and makes load() method async +interface AsyncOptions extends Options { + sync?: false; +} + +// Makes load() method sync +interface SyncOptions extends Options { + sync: true; +} + +interface Explorer { + clearFileCache(): void; + clearDirectoryCache(): void; + clearCaches(): void; +} + +interface AsyncExplorer extends Explorer { + // You should provide either searchPath or configPath for load method. To disallow both, overloaded definitions added. + load(searchPath?: string): Promise; + load(searchPath: null | undefined, configPath?: string): Promise; +} + +interface SyncExplorer extends Explorer { + // You should provide either searchPath or configPath for load method. To disallow both, overloaded definitions added. + load(searchPath?: string): Result; + load(searchPath: null | undefined, configPath?: string): Result; +} + +declare function cosmiconfig( + moduleName: string, + options: SyncOptions +): SyncExplorer; + +declare function cosmiconfig( + moduleName: string, + options?: AsyncOptions +): AsyncExplorer; + +export = cosmiconfig; diff --git a/types/cosmiconfig/tsconfig.json b/types/cosmiconfig/tsconfig.json new file mode 100644 index 0000000000..6f0f0ac3a2 --- /dev/null +++ b/types/cosmiconfig/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "cosmiconfig-tests.ts"] +} diff --git a/types/cosmiconfig/tslint.json b/types/cosmiconfig/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cosmiconfig/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/create-react-class/create-react-class-tests.ts b/types/create-react-class/create-react-class-tests.ts index b8025b23f0..3d7536d722 100644 --- a/types/create-react-class/create-react-class-tests.ts +++ b/types/create-react-class/create-react-class-tests.ts @@ -11,7 +11,7 @@ interface State { bar: number; } -const props: Props & React.ClassAttributes<{}> = { +const props: Props = { foo: "foo" }; diff --git a/types/cron/cron-tests.ts b/types/cron/cron-tests.ts index 7eea73eeed..21e28f9c0f 100644 --- a/types/cron/cron-tests.ts +++ b/types/cron/cron-tests.ts @@ -47,7 +47,12 @@ var job = new CronJob({ start: false, timeZone: 'America/Los_Angeles' }); +console.log(job.lastDate()); +console.log(job.nextDates(1)); +console.log(job.running); +job.setTime(new CronTime('00 30 11 * * 1-2')); job.start(); +job.stop(); // How to check if a cron pattern is valid: try { diff --git a/types/cron/index.d.ts b/types/cron/index.d.ts index 780890c014..b27bfdf90c 100644 --- a/types/cron/index.d.ts +++ b/types/cron/index.d.ts @@ -1,25 +1,118 @@ -// Type definitions for cron 1.2 +// Type definitions for cron 1.3 // Project: https://www.npmjs.com/package/cron // Definitions by: Hiroki Horiuchi +// Lundarl Gholoi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export declare class CronTime { + /** + * Create a new ```CronTime```. + * @param source The time to fire off your job. This can be in the form of cron syntax or a JS ```Date``` object. + * @param zone Timezone name. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/). + */ + constructor(source: string | Date, zone?: string); + /** + * Tells you when ```CronTime``` will be run. + * @param i Indicate which turn of run after now. If not given return next run time. + */ + public sendAt(i?: number): Date; + /** + * Get the number of milliseconds in the future at which to fire our callbacks. + */ + public getTimeout(): number; +} -interface CronJobStatic { - new (cronTime: string | Date, onTick: () => void, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean): CronJob; - new (options: { - cronTime: string | Date; onTick: () => void; onComplete?: () => void; start?: boolean; timeZone?: string; context?: any; runOnInit?: boolean - }): CronJob; +export declare interface CronJobParameters { + /** + * The time to fire off your job. This can be in the form of cron syntax or a JS ```Date``` object. + */ + cronTime: string | Date; + /** + * The function to fire at the specified time. + */ + onTick: () => void; + /** + * A function that will fire when the job is complete, when it is stopped. + */ + onComplete?: () => void; + /** + * Specifies whether to start the job just before exiting the constructor. By default this is set to false. If left at default you will need to call ```job.start()``` in order to start the job (assuming ```job``` is the variable you set the cronjob to). This does not immediately fire your onTick function, it just gives you more control over the behavior of your jobs. + */ + start?: boolean; + /** + * Specify the timezone for the execution. This will modify the actual time relative to your timezone. If the timezone is invalid, an error is thrown. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/). + */ + timeZone?: string; + /** + * The context within which to execute the onTick method. This defaults to the cronjob itself allowing you to call ```this.stop()```. However, if you change this you'll have access to the functions and values within your context object. + */ + context?: any; + /** + * This will immediately fire your ```onTick``` function as soon as the requisit initialization has happened. This option is set to ```false``` by default for backwards compatibility. + */ + runOnInit?: boolean; } -interface CronJob { - start(): void; - stop(): void; - running: boolean | undefined; -} -export declare var CronJob: CronJobStatic; -interface CronTimeStatic { - new (time: string | Date): CronTime; +export declare class CronJob { + /** + * Return ```true``` if job is running. + */ + public running: boolean | undefined; + /** + * Function using to fire ```onTick```, default set to an inner private function. Overwrite this only if you have a really good reason to do so. + */ + public fireOnTick: Function; + + /** + * Create a new ```CronJob```. + * @param cronTime The time to fire off your job. This can be in the form of cron syntax or a JS ```Date``` object. + * @param onTick The function to fire at the specified time. + * @param onComplete A function that will fire when the job is complete, when it is stopped. + * @param start Specifies whether to start the job just before exiting the constructor. By default this is set to false. If left at default you will need to call ```job.start()``` in order to start the job (assuming ```job``` is the variable you set the cronjob to). This does not immediately fire your onTick function, it just gives you more control over the behavior of your jobs. + * @param timeZone Specify the timezone for the execution. This will modify the actual time relative to your timezone. If the timezone is invalid, an error is thrown. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/). + * @param context The context within which to execute the onTick method. This defaults to the cronjob itself allowing you to call ```this.stop()```. However, if you change this you'll have access to the functions and values within your context object. + * @param runOnInit This will immediately fire your ```onTick``` function as soon as the requisit initialization has happened. This option is set to ```false``` by default for backwards compatibility. + */ + constructor(cronTime: string | Date, onTick: () => void, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean); + /** + * Create a new ```CronJob```. + * @param options Job parameters. + */ + constructor(options: CronJobParameters); + + /** + * Runs your job. + */ + public start(): void; + /** + * Stops your job. + */ + public stop(): void; + /** + * Change the time for the ```CronJob```. + * @param time Target time. + */ + public setTime(time: CronTime): void; + /** + * Tells you the last execution date. + */ + public lastDate(): Date; + /** + * Tells you when a ```CronTime``` will be run. + * @param i Indicate which turn of run after now. If not given return next run time. + */ + public nextDates(i?: number): Date; + /** + * Add another ```onTick``` function. + * @param callback Target function. + */ + public addCallback(callback: Function): void; } -interface CronTime { } -export declare var CronTime: CronTimeStatic; + +export declare var job: + ((cronTime: string | Date, onTick: () => void, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean) => CronJob) + | ((options: CronJobParameters) => CronJob); +export declare var time: (source: string | Date, zone?: string) => CronTime; +export declare var sendAt: (cronTime: CronTime) => Date; +export declare var timeout: (cronTime: CronTime) => number; diff --git a/types/crypto-js/crypto-js-tests.ts b/types/crypto-js/crypto-js-tests.ts index 9b5dd1be6f..59f1d684ed 100644 --- a/types/crypto-js/crypto-js-tests.ts +++ b/types/crypto-js/crypto-js-tests.ts @@ -4,9 +4,11 @@ import CryptoJS = require('crypto-js'); var wordArray: CryptoJS.WordArray; wordArray = CryptoJS.MD5('some message'); wordArray = CryptoJS.MD5('some message', 'some key'); +wordArray = CryptoJS.MD5('some message', { any: true }); wordArray = CryptoJS.SHA1('some message'); wordArray = CryptoJS.SHA1('some message', 'some key', { any: true }); +wordArray = CryptoJS.SHA1('some message', { any: true }); wordArray = CryptoJS.format.OpenSSL('some message'); wordArray = CryptoJS.format.OpenSSL('some message', 'some key'); diff --git a/types/crypto-js/index.d.ts b/types/crypto-js/index.d.ts index c066204df2..db9ed6c30e 100644 --- a/types/crypto-js/index.d.ts +++ b/types/crypto-js/index.d.ts @@ -8,7 +8,6 @@ export as namespace CryptoJS; declare var CryptoJS: CryptoJS.Hashes; declare namespace CryptoJS { - type Hash = (message: string | LibWordArray, key?: string | WordArray, ...options: any[]) => WordArray; interface Cipher { encrypt(message: string, secretPassphrase: string | WordArray, option?: CipherOption): WordArray; decrypt(encryptedMessage: string | WordArray, secretPassphrase: string | WordArray, option?: CipherOption): DecryptedMessage; @@ -54,23 +53,40 @@ declare namespace CryptoJS { interface Padding {} export interface Hashes { - MD5: Hash; - SHA1: Hash; - SHA256: Hash; - SHA224: Hash; - SHA512: Hash; - SHA384: Hash; - SHA3: Hash; - RIPEMD160: Hash; - HmacMD5: Hash; - HmacSHA1: Hash; - HmacSHA256: Hash; - HmacSHA224: Hash; - HmacSHA512: Hash; - HmacSHA384: Hash; - HmacSHA3: Hash; - HmacRIPEMD160: Hash; - PBKDF2: Hash; + MD5(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + MD5(message: string | LibWordArray, ...options: any[]): WordArray; + SHA1(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA1(message: string | LibWordArray, ...options: any[]): WordArray; + SHA256(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA256(message: string | LibWordArray, ...options: any[]): WordArray; + SHA224(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA224(message: string | LibWordArray, ...options: any[]): WordArray; + SHA512(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA512(message: string | LibWordArray, ...options: any[]): WordArray; + SHA384(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA384(message: string | LibWordArray, ...options: any[]): WordArray; + SHA3(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA3(message: string | LibWordArray, ...options: any[]): WordArray; + RIPEMD160(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + RIPEMD160(message: string | LibWordArray, ...options: any[]): WordArray; + HmacMD5(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacMD5(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA1(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA1(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA256(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA256(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA224(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA224(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA512(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA512(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA384(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA384(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA3(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA3(message: string | LibWordArray, ...options: any[]): WordArray; + HmacRIPEMD160(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacRIPEMD160(message: string | LibWordArray, ...options: any[]): WordArray; + PBKDF2(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + PBKDF2(message: string | LibWordArray, ...options: any[]): WordArray; AES: Cipher; DES: Cipher; TripleDES: Cipher; diff --git a/types/cucumber/index.d.ts b/types/cucumber/index.d.ts index d0fc9085fd..d93ad4c7b2 100644 --- a/types/cucumber/index.d.ts +++ b/types/cucumber/index.d.ts @@ -95,7 +95,7 @@ export namespace pickle { locations: Location[]; name: string; steps: Step[]; - tags: string[]; + tags: Tag[]; } interface Location { @@ -117,6 +117,11 @@ export namespace pickle { location: Location; value: string; } + + interface Tag { + name: string; + location: Location; + } } export type HookCode = (this: World, scenario: HookScenarioResult, callback?: CallbackStepDefinition) => void; diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts index b04ac2276e..4da9cd9ca0 100644 --- a/types/cytoscape/index.d.ts +++ b/types/cytoscape/index.d.ts @@ -8,7 +8,7 @@ // // Translation from Objects in help to Typescript interface. // http://js.cytoscape.org/#notation/functions -// +// TypeScript Version: 2.2 /** * cy --> Cy.Core @@ -3145,7 +3145,7 @@ declare namespace cytoscape { /** * http://js.cytoscape.org/#style/node-body */ - interface Node extends PaddingNode { + interface Node extends Partial, PaddingNode { "label"?: string; /** * The width of the node’s body. @@ -3320,7 +3320,7 @@ declare namespace cytoscape { "pie-i-background-opacity": number; } - interface Edge extends EdgeLine, EdgeArror { } + interface Edge extends EdgeLine, EdgeArror, Partial { } /** * These properties affect the styling of an edge’s line: diff --git a/types/d3-fetch/d3-fetch-tests.ts b/types/d3-fetch/d3-fetch-tests.ts index 941955c996..9712a0da15 100644 --- a/types/d3-fetch/d3-fetch-tests.ts +++ b/types/d3-fetch/d3-fetch-tests.ts @@ -49,3 +49,14 @@ promise1 = d3Fetch.tsv(url); promise1 = d3Fetch.tsv(url, init); promise2 = d3Fetch.tsv(url, parseRow); promise2 = d3Fetch.tsv(url, init, parseRow); + +let docPromise: Promise; +docPromise = d3Fetch.html(url); +docPromise = d3Fetch.html(url, init); + +docPromise = d3Fetch.svg(url); +docPromise = d3Fetch.svg(url, init); + +let xmlDocPromise: Promise; +xmlDocPromise = d3Fetch.xml(url); +xmlDocPromise = d3Fetch.xml(url, init); diff --git a/types/d3-fetch/index.d.ts b/types/d3-fetch/index.d.ts index 3eb11ce48a..6e31d70a76 100644 --- a/types/d3-fetch/index.d.ts +++ b/types/d3-fetch/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for d3-fetch 1.0 +// Type definitions for d3-fetch 1.1 // Project: https://d3js.org/d3-fetch/ // Definitions by: Hugues Stefanski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -// Last module patch version validated against: 1.0.1 +// Last module patch version validated against: 1.1.0 import { DSVParsedArray, DSVRowString, DSVRowAny } from 'd3-dsv'; @@ -146,6 +146,16 @@ export function dsv( row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null ): Promise>; +/** + * Fetches the file at the specified input URL as text, parses it as HTML and returns a Promise of an HTML DOM Document. + * + * If init is specified, it is passed along to the underlying call to fetch. + * + * @param url A valid URL string. + * @param init An optional request initialization object. + */ +export function html(url: string, init?: RequestInit): Promise; + /** * Fetches the image at the specified input URL and returns a promise of an HTML image element. * @@ -168,6 +178,16 @@ export function image(url: string, init?: {[key: string]: any}): Promise(url: string, init?: RequestInit): Promise; +/** + * Fetches the file at the specified input URL as text, parses it as SVG and returns a Promise of an SVG Document. + * + * If init is specified, it is passed along to the underlying call to fetch. + * + * @param url A valid URL string. + * @param init An optional request initialization object. + */ +export function svg(url: string, init?: RequestInit): Promise; + /** * Fetches the text file at the specified input URL and returns it as a Promise of a string. * @@ -234,3 +254,13 @@ export function tsv( init: RequestInit, row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null ): Promise>; + +/** + * Fetches the file at the specified input URL as text, parses it as XML and returns a Promise of an XML Document. + * + * If init is specified, it is passed along to the underlying call to fetch. + * + * @param url A valid URL string. + * @param init An optional request initialization object. + */ +export function xml(url: string, init?: RequestInit): Promise; diff --git a/types/d3-geo/d3-geo-tests.ts b/types/d3-geo/d3-geo-tests.ts index c4508351a0..51ddb93d89 100644 --- a/types/d3-geo/d3-geo-tests.ts +++ b/types/d3-geo/d3-geo-tests.ts @@ -89,7 +89,33 @@ const sampleExtendedFeatureCollection: d3Geo.ExtendedFeatureCollection = { + type: 'Feature', + geometry: null, + properties: null +}; +const sampleExtendedNullableFeature: d3Geo.ExtendedFeature = { + type: 'Feature', + geometry: null, + properties: null +}; + +const sampleNullableFeatureCollection: GeoJSON.FeatureCollection = { + type: 'FeatureCollection', + features: [ + sampleNullableFeature, + sampleNullableFeature + ] +}; + +const sampleExtendedNullableFeatureCollection: d3Geo.ExtendedFeatureCollection = { + type: 'FeatureCollection', + features: [ + sampleExtendedNullableFeature, + sampleExtendedNullableFeature + ] +}; // ---------------------------------------------------------------------- // Spherical Math // ---------------------------------------------------------------------- @@ -101,10 +127,14 @@ area = d3Geo.geoArea(sampleSphere); area = d3Geo.geoArea(sampleGeometryCollection); area = d3Geo.geoArea(sampleExtendedGeometryCollection); area = d3Geo.geoArea(sampleFeature); +area = d3Geo.geoArea(sampleNullableFeature); area = d3Geo.geoArea(sampleExtendedFeature1); area = d3Geo.geoArea(sampleExtendedFeature2); +area = d3Geo.geoArea(sampleExtendedNullableFeature); area = d3Geo.geoArea(sampleFeatureCollection); +area = d3Geo.geoArea(sampleNullableFeatureCollection); area = d3Geo.geoArea(sampleExtendedFeatureCollection); +area = d3Geo.geoArea(sampleExtendedNullableFeatureCollection); // geoBounds(...) ========================================================= @@ -113,10 +143,14 @@ bounds = d3Geo.geoBounds(sampleSphere); bounds = d3Geo.geoBounds(sampleGeometryCollection); bounds = d3Geo.geoBounds(sampleExtendedGeometryCollection); bounds = d3Geo.geoBounds(sampleFeature); +bounds = d3Geo.geoBounds(sampleNullableFeature); bounds = d3Geo.geoBounds(sampleExtendedFeature1); bounds = d3Geo.geoBounds(sampleExtendedFeature2); +bounds = d3Geo.geoBounds(sampleExtendedNullableFeature); bounds = d3Geo.geoBounds(sampleFeatureCollection); +bounds = d3Geo.geoBounds(sampleNullableFeatureCollection); bounds = d3Geo.geoBounds(sampleExtendedFeatureCollection); +bounds = d3Geo.geoBounds(sampleExtendedNullableFeatureCollection); // geoCentroid(...) ======================================================= @@ -125,10 +159,14 @@ centroid = d3Geo.geoCentroid(sampleSphere); centroid = d3Geo.geoCentroid(sampleGeometryCollection); centroid = d3Geo.geoCentroid(sampleExtendedGeometryCollection); centroid = d3Geo.geoCentroid(sampleFeature); +centroid = d3Geo.geoCentroid(sampleNullableFeature); centroid = d3Geo.geoCentroid(sampleExtendedFeature1); centroid = d3Geo.geoCentroid(sampleExtendedFeature2); +centroid = d3Geo.geoCentroid(sampleExtendedNullableFeature); centroid = d3Geo.geoCentroid(sampleFeatureCollection); +centroid = d3Geo.geoCentroid(sampleNullableFeatureCollection); centroid = d3Geo.geoCentroid(sampleExtendedFeatureCollection); +centroid = d3Geo.geoCentroid(sampleExtendedNullableFeatureCollection); // geoContains(...) ======================================================= @@ -137,10 +175,14 @@ contained = d3Geo.geoContains(sampleSphere, [0, 0]); contained = d3Geo.geoContains(sampleGeometryCollection, [0, 0]); contained = d3Geo.geoContains(sampleExtendedGeometryCollection, [0, 0]); contained = d3Geo.geoContains(sampleFeature, [0, 0]); +contained = d3Geo.geoContains(sampleNullableFeature, [0, 0]); contained = d3Geo.geoContains(sampleExtendedFeature1, [0, 0]); contained = d3Geo.geoContains(sampleExtendedFeature2, [0, 0]); +contained = d3Geo.geoContains(sampleExtendedNullableFeature, [0, 0]); contained = d3Geo.geoContains(sampleFeatureCollection, [0, 0]); +contained = d3Geo.geoContains(sampleNullableFeatureCollection, [0, 0]); contained = d3Geo.geoContains(sampleExtendedFeatureCollection, [0, 0]); +contained = d3Geo.geoContains(sampleExtendedNullableFeatureCollection, [0, 0]); // geoDistance(...) ======================================================= @@ -153,10 +195,14 @@ length = d3Geo.geoLength(sampleSphere); length = d3Geo.geoLength(sampleGeometryCollection); length = d3Geo.geoLength(sampleExtendedGeometryCollection); length = d3Geo.geoLength(sampleFeature); +length = d3Geo.geoLength(sampleNullableFeature); length = d3Geo.geoLength(sampleExtendedFeature1); length = d3Geo.geoLength(sampleExtendedFeature2); +length = d3Geo.geoLength(sampleExtendedNullableFeature); length = d3Geo.geoLength(sampleFeatureCollection); +length = d3Geo.geoLength(sampleNullableFeatureCollection); length = d3Geo.geoLength(sampleExtendedFeatureCollection); +length = d3Geo.geoLength(sampleExtendedNullableFeatureCollection); // geoInterpolate(...) ==================================================== @@ -181,7 +227,7 @@ const inverted: [number, number] = rotation.invert([54, 2]); // Create GeoCircleGenerator ============================================ // simple use case -let circleGeneratorSimple: d3Geo.GeoCircleGenerator = d3Geo.geoCircle(); +let circleGeneratorSimple: d3Geo.GeoCircleGenerator = d3Geo.geoCircle(); // complex use as part of object class Circulator { @@ -331,8 +377,9 @@ const naturalEart1Raw: d3Geo.GeoRawProjection = d3Geo.geoNaturalEarth1Raw(); // Use Raw Projection ===================================================== const rawProjectionPoint: [number, number] = azimuthalEqualAreaRaw(54, 2); -const rawProjectionInvertedPoint: [number, number] = azimuthalEqualAreaRaw.invert(180, 6); - +if (azimuthalEqualAreaRaw.invert) { + const rawProjectionInvertedPoint: [number, number] = azimuthalEqualAreaRaw.invert(180, 6); +} // ---------------------------------------------------------------------- // Pre-Defined Projections // ---------------------------------------------------------------------- @@ -365,8 +412,10 @@ let constructedProjection: d3Geo.GeoProjection = mutate(); // Use Projection ========================================================== -const projected: [number, number] = constructedProjection([54, 2]); -const inverted2: [number, number] = constructedProjection.invert([54, 2]); +const projected: [number, number] | null = constructedProjection([54, 2]); +if (constructedProjection.invert) { + const inverted2: [number, number] | null = constructedProjection.invert([54, 2]); +} // TODO ????? // let stream: d3Geo.Stream = constructedProjection.stream([54, 2]); @@ -378,7 +427,7 @@ constructedProjection = constructedProjection.preclip(d3Geo.geoClipCircle(45)); const postClip: (stream: d3Geo.GeoStream) => d3Geo.GeoStream = constructedProjection.postclip(); constructedProjection = constructedProjection.postclip(d3Geo.geoClipRectangle(0, 0, 1, 1)); -const clipAngle: number = constructedProjection.clipAngle(); +const clipAngle: number | null = constructedProjection.clipAngle(); constructedProjection = constructedProjection.clipAngle(null); constructedProjection = constructedProjection.clipAngle(45); @@ -395,6 +444,9 @@ constructedProjection = constructedProjection.translate([480, 250]); const center: [number, number] = constructedProjection.center(); constructedProjection = constructedProjection.center([0, 0]); +const angle = constructedProjection.angle(); +constructedProjection = constructedProjection.angle(45); + const rotate: [number, number, number] = constructedProjection.rotate(); constructedProjection = constructedProjection.rotate([0, 0]); constructedProjection = constructedProjection.rotate([0, 0, 0]); @@ -407,40 +459,56 @@ constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sa constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleGeometryCollection); constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleExtendedGeometryCollection); constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleFeature); +constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleNullableFeature); constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleExtendedFeature1); constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleExtendedFeature2); +constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleExtendedNullableFeature); constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleFeatureCollection); +constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleNullableFeatureCollection); constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleExtendedFeatureCollection); +constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleExtendedNullableFeatureCollection); constructedProjection = constructedProjection.fitSize([960, 500], samplePolygon); constructedProjection = constructedProjection.fitSize([960, 500], sampleSphere); constructedProjection = constructedProjection.fitSize([960, 500], sampleGeometryCollection); constructedProjection = constructedProjection.fitSize([960, 500], sampleExtendedGeometryCollection); constructedProjection = constructedProjection.fitSize([960, 500], sampleFeature); +constructedProjection = constructedProjection.fitSize([960, 500], sampleNullableFeature); constructedProjection = constructedProjection.fitSize([960, 500], sampleExtendedFeature1); constructedProjection = constructedProjection.fitSize([960, 500], sampleExtendedFeature2); +constructedProjection = constructedProjection.fitSize([960, 500], sampleExtendedNullableFeature); constructedProjection = constructedProjection.fitSize([960, 500], sampleFeatureCollection); +constructedProjection = constructedProjection.fitSize([960, 500], sampleNullableFeatureCollection); constructedProjection = constructedProjection.fitSize([960, 500], sampleExtendedFeatureCollection); +constructedProjection = constructedProjection.fitSize([960, 500], sampleExtendedNullableFeatureCollection); constructedProjection = constructedProjection.fitWidth(960, samplePolygon); constructedProjection = constructedProjection.fitWidth(960, sampleSphere); constructedProjection = constructedProjection.fitWidth(960, sampleGeometryCollection); constructedProjection = constructedProjection.fitWidth(960, sampleExtendedGeometryCollection); constructedProjection = constructedProjection.fitWidth(960, sampleFeature); +constructedProjection = constructedProjection.fitWidth(960, sampleNullableFeature); constructedProjection = constructedProjection.fitWidth(960, sampleExtendedFeature1); constructedProjection = constructedProjection.fitWidth(960, sampleExtendedFeature2); +constructedProjection = constructedProjection.fitWidth(960, sampleExtendedNullableFeature); constructedProjection = constructedProjection.fitWidth(960, sampleFeatureCollection); +constructedProjection = constructedProjection.fitWidth(960, sampleNullableFeatureCollection); constructedProjection = constructedProjection.fitWidth(960, sampleExtendedFeatureCollection); +constructedProjection = constructedProjection.fitWidth(960, sampleExtendedNullableFeatureCollection); constructedProjection = constructedProjection.fitHeight(500, samplePolygon); constructedProjection = constructedProjection.fitHeight(500, sampleSphere); constructedProjection = constructedProjection.fitHeight(500, sampleGeometryCollection); constructedProjection = constructedProjection.fitHeight(500, sampleExtendedGeometryCollection); constructedProjection = constructedProjection.fitHeight(500, sampleFeature); +constructedProjection = constructedProjection.fitHeight(500, sampleNullableFeature); constructedProjection = constructedProjection.fitHeight(500, sampleExtendedFeature1); constructedProjection = constructedProjection.fitHeight(500, sampleExtendedFeature2); +constructedProjection = constructedProjection.fitHeight(500, sampleExtendedNullableFeature); constructedProjection = constructedProjection.fitHeight(500, sampleFeatureCollection); +constructedProjection = constructedProjection.fitHeight(500, sampleNullableFeatureCollection); constructedProjection = constructedProjection.fitHeight(500, sampleExtendedFeatureCollection); +constructedProjection = constructedProjection.fitHeight(500, sampleExtendedNullableFeatureCollection); // ---------------------------------------------------------------------- // GeoConicProjection interface @@ -468,7 +536,7 @@ const minimalRenderingContextMockUp: d3Geo.GeoContext = { // Create geoPath Generator ============================================= -let geoPathCanvas: d3Geo.GeoPath; +let geoPathCanvas: d3Geo.GeoPath; geoPathCanvas = d3Geo.geoPath(); geoPathCanvas = d3Geo.geoPath(null); geoPathCanvas = d3Geo.geoPath(null, null); @@ -484,8 +552,8 @@ geoPathSVG = d3Geo.geoPath(); geoPathSVG = geoPathSVG.projection(conicConformal); @@ -498,13 +566,13 @@ const geoPathConicProjection: d3Geo.GeoConicProjection = geoPathSVG.projection, 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 +// Last module patch version validated against: 1.10.0 import * as GeoJSON from 'geojson'; @@ -31,9 +31,11 @@ export type GeoGeometryObjects = GeoJSON.GeometryObject | GeoSphere; /** * A GeoJSON-style GeometryCollection which supports GeoJSON geometry objects - * and additionally GeoSphere + * and additionally GeoSphere. + * + * The generic refers to the type(s) of d3-geo geometry objects contained in the collection. */ -export interface ExtendedGeometryCollection { +export interface ExtendedGeometryCollection { type: string; bbox?: number[]; crs?: { @@ -45,9 +47,18 @@ export interface ExtendedGeometryCollection extends GeoJSON.GeoJsonObject { +export interface ExtendedFeature< + GeometryType extends GeoGeometryObjects | null = GeoGeometryObjects | null, + Properties extends GeoJSON.GeoJsonProperties = GeoJSON.GeoJsonProperties + > extends GeoJSON.GeoJsonObject { geometry: GeometryType; properties: Properties; id?: string | number; @@ -56,8 +67,10 @@ export interface ExtendedFeature> extends GeoJSON.GeoJsonObject { +export interface ExtendedFeatureCollection extends GeoJSON.GeoJsonObject { features: FeatureType[]; } @@ -65,8 +78,7 @@ export interface ExtendedFeatureCollection - | ExtendedFeature | ExtendedFeatureCollection>; +export type GeoPermissibleObjects = GeoGeometryObjects | ExtendedGeometryCollection | ExtendedFeature | ExtendedFeatureCollection; // ---------------------------------------------------------------------- // Spherical Math @@ -78,14 +90,14 @@ export type GeoPermissibleObjects = GeoGeometryObjects | ExtendedGeometryCollect * * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ -export function geoArea(object: ExtendedFeature): number; +export function geoArea(object: ExtendedFeature): number; /** * Returns the spherical area of the specified feature collection in steradians. * This is the spherical equivalent of path.area. * * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). */ -export function geoArea(object: ExtendedFeatureCollection>): number; +export function geoArea(object: ExtendedFeatureCollection): number; /** * Returns the spherical area of the specified GeoJson Geometry Object or GeoSphere object in steradians. * This is the spherical equivalent of path.area. @@ -99,7 +111,7 @@ export function geoArea(object: GeoGeometryObjects): number; * * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ -export function geoArea(object: ExtendedGeometryCollection): number; +export function geoArea(object: ExtendedGeometryCollection): number; /** * Returns the spherical bounding box for the specified feature. The bounding box is represented by a two-dimensional array: [[left, bottom], [right, top]], @@ -109,7 +121,7 @@ export function geoArea(object: ExtendedGeometryCollection): * * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ -export function geoBounds(object: ExtendedFeature): [[number, number], [number, number]]; +export function geoBounds(object: ExtendedFeature): [[number, number], [number, number]]; /** * Returns the spherical bounding box for the specified feature collection. The bounding box is represented by a two-dimensional array: [[left, bottom], [right, top]], * where left is the minimum longitude, bottom is the minimum latitude, right is maximum longitude, and top is the maximum latitude. All coordinates are given in degrees. @@ -118,7 +130,7 @@ export function geoBounds(object: ExtendedFeature): [[n * * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). */ -export function geoBounds(object: ExtendedFeatureCollection>): [[number, number], [number, number]]; +export function geoBounds(object: ExtendedFeatureCollection): [[number, number], [number, number]]; /** * Returns the spherical bounding box for the specified GeoJson Geometry Object or GeoSphere object. The bounding box is represented by a two-dimensional array: [[left, bottom], [right, top]], * where left is the minimum longitude, bottom is the minimum latitude, right is maximum longitude, and top is the maximum latitude. All coordinates are given in degrees. @@ -136,7 +148,7 @@ export function geoBounds(object: GeoGeometryObjects): [[number, number], [numbe * * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ -export function geoBounds(object: ExtendedGeometryCollection): [[number, number], [number, number]]; +export function geoBounds(object: ExtendedGeometryCollection): [[number, number], [number, number]]; /** * Returns the spherical centroid of the specified feature in steradians. @@ -144,14 +156,14 @@ export function geoBounds(object: ExtendedGeometryCollection * * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ -export function geoCentroid(object: ExtendedFeature): [number, number]; +export function geoCentroid(object: ExtendedFeature): [number, number]; /** * Returns the spherical centroid of the specified feature collection in steradians. * This is the spherical equivalent of path.centroid. * * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). */ -export function geoCentroid(object: ExtendedFeatureCollection>): [number, number]; +export function geoCentroid(object: ExtendedFeatureCollection): [number, number]; /** * Returns the spherical centroid of the specified GeoJson Geometry Object or GeoSphere object in steradians. * This is the spherical equivalent of path.centroid. @@ -165,7 +177,7 @@ export function geoCentroid(object: GeoGeometryObjects): [number, number]; * * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ -export function geoCentroid(object: ExtendedGeometryCollection): [number, number]; +export function geoCentroid(object: ExtendedGeometryCollection): [number, number]; /** * Returns true if and only if the specified GeoJSON object contains the specified point, or false if the object does not contain the point. @@ -175,7 +187,7 @@ export function geoCentroid(object: ExtendedGeometryCollection, point: [number, number]): boolean; +export function geoContains(object: ExtendedFeature, point: [number, number]): boolean; /** * Returns true if and only if the specified GeoJSON object contains the specified point, or false if the object does not contain the point. * The point must be specified as a two-element array [longitude, latitude] in degrees. For Point and MultiPoint geometries, an exact test is used; @@ -184,7 +196,7 @@ export function geoContains(object: ExtendedFeature, po * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). * @param point Point specified as a two-element array [longitude, latitude] in degrees. */ -export function geoContains(object: ExtendedFeatureCollection>, point: [number, number]): boolean; +export function geoContains(object: ExtendedFeatureCollection, point: [number, number]): boolean; /** * Returns true if and only if the specified GeoJSON object contains the specified point, or false if the object does not contain the point. * The point must be specified as a two-element array [longitude, latitude] in degrees. For Point and MultiPoint geometries, an exact test is used; @@ -202,7 +214,7 @@ export function geoContains(object: GeoGeometryObjects, point: [number, number]) * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). * @param point Point specified as a two-element array [longitude, latitude] in degrees. */ -export function geoContains(object: ExtendedGeometryCollection, point: [number, number]): boolean; +export function geoContains(object: ExtendedGeometryCollection, point: [number, number]): boolean; /** * Returns the great-arc distance in radians between the two points a and b. @@ -219,14 +231,14 @@ export function geoDistance(a: [number, number], b: [number, number]): number; * * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ -export function geoLength(object: ExtendedFeature): number; +export function geoLength(object: ExtendedFeature): number; /** * Returns the great-arc length of the specified feature collection in radians. For polygons, returns the perimeter of the exterior ring plus that of any interior rings. * This is the spherical equivalent of path.measure. * * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). */ -export function geoLength(object: ExtendedFeatureCollection>): number; +export function geoLength(object: ExtendedFeatureCollection): number; /** * Returns the great-arc length of the specified GeoJson Geometry Object or GeoSphere object in radians. For polygons, returns the perimeter of the exterior ring plus that of any interior rings. * This is the spherical equivalent of path.measure. @@ -240,7 +252,7 @@ export function geoLength(object: GeoGeometryObjects): number; * * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ -export function geoLength(object: ExtendedGeometryCollection): number; +export function geoLength(object: ExtendedGeometryCollection): number; /** * Returns an interpolator function given two points a and b. @@ -291,7 +303,7 @@ export function geoRotation(angles: [number, number] | [number, number, number]) * * The second generic corresponds to the type of the Datum which will be passed into the geo circle generator. */ -export interface GeoCircleGenerator { +export interface GeoCircleGenerator { /** * Returns a new GeoJSON geometry object of type “Polygon” approximating a circle on the surface of a sphere, * with the current center, radius and precision. Any arguments are passed to the accessors. @@ -362,7 +374,7 @@ export interface GeoCircleGenerator { /** * Returns a new geo circle generator */ -export function geoCircle(): GeoCircleGenerator; +export function geoCircle(): GeoCircleGenerator; /** * Returns a new geo circle generator * @@ -547,7 +559,7 @@ export interface GeoStream { * @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; +export function geoStream(object: ExtendedFeature, stream: GeoStream): void; /** * Streams the specified GeoJSON object to the specified projection stream. While both features and geometry objects are supported as input, @@ -556,7 +568,7 @@ export function geoStream(object: ExtendedFeature, stre * @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; +export function geoStream(object: ExtendedFeatureCollection, stream: GeoStream): void; /** * Streams the specified GeoJSON object to the specified projection stream. While both features and geometry objects are supported as input, @@ -574,7 +586,7 @@ export function geoStream(object: GeoGeometryObjects, stream: GeoStream): void; * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). * @param stream A projection stream. */ -export function geoStream(object: ExtendedGeometryCollection, stream: GeoStream): void; +export function geoStream(object: ExtendedGeometryCollection, stream: GeoStream): void; // ---------------------------------------------------------------------- // Projections @@ -736,7 +748,7 @@ export interface GeoProjection extends GeoStreamWrapper { * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeature): this; + fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeature): this; /** * Sets the projection’s scale and translate to fit the specified geographic feature collection in the center of the given extent. * Returns the projection. @@ -746,7 +758,7 @@ export interface GeoProjection extends GeoStreamWrapper { * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature collection). */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeatureCollection>): this; + fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeatureCollection): this; /** * Sets the projection’s scale and translate to fit the specified geographic geometry object in the center of the given extent. * Returns the projection. @@ -766,7 +778,7 @@ export interface GeoProjection extends GeoStreamWrapper { * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedGeometryCollection): this; + fitExtent(extent: [[number, number], [number, number]], object: ExtendedGeometryCollection): this; /** * Sets the projection’s scale and translate to fit the specified geographic feature in the center of an extent with the given size and top-left corner of [0, 0]. @@ -777,7 +789,7 @@ export interface GeoProjection extends GeoStreamWrapper { * @param size The size of the extent, specified as an array [width, height]. * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ - fitSize(size: [number, number], object: ExtendedFeature): this; + fitSize(size: [number, number], object: ExtendedFeature): this; /** * Sets the projection’s scale and translate to fit the specified geographic feature collection in the center of an extent with the given size and top-left corner of [0, 0]. * Returns the projection. @@ -787,7 +799,7 @@ export interface GeoProjection extends GeoStreamWrapper { * @param size The size of the extent, specified as an array [width, height]. * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature collection). */ - fitSize(size: [number, number], object: ExtendedFeatureCollection>): this; + fitSize(size: [number, number], object: ExtendedFeatureCollection): this; /** * Sets the projection’s scale and translate to fit the specified geographic geometry object in the center of an extent with the given size and top-left corner of [0, 0]. * Returns the projection. @@ -807,7 +819,7 @@ export interface GeoProjection extends GeoStreamWrapper { * @param size The size of the extent, specified as an array [width, height]. * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ - fitSize(size: [number, number], object: ExtendedGeometryCollection): this; + fitSize(size: [number, number], object: ExtendedGeometryCollection): this; /** * A convenience method for projection.fitSize where the height is automatically chosen from the aspect ratio of object and the given constraint on width. @@ -815,14 +827,14 @@ export interface GeoProjection extends GeoStreamWrapper { * @param width The width of the extent. * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ - fitWidth(width: number, object: ExtendedFeature): this; + fitWidth(width: number, object: ExtendedFeature): this; /** * A convenience method for projection.fitSize where the height is automatically chosen from the aspect ratio of object and the given constraint on width. * * @param width The width of the extent. * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). */ - fitWidth(width: number, object: ExtendedFeatureCollection>): this; + fitWidth(width: number, object: ExtendedFeatureCollection): this; /** * A convenience method for projection.fitSize where the height is automatically chosen from the aspect ratio of object and the given constraint on width. * @@ -836,7 +848,7 @@ export interface GeoProjection extends GeoStreamWrapper { * @param width The width of the extent. * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ - fitWidth(width: number, object: ExtendedGeometryCollection): this; + fitWidth(width: number, object: ExtendedGeometryCollection): this; /** * A convenience method for projection.fitSize where the width is automatically chosen from the aspect ratio of object and the given constraint on height. @@ -844,14 +856,14 @@ export interface GeoProjection extends GeoStreamWrapper { * @param height The height of the extent. * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ - fitHeight(height: number, object: ExtendedFeature): this; + fitHeight(height: number, object: ExtendedFeature): this; /** * A convenience method for projection.fitSize where the width is automatically chosen from the aspect ratio of object and the given constraint on height. * * @param height The height of the extent. * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). */ - fitHeight(height: number, object: ExtendedFeatureCollection>): this; + fitHeight(height: number, object: ExtendedFeatureCollection): this; /** * A convenience method for projection.fitSize where the width is automatically chosen from the aspect ratio of object and the given constraint on height. * @@ -865,7 +877,7 @@ export interface GeoProjection extends GeoStreamWrapper { * @param height The height of the extent. * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ - fitHeight(height: number, object: ExtendedGeometryCollection): this; + fitHeight(height: number, object: ExtendedGeometryCollection): this; /** * Returns a new array [longitude, latitude] in degrees representing the unprojected point of the given projected point. @@ -887,7 +899,15 @@ export interface GeoProjection extends GeoStreamWrapper { * @param precision A numeric value in pixels to use as the threshold for the projection’s adaptive resampling. */ precision(precision: number): this; - + /** + * Returns the projection’s current angle, which defaults to 0°. + */ + angle(): number; + /** + * Sets the projection’s post-projection planar rotation angle to the specified angle in degrees and returns the projection. + * @param angle The new rotation angle of the projection. + */ + angle(angle: number): this; /** * Returns the current rotation [lambda, phi, gamma] specifying the rotation angles in degrees about each spherical axis. * (These correspond to yaw, pitch and roll.) which defaults [0, 0, 0]. @@ -1004,7 +1024,7 @@ export interface GeoContext { * * The second generic corresponds to the type of the DatumObject which will be passed into the geo path generator for rendering. */ -export interface GeoPath { +export interface GeoPath { /** * Renders the given object, which may be any GeoJSON feature or geometry object: * @@ -1214,7 +1234,7 @@ export interface GeoPath { * @param context An (optional) rendering context to be used. If a context is provided, it must at least implement the interface described by GeoContext, a subset of the CanvasRenderingContext2D API. * Setting the context to "null" means that the path generator will return an SVG path string representing the to be rendered object. The default is "null". */ -export function geoPath(projection?: GeoProjection | GeoStreamWrapper | null, context?: GeoContext | null): GeoPath; +export function geoPath(projection?: GeoProjection | GeoStreamWrapper | null, context?: GeoContext | null): GeoPath; /** * Creates a new geographic path generator with the default settings. * @@ -1517,7 +1537,7 @@ export interface GeoIdentityTranform extends GeoStreamWrapper { * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeature): this; + fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeature): this; /** * Sets the projection’s scale and translate to fit the specified geographic feature collection in the center of the given extent. * Returns the projection. @@ -1527,7 +1547,7 @@ export interface GeoIdentityTranform extends GeoStreamWrapper { * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature collection). */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeatureCollection>): this; + fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeatureCollection): this; /** * Sets the projection’s scale and translate to fit the specified geographic geometry object in the center of the given extent. * Returns the projection. @@ -1547,7 +1567,7 @@ export interface GeoIdentityTranform extends GeoStreamWrapper { * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedGeometryCollection): this; + fitExtent(extent: [[number, number], [number, number]], object: ExtendedGeometryCollection): this; /** * Sets the projection’s scale and translate to fit the specified geographic feature in the center of an extent with the given size and top-left corner of [0, 0]. @@ -1558,7 +1578,7 @@ export interface GeoIdentityTranform extends GeoStreamWrapper { * @param size The size of the extent, specified as an array [width, height]. * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ - fitSize(size: [number, number], object: ExtendedFeature): this; + fitSize(size: [number, number], object: ExtendedFeature): this; /** * Sets the projection’s scale and translate to fit the specified geographic feature collection in the center of an extent with the given size and top-left corner of [0, 0]. * Returns the projection. @@ -1568,7 +1588,7 @@ export interface GeoIdentityTranform extends GeoStreamWrapper { * @param size The size of the extent, specified as an array [width, height]. * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature collection). */ - fitSize(size: [number, number], object: ExtendedFeatureCollection>): this; + fitSize(size: [number, number], object: ExtendedFeatureCollection): this; /** * Sets the projection’s scale and translate to fit the specified geographic geometry object in the center of an extent with the given size and top-left corner of [0, 0]. * Returns the projection. @@ -1588,7 +1608,7 @@ export interface GeoIdentityTranform extends GeoStreamWrapper { * @param size The size of the extent, specified as an array [width, height]. * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ - fitSize(size: [number, number], object: ExtendedGeometryCollection): this; + fitSize(size: [number, number], object: ExtendedGeometryCollection): this; /** * Returns true if x-reflection is enabled, which defaults to false. diff --git a/types/d3-geo/tsconfig.json b/types/d3-geo/tsconfig.json index f3661c3ad2..128bdf7ee8 100644 --- a/types/d3-geo/tsconfig.json +++ b/types/d3-geo/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", "d3-geo-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/dagre/index.d.ts b/types/dagre/index.d.ts index 6c5e5e00ec..774fbf8f80 100644 --- a/types/dagre/index.d.ts +++ b/types/dagre/index.d.ts @@ -95,15 +95,15 @@ export interface NodeConfig { } export interface EdgeConfig { - minlen: number; - weight: number; - width: number; - height: number; - lablepos: 'l'|'c'|'r'; - labeloffest: number; + 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 function layout(graph: graphlib.Graph, layout?: GraphLabel & NodeConfig & EdgeConfig): void; export interface Edge { v: string; diff --git a/types/datatables.net-autofill/datatables.net-autofill-tests.ts b/types/datatables.net-autofill/datatables.net-autofill-tests.ts new file mode 100644 index 0000000000..0ad00b4395 --- /dev/null +++ b/types/datatables.net-autofill/datatables.net-autofill-tests.ts @@ -0,0 +1,8 @@ +const config: DataTables.Settings = { + // AutoFill extension options + autoFill: { + alwaysAsk: true, + enable: true, + columns: [1, 2] + } +}; diff --git a/types/datatables.net-autofill/index.d.ts b/types/datatables.net-autofill/index.d.ts new file mode 100644 index 0000000000..2f05d608be --- /dev/null +++ b/types/datatables.net-autofill/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for datatables.net-autofill 2.2 +// Project: https://datatables.net +// Definitions by: Andy Ma +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// +/// + +declare namespace DataTables { + interface Settings { + /* + * autoFill extension options + */ + autoFill?: boolean | AutoFillSettings; + } + + interface AutoFillSettings { + /* + * Always ask the end user if an action should be taken or not + */ + alwaysAsk?: boolean; + /* + * Select the columns that can be auto filled + */ + columns: string | number[]; + /* + * + * Initial enablement state of AutoFill + */ + enable?: boolean; + } +} diff --git a/types/datatables.net-autofill/tsconfig.json b/types/datatables.net-autofill/tsconfig.json new file mode 100644 index 0000000000..e17d5de5da --- /dev/null +++ b/types/datatables.net-autofill/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", + "datatables.net-autofill-tests.ts" + ] +} diff --git a/types/datatables.net-autofill/tslint.json b/types/datatables.net-autofill/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/datatables.net-autofill/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/datatables.net-colreorder/datatables.net-colreorder-tests.ts b/types/datatables.net-colreorder/datatables.net-colreorder-tests.ts new file mode 100644 index 0000000000..a6126baf44 --- /dev/null +++ b/types/datatables.net-colreorder/datatables.net-colreorder-tests.ts @@ -0,0 +1,12 @@ +$(document).ready(() => { + const config: DataTables.Settings = { + // ColReorder extension options + colReorder: { + fixedColumnsLeft: 0, + fixedColumnsRight: 0, + order: [1, 2, 3], + realtime: true, + reorderCallback: () => {}, + } + }; +}); diff --git a/types/datatables.net-colreorder/index.d.ts b/types/datatables.net-colreorder/index.d.ts new file mode 100644 index 0000000000..8254cd71dc --- /dev/null +++ b/types/datatables.net-colreorder/index.d.ts @@ -0,0 +1,64 @@ +// Type definitions for datatables.net-colReorder 1.4 +// Project: https://datatables.net/extensions/colreorder/ +// Definitions by: Andy Ma +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// +/// + +declare namespace DataTables { + interface Settings { + /* + * colReorder extension options + */ + colReorder?: boolean | ColReorderSettings; + } + + interface ColReorderSettings { + /* + * Number of columns (counting from the left) to disallow reordering of, '0' in default + */ + fixedColumnsLeft?: number; + + /* + * Number of columns (counting from the right) to disallow reordering of, '0' in default + */ + fixedColumnsRight?: number; + + /* + * Set a default order for the columns in the table + */ + order?: number[]; + + /* + * Enable / disable live reordering of columns during a drag, 'true' in default + */ + realtime?: boolean; + /* + * Callback after reorder + */ + reorderCallback: () => void; + } + + interface Api { + colReorder: { + /* + * Programmatically reorder columns + */ + move(from: number, to: number, drop: boolean, invalidate: boolean): Api; + /* + * Get / set column order + */ + order(newOrder?: number[], originalIndexes?: boolean): Api; + /* + * Restore the loaded column order + */ + reset(): Api; + /* + * Convert one or more column indexes to and from current and original indexes + */ + transpose(idx?: number | number[], direction?: "toCurrent" | "toOriginal" | "fromOriginal" | "fromCurrent"): Api; + }; + } +} diff --git a/types/datatables.net-colreorder/tsconfig.json b/types/datatables.net-colreorder/tsconfig.json new file mode 100644 index 0000000000..ec5e47bb49 --- /dev/null +++ b/types/datatables.net-colreorder/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", + "datatables.net-colreorder-tests.ts" + ] +} diff --git a/types/datatables.net-colreorder/tslint.json b/types/datatables.net-colreorder/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/datatables.net-colreorder/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/datatables.net-select/index.d.ts b/types/datatables.net-select/index.d.ts index e24f6b8ab6..563a51fc25 100644 --- a/types/datatables.net-select/index.d.ts +++ b/types/datatables.net-select/index.d.ts @@ -44,6 +44,41 @@ declare namespace DataTables { /* * Set the selection style for end user interaction with the table */ - style?: string; + style?: "api" | "single" | "multi" | "os" | "multi+shift"; + } + + interface Api { + select: { + /* + * Get the current selection style applied to the table + */ + style(): string; + /* + * Set the table's selection style + */ + style(s: "api" | "single" | "multi" | "os"): Api; + }; + } + + interface RowMethods { + /** + * Select a row + */ + select(): Api; + /** + * Deselect a row + */ + deselect(): Api; + } + + interface RowsMethods { + /** + * Select multiple rows + */ + select(): Api; + /** + * Deselect a row + */ + deselect(): Api; } } diff --git a/types/datatables.net/datatables.net-tests.ts b/types/datatables.net/datatables.net-tests.ts index e5cb5184fd..0c9f3db3cc 100644 --- a/types/datatables.net/datatables.net-tests.ts +++ b/types/datatables.net/datatables.net-tests.ts @@ -225,7 +225,7 @@ let config: DataTables.Settings = { ], // Data ajax: "url", - data: {}, + data: [], // Features autoWidth: true, deferRender: true, diff --git a/types/datatables.net/index.d.ts b/types/datatables.net/index.d.ts index cdddc98789..c0a37145ab 100644 --- a/types/datatables.net/index.d.ts +++ b/types/datatables.net/index.d.ts @@ -28,6 +28,10 @@ declare namespace DataTables { } interface Api extends CoreMethods { + /** + * API should be array-like + */ + [key: number]: any; /** * Returns DataTables API instance * @@ -221,7 +225,7 @@ declare namespace DataTables { * @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; + off(event: string, callback?: ((e: Event, ...args: any[]) => void)): Api; /** * Table events listener. @@ -229,7 +233,7 @@ declare namespace DataTables { * @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; + on(event: string, callback: ((e: Event, ...args: any[]) => void)): Api; /** * Listen for a table event once and then remove the listener. @@ -237,7 +241,7 @@ declare namespace DataTables { * @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; + one(event: string, callback: ((e: Event, ...args: any[]) => void)): Api; /** * Page Methods / object @@ -1297,7 +1301,7 @@ declare namespace DataTables { /** * Data to use as the display data for the table. Since: 1.10 */ - data?: object; + data?: any[]; //#endregion "Data" @@ -1931,6 +1935,7 @@ declare namespace DataTables { } interface ColumnLegacy { + idx: number; aDataSort: any; asSorting: string[]; bSearchable: boolean; diff --git a/types/decompress/decompress-tests.ts b/types/decompress/decompress-tests.ts index 3df7df0219..9cb8949d99 100644 --- a/types/decompress/decompress-tests.ts +++ b/types/decompress/decompress-tests.ts @@ -1,13 +1,13 @@ import decompress = require('decompress'); import * as path from "path"; -decompress('unicorn.zip', 'dist').then(files => { +decompress('unicorn.zip', 'dist').then((files: decompress.File[]) => { console.log('done!'); }); decompress('unicorn.zip', 'dist', { filter: file => path.extname(file.path) !== '.exe' -}).then(files => { +}).then((files: decompress.File[]) => { console.log('done!'); }); @@ -16,6 +16,6 @@ decompress('unicorn.zip', 'dist', { file.path = `unicorn-${file.path}`; return file; } -}).then(files => { +}).then((files: decompress.File[]) => { console.log('done!'); }); diff --git a/types/decompress/index.d.ts b/types/decompress/index.d.ts index a493f81a0d..745bebcd2e 100644 --- a/types/decompress/index.d.ts +++ b/types/decompress/index.d.ts @@ -7,7 +7,7 @@ export = decompress; -declare function decompress(input: string | Buffer, output: string, opts?: decompress.DecompressOptions): Promise; +declare function decompress(input: string | Buffer, output: string, opts?: decompress.DecompressOptions): Promise; declare namespace decompress { interface File { diff --git a/types/del/del-tests.ts b/types/del/del-tests.ts index fc6c63b6fa..f9d01f644f 100644 --- a/types/del/del-tests.ts +++ b/types/del/del-tests.ts @@ -1,39 +1,47 @@ -import del = require("del"); +import del = require('del'); -let paths = ["build", "dist/**/*.js"]; +let paths = ['build', 'dist/**/*.js']; -del(["tmp/*.js", "!tmp/unicorn.js"]); -del(["tmp/*.js", "!tmp/unicorn.js"], {force: true}); -del(["tmp/*.js", "!tmp/unicorn.js"], {dryRun: true}); -del(["tmp/*.js", "!tmp/unicorn.js"], {concurrency: 20}); -del(["tmp/*.js", "!tmp/unicorn.js"], {cwd: ''}); +del(['tmp/*.js', '!tmp/unicorn.js']); +del(['tmp/*.js', '!tmp/unicorn.js'], { force: true }); +del(['tmp/*.js', '!tmp/unicorn.js'], { dryRun: true }); +del(['tmp/*.js', '!tmp/unicorn.js'], { concurrency: 20 }); +del(['tmp/*.js', '!tmp/unicorn.js'], { cwd: '' }); -del(["tmp/*.js", "!tmp/unicorn.js"]).then((paths: string[]) => { +del(['tmp/*.js', '!tmp/unicorn.js']).then((paths: string[]) => { console.log('Deleted files/folders:\n', paths.join('\n')); }); -del(["tmp/*.js", "!tmp/unicorn.js"], {force: true}).then((paths: string[]) => { +del(['tmp/*.js', '!tmp/unicorn.js'], { force: true }).then( + (paths: string[]) => { + console.log('Deleted files/folders:\n', paths.join('\n')); + } +); + +del('tmp/*.js'); +del('tmp/*.js', { force: true }); +del('tmp/*.js', { dryRun: true }); +del('tmp/*.js', { concurrency: 20 }); +del('tmp/*.js', { cwd: '' }); +del('tmp/*.js').then((paths: string[]) => { console.log('Deleted files/folders:\n', paths.join('\n')); }); -del("tmp/*.js"); -del("tmp/*.js", {force: true}); -del("tmp/*.js", {dryRun: true}); -del("tmp/*.js", {concurrency: 20}); -del("tmp/*.js", {cwd: ''}); -del("tmp/*.js").then((paths: string[]) => { +del('tmp/*.js', { force: true }).then((paths: string[]) => { console.log('Deleted files/folders:\n', paths.join('\n')); }); -del("tmp/*.js", {force: true}).then((paths: string[]) => { - console.log('Deleted files/folders:\n', paths.join('\n')); -}); +paths = del.sync(['tmp/*.js', '!tmp/unicorn.js']); +paths = del.sync(['tmp/*.js', '!tmp/unicorn.js'], { force: true }); -paths = del.sync(["tmp/*.js", "!tmp/unicorn.js"]); -paths = del.sync(["tmp/*.js", "!tmp/unicorn.js"], {force: true}); +paths = del.sync('tmp/*.js'); +paths = del.sync('tmp/*.js', { force: true }); +paths = del.sync('tmp/*.js', { dryRun: true }); +paths = del.sync('tmp/*.js', { concurrency: 20 }); +paths = del.sync('tmp/*.js', { cwd: '' }); -paths = del.sync("tmp/*.js"); -paths = del.sync("tmp/*.js", {force: true}); -paths = del.sync("tmp/*.js", {dryRun: true}); -paths = del.sync("tmp/*.js", {concurrency: 20}); -paths = del.sync("tmp/*.js", {cwd: ''}); +const immutable: ReadonlyArray = ['tmp/*.js', '!tmp/unicorn.js']; +const mutable = del(immutable); +const mutablePaths = del.sync(immutable); +mutable.then(paths => paths.push('test')); +mutablePaths.push('test'); diff --git a/types/del/index.d.ts b/types/del/index.d.ts index e3c250e69b..ec92f96c84 100644 --- a/types/del/index.d.ts +++ b/types/del/index.d.ts @@ -3,14 +3,21 @@ // Definitions by: Asana // Aya Morisawa // BendingBender +// Jason Dreyzehner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import glob = require("glob"); +import glob = require('glob'); -declare function del(patterns: string | string[], options?: del.Options): Promise; +declare function del( + patterns: string | ReadonlyArray, + options?: del.Options +): Promise; declare namespace del { - function sync(patterns: string | string[], options?: Options): string[]; + function sync( + patterns: string | ReadonlyArray, + options?: Options + ): string[]; interface Options extends glob.IOptions { force?: boolean; diff --git a/types/detect-browser/index.d.ts b/types/detect-browser/index.d.ts index 351067ff59..22d6bf9c17 100644 --- a/types/detect-browser/index.d.ts +++ b/types/detect-browser/index.d.ts @@ -18,10 +18,13 @@ export type BrowserName = "phantomjs" | "safari" | "vivaldi" | - "yandexbrowser"; + "yandexbrowser" | + "node"; -export function detect(): null | { - name: BrowserName | "node"; +export interface BrowserInfo { + name: BrowserName; version: string; os: string; -}; +} + +export function detect(): null | BrowserInfo; diff --git a/types/devexpress-web/index.d.ts b/types/devexpress-web/index.d.ts index 50aac382b1..9b29d9e0db 100644 --- a/types/devexpress-web/index.d.ts +++ b/types/devexpress-web/index.d.ts @@ -1,7 +1,11 @@ -// Type definitions for DevExpress ASP.NET v171.4 +// Type definitions for DevExpress ASP.NET v172.6 // Project: http://devexpress.com/ // Definitions by: DevExpress Inc. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// +/// /** * A client-side counterpart of the DashboardViewer extension. @@ -115,7 +119,7 @@ interface ASPxClientDashboardItemClickEventArgs extends ASPxClientEventArgs { /** * Requests underlying data corresponding to the clicked visual element. * @param onCompleted A ASPxClientDashboardItemRequestUnderlyingDataCompleted object that references a method executed after the request is completed. - * @param dataMembers An array of string values that specify data members used to obtain underlying data. + * @param dataMembers (Optional) An array of string values that specify data members used to obtain underlying data. If this parameter is not specified, underlying data for all available data members will be requested. */ RequestUnderlyingData(onCompleted: ASPxClientDashboardItemRequestUnderlyingDataCompleted, dataMembers: string[]): void; } @@ -550,6 +554,53 @@ interface ASPxClientDashboardItemDataDeltaValue { */ GetIndicatorType(): ASPxClientDashboardItemDataMeasureValue; } +/** + * References a method that will handle the ItemCaptionToolbarUpdated event. + */ +interface ASPxClientDashboardItemCaptionToolbarUpdatedEventHandler { + /** + * References a method that will handle the ItemCaptionToolbarUpdated event. + * @param source The event source. + * @param e The ASPxClientDashboardItemCaptionToolbarUpdatedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemCaptionToolbarUpdatedEventArgs): void; +} +/** + * Provides data for the ItemCaptionToolbarUpdated event. + */ +interface ASPxClientDashboardItemCaptionToolbarUpdatedEventArgs extends ASPxClientEventArgs { + /** + * Gets a component name of the dashboard item. + * Value: A string value that is a component name of the dashboard item. + */ + ItemName: string; + /** + * Provides access to caption options of the dashboard item. + * Value: A DashboardItemCaptionToolbarOptions object containing caption options of the dashboard item. + */ + Options: Object; +} +/** + * References a method that will handle the DashboardTitleToolbarUpdated event. + */ +interface ASPxClientDashboardTitleToolbarUpdatedEventHandler { + /** + * References a method that will handle the DashboardTitleToolbarUpdated event. + * @param source The event source. + * @param e A ASPxClientDashboardTitleToolbarUpdatedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardTitleToolbarUpdatedEventArgs): void; +} +/** + * Provides data for the DashboardTitleToolbarUpdated event. + */ +interface ASPxClientDashboardTitleToolbarUpdatedEventArgs extends ASPxClientEventArgs { + /** + * Provides access to dashboard title options. + * Value: A DashboardTitleToolbarOptions object containing dashboard title options. + */ + Options: Object; +} /** * A point on the data axis. */ @@ -945,6 +996,16 @@ interface DashboardPdfExportOptions { * Value: A DashboardExportScaleMode value that specifies the mode for scaling a dashboard/dashboard item in the exported document. */ ScaleMode: string; + /** + * Gets or sets the mode for scaling a dashboard/dashboard item in the exported document. + * Value: A DashboardExportDocumentScaleMode value that specifies the mode for scaling a dashboard/dashboard item in the exported document. + */ + DocumentScaleMode: string; + /** + * Gets or sets whether the page orientation used to export a dashboard is selected automatically. + * Value: true, to automatically select the page orientation used to export a dashboard; otherwise, false. + */ + DashboardAutomaticPageLayout: boolean; /** * Gets or sets the scale factor (in fractions of 1), by which a dashboard/dashboard item is scaled in the exported document. * Value: A Single value that specifies the scale factor by which a dashboard/dashboard item is scaled in the exported document. @@ -1232,6 +1293,30 @@ interface ASPxClientDashboard extends ASPxClientControl { * Occurs after the dashboard update is performed. */ DashboardEndUpdate: ASPxClientEvent>; + /** + * Allows you to customize a dashboard item's caption (for instance, add custom buttons, menus, etc.). + */ + ItemCaptionToolbarUpdated: ASPxClientEvent>; + /** + * Allows you to customize a dashboard title (for instance, add custom buttons, menus, etc.). + */ + DashboardTitleToolbarUpdated: ASPxClientEvent>; + /** + * Returns names of the predefined ranges available for the specified Range Filter. + * @param itemName A string value that specifies the component name of the Range Filter dashboard item. + */ + GetAvailablePredefinedRanges(itemName: string): string[]; + /** + * Returns the name of the currently selected predefined range. + * @param itemName A string value that specifies the component name of the Range Filter dashboard item. + */ + GetCurrentPredefinedRange(itemName: string): string; + /** + * + * @param itemName + */ + UpdateItemCaptionToolbar(itemName: string): void; + UpdateDashboardTitleToolbar(): void; /** * Sends a callback to the server and generates the server-side CustomDataCallback event, passing it the specified argument. * @param parameter A string value that represents any information that needs to be sent to the server-side CustomDataCallback event. @@ -1239,7 +1324,7 @@ interface ASPxClientDashboard extends ASPxClientControl { */ PerformDataCallback(parameter: string, onCallback: ASPxClientDataCallback): void; /** - * Gets an inner part of the ASPxClientDashboard control. + * Gets the DashboardControl object that is the client-side part of the Web Dashboard. */ GetDashboardControl(): DashboardControl; /** @@ -1299,7 +1384,7 @@ interface ASPxClientDashboard extends ASPxClientControl { GetParameters(): ASPxClientDashboardParameters; /** * Invokes the dialog that allows end-users to export the entire dashboard to the specified format. - * @param format A string value that specifies the format. For instance, you can use 'PDF' or 'Image'. + * @param format A string value that specifies the format. For instance, you can use 'PDF', 'Image', or 'Excel'. */ ShowExportDashboardDialog(format: string): void; /** @@ -1635,16 +1720,6 @@ interface ASPxClientDashboard extends ASPxClientControl { * @param dateTimePeriodName A String value that specifies the predefined range name. */ SetPredefinedRange(itemName: string, dateTimePeriodName: string): void; - /** - * Returns names of the predefined ranges available for the specified Range Filter. - * @param itemName A string value that specifies the component name of the Range Filter dashboard item. - */ - GetAvailablePredefinedRanges(itemName: string): string[]; - /** - * Returns the name of the currently selected predefined range. - * @param itemName A string value that specifies the component name of the Range Filter dashboard item. - */ - GetCurrentPredefinedRange(itemName: string): string; } /** * References a method that will handle the DashboardStateChanged event. @@ -1986,6 +2061,14 @@ interface ASPxClientDashboardViewer extends ASPxClientControl { * Allows you to color the required dashboard item elements using the specified colors. */ ItemElementCustomColor: ASPxClientEvent>; + /** + * Allows you to customize a dashboard item's caption (for instance, add custom buttons, menus, etc.). + */ + ItemCaptionToolbarUpdated: ASPxClientEvent>; + /** + * Allows you to customize a dashboard title (for instance, add custom buttons, menus, etc.). + */ + TitleToolbarUpdated: ASPxClientEvent>; /** * Reloads data in the data sources. */ @@ -2064,6 +2147,12 @@ interface ASPxClientDashboardViewer extends ASPxClientControl { * @param itemName A String that specifies a component name of the master filter item. */ GetCurrentSelection(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * + * @param itemName + */ + UpdateItemCaptionToolbar(itemName: string): void; + UpdateDashboardTitleToolbar(): void; /** * Requests underlying data for the specified dashboard item. * @param itemName A string that specifies the component name of the dashboard item. @@ -2079,6 +2168,21 @@ interface ASPxClientDashboardViewer extends ASPxClientControl { * Closes the Dashboard Parameters dialog. */ HideParametersDialog(): void; + /** + * Shows the dialog that allows end-users to export the dashboard. + * @param format A string value that specifies the format. For instance, you can use 'PDF, 'Image' or 'Excel'. + */ + ShowExportDialog(format: string): void; + /** + * Shows the dialog that allows end-users to export the dashboard item. + * @param itemComponentName A component name of the dashboard item. + * @param format A string value that specifies the format. For instance, you can use 'PDF, 'Image' or 'Excel'. + */ + ShowExportDashboardItemDialog(itemComponentName: string, format: string): void; + /** + * Hides the dialog that allows end-users to export the dashboard/dashboard item. + */ + HideExportDialog(): void; /** * Returns settings that specify parameters affecting how the dashboard is exported. */ @@ -2554,8 +2658,17 @@ interface ASPxClientDashboardDrillUpPerformedEventArgs extends ASPxClientEventAr */ ItemName: string; } +/** + * Provides data for the onCustomizeText handler. + */ interface CardWidgetCustomizeTextEventArgs { + /** + * Gets a dimension/measure value to be displayed within the card. + */ getValue(): Object; + /** + * Gets a formatted value displayed within the card. + */ getDefaultText(): string; } /** @@ -2567,7 +2680,15 @@ interface CardWidget { * Value: A string that specifies the HTML color used to paint a card's background. */ cardBackColor: string; + /** + * Allows you to customize texts displayed within individual cards. + * Value: A handler used customize texts displayed within individual cards. + */ onCustomizeText: Object; + /** + * Gets the root element of the widget. + */ + element(): Object; } /** * When implemented, represents the Web Dashboard extension. @@ -2588,14 +2709,14 @@ interface IExtension { stop(): void; } /** - * An inner part of the ASPxClientDashboard control. + * A client-side part of the Web Dashboard. */ interface DashboardControl { /** * Gets or sets knockout templates that you can use in the Web Dashboard. * Value: A object that is a knockout template collection. */ - customTemplates: KnockoutObservableArray; + customTemplates: KnockoutObservableArray; /** * Provides an access to the collection of registered dashboard extensions. * Value: An array of IExtension objects that are dashboard extensions. @@ -2630,11 +2751,60 @@ interface DashboardControl { */ unregisterExtension(extensionName: string): void; } +interface UrlStateExtension extends IExtension { +} +interface Element { +} +/** + * The content of the Dashboard Parameters dialog. + */ +interface ParameterDialogContent { + /** + * Gets the Dashboard Parameters dialog's grid that displays parameter values. + * Value: The Dashboards Parameters dialog's grid that displays parameter values. + */ + grid: Object; + /** + * Applies changes made in the Dashboard Parameters dialog. + */ + submitParameterValues(): void; + /** + * Resets changes in the Dashboard Parameters dialog to the default values. + */ + resetParameterValues(): void; + valueChanged(): void; +} +/** + * A Web Dashboard extension that is the Dashboard Parameters dialog. + */ interface DashboardParameterDialogExtension extends IExtension { + /** + * Gets or sets whether to show the Dashboard Parameters button in the dashboard title. + * Value: true, to show the Dashboard Parameters button; otherwise, false. + */ + showDialogButton: KnockoutObservableBoolean; + /** + * Invokes the Dashboard Parameters dialog. + */ + show(): void; + /** + * Closes the Dashboard Parameters dialog. + */ + hide(): void; + /** + * Allows you to be notified about the dashboard parameter settings changes. + * @param callback A custom function. + */ + subscribeToContentChanges(callback: Function): Object; + /** + * Renders the content of the Dashboard Parameters dialog inside the specified JQuery element. + * @param element A JQuery element where the Dashboard Parameters dialog content is rendered. + */ + renderContent(element: Element): ParameterDialogContent; } interface DashboardExportExtension extends IExtension { } -interface DashboardClientApiExtension extends IExtension { +interface ViewerApiExtension extends IExtension { } interface DashboardCurrencyEditorExtension extends IExtension { } @@ -2642,7 +2812,12 @@ interface DataSourceBrowserExtension extends IExtension { } interface DataSourceWizardExtension extends IExtension { } -interface DashboadItemMenuExtension extends IExtension { +interface DashboardItemMenuExtension extends IExtension { +} +/** + * A Web Dashboard extension that allows you to configure color schemes. + */ +interface DashboardColorSchemeEditorExtension extends IExtension { } /** * A Web Dashboard extension that allows you to keep track of all user actions, and cancel or repeat them. @@ -2654,17 +2829,12 @@ interface UndoRedoExtension extends IExtension { isChanged(): boolean; } /** - * An extension that is the dashboard item's Binding menu allowing you to create and modify data binding. + * A Web Dashboard extension that is the dashboard item's Binding menu allowing you to create and modify data binding. */ interface BindingPanelExtension extends IExtension { } /** - * A Web Dashboard extension that allows you to configure color schemes. - */ -interface DashboardColorSchemeEditorExtension extends IExtension { -} -/** - * An extension that is the dashboard item's Convert To menu allowing you to convert or duplicate the current item. + * A Web Dashboard extension that is the dashboard item's Convert To menu allowing you to convert or duplicate the current item. */ interface ConversionPanelExtension extends IExtension { } @@ -2710,22 +2880,22 @@ interface OpenDashboardExtension extends IExtension { loadDashboard(id: string): void; } /** - * An extension that is the dashboard item's Interactivity menu containing settings that affect on interaction between various dashboard items. + * A Web Dashboard extension that is the dashboard item's Interactivity menu containing settings that affect on interaction between various dashboard items. */ interface InteractivityPanelExtension extends IExtension { } /** - * An extension that is the dashboard item's Options menu containing specific options and settings related to the current dashboard item. + * A Web Dashboard extension that is the dashboard item's Options menu containing specific options and settings related to the current dashboard item. */ interface OptionsPanelExtension extends IExtension { } /** - * An extension that is the Web Dashboard title editor. + * A Web Dashboard extension that is the dashboard title editor. */ interface DashboardTitleEditorExtension extends IExtension { } /** - * The Dashboard Panel extension that displays a list of available dashboards and lets you switch between the designer and viewer modes. + * The Dashboard Panel extension that allows users to switch between dashboards and enable the Designer mode. */ interface DashboardPanelExtension extends IExtension { /** @@ -2894,10 +3064,10 @@ interface DashboardToolboxGroup { */ index: number; /** - * Provide an access to the collection of toolbox items obtained from the specified toolbox group. - * Value: A object that is an array of items obtained from the specified toolbox group. + * Provides access to a collection of toolbox group items. + * Value: A DashboardToolboxItem). */ - items: KnockoutObservableArray; + items: KnockoutObservableArray; } /** * A toolbar group that contains dashboard toolbar items. @@ -2919,35 +3089,34 @@ interface DashboardToolbarGroup { */ index: number; /** - * Provide an access to the collection of toolbox items obtained from the specified toolbar group. - * Value: A object that is an array of items obtained from the specified toolbar group. + * Provides access to a collection of toolbar group items. + * Value: A DashboardToolbarItem). */ - items: KnockoutObservableArray; + items: KnockoutObservableArray; } /** * The Web Dashboard Toolbox extension that provides access to the dashboard menu and allows you to add dashboard items, as well as undo or repeat user actions. */ interface ToolboxExtension extends IExtension { /** - * Gets or sets the visibility of the dashboard menu. - * Value: true, to display the dashboard menu; otherwise, false. + * Provides access to a collection of the dashboard menu items. + * Value: A DashboardMenuItem). + */ + menuItems: KnockoutObservableArray; + /** + * Provides access to a collection of the Toolbox groups. + * Value: A DashboardToolboxGroup). + */ + toolboxGroups: KnockoutObservableArray; + /** + * Provides access to a collection of toolbar groups from the Toolbox. + * Value: A DashboardToolbarGroup). + */ + toolbarGroups: KnockoutObservableArray; + /** + * For internal use. */ menuVisible: KnockoutObservableBoolean; - /** - * Provide an access to the collection of menu items obtained from the dashboard menu. - * Value: A object that is a collection the dashboard menu items . - */ - menuItems: KnockoutObservableArray; - /** - * Provide an access to the collection of toolbox groups obtained from the Toolbox. - * Value: A object that is a collection the toolbox groups. - */ - toolboxGroups: KnockoutObservableArray; - /** - * Provide an access to the collection of toolbar groups obtained from the Toolbox. - * Value: A object that is a collection the toolbar groups. - */ - toolbarGroups: KnockoutObservableArray; /** * Allows you to add a specified menu item to the dashboard menu. * @param menuItem A DashboardMenuItem object that is a dashboard menu item. @@ -2970,9 +3139,9 @@ interface ToolboxExtension extends IExtension { */ addToolboxItem(groupName: string, toolboxItem: DashboardToolboxItem): void; /** - * Removes the specified toolbox item from the specified toolbox group. - * @param groupName A string value that is a unique toolbox group name. - * @param toolboxItemName A string value that is a unique toolbox item name. + * Removes the specified item from the specified toolbox group. + * @param groupName A string value that is a unique toolbox group name (name). + * @param toolboxItemName A string value that is a unique toolbox item name (name). */ removeToolboxItem(groupName: string, toolboxItemName: string): void; /** @@ -3438,6 +3607,10 @@ interface ASPxClientTextEdit extends ASPxClientEdit { * Fires on the client side when the editor's text is changed and focus moves out of the editor by end-user interactions. */ TextChanged: ASPxClientEvent>; + /** + * Fires on the client side when the editor's input value is changed before the focus moves out of the editor by end-user interactions. + */ + UserInput: ASPxClientEvent>; /** * Returns the text displayed within the editor. */ @@ -4249,7 +4422,7 @@ interface ASPxClientListBox extends ASPxClientListEdit { */ PerformCallback(parameter: string): void; /** - * Adds a new item to the end of the editor's items collection, specifying the item's display text, and returns the index of the added item. + * Adds a new item to the editor, specifying the item's display text, and returns the added item's index. * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. */ AddItem(texts: string[]): number; @@ -5021,6 +5194,11 @@ interface ASPxClientGridBase extends ASPxClientControl { */ interface ASPxClientGridColumnBase { } +/** + * Lists values that specify the document formats available for export from the grid. + */ +interface ASPxClientGridExportFormat { +} /** * A method that will handle the ToolbarItemClick event. */ @@ -5047,8 +5225,8 @@ interface ASPxClientGridToolbarItemClickEventArgs extends ASPxClientProcessingMo */ toolbarName: string; /** - * Gets the clicked toolbar item. - * Value: A ASPxClientMenuItem object that is the toolbar item. + * Gets the clicked menu item + * Value: An ASPxClientMenu value that is the menu item. */ item: ASPxClientMenuItem; /** @@ -5158,7 +5336,11 @@ interface ASPxClientCardView extends ASPxClientGridBase { /** * Fires in response to changing card focus. */ - FocusedCardChanged: ASPxClientEvent>; + FocusedCardChanged: ASPxClientEvent>; + /** + * Fires before a card has been focused. + */ + CardFocusing: ASPxClientEvent>; /** * Occurs when a callback for server-side processing is initiated. */ @@ -5175,6 +5357,21 @@ interface ASPxClientCardView extends ASPxClientGridBase { * Fires after the customization window has been closed. */ CustomizationWindowCloseUp: ASPxClientEvent>; + /** + * Returns the editor used to edit the specified column's values. + * @param column An ASPxClientCardViewColumn object that specifies the required column within the client grid. + */ + GetEditor(column: ASPxClientCardViewColumn): ASPxClientEdit; + /** + * Returns the editor used to edit the specified column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + GetEditor(columnIndex: number): ASPxClientEdit; + /** + * Returns the editor used to edit the specified column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + GetEditor(columnFieldNameOrId: string): ASPxClientEdit; /** * Returns the value of the specified edit cell. * @param column An ASPxClientCardViewColumn object that represents the data column within the client grid. @@ -5255,6 +5452,11 @@ interface ASPxClientCardView extends ASPxClientGridBase { * @param columnIndex A zero-based index that identifies the column in the column collection (the column's Index property value). */ SetFocusedCell(cardVisibleIndex: number, columnIndex: number): void; + /** + * Specifies a custom editor for the search panel on the client side. + * @param editor An ASPxClientEdit object representing a custom editor. + */ + SetSearchPanelCustomEditor(editor: ASPxClientEdit): void; /** * Sorts data by the specified data column's values. * @param column An ASPxClientCardViewColumn object that represents the data column. @@ -5407,7 +5609,7 @@ interface ASPxClientCardView extends ASPxClientGridBase { */ IsNewCardEditing(): boolean; /** - * Adds a new record. + * Adds a new card. */ AddNewCard(): void; /** @@ -5543,6 +5745,11 @@ interface ASPxClientCardView extends ASPxClientGridBase { * @param visibleIndex An integer value that identifies the card by its visible index. */ IsCardSelectedOnPage(visibleIndex: number): boolean; + /** + * Exports a grid data to a file in the specified format. + * @param format An ASPxClientCardViewExportFormat object specifying the export format. + */ + ExportTo(format: ASPxClientCardViewExportFormat): void; /** * Applies the specified search panel filter criterion to grid data. * @param value A string value that specifies the filter criterion. @@ -5682,25 +5889,10 @@ interface ASPxClientCardView extends ASPxClientGridBase { */ GetColumnById(columnId: string): ASPxClientCardViewColumn; /** - * Returns the client column which is bound to the specified data source field. + * Returns the client column to which the specified data source field is bound. * @param columnFieldName A string value that specifies the name of the data source field to which the column is bound (the column's FieldName property value). */ GetColumnByField(columnFieldName: string): ASPxClientCardViewColumn; - /** - * Returns the editor used to edit the specified column's values. - * @param column An ASPxClientCardViewColumn object that specifies the required column within the client grid. - */ - GetEditor(column: ASPxClientCardViewColumn): ASPxClientEdit; - /** - * Returns the editor used to edit the specified column's values. - * @param columnIndex An integer value that specifies the column's position within the column collection. - */ - GetEditor(columnIndex: number): ASPxClientEdit; - /** - * Returns the editor used to edit the specified column's values. - * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). - */ - GetEditor(columnFieldNameOrId: string): ASPxClientEdit; } /** * Represents a client column. @@ -5758,6 +5950,32 @@ interface ASPxClientCardViewColumnCancelEventArgs extends ASPxClientCancelEventA */ column: ASPxClientCardViewColumn; } +/** + * A method that will handle the client CardFocusing event. + */ +interface ASPxClientCardViewCardFocusingEventHandler { + /** + * Represents a method that will handle the CardFocusing event. + * @param source The event source. + * @param e An ASPxClientCardViewCardFocusingEventArgs object which contains event data. + */ + (source: S, e: ASPxClientCardViewCardFocusingEventArgs): void; +} +/** + * Provides data for the CardFocusing event. + */ +interface ASPxClientCardViewCardFocusingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the card visible index. + * Value: An integer value specifying the visible index. + */ + visibleIndex: number; + /** + * Provides access to the parameters associated with the CardFocusing event. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; +} /** * A method that will handle the CardClick event. */ @@ -5846,6 +6064,27 @@ interface ASPxClientCardViewSelectionEventArgs extends ASPxClientProcessingModeE */ isChangedOnServer: boolean; } +/** + * A method that will handle the client FocusedCardChanged event. + */ +interface ASPxClientCardViewFocusEventHandler { + /** + * Represents a method that will handle the FocusedCardChanged event. + * @param source The event source. + * @param e An ASPxClientCardViewFocusEventArgs object which contains event data. + */ + (source: S, e: ASPxClientCardViewFocusEventArgs): void; +} +/** + * Provides data for the corresponding event. + */ +interface ASPxClientCardViewFocusEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets whether card focusing has been changed on the server. + * Value: true , if the card focusing has been changed on the server; otherwise, false. + */ + isChangedOnServer: boolean; +} /** * A method that will handle the client BatchEditStartEditing event. */ @@ -6143,6 +6382,30 @@ interface ASPxClientCardViewBatchEditApi { * @param visibleIndex An integer value that identifies the card by its visible index. */ IsNewCard(visibleIndex: number): boolean; + /** + * Adds a new card when ASPxCardView is in Batch Edit mode. + */ + AddNewCard(): void; + /** + * Deletes the specified card when ASPxCardView is in Batch Edit mode. + * @param visibleIndex An integer value that identifies the card index. + */ + DeleteCard(visibleIndex: number): void; + /** + * Deletes a card with a specified key value when ASPxCardView is in Batch Edit mode. + * @param key An object that uniquely identifies the card. + */ + DeleteCardByKey(key: Object): void; + /** + * Recovers the specified card when ASPxCardView is in Batch Edit mode. + * @param visibleIndex An integer value that identifies the card index. + */ + RecoverCard(visibleIndex: number): void; + /** + * Recovers a card with a specified key value when ASPxCardView is in Batch Edit mode. + * @param key An object that uniquely identifies the card. + */ + RecoverCardByKey(key: Object): void; /** * Programmatically moves the focus to the previous cell in the card */ @@ -6220,6 +6483,12 @@ interface ASPxClientCardViewBatchEditApi { * Ends cell or card editing. */ EndEdit(): void; + /** + * Provides the text displayed within the cell according to the specified display format rule. + * @param columnFieldNameOrId A string value representing the column's unique identifier or field name. + * @param value An object representing a value. + */ + GetColumnDisplayText(columnFieldNameOrId: string, value: Object): string; } /** * Contains information on a grid cell. @@ -6236,6 +6505,11 @@ interface ASPxClientCardViewCellInfo { */ column: ASPxClientCardViewColumn; } +/** + * Lists values that specify the document formats available for export from the grid. + */ +interface ASPxClientCardViewExportFormat extends ASPxClientGridExportFormat { +} /** * A client-side equivalent of the ASPxGridView object. */ @@ -6260,7 +6534,11 @@ interface ASPxClientGridView extends ASPxClientGridBase { /** * Fires in response to changing row focus. */ - FocusedRowChanged: ASPxClientEvent>; + FocusedRowChanged: ASPxClientEvent>; + /** + * Fires before a row has been focused. + */ + RowFocusing: ASPxClientEvent>; /** * Enables you to cancel data grouping. */ @@ -6369,6 +6647,29 @@ interface ASPxClientGridView extends ASPxClientGridBase { * Fires after the Customization Window has been closed. */ CustomizationWindowCloseUp: ASPxClientEvent>; + /** + * Selects the specified rows within the grid. + * @param visibleIndices An array of zero-based indices that identify data rows within the grid. + */ + SelectRows(visibleIndices: number[]): void; + /** + * Selects or deselects the specified rows within the grid. + * @param visibleIndices An array of zero-based indices that identify data rows within the grid. + * @param selected true to select the specified rows; false to deselect the rows. + */ + SelectRows(visibleIndices: number[], selected: boolean): void; + /** + * Selects or deselects the specified row within the grid. + * @param visibleIndex An integer zero-based index that identifies the data row within the grid. + * @param selected true to select the specified row; false to deselect the row. + */ + SelectRows(visibleIndex: number, selected?: boolean): void; + /** + * Selects or deselects the specified rows displayed within the grid. + * @param keys An array of objects that uniquely identify the rows. + * @param selected true to select the specified rows; false to deselect the rows. + */ + SelectRowsByKey(keys: Object[], selected?: boolean): void; /** * Selects or deselects the specified row displayed within the grid. * @param key An object that uniquely identifies the row. @@ -6498,6 +6799,16 @@ interface ASPxClientGridView extends ASPxClientGridBase { * @param scrollableRowSettings An object specifying which types of grid rows should or should not be scrollable. */ SetFixedColumnScrollableRows(scrollableRowSettings: Object): void; + /** + * Exports a grid data to a file in the specified format. + * @param format An ASPxClientGridViewExportFormat object specifying the export format. + */ + ExportTo(format: ASPxClientGridViewExportFormat): void; + /** + * Returns a value specifying the indices of the rows visible in the browser's view port. + * @param includePartiallyVisible true, to include partially visible rows, otherwise, false. + */ + GetRowIndicesVisibleInViewPort(includePartiallyVisible: boolean): number[]; /** * Applies a filter specified in the filter row to the GridView. */ @@ -6777,6 +7088,11 @@ interface ASPxClientGridView extends ASPxClientGridBase { * @param columnIndex A zero-based index that identifies the column in the column collection (the column's Index property value). */ SetFocusedCell(rowVisibleIndex: number, columnIndex: number): void; + /** + * Specifies a custom editor for the search panel on the client side. + * @param editor An ASPxClientEdit object representing a custom editor. + */ + SetSearchPanelCustomEditor(editor: ASPxClientEdit): void; /** * Invokes the Customization Dialog and displays it over the grid. */ @@ -6996,6 +7312,15 @@ interface ASPxClientGridView extends ASPxClientGridBase { * @param moveFromGroup true, to ungroup the grid's data by the column; otherwise, false. */ MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, targetPosition: ASPxClientGridColumnMovingTargetPosition, moveToGroup: boolean, moveFromGroup: boolean): void; + /** + * Returns an object specifying the grid column's layout. + */ + GetColumnLayout(): Object; + /** + * Specifies the grid column's layout. + * @param columnLayout An object specifying the grid column's layout. + */ + SetColumnLayout(columnLayout: Object): void; /** * Groups data by the values of the specified column. * @param column An ASPxClientGridViewColumn object that represents the data column by whose values data is grouped. @@ -7184,29 +7509,6 @@ interface ASPxClientGridView extends ASPxClientGridBase { * @param visibleIndex A zero-based integer value that specifies the row's visible index. */ SelectRows(visibleIndex: number): void; - /** - * Selects the specified rows within the grid. - * @param visibleIndices An array of zero-based indices that identify data rows within the grid. - */ - SelectRows(visibleIndices: number[]): void; - /** - * Selects or deselects the specified rows within the grid. - * @param visibleIndices An array of zero-based indices that identify data rows within the grid. - * @param selected true to select the specified rows; false to deselect the rows. - */ - SelectRows(visibleIndices: number[], selected: boolean): void; - /** - * Selects or deselects the specified row within the grid. - * @param visibleIndex An integer zero-based index that identifies the data row within the grid. - * @param selected true to select the specified row; false to deselect the row. - */ - SelectRows(visibleIndex: number, selected?: boolean): void; - /** - * Selects or deselects the specified rows displayed within the grid. - * @param keys An array of objects that uniquely identify the rows. - * @param selected true to select the specified rows; false to deselect the rows. - */ - SelectRowsByKey(keys: Object[], selected?: boolean): void; } /** * A client grid column. @@ -7347,6 +7649,48 @@ interface ASPxClientGridViewSelectionEventArgs extends ASPxClientProcessingModeE */ isChangedOnServer: boolean; } +/** + * A method that will handle the client FocusedRowChanged event. + */ +interface ASPxClientGridViewFocusEventHandler { + /** + * Represents a method that will handle the FocusedRowChanged event. + * @param source The event source. + * @param e An ASPxClientGridViewFocusEventArgs object which contains event data. + */ + (source: S, e: ASPxClientGridViewFocusEventArgs): void; +} +/** + * Provides data for the corresponding event. + */ +interface ASPxClientGridViewFocusEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets whether the row focusing has been changed on the server. + * Value: true , if the row focusing has been changed on the server; otherwise, false. + */ + isChangedOnServer: boolean; +} +/** + * A method that will handle the client RowFocusing event. + */ +interface ASPxClientGridViewRowFocusingEventHandler { + /** + * Represents a method that will handle the RowFocusing event. + * @param source The event source. + * @param e An ASPxClientGridViewRowFocusingEventArgs object which contains event data. + */ + (source: S, e: ASPxClientGridViewRowFocusingEventArgs): void; +} +/** + * Provides data for the RowFocusing event. + */ +interface ASPxClientGridViewRowFocusingEventArgs extends ASPxClientGridViewRowCancelEventArgs { + /** + * Provides access to the parameters associated with the RowFocusing event. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; +} /** * A method that will handle the RowClick events. */ @@ -7829,6 +8173,30 @@ interface ASPxClientGridViewBatchEditApi { * @param visibleIndex An integer value that identifies the row by its visible index. */ IsNewRow(visibleIndex: number): boolean; + /** + * Adds a new row when ASPxGridView is in Batch Edit mode. + */ + AddNewRow(): void; + /** + * Deletes the specified row when ASPxGridView is in Batch Edit. + * @param visibleIndex An integer value that identifies the row index. + */ + DeleteRow(visibleIndex: number): void; + /** + * Deletes a row with a specified key value when ASPxGridView is in Batch Edit mode. + * @param key An object that uniquely identifies the row. + */ + DeleteRowByKey(key: Object): void; + /** + * Recovers the specified row when ASPxGridView is in Batch Edit mode. + * @param visibleIndex An integer value that identifies the row index. + */ + RecoverRow(visibleIndex: number): void; + /** + * Recovers a row with a specified key value when ASPxGridView is in Batch Edit mode. + * @param key An object that uniquely identifies the row. + */ + RecoverRowByKey(key: Object): void; /** * Programmatically moves the focus to the previous cell in the row. */ @@ -7906,6 +8274,17 @@ interface ASPxClientGridViewBatchEditApi { * Ends cell or row editing. */ EndEdit(): void; + /** + * Provides the text displayed within the cell according to the specified display format rule. + * @param columnFieldNameOrId A string value representing the column's unique identifier or field name. + * @param value An object representing a value. + */ + GetColumnDisplayText(columnFieldNameOrId: string, value: Object): string; +} +/** + * Lists values that specify the document formats available for export from the grid. + */ +interface ASPxClientGridViewExportFormat extends ASPxClientGridExportFormat { } /** * A client-side equivalent of the ASPxVerticalGrid object. @@ -8207,6 +8586,11 @@ interface ASPxClientVerticalGrid extends ASPxClientGridBase { * @param visibleIndex An integer value that identifies the record by its visible index. */ IsRecordSelectedOnPage(visibleIndex: number): boolean; + /** + * Exports a grid data to a file in the specified format. + * @param format An ASPxClientVerticalGridExportFormat object specifying the export format. + */ + ExportTo(format: ASPxClientVerticalGridExportFormat): void; /** * Returns the values of the specified data source fields within the specified record. * @param visibleIndex An integer value that identifies the record. @@ -8221,7 +8605,7 @@ interface ASPxClientVerticalGrid extends ASPxClientGridBase { */ GetPageRecordValues(fieldNames: string, onCallback: ASPxClientVerticalGridValuesCallback): void; /** - * Returns the number of records actually displayed within the active page. + * Returns the number of records actually displayed on the active page. */ GetVisibleRecordsOnPage(): number; /** @@ -8338,6 +8722,11 @@ interface ASPxClientVerticalGrid extends ASPxClientGridBase { * @param isFilterEnabled true to enable the current filter; otherwise, false. */ SetFilterEnabled(isFilterEnabled: boolean): void; + /** + * Specifies a custom editor for the search panel on the client side. + * @param editor An ASPxClientEdit object representing a custom editor. + */ + SetSearchPanelCustomEditor(editor: ASPxClientEdit): void; /** * Returns the client row that resides at the specified position within the row collection. * @param rowIndex A zero-based index that identifies the row within the row collection (the row's Index property value). @@ -8903,6 +9292,30 @@ interface ASPxClientVerticalGridBatchEditApi { * @param visibleIndex An integer value that identifies the record by its visible index. */ IsNewRecord(visibleIndex: number): boolean; + /** + * Adds a new record when ASPxVerticalGrid is in Batch Edit mode. + */ + AddNewRecord(): void; + /** + * Deletes the specified record when ASPxVerticalGrid is in Batch Edit mode. + * @param visibleIndex An integer value that identifies the record index. + */ + DeleteRecord(visibleIndex: number): void; + /** + * Deletes a record with a specified key value when ASPxVerticalGrid is in Batch Edit mode. + * @param key An object that uniquely identifies the record. + */ + DeleteRecordByKey(key: Object): void; + /** + * Recovers the specified record when ASPxVerticalGrid is in Batch Edit mode. + * @param visibleIndex An integer value that identifies the record index. + */ + RecoverRecord(visibleIndex: number): void; + /** + * Recovers a record with a specified key value when ASPxVerticalGrid is in Batch Edit mode. + * @param key An object that uniquely identifies the record. + */ + RecoverRecordByKey(key: Object): void; /** * Programmatically moves the focus to the previous cell in the record. */ @@ -8980,6 +9393,17 @@ interface ASPxClientVerticalGridBatchEditApi { * Ends the cell(s) editing. */ EndEdit(): void; + /** + * Provides the text displayed within the cell according to the specified display format rule. + * @param columnFieldNameOrId A string value representing the row's unique identifier or field name. + * @param value An object representing a value. + */ + GetColumnDisplayText(columnFieldNameOrId: string, value: Object): string; +} +/** + * Lists values that specify the document formats available for export from the grid. + */ +interface ASPxClientVerticalGridExportFormat extends ASPxClientGridExportFormat { } /** * Contains style settings related to media elements in ASPxHtmlEditor. @@ -9886,6 +10310,11 @@ interface ASPxClientHtmlEditor extends ASPxClientControl { * Performs validation of the editor's content. */ Validate(): void; + /** + * Returns a toolbar specified by its name. + * @param name A string value specifying the toolbar name. + */ + GetToolbarByName(name: string): ASPxClientMenu; /** * Set an active tab specified by its name. * @param name A string value that is the name of the tab. @@ -10730,22 +11159,246 @@ interface ASPxClientRichEditHyperlinkClickEventArgs extends ASPxClientEventArgs */ targetUri: string; } +/** + * A method that will handle the KeyDown event. + */ +interface ASPxClientRichEditKeyDownEventHandler { + /** + * A method that will handle the KeyDown event. + * @param source The event source. + * @param e An ASPxClientRichEditKeyDownEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditKeyDownEventArgs): void; +} +/** + * Provides data for the KeyDown event. + */ +interface ASPxClientRichEditKeyDownEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether the event is handled manually, so no default processing is required. + * Value: true if the event is handled and no default processing is required; otherwise false. + */ + handled: boolean; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle the KeyUp event. + */ +interface ASPxClientRichEditKeyUpEventHandler { + /** + * A method that will handle the KeyUp event. + * @param source The event source. + * @param e An ASPxClientRichEditKeyUpEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditKeyUpEventArgs): void; +} +/** + * Provides data for the KeyUp event. + */ +interface ASPxClientRichEditKeyUpEventArgs extends ASPxClientEventArgs { + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle the PointerDown event. + */ +interface ASPxClientRichEditPointerDownEventHandler { + /** + * A method that will handle the PointerDown event. + * @param source The event source. + * @param e An ASPxClientRichEditPointerDownEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditPointerDownEventArgs): void; +} +/** + * Provides data for the PointerDown event. + */ +interface ASPxClientRichEditPointerDownEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether the event is handled manually, so no default processing is required. + * Value: true if the event is handled and no default processing is required; otherwise false. + */ + handled: boolean; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle the PointerUp event. + */ +interface ASPxClientRichEditPointerUpEventHandler { + /** + * A method that will handle the PointerUp event. + * @param source The event source. + * @param e An ASPxClientRichEditPointerUpEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditPointerUpEventArgs): void; +} +/** + * Provides data for the PointerUp event. + */ +interface ASPxClientRichEditPointerUpEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether the event is handled manually, so no default processing is required. + * Value: true if the event is handled and no default processing is required; otherwise false. + */ + handled: boolean; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle the ContentInserted event. + */ +interface ASPxClientRichEditContentInsertedEventHandler { + /** + * A method that will handle the ContentInserted event. + * @param source The event source + * @param e An ASPxClientRichEditContentInsertedEventArgs that contains event data. + */ + (source: S, e: ASPxClientRichEditContentInsertedEventArgs): void; +} +/** + * Provides data for the ContentInserted event. + */ +interface ASPxClientRichEditContentInsertedEventArgs extends ASPxClientEventArgs { + /** + * Gets the active sub-document's identifier. + * Value: An integer value specifying the sub-document's identifier. + */ + subDocumentId: number; + /** + * Gets the text buffer interval related to the inserted content. + * Value: An object that stores the inserted content's length and position. + */ + interval: Interval; +} +/** + * A method that will handle the ContentRemoved event. + */ +interface ASPxClientRichEditContentRemovedEventHandler { + /** + * A method that will handle the ContentRemoved event. + * @param source The event source + * @param e An ASPxClientRichEditContentRemovedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditContentRemovedEventArgs): void; +} +/** + * Provides data for the ContentRemoved event. + */ +interface ASPxClientRichEditContentRemovedEventArgs extends ASPxClientEventArgs { + /** + * Gets the active sub-document's identifier. + * Value: An integer value specifying the sub-document's identifier + */ + subDocumentId: number; + /** + * Gets the text buffer interval related to the removed content. + * Value: An object that stores the removed content's length and position. + */ + interval: Interval; +} +/** + * A method that will handle the CharacterPropertiesChanged event. + */ +interface ASPxClientRichEditCharacterPropertiesChangedEventHandler { + /** + * A method that will handle the CharacterPropertiesChanged event. + * @param source The event source + * @param e An ASPxClientRichEditCharacterPropertiesChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditCharacterPropertiesChangedEventArgs): void; +} +/** + * Provides data for the CharacterPropertiesChanged event. + */ +interface ASPxClientRichEditCharacterPropertiesChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the active sub-document's identifier. + * Value: An integer value specifying the sub-document's identifier. + */ + subDocumentId: number; + /** + * Gets the text buffer interval related to the changed characters. + * Value: An object that stores the changed character length and position. + */ + interval: Interval; +} +/** + * A method that will handle the ParagraphPropertiesChanged event. + */ +interface ASPxClientRichEditParagraphPropertiesChangedEventHandler { + /** + * A method that will handle the ParagraphPropertiesChanged event. + * @param source The event source. + * @param e An ASPxClientRichEditParagraphPropertiesChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditParagraphPropertiesChangedEventArgs): void; +} +/** + * Provides data for the ParagraphPropertiesChanged event. + */ +interface ASPxClientRichEditParagraphPropertiesChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the active sub-document's identifier. + * Value: An integer value specifying the sub-document's identifier + */ + subDocumentId: number; + /** + * Gets the changed paragraph's index. + * Value: An integer value specifying the changed paragraph's identifier. + */ + paragraphIndex: number; +} +/** + * A method that will handle the PopupMenuShowing event. + */ +interface ASPxClientRichEditPopupMenuShowingEventHandler { + /** + * A method that will handle the PopupMenuShowing event. + * @param source The event source. + * @param e An ASPxClientRichEditPopupMenuShowingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditPopupMenuShowingEventArgs): void; +} +/** + * Provides data for the PopupMenuShowing event. + */ +interface ASPxClientRichEditPopupMenuShowingEventArgs extends ASPxClientCancelEventArgs { + /** + * Provides access to a collection of menu items in the context menu being invoked. + * Value: A object representing the context menu's item collection. + */ + menuItems: ASPxClientRichEditPopupMenuItemCollection; +} /** * A client-side equivalent of the ASPxRichEdit object. */ interface ASPxClientRichEdit extends ASPxClientControl { /** * Provides access to document structural elements. - * Value: A object that lists RichEdit's document structural elements. + * Value: A object that lists a RichEdit document's structural elements. */ document: RichEditDocument; /** - * Provides access to RichEdit's client-side commands. - * Value: A object that lists RichEdit's client-side commands. + * Provides access to the RichEdit's client-side commands. + * Value: A object that lists the RichEdit's client-side commands. */ commands: RichEditCommands; /** - * Provides access to the client methods that changes the selection. + * Provides access to the client methods that change the selection. * Value: A object that lists methods to work with the selection. */ selection: RichEditSelection; @@ -10778,18 +11431,70 @@ interface ASPxClientRichEdit extends ASPxClientControl { * Fires on the client if any server error occurs during server-side processing of a callback sent by the RichEdit. */ CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side when a document model is loaded into the control. + */ + DocumentLoaded: ASPxClientEvent>; /** * Fires if any change is made to the RichEdit's document on the client. */ DocumentChanged: ASPxClientEvent>; /** - * Occurs when a hyperlink is clicked within the document. + * Occurs when the active sub-document is substituted with another sub-document. + */ + ActiveSubDocumentChanged: ASPxClientEvent>; + /** + * Occurs when the control receives focus. + */ + GotFocus: ASPxClientEvent>; + /** + * Occurs when the control loses focus. + */ + LostFocus: ASPxClientEvent>; + /** + * Occurs when the mouse pointer is over the RichEdit's document and a mouse button is pressed. + */ + PointerDown: ASPxClientEvent>; + /** + * Occurs when the mouse button is released if it was pressed within the RichEdit's document. + */ + PointerUp: ASPxClientEvent>; + /** + * Occurs when a key is pressed while the ASPxRichEdit's document has focus. + */ + KeyDown: ASPxClientEvent>; + /** + * Occurs when a key is released while the ASPxRichEdit's document has focus. + */ + KeyUp: ASPxClientEvent>; + /** + * Occurs when a pop-up menu is about to be shown. + */ + PopupMenuShowing: ASPxClientEvent>; + /** + * Occurs when a hyperlink is activated within the document. */ HyperlinkClick: ASPxClientEvent>; /** * Occurs when the selection is changed within the document. */ SelectionChanged: ASPxClientEvent>; + /** + * Occurs when content is inserted into the document. + */ + ContentInserted: ASPxClientEvent>; + /** + * Occurs when content is removed from the document + */ + ContentRemoved: ASPxClientEvent>; + /** + * Occurs when the characters' formatting is changed. + */ + CharacterPropertiesChanged: ASPxClientEvent>; + /** + * Occurs when a paragraph's formatting is changed. + */ + ParagraphPropertiesChanged: ASPxClientEvent>; /** * Enables you to switch the full-screen mode of the Rich Text Editor. * @param fullscreen true to activate full-screen mode; false to deactivate full-screen mode. @@ -10823,6 +11528,123 @@ interface ASPxClientRichEdit extends ASPxClientControl { */ ReconnectToExternalRibbon(): void; } +/** + * Represents an individual item of the Rich Edit's context menu. + */ +interface ASPxClientRichEditPopupMenuItem { + /** + * Gets the immediate parent menu item to which the current menu item belongs. + * Value: A ASPxClientRichEditPopupMenuItem object representing the menu item's immediate parent. + */ + parent: ASPxClientRichEditPopupMenuItem; + /** + * Gets or sets the unique identifier name for the current menu item. + * Value: A string value that specifies the item's unique identifier name. + */ + name: string; + /** + * Gets or sets the text content of the current menu item. + * Value: A string value that specifies the text content of the menu item. + */ + text: string; + /** + * Gets or sets a value that indicates whether the menu item is enabled, allowing the item to respond to end-user interactions. + * Value: true if the item is enabled; otherwise, false. + */ + enabled: boolean; + /** + * Gets or sets the CSS class name defining the menu item's image. + * Value: A string value specifying the class name. + */ + imageClassName: string; + /** + * Gets or sets a URL which defines the navigation location. + * Value: A string value which represents a URL where the client web browser will navigate. + */ + navigateUrl: string; + /** + * Gets or sets the URL of the menu item's image. + * Value: A string value that specifies the location of an image. + */ + imageUrl: string; + /** + * Gets or sets a value that specifies whether the current menu item starts a group. + * Value: true if the current menu item starts a group; otherwise, false. + */ + beginGroup: boolean; + /** + * Gets or sets the current menu item's tooltip text. + * Value: A string which specifies the text content of the current menu item's tooltip. + */ + tooltip: string; + /** + * Gets or sets the window or frame at which to target the contents of the URL associated with the current menu item. + * Value: A string which identifies the window or frame at which to target the URL content. + */ + target: string; + /** + * Gets a collection that contains the submenu items of the current menu item. + */ + GetSubItems(): ASPxClientRichEditPopupMenuItemCollection; + /** + * Returns the menu item's sub-item with the specified index. + * @param index An integer value specifying the index of the sub-item within a collection of the current menu item's submenu items. + */ + GetItem(index: number): ASPxClientRichEditPopupMenuItem; + /** + * Returns the menu item's sub-item with the specified name property value. + * @param name A string value specifying the name property value of the sub-item to find. + */ + GetItemByName(name: string): ASPxClientRichEditPopupMenuItem; + /** + * Returns the total number of the menu item's child items (submenu items). + */ + GetItemCount(): number; +} +/** + * Represents a collection of items in the Rich Edit's context menu. + */ +interface ASPxClientRichEditPopupMenuItemCollection { + /** + * Adds the specified menu item to the end of the collection. + * @param item An ASPxClientRichEditPopupMenuItem object specifying the item to be added to the collection. + */ + Add(item: ASPxClientRichEditPopupMenuItem): void; + /** + * Removes a menu item specified by its index within the collection. + * @param index An integer value specifying the index of the menu item to remove. + */ + Remove(index: number): void; + /** + * Removes a menu item specified by its name. + * @param name A string value specifying the name property value of a menu item to remove from the collection. + */ + RemoveByName(name: string): void; + /** + * Adds the specified item to the specified position within the collection. + * @param index An integer value that specifies the zero-based index at which the specified item should be inserted. + * @param item An ASPxClientRichEditPopupMenuItem object to insert. + */ + Insert(index: number, item: ASPxClientRichEditPopupMenuItem): void; + /** + * Returns the total number of menu items in the collection. + */ + GetCount(): number; + /** + * Returns an item object with the specified name property value. + * @param name A string value representing the name property value of the required item. + */ + GetByName(name: string): ASPxClientRichEditPopupMenuItem; + /** + * Returns a menu item specified by its index in the collection. + * @param index An integer value that is the zero-based index of the to retrieve from the ASPxClientRichEditPopupMenuItemCollection. + */ + Get(index: number): ASPxClientRichEditPopupMenuItem; + /** + * Removes all menu items from the collection. + */ + Clear(): void; +} /** * Contains a set of the available client commands. */ @@ -10833,7 +11655,7 @@ interface RichEditCommands { */ fileNew: FileNewCommand; /** - * Gets a command to open the file, specifying its path. + * Gets a command to open a document stored in the specified file. * Value: A object that provides methods for executing the command and checking its state. */ fileOpen: FileOpenCommand; @@ -10843,22 +11665,22 @@ interface RichEditCommands { */ fileOpenDialog: FileOpenDialogCommand; /** - * Gets a command to save the document to a file. + * Gets a command to save the document at its original location on the server. * Value: A object that provides methods for executing the command and checking its state. */ fileSave: FileSaveCommand; /** - * Gets a command to download the document file, specifying its extension. + * Gets a command to download the document specifying the file's extension. * Value: A object that provides methods for executing the command and checking its state. */ fileDownload: FileDownloadCommand; /** - * Gets a command to invoke the Save As dialog that prompts for a file name and saves the current document in a file with the specified path. + * Gets a command to save a document in a file with the specified path. * Value: A object that provides methods for executing the command and checking its state. */ fileSaveAs: FileSaveAsCommand; /** - * Gets a command to open the file's Save As dialog. + * Gets a command to invoke the Save As dialog that prompts for a file name and saves the current document in a file with the specified path. * Value: A object that provides methods for executing the command and checking its state. */ fileSaveAsDialog: FileSaveAsDialogCommand; @@ -10898,17 +11720,17 @@ interface RichEditCommands { */ changeFontName: ChangeFontNameCommand; /** - * Gets a command to change the font size of characters in a selected range. + * Gets a command to change the font size (in points) of characters in a selected range. * Value: A object that provides methods for executing the command and checking its state. */ changeFontSize: ChangeFontSizeCommand; /** - * Gets a command to increase the font size of characters in a selected range to the closest larger predefined value. + * Gets a command to increase the font size of characters in a selected range to the closest larger predefined value (in points). * Value: A object that provides methods for executing the command and checking its state. */ increaseFontSize: IncreaseFontSizeCommand; /** - * Gets a command to decrease the selected range's font size to the closest smaller predefined value. + * Gets a command to decrease the selected range's font size to the closest smaller predefined value (in points). * Value: A object that provides methods for executing the command and checking its state. */ decreaseFontSize: DecreaseFontSizeCommand; @@ -10958,7 +11780,7 @@ interface RichEditCommands { */ changeFontSuperscript: ChangeFontSuperscriptCommand; /** - * Gets a command to change the subscript formatting of characters in the selected range. + * Gets a command to change the subscript formatting of characters in a selected range. * Value: A object that provides methods for executing the command and checking its state. */ changeFontSubscript: ChangeFontSubscriptCommand; @@ -10973,12 +11795,12 @@ interface RichEditCommands { */ changeFontBackColor: ChangeFontBackColorCommand; /** - * Gets a command to reset text and paragraph formatting in the selected range to default. + * Gets a command to reset textual and paragraph formatting in the selected range to default values. * Value: A object that provides methods for executing the command and checking its state. */ clearFormatting: ClearFormattingCommand; /** - * Gets a command to change the selected range's style. + * Gets a command to apply a character or paragraph style settings to text in a selected range. * Value: A object that provides methods for executing the command and checking its state. */ changeStyle: ChangeStyleCommand; @@ -11088,7 +11910,7 @@ interface RichEditCommands { */ openParagraphFormattingDialog: OpenParagraphFormattingDialogCommand; /** - * Gets a command to change the formatting of paragraphs in a selected range. + * Gets a command to apply formatting settings to paragraphs within a selected range. * Value: A object that provides methods for executing the command and checking its state. */ changeParagraphFormatting: ChangeParagraphFormattingCommand; @@ -11103,7 +11925,7 @@ interface RichEditCommands { */ openInsertTableDialog: OpenInsertTableDialogCommand; /** - * Gets a command to insert a rectangle table of a specified size. + * Gets a command to insert a rectangular table of the specified size. * Value: A object that provides methods for executing the command and checking its state. */ insertTable: InsertTableCommand; @@ -11113,7 +11935,7 @@ interface RichEditCommands { */ openInsertPictureDialog: OpenInsertPictureDialogCommand; /** - * Gets a command to insert an inline picture stored by specifed web address. + * Gets a command to insert an inline picture stored by the specified web address. * Value: A object that provides methods for executing the command and checking its state. */ insertPicture: InsertPictureCommand; @@ -11143,7 +11965,7 @@ interface RichEditCommands { */ openInsertHyperlinkDialog: OpenInsertHyperlinkDialogCommand; /** - * Gets a command to insert a hyperlink at the current position in the document. + * Gets a command to insert and update a hyperlink field in place of a selected range. * Value: A object that provides methods for executing the command and checking its state. */ insertHyperlink: InsertHyperlinkCommand; @@ -11158,7 +11980,7 @@ interface RichEditCommands { */ deleteHyperlinks: DeleteHyperlinksCommand; /** - * Gets a command to navigate to the document bookmark or URI (uniform resource identifier) specified for the hyperlink. + * Gets a command to go to a bookmark or URI contained within the selected hyperlink. * Value: A object that provides methods for executing the command and checking its state. */ openHyperlink: OpenHyperlinkCommand; @@ -11168,12 +11990,12 @@ interface RichEditCommands { */ openInsertSymbolDialog: OpenInsertSymbolDialogCommand; /** - * Gets a command to insert a character into a document. + * Gets a command to insert characters into a document instead of a selected range. * Value: A object that provides methods for executing the command and checking its state. */ insertSymbol: InsertSymbolCommand; /** - * Gets a command to change page margin settings. + * Gets a command to apply page margins settings to sections located within a selected range. * Value: A object that provides methods for executing the command and checking its state. */ changePageMargins: ChangePageMarginsCommand; @@ -11183,12 +12005,12 @@ interface RichEditCommands { */ openPageMarginsDialog: OpenPageMarginsDialogCommand; /** - * Gets a command to change the page orientation. + * Gets a command to apply page orientation settings to sections located within a selected range. * Value: A object that provides methods for executing the command and checking its state. */ changePageOrientation: ChangePageOrientationCommand; /** - * Gets a command to define the page size dialog's settings. + * Gets a command to invoke the Page Setup dialog. * Value: A object that provides methods for executing the command and checking its state. */ setPageSizeDialog: SetPageSizeDialogCommand; @@ -11198,12 +12020,12 @@ interface RichEditCommands { */ openPagePaperSizeDialog: OpenPagePaperSizeDialogCommand; /** - * Gets a command to change the page size. + * Gets a command to apply page size settings to sections located within a selected range. * Value: A object that provides methods for executing the command and checking its state. */ changePageSize: ChangePageSizeCommand; /** - * Gets a command to change the number of section columns having the same width. + * Gets a command to change the number of columns having the same width in a section. * Value: A object that provides methods for executing the command and checking its state. */ changeSectionEqualColumnCount: ChangeSectionEqualColumnCountCommand; @@ -11213,7 +12035,7 @@ interface RichEditCommands { */ openSectionColumnsDialog: OpenSectionColumnsDialogCommand; /** - * Gets a command to change the settings of individual section columns. + * Gets a command to apply column layout settings to a section. * Value: A object that provides methods for executing the command and checking its state. */ changeSectionColumns: ChangeSectionColumnsCommand; @@ -11238,7 +12060,7 @@ interface RichEditCommands { */ insertSectionBreakOddPage: InsertSectionBreakOddPageCommand; /** - * Gets a command to set the background color of the page. + * Gets a command to set the background color of all pages contained in the document. * Value: A object that provides methods for executing the command and checking its state. */ changePageColor: ChangePageColorCommand; @@ -11263,12 +12085,12 @@ interface RichEditCommands { */ insertParagraph: InsertParagraphCommand; /** - * Gets a command to insert text at the current position in a document. + * Gets a command to insert text in place of a selected range. * Value: A object that provides methods for executing the command and checking its state. */ insertText: InsertTextCommand; /** - * Gets a command to delete the text in a selected range. + * Gets a command to delete text and in-line objects in a selected range. * Value: A object that provides methods for executing the command and checking its state. */ delete: DeleteCommand; @@ -11283,7 +12105,7 @@ interface RichEditCommands { */ removeNextWord: RemoveNextWordCommand; /** - * Gets a command to move the cursor backwards and erase the character in that space. + * Gets a command to move the cursor backwards and erase characters in a selected range. * Value: A object that provides methods for executing the command and checking its state. */ backspace: BackspaceCommand; @@ -11293,12 +12115,12 @@ interface RichEditCommands { */ insertLineBreak: InsertLineBreakCommand; /** - * Gets a command to scale pictures in a selected range. + * Gets a command to scale a selected in-line picture. * Value: A object that provides methods for executing the command and checking its state. */ changePictureScale: ChangePictureScaleCommand; /** - * Gets a command to increment the left indentation of paragraphs in a selected range. + * Gets a command to increment the left indent of paragraphs in a selected range. * Value: A object that provides methods for executing the command and checking its state. */ incrementParagraphLeftIndent: IncrementParagraphLeftIndentCommand; @@ -11322,13 +12144,18 @@ interface RichEditCommands { * Value: A object that provides methods for executing the command and checking its state. */ insertTab: InsertTabCommand; + /** + * Gets a command to add a non-breaking space in place of a selected range + * Value: A object that provides methods for executing the command and checking its state. + */ + insertNonBreakingSpace: InsertNonBreakingSpaceCommand; /** * Gets a command to invoke the Tabs dialog window. * Value: A object that provides methods for executing the command and checking its state. */ openTabsDialog: OpenTabsDialogCommand; /** - * Gets a command to change the tab stop value of a document or selected paragraphs + * Gets a command to change the default tab stop value of a document and apply custom tab settings to the selected paragraphs. * Value: A object that provides methods for executing the command and checking its state. */ changeTabs: ChangeTabsCommand; @@ -11358,12 +12185,12 @@ interface RichEditCommands { */ decrementNumberingIndent: DecrementNumberingIndentCommand; /** - * Gets a command to create a field with an empty code and populate it with the selection (if it is not collapsed). + * Gets a command to create a field with an empty code and populate it with the characters in the selected range (if it is not collapsed). * Value: A object that provides methods for executing the command and checking its state. */ createField: CreateFieldCommand; /** - * Gets a command to update the field's result. + * Gets a command to update each field's result in the selection. * Value: A object that provides methods for executing the command and checking its state. */ updateField: UpdateFieldCommand; @@ -11388,12 +12215,12 @@ interface RichEditCommands { */ insertNumeration: InsertNumerationCommand; /** - * Gets a command to remove the selected numeration. + * Gets a command to exclude the selected paragraphs from the numbered list. * Value: A object that provides methods for executing the command and checking its state. */ removeNumeration: RemoveNumerationCommand; /** - * Gets a command to update all fields in the selected range. + * Gets a command to update all fields in the document. * Value: A object that provides methods for executing the command and checking its state. */ updateAllFields: UpdateAllFieldsCommand; @@ -11413,12 +12240,12 @@ interface RichEditCommands { */ createPageField: CreatePageFieldCommand; /** - * Gets a command to convert the text of all selected sentences to sentence case. + * Gets a command changing all selected text to the sentence case capitalization. * Value: A object that provides methods for executing the command and checking its state. */ makeTextSentenceCase: MakeTextSentenceCaseCommand; /** - * Gets a command to switch the text case at the current position in the document. + * Gets a command to switch the text capitalization in the selection. * Value: A object that provides methods for executing the command and checking its state. */ switchTextCase: SwitchTextCaseCommand; @@ -11438,7 +12265,7 @@ interface RichEditCommands { */ goToNextDataRecord: GoToNextDataRecordCommand; /** - * Gets a command to navigate to the next data record. + * Gets a command to open the specified data record. * Value: A object that provides methods for executing the command and checking its state. */ goToDataRecord: GoToDataRecordCommand; @@ -11478,12 +12305,12 @@ interface RichEditCommands { */ mailMergeAndSaveAs: MailMergeAndSaveAsCommand; /** - * Gets a command to activate the page header and begin editing. + * Gets a command to create a header sub-document (if it is not yet created) and set it as an active sub-document instead of the main sub-document. * Value: A object that provides methods for executing the command and checking its state. */ insertHeader: InsertHeaderCommand; /** - * Gets a command to activate the page footer and begin editing. + * Gets a command to create a footer sub-document (if it is not yet created) and set it as an active sub-document instead of the main sub-document. * Value: A object that provides methods for executing the command and checking its state. */ insertFooter: InsertFooterCommand; @@ -11493,37 +12320,37 @@ interface RichEditCommands { */ linkHeaderFooterToPrevious: LinkHeaderFooterToPreviousCommand; /** - * Gets a command to navigate to the page footer from the page header in the header/footer editing mode. + * Gets a command to substitute a header sub-document with a footer sub-document of the same page as an active sub-document. * Value: A object that provides methods for executing the command and checking its state. */ goToFooter: GoToFooterCommand; /** - * Gets a command to navigate to the page header from the page footer in the header/footer editing mode. + * Gets a command to substitute a footer sub-document with a header sub-document of the same page as an active sub-document. * Value: A object that provides methods for executing the command and checking its state. */ goToHeader: GoToHeaderCommand; /** - * Gets a command to navigate to the next page header or footer in the header/footer editing mode. + * Gets a command to substitute a current header/footer with a header/footer of the next section as an active sub-document. * Value: A object that provides methods for executing the command and checking its state. */ goToNextHeaderFooter: GoToNextHeaderFooterCommand; /** - * Gets a command to navigate to the previous page header or footer in the header/footer editing mode. + * Gets a command to substitute a current header/footer with a header/footer of the previous section as an active sub-document. * Value: A object that provides methods for executing the command and checking its state. */ goToPreviousHeaderFooter: GoToPreviousHeaderFooterCommand; /** - * Gets a command to change the header/footer edit mode, so it allows creation of a different header or footer for the first page of a document or section. + * Gets a command to enable (or disable if it is enabled) a different page header and footer for the first page of the current section. * Value: A object that provides methods for executing the command and checking its state. */ setDifferentFirstPageHeaderFooter: SetDifferentFirstPageHeaderFooterCommand; /** - * Gets a command to change the header/footer edit mode so it allows creation of a different header or footer for odd and even pages of a document or section. + * Gets a command to enable (or disable if it is enabled) a different page header and footer for odd and even pages of the current section. * Value: A object that provides methods for executing the command and checking its state. */ setDifferentOddAndEvenPagesHeaderFooter: SetDifferentOddAndEvenPagesHeaderFooterCommand; /** - * Gets a command to finish header/footer editing. + * Gets a command to substitute a header/footer sub-document with the main sub-document as an active sub-document. * Value: A object that provides methods for executing the command and checking its state. */ closeHeaderFooter: CloseHeaderFooterCommand; @@ -11553,7 +12380,7 @@ interface RichEditCommands { */ changeTableCellPreferredWidth: ChangeTableCellPreferredWidthCommand; /** - * Gets a command to toggle inside borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings of the inside borders for the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellInsideBorders: ToggleTableCellInsideBordersCommand; @@ -11708,22 +12535,22 @@ interface RichEditCommands { */ changeTableStyle: ChangeTableStyleCommand; /** - * Gets a command to toggle top borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings of the top border for the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellTopBorder: ToggleTableCellTopBorderCommand; /** - * Gets a command to toggle right borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings of the right border for the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellRightBorder: ToggleTableCellRightBorderCommand; /** - * Gets a command to toggle bottom borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings of the bottom border for the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellBottomBorder: ToggleTableCellBottomBorderCommand; /** - * Gets a command to toggle left borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings of the left border for the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellLeftBorder: ToggleTableCellLeftBorderCommand; @@ -11733,22 +12560,22 @@ interface RichEditCommands { */ removeTableCellBorders: RemoveTableCellBordersCommand; /** - * Gets a command to toggle all borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings to all borders of the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellAllBorders: ToggleTableCellAllBordersCommand; /** - * Gets a command to toggle inner horizontal borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings of the inside horizontal borders for the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellInsideHorizontalBorders: ToggleTableCellInsideHorizontalBordersCommand; /** - * Gets a command to toggle inner vertical borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings of the inside vertical borders for the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellInsideVerticalBorders: ToggleTableCellInsideVerticalBordersCommand; /** - * Gets a command to toggle outer borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings of the outside borders for the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellOutsideBorders: ToggleTableCellOutsideBordersCommand; @@ -11758,12 +12585,12 @@ interface RichEditCommands { */ changeTableLook: ChangeTableLookCommand; /** - * Gets a command to change the repository item's table border style. + * Gets a command to apply borders' drawing settings. * Value: A object that provides methods for executing the command and checking its state. */ changeTableBorderRepositoryItem: ChangeTableBorderRepositoryItemCommand; /** - * Gets a command to change cell shading in the selected table elements. + * Gets a command to change cell shading in selected table cells. * Value: A object that provides methods for executing the command and checking its state. */ changeTableCellShading: ChangeTableCellShadingCommand; @@ -11788,17 +12615,17 @@ interface RichEditCommands { */ findAll: FindAllCommand; /** - * Gets a command to hide the results of the search. + * Gets a command to hide the search results. * Value: A object that provides methods for executing the command and checking its state. */ hideFindResults: HideFindResultsCommand; /** - * Gets a command to search for a specific text and replace all matches in the document with the specified string. + * Gets a command to replace all matches of the specified text with new characters. * Value: A object that provides methods for executing the command and checking its state. */ replaceAll: ReplaceAllCommand; /** - * Gets a command to search for a specific text and replace the next match in the document with the specified string. + * Gets a command to find and replace a next match of the specified text after the cursor position with new characters. * Value: A object that provides methods for executing the command and checking its state. */ replaceNext: ReplaceNextCommand; @@ -11853,7 +12680,7 @@ interface RichEditCommands { */ changeFloatingObjectAbsoluteSize: ChangeFloatingObjectAbsoluteSizeCommand; /** - * Gets a command to modify a text box' relative size settings. + * Gets a command to modify a text box's relative size settings. * Value: A object that provides methods for executing the command and checking its state. */ changeTextBoxRelativeSize: ChangeTextBoxRelativeSizeCommand; @@ -11883,11 +12710,20 @@ interface RichEditCommands { */ changeFloatingObjectOutlineWidth: ChangeFloatingObjectOutlineWidthCommand; /** - * Gets a command to modify a text box' content margins. + * Gets a command to modify a text box's content margins. * Value: A object that provides methods for executing the command and checking its state. */ changeTextBoxContentMargins: ChangeTextBoxContentMarginsCommand; + /** + * Gets a command to resize the shape to fit the text in the text box. + * Value: A object that provides methods for executing the command and checking its state. + */ changeTextBoxResizeShapeToFitText: ChangeTextBoxResizeShapeToFitTextCommand; + /** + * Gets a command to add an HTML formatted content in place of a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertHtml: InsertHtmlCommand; } /** * Serves as a base for objects that implement different client command functionalities. @@ -11981,6 +12817,10 @@ interface RichEditDocument { * An abstract numbering list definition that defines the appearance and behavior of numbered paragraphs in a document. */ interface AbstractNumberingList { + /** + * Gets or sets a value indicating whether an abstract numbering list is deleted. + * Value: true, if the abstract numbering list is deleted; otherwise, false. + */ deleted: boolean; } /** @@ -12067,6 +12907,11 @@ interface Field { * Value: true, if the field code is displayed; false, if the field result is displayed. */ showCode: boolean; + /** + * Gets the index of the field + * Value: An integer value specifying the field's index + */ + index: number; } /** * Defines a bookmark in the document. @@ -12468,7 +13313,7 @@ interface SpellingInfo { spellCheckerState: any; /** * Provides access to an array containing misspelled intervals. - * Value: An array of objects. + * Value: An array of MisspelledInterval objects. */ misspelledIntervals: MisspelledInterval[]; } @@ -12635,6 +13480,26 @@ interface SubDocument { * Value: An integer that is the number of character positions in the document. */ length: number; + /** + * Returns a field if its interval includes the specified position. + * @param position An integer value specifying the target field's position. + */ + findFields(position: number): Field[]; + /** + * Returns all fields contained in the specified interval. + * @param interval A text buffer interval that contains the target fields. + */ + findFields(interval: Interval): Field[]; + /** + * Returns a table if its interval includes the specified position. + * @param position An integer value specifying the target table's position. + */ + findTables(position: number): Field[]; + /** + * Returns all tables contained in the specified interval. + * @param interval A text buffer interval that contains the target tables. + */ + findTables(interval: Interval): Field[]; } declare enum SubDocumentType { Main=0, @@ -12656,6 +13521,11 @@ interface Table { * Value: A integer value specifying the character length of the table. */ length: number; + /** + * Gets an index of the table. + * Value: An integer value specifying the table's index. + */ + index: number; /** * Gets the text buffer interval occupied by the current table element. * Value: An object specifying the interval settings. @@ -12809,7 +13679,7 @@ interface DeleteBookmarkCommand extends CommandWithSimpleStateBase { interface GoToBookmarkCommand extends CommandWithSimpleStateBase { /** * Executes the GoToBookmarkCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param name + * @param name A string value specifying the bookmark's name */ execute(name: string): boolean; } @@ -12857,6 +13727,11 @@ interface UpdateFieldCommand extends CommandWithSimpleStateBase { * Executes the UpdateFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. */ execute(): boolean; + /** + * Executes the UpdateFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param callback A callback function that is performed when updating of all fields in the selection is completed. + */ + execute(callback: Function): boolean; } /** * A command to display the selected field's field codes. @@ -12894,6 +13769,11 @@ interface UpdateAllFieldsCommand extends CommandWithSimpleStateBase { * Executes the UpdateAllFieldsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. */ execute(): boolean; + /** + * Executes the UpdateAllFieldsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param callback A callback function that is performed when updating of all fields in the document is completed. + */ + execute(callback: Function): boolean; } /** * A command to insert a DATE field displaying the current date. @@ -12945,6 +13825,10 @@ interface DataRecordOptions { * Value: An integer value specifying the data record index. */ activeRecordIndex: number; + /** + * Gets or sets the count of data source records. + * Value: An integer value specifying the count of data source records. + */ recordCount: number; } /** @@ -13163,7 +14047,7 @@ interface FileSaveCommand extends CommandWithSimpleStateBase { interface FileSaveAsCommand extends CommandWithSimpleStateBase { /** * Executes the FileSaveAsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param path A string value specifying path to the saving file. + * @param path A string value specifying path to the saving file. Note that the path should be relative to the work directory. */ execute(path: string): boolean; /** @@ -13231,15 +14115,15 @@ interface FindAllCommand extends CommandWithSimpleStateBase { * Executes the FindAllCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. * @param text A string value specifying finding text. * @param matchCase true, to perform a case-sensitive search; otherwise, false. - * @param highlightResults true, to highlight result of search; otherwise, false. + * @param highlightResults true, to highlight the search results; otherwise, false. */ execute(text: string, matchCase: boolean, highlightResults: boolean): boolean; /** * Executes the FindAllCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. * @param text A string value specifying text to find. * @param matchCase true, to perform a case-sensitive search; otherwise, false. - * @param highlightResults true, to highlight result of search; otherwise, false. - * @param results An array of Interval objects containing the results of search. + * @param highlightResults true, to highlight the search results; otherwise, false. + * @param results An array of Interval objects containing the search results. */ execute(text: string, matchCase: boolean, highlightResults: boolean, results: Interval[]): boolean; } @@ -13259,7 +14143,7 @@ interface ReplaceAllCommand extends CommandWithSimpleStateBase { /** * Executes the ReplaceAllCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. * @param text A string value specifying a text to replace. - * @param replaceText A string value specifying the replacing text. + * @param replaceText A string value specifying the inserted text. * @param matchCase true, to perform a case-sensitive search; otherwise, false. */ execute(text: string, replaceText: string, matchCase: boolean): boolean; @@ -13270,8 +14154,8 @@ interface ReplaceAllCommand extends CommandWithSimpleStateBase { interface ReplaceNextCommand extends CommandWithSimpleStateBase { /** * Executes the ReplaceNextCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param text A string value specifying text to replace. - * @param replaceText A string value specifying replacing text. + * @param text A string value specifying a text to replace. + * @param replaceText A string value specifying the inserted text. * @param matchCase true, to perform a case-sensitive search; otherwise, false. */ execute(text: string, replaceText: string, matchCase: boolean): boolean; @@ -13325,7 +14209,7 @@ interface ChangeFloatingObjectAlignmentPositionCommand extends CommandBase { interface ChangeFloatingObjectAbsolutePositionCommand extends CommandBase { /** * Executes the ChangeFloatingObjectAbsolutePositionCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param settings A FloatingObjectAbsolutePositionSettings object specifying page margin settings. + * @param settings A FloatingObjectAbsolutePositionSettings object specifying object position settings. */ execute(settings: FloatingObjectAbsolutePositionSettings): boolean; /** @@ -13473,8 +14357,18 @@ interface ChangeTextBoxContentMarginsCommand extends CommandBase { */ getState(): any; } +/** + * A command to resize the shape to fit the text in the text box. + */ interface ChangeTextBoxResizeShapeToFitTextCommand extends CommandBase { + /** + * Executes the ChangeTextBoxResizeShapeToFitTextCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param resizeShapeToFitText true, to resize the shape to fit the text; otherwise, false. + */ execute(resizeShapeToFitText: boolean): boolean; + /** + * Gets information about the command state. + */ getState(): any; } /** @@ -13508,7 +14402,7 @@ interface FloatingObjectAlignmentPositionSettings { interface FloatingObjectAbsolutePositionSettings { /** * Gets or sets a floating object's horizontal position relative to an element specified by the horizontalPositionType property. - * Value: An integer value specifying the position. + * Value: An integer value specifying the position in twips. */ horizontalAbsolutePosition: number; /** @@ -13518,7 +14412,7 @@ interface FloatingObjectAbsolutePositionSettings { horizontalPositionType: any; /** * Gets or sets a floating object's vertical position relative to an element specified by the verticalPositionType property. - * Value: An integer value specifying the position. + * Value: An integer value specifying the position in twips. */ verticalAbsolutePosition: number; /** @@ -13533,7 +14427,7 @@ interface FloatingObjectAbsolutePositionSettings { interface FloatingObjectRelativePositionSettings { /** * Gets or sets the horizontal distance between the edge of a floating object and the element specified by the horizontalRelativePosition property - * Value: An integer value specifying the horizontal position. + * Value: An integer value specifying the horizontal position in twips. */ horizontalRelativePosition: number; /** @@ -13543,7 +14437,7 @@ interface FloatingObjectRelativePositionSettings { horizontalPositionType: any; /** * Gets or sets the horizontal distance between the edge of a floating object and the element specified by the verticalRelativePosition property - * Value: An integer value specifying the vertical position. + * Value: An integer value specifying the vertical position in twips. */ verticalRelativePosition: number; /** @@ -13568,22 +14462,22 @@ interface FloatingObjectTextWrappingSettings { floatingObjectTextWrapSide: any; /** * Gets or sets the left offset of text wrapping. - * Value: An integer value specifying the left offset. + * Value: An integer value specifying the left offset in twips. */ leftDistance: number; /** * Gets or sets the right offset of text wrapping. - * Value: An integer value specifying the right offset. + * Value: An integer value specifying the right offset in twips. */ rightDistance: number; /** * Gets or sets the top offset of text wrapping. - * Value: An integer value specifying the top offset. + * Value: An integer value specifying the top offset in twips. */ topDistance: number; /** * Gets or sets the bottom offset of text wrapping. - * Value: An integer value specifying the bottom offset. + * Value: An integer value specifying the bottom offset in twips. */ bottomDistance: number; } @@ -13593,12 +14487,12 @@ interface FloatingObjectTextWrappingSettings { interface FloatingObjectAbsoluteSizeSettings { /** * Gets or sets a floating object's absolute width. - * Value: An integer value specifying the width. + * Value: An integer value specifying the width in twips. */ absoluteWidth: number; /** * Gets or sets a floating object's absolute height. - * Value: An integer value specifying the height. + * Value: An integer value specifying the height in twips. */ absoluteHeight: number; } @@ -13710,6 +14604,16 @@ interface RedoCommand extends CommandWithSimpleStateBase { */ execute(): boolean; } +/** + * A command to add an HTML formatted content in place of a selected range. + */ +interface InsertHtmlCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertHtmlCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param html A string that specifies the inserted HTML code. + */ + execute(html: string): boolean; +} /** * A command to invoke the Hyperlink dialog. */ @@ -13725,7 +14629,7 @@ interface OpenInsertHyperlinkDialogCommand extends CommandWithSimpleStateBase { interface InsertHyperlinkCommand extends CommandBase { /** * Executes the InsertHyperlinkCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param settings A HyperLinkSettings object specifying hyperlink settings. + * @param settings A HyperlinkSettings object specifying hyperlink settings. */ execute(settings: HyperlinkSettings): boolean; /** @@ -14204,8 +15108,8 @@ interface ChangePictureScaleCommand extends CommandBase { execute(scale: Scale): boolean; /** * Executes the ChangePictureScaleCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param x An interger number specifying width of the picture - * @param y An interger number specifying height of the picture + * @param x An integer number specifying the scaling value for the width of the picture as a percentage. + * @param y An integer number specifying the scaling value for the height of the picture as a percentage. */ execute(x: number, y: number): boolean; /** @@ -14229,7 +15133,7 @@ interface MoveContentCommand extends CommandWithSimpleStateBase { interface CopyContentCommand extends CommandWithSimpleStateBase { /** * Executes the CopyContentCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param position An integer number value specifying position for pasting selected text. + * @param position An integer value specifying a position of the inserted text. */ execute(position: number): boolean; } @@ -14242,6 +15146,15 @@ interface InsertTabCommand extends CommandWithSimpleStateBase { */ execute(): boolean; } +/** + * A command to add a non-breaking space in place of a selected range. + */ +interface InsertNonBreakingSpaceCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertNonBreakingSpaceCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} /** * Defines the scaling settings. */ @@ -14263,10 +15176,10 @@ interface Scale { interface ChangePageMarginsCommand extends CommandBase { /** * Executes the ChangePageMarginsCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param left An integer number specifying left margin of the page. - * @param top An integer number specifying top margin of the page. - * @param right An integer number specifying right margin of the page. - * @param bottom An integer number specifying bottom margin of the page. + * @param left An integer number specifying left margin of the page in twips. + * @param top An integer number specifying top margin of the page in twips. + * @param right An integer number specifying right margin of the page in twips. + * @param bottom An integer number specifying bottom margin of the page in twips. */ execute(left: number, top: number, right: number, bottom: number): boolean; /** @@ -14326,8 +15239,8 @@ interface SetPageSizeDialogCommand extends CommandWithSimpleStateBase { interface ChangePageSizeCommand extends CommandBase { /** * Executes the ChangePageSizeCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param width An integer number specifying width of the page. - * @param height An integer number specifying height of the page. + * @param width An integer number specifying width of the page in twips. + * @param height An integer number specifying height of the page in twips. */ execute(width: number, height: number): boolean; /** @@ -14383,7 +15296,7 @@ interface ChangeSectionColumnsCommand extends CommandBase { interface ChangePageColorCommand extends CommandBase { /** * Executes the ChangePageColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param color A string specifying a background color the page. May be specified as a color name or a hex color value. + * @param color A string specifying a background color of all pages contained in the document. May be specified as a color name or a hex color value. */ execute(color: string): boolean; /** @@ -14497,12 +15410,12 @@ interface CloseHeaderFooterCommand extends CommandWithSimpleStateBase { interface SectionColumn { /** * Gets or sets the width of the section column. - * Value: An integer value specifying the section column width. + * Value: An integer value specifying the section column width in twips. */ width: number; /** * Gets or sets the amount of space between adjacent section columns. - * Value: An integer value specifying the spacing between section columns. + * Value: An integer value specifying the spacing after a column in twips. */ spacing: number; } @@ -14511,12 +15424,12 @@ interface SectionColumn { */ interface Size { /** - * Gets or sets the width value. + * Gets or sets the width value in twips. * Value: An integer value specifying the width. */ width: number; /** - * Gets or sets the height value. + * Gets or sets the height value in twips. * Value: An integer value specifying the height. */ height: number; @@ -14527,22 +15440,22 @@ interface Size { interface Margins { /** * Gets or sets the left margin. - * Value: An integer value specifying the left margin. + * Value: An integer value specifying the left margin in twips. */ left: number; /** * Gets or sets the top margin. - * Value: An integer value specifying the top margin. + * Value: An integer value specifying the top margin in twips. */ top: number; /** * Gets or sets the right margin. - * Value: An integer value specifying the right margin. + * Value: An integer value specifying the right margin in twips. */ right: number; /** * Gets or sets the bottom margin. - * Value: An integer value specifying the bottom margin. + * Value: An integer value specifying the bottom margin in twips. */ bottom: number; } @@ -14829,17 +15742,17 @@ interface ParagraphFormattingSettings { */ outlineLevel: number; /** - * Gets or sets the right indent value for the specified paragraph. + * Gets or sets the right indent value for the specified paragraph (in twips). * Value: An integer value specifying the right indent. */ rightIndent: number; /** - * Gets or sets the spacing before the current paragraph. + * Gets or sets the spacing before each selected paragraph (in twips). * Value: An integer value specifying the spacing before the paragraph. */ spacingBefore: number; /** - * Gets or sets the spacing after the current paragraph. + * Gets or sets the spacing after each selected paragraph (in twips). * Value: An integer value specifying the spacing after the paragraph. */ spacingAfter: number; @@ -14854,7 +15767,7 @@ interface ParagraphFormattingSettings { */ firstLineIndentType: any; /** - * Gets or sets a value specifying the indent of the first line of a paragraph. + * Gets or sets a value specifying the indent of the first line of a paragraph (in twips). * Value: An integer value specifying the indent of the first line. */ firstLineIndent: number; @@ -14874,12 +15787,12 @@ interface ParagraphFormattingSettings { */ pageBreakBefore: boolean; /** - * Gets or sets the left indent for text within a paragraph. + * Gets or sets the left indent for text within a paragraph (in twips). * Value: An integer value specifying the left indent. */ leftIndent: number; /** - * Gets or sets a line spacing value. + * Gets or sets a line spacing value (in twips). * Value: An integer value specifying the line spacing. */ lineSpacing: number; @@ -14914,10 +15827,10 @@ declare enum ParagraphFirstLineIndent { interface AssignShortcutCommand extends CommandWithSimpleStateBase { /** * Executes the AssignShortcutCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param keyCode An integer value specifying the code uniquely identifying the key combination. - * @param callback A callback function to execute on pressing the shortcut. + * @param keyCode A specifically generated code that uniquely identifies the combination of keys specified for a shortcut. This code is specified using the GetShortcutCode method. + * @param callback A callback function to execute when a shortcut is activated. */ - execute(keyCode: number, callback: (arg1: string) => void): boolean; + execute(keyCode: number, callback: Function): boolean; } /** * A command to invoke the Spelling dialog window. @@ -15529,7 +16442,7 @@ interface TableBorderSettings { */ color: string; /** - * Gets or sets the border line width. + * Gets or sets the border line width in twips. * Value: An integer value defining the border line width. */ width: number; @@ -15752,22 +16665,22 @@ interface TableCellFormattingSettings { */ noWrap: boolean; /** - * Gets or sets a table cell's left margin. + * Gets or sets a table cell's left margin in twips. * Value: An integer value specifying the left margin. */ marginLeft: number; /** - * Gets or sets a table cell's right margin. + * Gets or sets a table cell's right margin in twips. * Value: An integer value specifying the right margin. */ marginRight: number; /** - * Gets or sets a table cell's top margin. + * Gets or sets a table cell's top margin in twips. * Value: An integer value specifying the top margin. */ marginTop: number; /** - * Gets or sets a table cell's bottom margin. + * Gets or sets a table cell's bottom margin in twips. * Value: An integer value specifying the bottom margin. */ marginBottom: number; @@ -15798,12 +16711,12 @@ interface TableFormattingSettings { */ alignment: any; /** - * Gets or sets the table's left indent. + * Gets or sets the table's left indent in twips. * Value: An integer value specifying the indent. */ indent: number; /** - * Gets or sets the spacing between table cells. + * Gets or sets the spacing between table cells in twips. * Value: An integer value specifying the spacing. */ spacingBetweenCells: number; @@ -15818,22 +16731,22 @@ interface TableFormattingSettings { */ resizeToFitContent: boolean; /** - * Gets or sets the default left margin for cells in the table. + * Gets or sets the default left margin for cells in the table in twips. * Value: An integer value specifying the margin value. */ defaultCellMarginLeft: number; /** - * Gets or sets the default right margin for cells in the table. + * Gets or sets the default right margin for cells in the table in twips. * Value: An integer value specifying the margin value. */ defaultCellMarginRight: number; /** - * Gets or sets the default top margin for cells in the table. + * Gets or sets the default top margin for cells in the table in twips. * Value: An integer value specifying the margin value. */ defaultCellMarginTop: number; /** - * Gets or sets the default bottom margin for cells in the table. + * Gets or sets the default bottom margin for cells in the table in twips. * Value: An integer value specifying the margin value. */ defaultCellMarginBottom: number; @@ -15843,7 +16756,7 @@ interface TableFormattingSettings { */ interface TableWidthUnit { /** - * Gets or sets the table width value. + * Gets or sets the table width value in twips. * Value: An integer value specifying the table width. */ value: number; @@ -15858,7 +16771,7 @@ interface TableWidthUnit { */ interface TableHeightUnit { /** - * Gets or sets the table height value. + * Gets or sets the table height value in twips. * Value: An integer value specifying the table height. */ value: number; @@ -15907,7 +16820,7 @@ interface ChangeFontNameCommand extends CommandBase { interface ChangeFontSizeCommand extends CommandBase { /** * Executes the ChangeFontSizeCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param fontSize An integer number specifying the font size. + * @param fontSize An integer number specifying the font size in points. */ execute(fontSize: number): boolean; /** @@ -16161,7 +17074,7 @@ interface FontFormattingSettings { */ fontName: string; /** - * Gets or sets the character(s) font size. + * Gets or sets the character(s) font size (in points). * Value: An integer value specifying the font size. */ size: number; @@ -16197,7 +17110,7 @@ interface FontFormattingSettings { italic: boolean; /** * Gets or sets a value specifying whether the strikeout formatting is applied to a character(s). - * Value: true if the strikeout formatting is applied; otherwise, false. + * Value: true, if the strikeout formatting is applied; otherwise, false. */ strikeout: boolean; /** @@ -16972,7 +17885,7 @@ interface YearlyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAcce GetWeekOfMonth(): ASPxClientWeekOfMonth; } /** - * Provides base functionality for ASPxClientScheduler's forms. + * Provides base functionality for the ASPxClientScheduler's forms. */ interface ASPxClientFormBase { /** @@ -17201,6 +18114,10 @@ interface ASPxClientScheduler extends ASPxClientControl { * Client-side event that fires before an appointment is deleted. */ AppointmentDeleting: ASPxClientEvent>; + /** + * Fires on the client side before the appointment tooltip is shown. + */ + AppointmentToolTipShowing: ASPxClientEvent>; /** * Client-side scripting method that gets the active View. */ @@ -17265,6 +18182,24 @@ interface ASPxClientScheduler extends ASPxClientControl { * Client-side function that returns the time interval, selected in the scheduler. */ GetSelectedInterval(): ASPxClientTimeInterval; + /** + * Selects time cells which encompass the specified time interval on the client side. + * @param interval An ASPxClientTimeInterval object that specifies the time interval to select. + */ + SetSelection(interval: ASPxClientTimeInterval): void; + /** + * Selects time cells which encompass the specified time interval on the client side. + * @param interval An ASPxClientTimeInterval object that specifies the time interval to select. + * @param resourceId An integer value specifying the ID of the resource to which the specified time interval belongs. + */ + SetSelection(interval: ASPxClientTimeInterval, resourceId: string): void; + /** + * Selects time cells which encompass the specified time interval on the client side. + * @param interval An ASPxClientTimeInterval object that specifies the time interval to select. + * @param resourceId An integer value specifying the ID of the resource to which the specified time interval belongs. + * @param scrollToSelection true, to scroll the scheduler's contents to make the selection visible; otherwise, false. + */ + SetSelection(interval: ASPxClientTimeInterval, resourceId: string, scrollToSelection: boolean): void; /** * Client-side function that returns the ResourceId of selected time cell's resource. */ @@ -17292,6 +18227,12 @@ interface ASPxClientScheduler extends ASPxClientControl { * @param aptId An appointment's identifier. */ SelectAppointmentById(aptId: Object): void; + /** + * Selects the appointment with the specified ID. + * @param aptId An integer value specifying the appointment ID. + * @param scrollToSelection true, to scroll to the selected appointment; otherwise, false. + */ + SelectAppointmentById(aptId: Object, scrollToSelection: boolean): void; /** * Enables obtaining appointment property values in a client-side script. Executes the callback command with the AppointmentData identifier. * @param aptId An integer, representing the appointment ID. @@ -17439,6 +18380,42 @@ interface ASPxClientScheduler extends ASPxClientControl { * Client-side scripting method that changes the alert time for the selected reminder to the specified interval. */ ReminderFormSnooze(): void; + /** + * Specifies whether the toolbar is visible. + * @param visible true, to make the toolbar visible; otherwise, false. + */ + SetToolbarVisible(visible: boolean): void; + /** + * Returns a value specifying whether a toolbar is displayed. + */ + GetToolbarVisible(): boolean; + /** + * Specifies whether the Resource Navigator is visible. + * @param visible true, to make the Resource Navigator visible; otherwise, false. + */ + SetResourceNavigatorVisible(visible: boolean): void; + /** + * Returns a value specifying whether the Resource Navigator is displayed. + */ + GetResourceNavigatorVisible(): boolean; + /** + * Returns the value specifying the Scheduler's scrollable area height. + */ + GetScrollAreaHeight(): number; + /** + * Specifies the All-Day Area area height. + * @param height An integer value specifying the all-day area height. + */ + SetAllDayAreaHeight(height: number): void; + /** + * Gets the All-Day Area area height. + */ + GetAllDayAreaHeight(): number; + /** + * Sets the Scheduler's height. + * @param height An integer value specifying the scheduler's height. + */ + SetHeight(height: number): void; } /** * Represents a client-side equivalent of the SchedulerViewType object. @@ -17923,6 +18900,27 @@ interface CellClickEventArgs extends ASPxClientEventArgs { */ resource: string; } +/** + * A method that will handle the client AppointmentToolTipShowing event. + */ +interface ASPxClientAppointmentToolTipShowingEventHandler { + /** + * A method that will handle the corresponding client event. + * @param source The event source. + * @param e An ASPxClientAppointmentToolTipShowingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientAppointmentToolTipShowingEventArgs): void; +} +/** + * Provides data for the AppointmentToolTipShowing event. + */ +interface ASPxClientAppointmentToolTipShowingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the appointment. + * Value: An ASPxClientAppointment object representing the appointment. + */ + appointment: ASPxClientAppointment; +} /** * Contains information about a client tooltip. */ @@ -17968,13 +18966,13 @@ interface ASPxClientToolTipBase { */ CalculatePosition(bounds: Object): ASPxClientPoint; /** - * Displays the Appointment Menu in the position of the tooltip. - * @param eventObject An object containing information about the event on which the menu is displayed. + * Displays the Appointment Menu at the position of the tooltip. + * @param eventObject An object containing information about the event in which the menu is displayed. */ ShowAppointmentMenu(eventObject: Object): void; /** - * Displays the View Menu in the position of the tooltip. - * @param eventObject An object containing information about the event on which the menu is displayed. + * Displays the View Menu at the position of the tooltip. + * @param eventObject An object containing information about the event in which the menu is displayed. */ ShowViewMenu(eventObject: Object): void; /** @@ -18579,6 +19577,20 @@ interface ASPxClientTreeList extends ASPxClientControl { * Occurs after a column's width has been changed by an end-user. */ ColumnResized: ASPxClientEvent>; + /** + * Hides the Filter Control. + */ + CloseFilterControl(): void; + /** + * Enables or disables the current filter. + * @param isFilterEnabled true to enable the current filter; otherwise, false. + */ + SetFilterEnabled(isFilterEnabled: boolean): void; + /** + * Specifies a custom editor for the search panel on the client side. + * @param editor An ASPxClientEdit object representing a custom editor. + */ + SetSearchPanelCustomEditor(editor: ASPxClientEdit): void; /** * Sets input focus to the ASPxTreeList. */ @@ -18973,6 +19985,66 @@ interface ASPxClientTreeList extends ASPxClientControl { * @param position An integer value specifying the horizontal scroll position. */ SetHorizontalScrollPosition(position: number): void; + /** + * Exports tree list data to a file in the specified format. + * @param format An ASPxClientTreeListExportFormat object specifying the export format. + */ + ExportTo(format: ASPxClientTreeListExportFormat): void; + /** + * Applies the specified filter expression to the tree list. + * @param filterExpression A string value that specifies the filter expression. + */ + ApplyFilter(filterExpression: string): void; + /** + * Clears the filter expression applied to a client Tree List. + */ + ClearFilter(): void; + /** + * Applies a filter specified in the filter row to the ASPxTreeList. + */ + ApplyOnClickRowFilter(): void; + /** + * Applies the specified search panel filter criterion to tree list data. + * @param value A string value that specifies the filter criterion. + */ + ApplySearchPanelFilter(value: string): void; + /** + * Returns the editor used to edit the value in the auto filter row for the specified data column. + * @param column An ASPxClientTreeListColumn object that represents the data column within the ASPxTreeList. + */ + GetAutoFilterEditor(column: ASPxClientTreeListColumn): Object; + /** + * Returns the editor used to edit the value in the auto filter row for the specified data column. + * @param columnIndex An integer value that identifies the data column by its index. + */ + GetAutoFilterEditor(columnIndex: number): Object; + /** + * Returns the editor used to edit the value in the auto filter row for the specified data column. + * @param columnFieldNameOrId A string value that specifies the column's name or its data base field name. + */ + GetAutoFilterEditor(columnFieldNameOrId: string): Object; + /** + * Applies a filter to the specified data column. + * @param column An ASPxClientTreeListColumn object that represents the data column within the client Tree List. + * @param val A string value that specifies the filter expression. + */ + AutoFilterByColumn(column: ASPxClientTreeListColumn, val: string): void; + /** + * Applies a filter to the specified data column. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param val A string value that specifies the filter expression. + */ + AutoFilterByColumn(columnIndex: number, val: string): void; + /** + * Applies a filter to the specified data column. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param val A string value that specifies the filter expression. + */ + AutoFilterByColumn(columnFieldNameOrId: string, val: string): void; + /** + * Displays the Filter Control. + */ + ShowFilterControl(): void; } /** * Represents a client column. @@ -18994,6 +20066,11 @@ interface ASPxClientTreeListColumn { */ fieldName: string; } +/** + * Lists values that specify the document formats available for export from the tree list. + */ +interface ASPxClientTreeListExportFormat { +} /** * Provides data for the CustomDataCallback event. */ @@ -19227,8 +20304,8 @@ interface ASPxClientTreeListToolbarItemClickEventArgs extends ASPxClientProcessi */ toolbarName: string; /** - * Gets the toolbar item related to the event. - * Value: An ASPxClientMenuItem object that is the toolbar item. + * Gets the clicked menu item + * Value: An ASPxClientMenu value that is the menu item. */ item: ASPxClientMenuItem; /** @@ -19252,7 +20329,241 @@ interface ASPxClientTreeListToolbarItemClickEventHandler { * Represents a client-side equivalent of the BootstrapAccordion control. */ interface BootstrapClientAccordion extends ASPxClientNavBar { + /** + * Returns a group specified by its index. + * @param index An integer value specifying the zero-based index of the group object to retrieve. + */ + GetGroup(index: number): BootstrapClientAccordionGroup; + /** + * Returns a group specified by its name. + * @param name A string value specifying the name of the group. + */ + GetGroupByName(name: string): BootstrapClientAccordionGroup; + /** + * Returns the Accordion control's active group. + */ + GetActiveGroup(): BootstrapClientAccordionGroup; + /** + * Makes the specified group active. + * @param group A BootstrapClientAccordionGroup object that specifies the active group. + */ + SetActiveGroup(group: BootstrapClientAccordionGroup): void; + /** + * Returns an item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): BootstrapClientAccordionItem; + /** + * Returns the selected item within the Accordion control. + */ + GetSelectedItem(): BootstrapClientAccordionItem; + /** + * Selects the specified item within the Accordion control on the client side. + * @param item A BootstrapClientAccordionItem object specifying the item to select. + */ + SetSelectedItem(item: BootstrapClientAccordionItem): void; + /** + * Makes the specified group active. + * @param group A ASPxClientNavBarGroup object that specifies the active group. + */ + SetActiveGroup(group: ASPxClientNavBarGroup): void; + /** + * Selects the specified item within the navbar control on the client side. + * @param item An ASPxClientNavBarItem object specifying the item to select. + */ + SetSelectedItem(item: ASPxClientNavBarItem): void; } +/** + * Represents a client-side equivalent of the Accordion's BootstrapAccordionGroup object. + */ +interface BootstrapClientAccordionGroup extends ASPxClientNavBarGroup { + /** + * Gets the BootstrapClientAccordion object to which the current group belongs. + * Value: A object that is the group's owner. + */ + navBar: BootstrapClientAccordion; + /** + * Returns the group's item specified by its index. + * @param index An integer value specifying the zero-based index of the item to be retrieved. + */ + GetItem(index: number): BootstrapClientAccordionItem; + /** + * Returns a group item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): BootstrapClientAccordionItem; + /** + * Gets the text displayed within an accordion group header badge. + */ + GetHeaderBadgeText(): string; + /** + * Sets the text displayed within an accordion group header badge. + * @param text A String specifying the badge text. + */ + SetHeaderBadgeText(text: string): void; + /** + * Gets the CSS class of the icon displayed within an accordion group header badge. + */ + GetHeaderBadgeIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed within an accordion group header badge. + * @param cssClass A String containing the name of a CSS class. + */ + SetHeaderBadgeIconCssClass(cssClass: string): void; +} +/** + * Represents a client-side equivalent of the Accordion's BootstrapAccordionItem object. + */ +interface BootstrapClientAccordionItem extends ASPxClientNavBarItem { + /** + * Gets the BootstrapClientAccordion object to which the current item belongs. + * Value: A object that is the item's owner. + */ + navBar: BootstrapClientAccordion; + /** + * Gets the group to which the current item belongs. + * Value: A object representing the group to which the item belongs. + */ + group: BootstrapClientAccordionGroup; + /** + * Gets the text displayed within the accordion item badge. + */ + GetBadgeText(): string; + /** + * Sets the text displayed within the accordion item badge. + * @param text A String specifying the badge text. + */ + SetBadgeText(text: string): void; + /** + * Gets the CSS class of the icon displayed within the accordion item badge. + */ + GetBadgeIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed within the accordion item badge. + * @param cssClass A string containing the name of a CSS class. + */ + SetBadgeIconCssClass(cssClass: string): void; + /** + * Specifies the URL which points to the image displayed within the item. + */ + GetImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the item. + * @param value + */ + SetImageUrl(value: string): void; + /** + * Gets the CSS class of the icon displayed by the Accordion item. + */ + GetIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed by the Accordion item. + * @param cssClass A string containing the name of a CSS class. + */ + SetIconCssClass(cssClass: string): void; +} +/** + * A method that will handle the Accordion control's client events concerning manipulations with an item. + */ +interface BootstrapClientAccordionItemEventHandler { + /** + * A method that will handle the Accordion control's client events concerning manipulations with an item. + * @param source An object representing the event source. Identifies the BootstrapClientAccordion control that raised the event. + * @param e An BootstrapClientAccordionItemEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientAccordionItemEventArgs): void; +} +/** + * Provides data for events related to manipulations on items. + */ +interface BootstrapClientAccordionItemEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the item object related to the event. + * Value: A BootstrapClientAccordionItem object, manipulations on which forced the event to be raised. + */ + item: BootstrapClientAccordionItem; + /** + * Gets an HTML object that contains the processed Accordion item. + * Value: An HTML object. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: A DHTML event object. + */ + htmlEvent: Object; +} +/** + * A method that will handle the Accordion control's client events concerning manipulations with a group. + */ +interface BootstrapClientAccordionGroupEventHandler { + /** + * A method that will handle the Accordion control's client events concerning manipulations with a group. + * @param source An object representing the event source. Identifies the BootstrapClientAccordion control that raised the event. + * @param e An BootstrapClientAccordionGroupEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientAccordionGroupEventArgs): void; +} +/** + * Provides data for events related to manipulations on groups. + */ +interface BootstrapClientAccordionGroupEventArgs extends ASPxClientEventArgs { + /** + * Gets the group object related to the event. + * Value: A BootstrapClientAccordionGroup object, manipulations on which forced the event to be raised. + */ + group: BootstrapClientAccordionGroup; +} +/** + * A method that will handle the Accordion control's cancelable client events concerning manipulations with a group. + */ +interface BootstrapClientAccordionGroupCancelEventHandler { + /** + * A method that will handle the Accordion control's cancelable client events concerning manipulations with a group. + * @param source An object representing the event source. Identifies the BootstrapClientAccordion control that raised the event. + * @param e An BootstrapClientAccordionGroupCancelEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientAccordionGroupCancelEventArgs): void; +} +/** + * Provides data for events related to manipulations on accordion groups. + */ +interface BootstrapClientAccordionGroupCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the group object related to the event. + * Value: A BootstrapClientAccordionGroup object, manipulations on which forced the event to be raised. + */ + group: BootstrapClientAccordionGroup; +} +/** + * A method that will handle the Accordion control's client events concerning clicks on groups. + */ +interface BootstrapClientAccordionGroupClickEventHandler { + /** + * A method that will handle the Accordion control's client events concerning clicks on groups. + * @param source An object representing the event source. Identifies the BootstrapClientAccordion control that raised the event. + * @param e An BootstrapClientAccordionGroupClickEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientAccordionGroupClickEventArgs): void; +} +/** + * Provides data for events related to clicking on the control's group headers. + */ +interface BootstrapClientAccordionGroupClickEventArgs extends BootstrapClientAccordionGroupCancelEventArgs { + /** + * Gets an HTML object that contains the processed Accordion group. + * Value: An HTML object. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: A DHTML event object. + */ + htmlEvent: Object; +} +/** + * Represents the client-side equivalent of the BootstrapBinaryImage control. + */ interface BootstrapClientBinaryImage extends ASPxClientHyperLink { } /** @@ -19268,6 +20579,24 @@ interface BootstrapClientButton extends ASPxClientButton { * @param value A string value specifying the text to be displayed within the button. */ SetText(value: string): void; + /** + * Gets the text displayed within the button badge. + */ + GetBadgeText(): string; + /** + * Sets the text displayed within the button badge. + * @param text A String specifying the badge text. + */ + SetBadgeText(text: string): void; + /** + * Gets the CSS class of the icon displayed within the button badge. + */ + GetBadgeIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed within the button badge. + * @param cssClass A string containing the name of a CSS class. + */ + SetBadgeIconCssClass(cssClass: string): void; } /** * Represents a client-side equivalent of the BootstrapCalendar control. @@ -19320,92 +20649,12 @@ interface BootstrapClientCallbackPanel extends ASPxClientControl { */ GetEnabled(): boolean; } -/** - * Serves as the base type for the BootstrapClientPieChart objects. - */ -interface BootstrapClientChartBase extends ASPxClientControl { - Done: ASPxClientEvent>; - LegendClick: ASPxClientEvent>; - PointClick: ASPxClientEvent>; - PointHoverChanged: ASPxClientEvent>; - PointSelectionChanged: ASPxClientEvent>; - TooltipHidden: ASPxClientEvent>; - TooltipShown: ASPxClientEvent>; - ArgumentAxisClick: ASPxClientEvent>; - SeriesClick: ASPxClientEvent>; - SeriesHoverChanged: ASPxClientEvent>; - SeriesSelectionChanged: ASPxClientEvent>; -} -/** - * Represents a client-side equivalent of the BootstrapChart control. - */ -interface BootstrapClientChart extends BootstrapClientChartBase { - ZoomStart: ASPxClientEvent>; - ZoomEnd: ASPxClientEvent>; -} -/** - * Represents a client-side equivalent of the BootstrapPolarChart control. - */ -interface BootstrapClientPolarChart extends BootstrapClientChartBase { -} -/** - * Represents a client-side equivalent of the BootstrapPieChart control. - */ -interface BootstrapClientPieChart extends BootstrapClientChartBase { -} -interface BootstrapClientChartBaseDoneEventHandler { - (source: S, e: BootstrapUIWidgetEventArgsBase): void; -} -interface BootstrapClientChartBaseLegendClickEventHandler { - (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; -} -interface BootstrapClientCoordinateSystemChartArgumentAxisClickEventHandler { - (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; -} -interface BootstrapClientChartBasePointClickEventHandler { - (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; -} -interface BootstrapClientChartBasePointHoverChangedEventHandler { - (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; -} -interface BootstrapClientChartBasePointSelectionChangedEventHandler { - (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; -} -interface BootstrapClientChartBaseTooltipHiddenEventHandler { - (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; -} -interface BootstrapClientChartBaseTooltipShownEventHandler { - (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; -} -interface BootstrapClientCoordinateSystemChartSeriesClickEventHandler { - (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; -} -interface BootstrapClientCoordinateSystemChartSeriesHoverChangedEventHandler { - (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; -} -interface BootstrapClientCoordinateSystemChartSeriesSelectionChangedEventHandler { - (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; -} -interface BootstrapClientChartZoomStartEventHandler { - (source: S, e: BootstrapUIWidgetEventArgsBase): void; -} -interface BootstrapClientChartZoomEndEventHandler { - (source: S, e: BootstrapClientChartZoomEndEventArgs): void; -} -interface BootstrapUIWidgetEventArgsBase extends ASPxClientEventArgs { - component: Object; - element: Object; -} -interface BootstrapClientChartZoomEndEventArgs extends BootstrapUIWidgetEventArgsBase { - rangeStart: Object; - rangeEnd: Object; -} /** * Represents a client-side equivalent of the BootstrapCheckBox control. */ interface BootstrapClientCheckBox extends ASPxClientEdit { /** - * Occurs on the client side when the editor's checked state is changed. + * Occurs on the client side when the editor's checked state has been changed. */ CheckedChanged: ASPxClientEvent>; /** @@ -19414,7 +20663,7 @@ interface BootstrapClientCheckBox extends ASPxClientEdit { GetChecked(): boolean; /** * Sets a value which specifies the checked status of the check box editor. - * @param isChecked + * @param isChecked true if the check box editor is checked; otherwise, false. */ SetChecked(isChecked: boolean): void; /** @@ -19427,12 +20676,12 @@ interface BootstrapClientCheckBox extends ASPxClientEdit { GetCheckState(): string; /** * Sets a value specifying the state of a check box. - * @param checkState + * @param checkState A string value matches one of the CheckState enumeration values. */ SetCheckState(checkState: string): void; /** * Sets the text to be displayed within the editor. - * @param text + * @param text A string value specifying the text to be displayed within the editor. */ SetText(text: string): void; } @@ -19450,103 +20699,125 @@ interface BootstrapClientComboBox extends ASPxClientComboBox { */ GetSelectedItem(): BootstrapClientListBoxItem; /** - * Sets the combo box editor's selected item. - * @param item + * Sets the list editor's selected item. + * @param item A BootstrapClientListBoxItem object that specifies the item to select. */ SetSelectedItem(item: BootstrapClientListBoxItem): void; /** * Returns an item specified by its index within the combo box editor's item collection. - * @param index + * @param index An integer value specifying the zero-based index of the item to search for. */ GetItem(index: number): BootstrapClientListBoxItem; /** * Returns a combo box item by its text. - * @param text + * @param text A string that specifies the item's text. */ FindItemByText(text: string): BootstrapClientListBoxItem; /** * Returns a combo box item by its value. - * @param value + * @param value An object that specifies the item's value. */ FindItemByValue(value: Object): BootstrapClientListBoxItem; /** - * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. + * Adds a new item to the end of the editor's items collection, specifying the item's display text, and returns the index of the added item. * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. */ AddItem(texts: string[]): number; /** * Adds a new item to the end of the control's items collection. - * @param texts - * @param value + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. + * @param value An object that represents the item's associated value. */ AddItem(texts: string[], value: Object): number; /** * Adds a new item to the end of the control's items collection. - * @param texts - * @param value - * @param iconCssClass + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. */ AddItem(texts: string[], value: Object, iconCssClass: string): number; /** - * Adds a new item to the editor specifying the item's display text and returns the index of the added item. - * @param text + * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. + * @param text A string value specifying the item's display text. */ AddItem(text: string): number; /** - * Adds a new item to the editor specifying the item's display text and associated value, and returns the index of the added item. - * @param text - * @param value + * Adds a new item to the editor, specifying the item's display text and associated value, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. */ AddItem(text: string, value: Object): number; /** - * Adds a new item to the editor specifying the item's display text, associated value and displayed image, and returns the index of the added item. - * @param text - * @param value - * @param iconCssClass + * Adds a new item to the editor, specifying the item's display text, associated value and displayed image, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. */ AddItem(text: string, value: Object, iconCssClass: string): number; /** - * Adds a new item to the control's items collection at the specified index. - * @param index - * @param texts - * @param value - * @param iconCssClass + * Inserts a new item into the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding field within the editor's Fields collection. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. */ InsertItem(index: number, texts: string[], value: Object, iconCssClass: string): void; /** - * Adds a new item to the control's items collection at the specified index. - * @param index - * @param texts - * @param value + * Inserts a new item into the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. + * @param value An object that represents the item's associated value. */ InsertItem(index: number, texts: string[], value: Object): void; /** - * Adds a new item to the control's items collection at the specified index. - * @param index - * @param texts + * Inserts a new item into the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. */ InsertItem(index: number, texts: string[]): void; /** - * Adds a new item to the control's items collection at the specified index. - * @param index - * @param text - * @param value - * @param iconCssClass + * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. + * @param index An integer value that represents the index position. + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. */ InsertItem(index: number, text: string, value: Object, iconCssClass: string): void; /** - * Inserts a new item specified by its display text and associated value into the editor's item collection, at the position specified. - * @param index - * @param text - * @param value + * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. + * @param index An integer value that represents the index position. + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. */ InsertItem(index: number, text: string, value: Object): void; /** - * Inserts a new item specified by its display text into the editor's item collection, at the position specified. - * @param index - * @param text + * Inserts a new item into the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param text A string value specifying the item's display text. */ InsertItem(index: number, text: string): void; + /** + * Gets the text displayed within a Combo Box item badge. + * @param index The index of a Combo Box item. + */ + GetItemBadgeText(index: number): string; + /** + * Sets the text displayed within a Combo Box item badge. + * @param index The index of a Combo Box item. + * @param text A String specifying the badge text. + */ + SetItemBadgeText(index: number, text: string): void; + /** + * Gets the CSS class of the icon displayed within a Combo Box item badge. + * @param index The index of a Combo Box item. + */ + GetItemBadgeIconCssClass(index: number): string; + /** + * Sets the CSS class of the icon displayed within a Combo Box item badge. + * @param index The index of a Combo Box item. + * @param cssClass A String containing the name of a CSS class. + */ + SetItemBadgeIconCssClass(index: number, cssClass: string): void; /** * Sets the list editor's selected item. * @param item An ASPxClientListEditItem object that specifies the item to select. @@ -19572,7 +20843,28 @@ interface BootstrapClientFormLayout extends ASPxClientFormLayout { * Represents a client-side equivalent of the BootstrapHyperLink control. */ interface BootstrapClientHyperLink extends ASPxClientHyperLink { + /** + * Gets the text displayed within the hyperlink badge. + */ + GetBadgeText(): string; + /** + * Sets the text displayed within the hyperlink badge. + * @param text A String specifying the badge text. + */ + SetBadgeText(text: string): void; + /** + * Gets the CSS class of the icon displayed within the hyperlink badge. + */ + GetBadgeIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed within the hyperlink badge. + * @param cssClass A string containing the name of a CSS class. + */ + SetBadgeIconCssClass(cssClass: string): void; } +/** + * Represents the client-side equivalent of the BootstrapImage control. + */ interface BootstrapClientImage extends ASPxClientImage { } /** @@ -19583,6 +20875,10 @@ interface BootstrapClientListBoxItem extends ASPxClientListEditItem { * This member is not in effect for this class. It is overridden only for the purpose of preventing it from appearing in Microsoft Visual Studio designer tools. */ imageUrl: string; + /** + * Gets the CSS class of the icon displayed by the list box item. + * Value: A string containing the name of a CSS class. + */ iconCssClass: string; /** * @@ -19595,13 +20891,13 @@ interface BootstrapClientListBoxItem extends ASPxClientListEditItem { */ GetColumnText(columnName: string): string; /** - * - * @param fieldIndex + * Returns the list item's text value that corresponds to a data field specified by its index. + * @param fieldIndex An integer value that specifies the field's index within the editor's Fields collection. */ GetFieldText(fieldIndex: number): string; /** - * - * @param fieldName + * Returns the list item's text value that corresponds to a data field specified by its name. + * @param fieldName A string value that specifies the data field's name defined via a FieldName property. */ GetFieldText(fieldName: string): string; } @@ -19610,17 +20906,17 @@ interface BootstrapClientListBoxItem extends ASPxClientListEditItem { */ interface BootstrapClientListBox extends ASPxClientListBox { /** - * Returns the list box editor's selected item. + * Returns the list editor's selected item. */ GetSelectedItem(): BootstrapClientListBoxItem; /** - * Sets the list box editor's selected item. - * @param item + * Sets the list editor's selected item. + * @param item A BootstrapClientListBoxItem object that specifies the item to select. */ SetSelectedItem(item: BootstrapClientListBoxItem): void; /** * Returns an item specified by its index within the list box editor's item collection. - * @param index + * @param index An integer value specifying the zero-based index of the item to search for. */ GetItem(index: number): BootstrapClientListBoxItem; /** @@ -19629,102 +20925,124 @@ interface BootstrapClientListBox extends ASPxClientListBox { GetSelectedItems(): BootstrapClientListBoxItem[]; /** * Selects the specified items within a list box. - * @param items + * @param items An array of BootstrapClientListBoxItem objects that represent the items. */ SelectItems(items: BootstrapClientListBoxItem[]): void; /** * Unselects an array of the specified list box items. - * @param items + * @param items An array of BootstrapClientListBoxItem objects that represent the items. */ UnselectItems(items: BootstrapClientListBoxItem[]): void; /** * Returns a list box item by its text. - * @param text + * @param text A string that specifies the item's text. */ FindItemByText(text: string): BootstrapClientListBoxItem; /** * Returns a list box item by its value. - * @param value + * @param value An object that specifies the item's value. */ FindItemByValue(value: Object): BootstrapClientListBoxItem; /** * Adds a new item to the end of the editor's items collection, specifying the item's display text, and returns the index of the added item. - * @param texts + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. */ AddItem(texts: string[]): number; /** * Adds a new item to the end of the control's items collection. - * @param texts - * @param value + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. + * @param value An object that represents the item's associated value. */ AddItem(texts: string[], value: Object): number; /** * Adds a new item to the end of the control's items collection. - * @param texts - * @param value - * @param iconCssClass + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. */ AddItem(texts: string[], value: Object, iconCssClass: string): number; /** * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. - * @param text + * @param text A string value specifying the item's display text. */ AddItem(text: string): number; /** * Adds a new item to the editor, specifying the item's display text and associated value, and returns the index of the added item. - * @param text - * @param value + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. */ AddItem(text: string, value: Object): number; /** * Adds a new item to the editor, specifying the item's display text, associated value and displayed image, and returns the index of the added item. - * @param text - * @param value - * @param iconCssClass + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. */ AddItem(text: string, value: Object, iconCssClass: string): number; /** - * Adds a new item to the control's items collection at the specified index. - * @param index - * @param texts - * @param value - * @param iconCssClass + * Inserts a new item into the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding field within the editor's Fields collection. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. */ InsertItem(index: number, texts: string[], value: Object, iconCssClass: string): void; /** - * Adds a new item to the control's items collection at the specified index. - * @param index - * @param texts - * @param value + * Inserts a new item into the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. + * @param value An object that represents the item's associated value. */ InsertItem(index: number, texts: string[], value: Object): void; /** - * Adds a new item to the control's items collection at the specified index. - * @param index - * @param texts + * Inserts a new item into the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. */ InsertItem(index: number, texts: string[]): void; /** * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. - * @param index - * @param text - * @param value - * @param iconCssClass + * @param index An integer value that represents the index position. + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. */ InsertItem(index: number, text: string, value: Object, iconCssClass: string): void; /** * Inserts a new item specified by its display text and associated value into the editor's item collection, at the position specified. - * @param index - * @param text - * @param value + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. */ InsertItem(index: number, text: string, value: Object): void; /** * Inserts a new item specified by its display text into the editor's item collection, at the position specified. - * @param index - * @param text + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. */ InsertItem(index: number, text: string): void; + /** + * Gets the text displayed within a List Box item badge. + * @param index The index of a List Box item. + */ + GetItemBadgeText(index: number): string; + /** + * Sets the text displayed within a List Box item badge. + * @param index The index of a List Box item. + * @param text A String specifying the badge text. + */ + SetItemBadgeText(index: number, text: string): void; + /** + * Gets the CSS class of the icon displayed within a List Box item badge. + * @param index The index of a List Box item. + */ + GetItemBadgeIconCssClass(index: number): string; + /** + * Sets the CSS class of the icon displayed within a List Box item badge. + * @param index The index of a List Box item. + * @param cssClass A String containing the name of a CSS class. + */ + SetItemBadgeIconCssClass(index: number, cssClass: string): void; /** * Selects the specified items within a list box. * @param items An array of ASPxClientListEditItem objects that represent the items. @@ -19751,10 +21069,162 @@ interface BootstrapClientCheckBoxList extends ASPxClientCheckBoxList { */ interface BootstrapClientRadioButtonList extends ASPxClientRadioButtonList { } +/** + * Represents a client-side equivalent of the menu's BootstrapMenuItem object. + */ +interface BootstrapClientMenuItem extends ASPxClientMenuItem { + /** + * Gets the immediate parent item to which the current item belongs. + * Value: A BootstrapClientMenuItem object representing the item's immediate parent. + */ + parent: BootstrapClientMenuItem; + /** + * Returns the current menu item's immediate subitem specified by its index. + * @param index An integer value specifying the zero-based index of the submenu item to be retrieved. + */ + GetItem(index: number): BootstrapClientMenuItem; + /** + * Returns the current menu item's subitem specified by its name. + * @param name A string value specifying the name of the menu item. + */ + GetItemByName(name: string): BootstrapClientMenuItem; + /** + * Gets the text displayed within the menu item badge. + */ + GetBadgeText(): string; + /** + * Sets the text displayed within the menu item badge. + * @param text A String specifying the badge text. + */ + SetBadgeText(text: string): void; + /** + * Gets the CSS class of the icon displayed within the menu item badge. + */ + GetBadgeIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed within the menu item badge. + * @param cssClass A string containing the name of a CSS class. + */ + SetBadgeIconCssClass(cssClass: string): void; + /** + * Returns the URL pointing to the image displayed within the menu item. + */ + GetImageUrl(): string; + /** + * Sets the URL which points to the image displayed within the menu item. + * @param value + */ + SetImageUrl(value: string): void; + /** + * Gets the CSS class of the icon displayed by the menu item. + */ + GetIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed by the menu item. + * @param cssClass A string containing the name of a CSS class. + */ + SetIconCssClass(cssClass: string): void; +} /** * Represents a client-side equivalent of the BootstrapMenu control. */ interface BootstrapClientMenu extends ASPxClientMenu { + /** + * Returns the menu's root menu item specified by its index. + * @param index An integer value specifying the zero-based index of the root menu item to be retrieved. + */ + GetItem(index: number): BootstrapClientMenuItem; + /** + * Returns a menu item specified by its name. + * @param name A string value specifying the name of the menu item. + */ + GetItemByName(name: string): BootstrapClientMenuItem; + /** + * Returns the selected item within the menu control. + */ + GetSelectedItem(): BootstrapClientMenuItem; + /** + * Selects the specified menu item within the Menu control on the client side. + * @param item A BootstrapClientMenuItem object specifying the menu item to select. + */ + SetSelectedItem(item: BootstrapClientMenuItem): void; + /** + * Returns a root menu item. + */ + GetRootItem(): BootstrapClientMenuItem; + /** + * Selects the specified menu item within a menu control on the client side. + * @param item An ASPxClientMenuItem object specifying the menu item to select. + */ + SetSelectedItem(item: ASPxClientMenuItem): void; +} +/** + * A method that will handle the menu's client events concerning manipulations with an item. + */ +interface BootstrapClientMenuItemEventHandler { + /** + * A method that will handle the menu's client events concerning manipulations with an item. + * @param source An object representing the event source. Identifies the BootstrapMenu control that raised the event. + * @param e An BootstrapClientMenuItemEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientMenuItemEventArgs): void; +} +/** + * Provides data for events related to manipulations on menu items. + */ +interface BootstrapClientMenuItemEventArgs extends ASPxClientEventArgs { + /** + * Gets the menu item object related to the event. + * Value: A BootstrapClientMenuItem object, manipulations on which forced the event to be raised. + */ + item: BootstrapClientMenuItem; +} +/** + * A method that will handle the ItemMouseOver events. + */ +interface BootstrapClientMenuItemMouseEventHandler { + /** + * A method that will handle the ItemMouseOver events. + * @param source An object representing the event source. Identifies the BootstrapMenu control that raised the event. + * @param e An BootstrapClientMenuItemMouseEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientMenuItemMouseEventArgs): void; +} +/** + * Provides data for client events related to mouse hovering over menu items. + */ +interface BootstrapClientMenuItemMouseEventArgs extends BootstrapClientMenuItemEventArgs { +} +/** + * A method that will handle client ItemClick events. + */ +interface BootstrapClientMenuItemClickEventHandler { + /** + * A method that will handle client ItemClick events. + * @param source An object representing the event source. Identifies the BootstrapMenu control that raised the event. + * @param e An BootstrapClientMenuItemClickEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientMenuItemClickEventArgs): void; +} +/** + * Provides data for events related to clicking on the control's items. + */ +interface BootstrapClientMenuItemClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the menu item object related to the event. + * Value: A BootstrapClientMenuItem object, manipulations on which forced the event to be raised. + */ + item: BootstrapClientMenuItem; + /** + * Gets an HTML object that contains the processed Menu item. + * Value: An HTML object. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: A DHTML event object. + */ + htmlEvent: Object; } /** * Represents a client-side equivalent of the BootstrapPager control. @@ -19766,8 +21236,8 @@ interface BootstrapClientPager extends ASPxClientPager { */ interface BootstrapClientPopupControl extends ASPxClientPopupControl { /** - * - * @param selector + * Sets the CSS selector of a web control or HTML element with which the current popup window is associated. + * @param selector A string value specifying the CSS selector of the web control or HTML element with which the popup window is associated. */ SetPopupElementCssSelector(selector: string): void; } @@ -19776,10 +21246,38 @@ interface BootstrapClientPopupControl extends ASPxClientPopupControl { */ interface BootstrapClientPopupMenu extends ASPxClientPopupMenu { /** - * - * @param selector + * Returns the popup menu's root menu item specified by its index. + * @param index An integer value specifying the zero-based index of the root menu item to be retrieved. + */ + GetItem(index: number): BootstrapClientMenuItem; + /** + * Returns a menu item specified by its name. + * @param name A string value specifying the name of the menu item. + */ + GetItemByName(name: string): BootstrapClientMenuItem; + /** + * Returns the selected item within the menu control. + */ + GetSelectedItem(): BootstrapClientMenuItem; + /** + * Selects the specified menu item within a the Popup Menu control on the client side. + * @param item A BootstrapClientMenuItem object specifying the menu item to select. + */ + SetSelectedItem(item: BootstrapClientMenuItem): void; + /** + * Returns a root menu item. + */ + GetRootItem(): BootstrapClientMenuItem; + /** + * Sets the CSS selector of a web control or HTML element with which the current popup menu is associated. + * @param selector A string value specifying the CSS selector of the web control or HTML element with which the popup menu is associated. */ SetPopupElementCssSelector(selector: string): void; + /** + * Selects the specified menu item within a menu control on the client side. + * @param item An ASPxClientMenuItem object specifying the menu item to select. + */ + SetSelectedItem(item: ASPxClientMenuItem): void; } /** * Represents a client-side equivalent of the BootstrapProgressBar control. @@ -19791,15 +21289,472 @@ interface BootstrapClientProgressBar extends ASPxClientProgressBar { */ interface BootstrapClientSpinEdit extends ASPxClientSpinEdit { } +/** + * Represents the client-side equivalent of the BootstrapClientTimeEdit control. + */ +interface BootstrapClientTimeEdit extends ASPxClientTimeEdit { +} /** * Represents a client-side equivalent of the BootstrapTabControl control. */ interface BootstrapClientTabControl extends ASPxClientTabControl { + /** + * Returns the active tab within the Tab Control. + */ + GetActiveTab(): BootstrapClientTab; + /** + * Makes the specified tab active within the Tab Control on the client side. + * @param tab A BootstrapClientTab object specifying the tab to select. + */ + SetActiveTab(tab: BootstrapClientTab): void; + /** + * Returns a tab specified by its index. + * @param index An integer value specifying the zero-based index of the tab object to retrieve. + */ + GetTab(index: number): BootstrapClientTab; + /** + * Returns a tab specified by its name. + * @param name A string value specifying the name of the tab. + */ + GetTabByName(name: string): BootstrapClientTab; + /** + * Makes the specified tab active within the tab control on the client side. + * @param tab An ASPxClientTab object specifying the tab to select. + */ + SetActiveTab(tab: ASPxClientTab): void; } /** * Represents a client-side equivalent of the BootstrapPageControl control. */ interface BootstrapClientPageControl extends ASPxClientPageControl { + /** + * Returns the active tab within the Page Control. + */ + GetActiveTab(): BootstrapClientTab; + /** + * Makes the specified tab active within the Page Control on the client side. + * @param tab A BootstrapClientTab object specifying the tab to select. + */ + SetActiveTab(tab: BootstrapClientTab): void; + /** + * Returns a tab specified by its index. + * @param index An integer value specifying the zero-based index of the tab object to retrieve. + */ + GetTab(index: number): BootstrapClientTab; + /** + * Returns a tab specified by its name. + * @param name A string value specifying the name of the tab. + */ + GetTabByName(name: string): BootstrapClientTab; + /** + * Returns the HTML code that represents the contents of the specified page within the page control. + * @param tab An BootstrapClientTab object that specifies the required page. + */ + GetTabContentHTML(tab: BootstrapClientTab): string; + /** + * Defines the HTML content for a specific tab page within the page control. + * @param tab A BootstrapClientTab object that specifies the required tab page. + * @param html A string value that represents the HTML code defining the content of the specified page. + */ + SetTabContentHTML(tab: BootstrapClientTab, html: string): void; + /** + * Returns the HTML code that represents the contents of the specified page within the page control. + * @param tab An ASPxClientTab object that specifies the required page. + */ + GetTabContentHTML(tab: ASPxClientTab): string; + /** + * Defines the HTML content for a specific tab page within the page control. + * @param tab An ASPxClientTab object that specifies the required tab page. + * @param html A string value that represents the HTML code defining the content of the specified page. + */ + SetTabContentHTML(tab: ASPxClientTab, html: string): void; + /** + * Makes the specified tab active within the tab control on the client side. + * @param tab An ASPxClientTab object specifying the tab to select. + */ + SetActiveTab(tab: ASPxClientTab): void; +} +/** + * Represents a client-side equivalent of a tab control's BootstrapTabPage object. + */ +interface BootstrapClientTab extends ASPxClientTab { + /** + * Gets the text displayed within the tab badge. + */ + GetBadgeText(): string; + /** + * Sets the text displayed within the tab badge. + * @param text A String specifying the badge text. + */ + SetBadgeText(text: string): void; + /** + * Gets the CSS class of the icon displayed within the tab badge. + */ + GetBadgeIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed within the tab badge. + * @param cssClass A string containing the name of a CSS class. + */ + SetBadgeIconCssClass(cssClass: string): void; + /** + * Returns the URL pointing to the image displayed within the tab. + */ + GetImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the tab. + * @param value + */ + SetImageUrl(value: string): void; + /** + * Returns the URL pointing to the image displayed within the active tab. + */ + GetActiveImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the active tab. + * @param value + */ + SetActiveImageUrl(value: string): void; + /** + * Gets the CSS class of the icon displayed by the tab. + */ + GetIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed by the tab. + * @param cssClass A string containing the name of a CSS class. + */ + SetIconCssClass(cssClass: string): void; + /** + * Gets the CSS class of an icon displayed by the tab when it is active. + */ + GetActiveIconCssClass(): string; + /** + * Sets the CSS class of an icon displayed by the tab when it is active. + * @param cssClass A String containing the name of a CSS class. + */ + SetActiveIconCssClass(cssClass: string): void; +} +/** + * A method that will handle a tab control's client events concerning manipulations with a tab. + */ +interface BootstrapClientTabControlTabEventHandler { + /** + * A method that will handle a tab control's client events concerning manipulations with a tab. + * @param source An object representing the event source. Identifies the BootstrapClientTabControl that raised the event. + * @param e An BootstrapClientTabControlTabEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientTabControlTabEventArgs): void; +} +/** + * Provides data for events related to manipulations on tabs. + */ +interface BootstrapClientTabControlTabEventArgs extends ASPxClientEventArgs { + /** + * Gets the tab object related to the event. + * Value: A BootstrapClientTab object, manipulations on which forced the event to be raised. + */ + tab: BootstrapClientTab; +} +/** + * A method that will handle a tab control's cancelable client events concerning manipulations with a tab. + */ +interface BootstrapClientTabControlTabCancelEventHandler { + /** + * A method that will handle a tab control's cancelable client events concerning manipulations with a tab. + * @param source An object representing the event source. Identifies the BootstrapTabControl that raised the event. + * @param e An BootstrapClientTabControlTabCancelEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientTabControlTabCancelEventArgs): void; +} +/** + * Provides data for cancellable events related to manipulations on tabs. + */ +interface BootstrapClientTabControlTabCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the tab object related to the event. + * Value: A BootstrapClientTab object representing the tab manipulations on which forced the tab control to raise the event. + */ + tab: BootstrapClientTab; + /** + * Gets or sets a value specifying whether a callback should be sent to the server to reload the content of the page being activated. + * Value: true, to reload the page's content; otherwise, false. + */ + reloadContentOnCallback: boolean; +} +/** + * A method that will handle client events concerning clicks on tabs. + */ +interface BootstrapClientTabControlTabClickEventHandler { + /** + * A method that will handle client events concerning clicks on tabs. + * @param source An object representing the event source. Identifies the BootstrapTabControl that raised the event. + * @param e An BootstrapClientTabControlTabClickEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientTabControlTabClickEventArgs): void; +} +/** + * Provides data for events related to clicking on the control's tabs. + */ +interface BootstrapClientTabControlTabClickEventArgs extends BootstrapClientTabControlTabCancelEventArgs { + /** + * Gets an HTML object that contains the processed tab. + * Value: An HTML object. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: A DHTML event object. + */ + htmlEvent: Object; +} +/** + * A client-side equivalent of the BootstrapTagBox object. + */ +interface BootstrapClientTagBox extends ASPxClientTokenBox { + /** + * Use the TagsChanged event instead. + */ + TokensChanged: ASPxClientEvent>; + /** + * Fires on the client side after the tag collection has been changed. + */ + TagsChanged: ASPxClientEvent>; + /** + * Adds a new token with the specified text to the end of the control's token collection. + * @param text + */ + AddToken(text: string): void; + /** + * Adds a new tag with the specified text to the end of the control's tag collection. + * @param text A string value specifying the tag's text. + */ + AddTag(text: string): void; + /** + * Use the RemoveTagByText method instead. + * @param text + */ + RemoveTokenByText(text: string): void; + /** + * Removes a tag specified by its text from the tag box on the client. + * @param text A string value that is the text of the tag to be removed. + */ + RemoveTagByText(text: string): void; + /** + * Use the RemoveTag method instead. + * @param index + */ + RemoveToken(index: number): void; + /** + * Removes a tag specified by its index from the tag box on the client. + * @param index An integer value that is the index of the tag to be removed. + */ + RemoveTag(index: number): void; + /** + * Returns an HTML span element that corresponds to the specified token. + * @param index + */ + GetTokenHtmlElement(index: number): Object; + /** + * Returns an HTML span element that corresponds to the specified tag. + * @param index An integer value that is the tag index. + */ + GetTagHtmlElement(index: number): Object; + /** + * Returns an HTML span element that corresponds to the specified token's text. + * @param index + */ + GetTokenTextHtmlElement(index: number): Object; + /** + * Returns an HTML span element that corresponds to the specified tag's text. + * @param index An integer value that is the tag index. + */ + GetTagTextHtmlElement(index: number): Object; + /** + * Returns an HTML span element that corresponds to the specified token's remove button. + * @param index + */ + GetTokenRemoveButtonHtmlElement(index: number): Object; + /** + * Returns an HTML span element that corresponds to the specified tag's remove button. + * @param index An integer value that is the tag index. + */ + GetTagRemoveButtonHtmlElement(index: number): Object; + /** + * Returns a collection of tokens. + */ + GetTokenCollection(): string[]; + /** + * Returns a collection of tags. + */ + GetTagCollection(): string[]; + /** + * Returns a collection of tokens. + * @param collection + */ + SetTokenCollection(collection: string[]): void; + /** + * Sets a collection of tags. + * @param collection An object that is the collection of tags. + */ + SetTagCollection(collection: string[]): void; + /** + * Use the ClearTagCollection method instead. + */ + ClearTokenCollection(): void; + /** + * Removes all tags contained in the tag box. + */ + ClearTagCollection(): void; + /** + * Returns the index of a token specified by its text. + * @param text + */ + GetTokenIndexByText(text: string): number; + /** + * Returns the index of a tag specified by its text. + * @param text A string value that specifies the text of the tag. + */ + GetTagIndexByText(text: string): number; + /** + * Use the IsCustomTag method instead. + * @param text + * @param caseSensitive + */ + IsCustomToken(text: string, caseSensitive: boolean): boolean; + /** + * Returns a value that indicates if the specified tag (string) is a custom tag. + * @param text A string value that is a tag. + * @param caseSensitive true, if tags are case sensitive; otherwise, false. + */ + IsCustomTag(text: string, caseSensitive: boolean): boolean; + /** + * Returns the editor's selected item. + */ + GetSelectedItem(): BootstrapClientListBoxItem; + /** + * Sets the list editor's selected item. + * @param item A BootstrapClientListBoxItem object that specifies the item to select. + */ + SetSelectedItem(item: BootstrapClientListBoxItem): void; + /** + * Returns an item specified by its index within the tag box editor's item collection. + * @param index An integer value specifying the zero-based index of the item to search for. + */ + GetItem(index: number): BootstrapClientListBoxItem; + /** + * Returns an item by its text. + * @param text A string that specifies the item's text. + */ + FindItemByText(text: string): BootstrapClientListBoxItem; + /** + * Returns a list item by its value. + * @param value An object that specifies the item's value. + */ + FindItemByValue(value: Object): BootstrapClientListBoxItem; + /** + * This method is not in effect for the BootstrapClientTagBox class. + * @param texts + */ + AddItem(texts: string[]): number; + /** + * This method is not in effect for the BootstrapClientTagBox class. + * @param texts + * @param value + */ + AddItem(texts: string[], value: Object): number; + /** + * This method is not in effect for the BootstrapClientTagBox class. + * @param texts + * @param value + * @param iconCssClass + */ + AddItem(texts: string[], value: Object, iconCssClass: string): number; + /** + * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. + * @param text A string value specifying the item's display text. + */ + AddItem(text: string): number; + /** + * Adds a new item to the editor, specifying the item's display text and associated value, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. + */ + AddItem(text: string, value: Object): number; + /** + * Adds a new item to the editor, specifying the item's display text, associated value and displayed image, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. + */ + AddItem(text: string, value: Object, iconCssClass: string): number; + /** + * This method is not in effect for the BootstrapClientTagBox class. + * @param index + * @param texts + * @param value + * @param iconCssClass + */ + InsertItem(index: number, texts: string[], value: Object, iconCssClass: string): void; + /** + * This method is not in effect for the BootstrapClientTagBox class. + * @param index + * @param texts + * @param value + */ + InsertItem(index: number, texts: string[], value: Object): void; + /** + * This method is not in effect for the BootstrapClientTagBox class. + * @param index + * @param texts + */ + InsertItem(index: number, texts: string[]): void; + /** + * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. + * @param index An integer value that represents the index position. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. + */ + InsertItem(index: number, text: string, value: Object, iconCssClass: string): void; + /** + * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. + * @param index An integer value that represents the index position. + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. + */ + InsertItem(index: number, text: string, value: Object): void; + /** + * Inserts a new item into the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param text A string value specifying the item's display text. + */ + InsertItem(index: number, text: string): void; + /** + * Gets the text displayed within a Tag Box item badge. + * @param index The index of a Tag Box item. + */ + GetItemBadgeText(index: number): string; + /** + * Sets the text displayed within a Tag Box item badge. + * @param index The index of a Tag Box item. + * @param text A String specifying the badge text. + */ + SetItemBadgeText(index: number, text: string): void; + /** + * Gets the CSS class of the icon displayed within a Tag Box item badge. + * @param index The index of a Tag Box item. + */ + GetItemBadgeIconCssClass(index: number): string; + /** + * Sets the CSS class of the icon displayed within a Tag Box item badge. + * @param index The index of a Tag Box item. + * @param cssClass A String containing the name of a CSS class. + */ + SetItemBadgeIconCssClass(index: number, cssClass: string): void; + /** + * Sets the list editor's selected item. + * @param item An ASPxClientListEditItem object that specifies the item to select. + */ + SetSelectedItem(item: ASPxClientListEditItem): void; } /** * Represents a client-side equivalent of the BootstrapTextBox control. @@ -19816,79 +21771,741 @@ interface BootstrapClientMemo extends ASPxClientMemo { */ interface BootstrapClientButtonEdit extends ASPxClientButtonEdit { } +/** + * Represents the client-side equivalent of the BootstrapToolbar control. + */ +interface BootstrapClientToolbar extends BootstrapClientMenu { +} /** * Represents a client-side equivalent of the BootstrapTreeView control. */ interface BootstrapClientTreeView extends ASPxClientTreeView { + /** + * Returns a node specified by its index within the Tree View's node collection. + * @param index An integer value specifying the zero-based index of the node to be retrieved. + */ + GetNode(index: number): BootstrapClientTreeViewNode; + /** + * Returns a node specified by its name. + * @param name A string value specifying the name of the node. + */ + GetNodeByName(name: string): BootstrapClientTreeViewNode; + /** + * Returns a node specified by its text. + * @param text A string value specifying the text content of the node. + */ + GetNodeByText(text: string): BootstrapClientTreeViewNode; + /** + * Returns the selected node within the Tree View control on the client side. + */ + GetSelectedNode(): BootstrapClientTreeViewNode; + /** + * Selects the specified node within the Tree View control on the client side. + * @param node A BootstrapClientTreeViewNode object specifying the node to select. + */ + SetSelectedNode(node: BootstrapClientTreeViewNode): void; + /** + * Gets the root node of the Tree View control. + */ + GetRootNode(): BootstrapClientTreeViewNode; + /** + * Selects the specified node within the ASPxTreeView control on the client side. + * @param node An ASPxClientTreeViewNode object specifying the node to select. + */ + SetSelectedNode(node: ASPxClientTreeViewNode): void; } -interface BootstrapUIWidgetBase extends ASPxClientControl { - Init: ASPxClientEvent>; - Drawn: ASPxClientEvent>; - Disposing: ASPxClientEvent>; - OptionChanged: ASPxClientEvent>; - Exporting: ASPxClientEvent>; - Exported: ASPxClientEvent>; - FileSaving: ASPxClientEvent>; - IncidentOccurred: ASPxClientEvent>; - GetInstance(): Object; - SetOptions(options: Object): void; - SetDataSource(dataSource: Object): void; - GetDataSource(): Object; - ExportTo(format: string, fileName: string): void; - Print(): void; +/** + * Represents a client-side equivalent of the TreeView's BootstrapTreeViewNode object. + */ +interface BootstrapClientTreeViewNode extends ASPxClientTreeViewNode { + /** + * Gets the BootstrapClientTreeView object to which the current node belongs. + * Value: A object that is the node's owner. + */ + treeView: BootstrapClientTreeView; + /** + * Gets the current node's parent node. + * Value: A BootstrapClientTreeViewNode object representing the node's immediate parent. + */ + parent: BootstrapClientTreeViewNode; + /** + * Returns the current node's immediate child node specified by its index. + * @param index An integer value specifying the zero-based index of the node to be retrieved. + */ + GetNode(index: number): BootstrapClientTreeViewNode; + /** + * Returns the current node's child node specified by its name. + * @param name A string value specifying the name of the node. + */ + GetNodeByName(name: string): BootstrapClientTreeViewNode; + /** + * Returns the current node's child node specified by its text. + * @param text A string value specifying the text content of the node. + */ + GetNodeByText(text: string): BootstrapClientTreeViewNode; + /** + * Gets the text displayed within the node badge. + */ + GetBadgeText(): string; + /** + * Sets the text displayed within the node badge. + * @param text A String specifying the badge text. + */ + SetBadgeText(text: string): void; + /** + * Gets the CSS class of the icon displayed within the node badge. + */ + GetBadgeIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed within the node badge. + * @param cssClass A string containing the name of a CSS class. + */ + SetBadgeIconCssClass(cssClass: string): void; + /** + * Returns the URL pointing to the image displayed within the node. + */ + GetImageUrl(): string; + /** + * Sets the URL which points to the image displayed within the node. + * @param value + */ + SetImageUrl(value: string): void; + /** + * Gets the CSS class of the icon displayed by the node. + */ + GetIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed by the node. + * @param cssClass A string containing the name of a CSS class. + */ + SetIconCssClass(cssClass: string): void; } -interface BootstrapUIWidgetInitializedEventHandler { - (source: S, e: BootstrapUIWidgetEventArgsBase): void; +/** + * A method that will handle the client events concerned with node processing. + */ +interface BootstrapClientTreeViewNodeProcessingModeEventHandler { + /** + * A method that will handle the client events concerned with node processing. + * @param source An object representing the event source. Identifies the BootstrapClientTreeView control that raised the event. + * @param e An BootstrapClientTreeViewNodeProcessingModeEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientTreeViewNodeProcessingModeEventArgs): void; } -interface BootstrapUIWidgetDrawnEventHandler { - (source: S, e: BootstrapUIWidgetEventArgsBase): void; +/** + * Provides data for the client events related to node processing, and allowing the event's processing to be passed to the server side. + */ +interface BootstrapClientTreeViewNodeProcessingModeEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets a node object related to the event. + * Value: A BootstrapClientTreeViewNode object, manipulations on which forced the event to be raised. + */ + node: BootstrapClientTreeViewNode; } -interface BootstrapUIWidgetDisposingEventHandler { - (source: S, e: BootstrapUIWidgetEventArgsBase): void; +/** + * A method that will handle the NodeClick event. + */ +interface BootstrapClientTreeViewNodeClickEventHandler { + /** + * A method that will handle the NodeClick event. + * @param source An object representing the event source. Identifies the BootstrapClientTreeView control that raised the event. + * @param e An BootstrapClientTreeViewNodeClickEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientTreeViewNodeClickEventArgs): void; } -interface BootstrapUIWidgetExportedEventHandler { - (source: S, e: BootstrapUIWidgetEventArgsBase): void; +/** + * Provides data for the NodeClick event. + */ +interface BootstrapClientTreeViewNodeClickEventArgs extends BootstrapClientTreeViewNodeProcessingModeEventArgs { + /** + * Gets an HTML object that contains the processed Tree View node. + * Value: An HTML object. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: A DHTML event object. + */ + htmlEvent: Object; } -interface BootstrapUIWidgetOptionChangedEventHandler { - (source: S, e: BootstrapUIWidgetOptionChangedEventArgs): void; +/** + * A method that will handle the Tree View control's client events, concerning manipulations with a node. + */ +interface BootstrapClientTreeViewNodeEventHandler { + /** + * A method that will handle the Tree View control's client events, concerning manipulations with a node. + * @param source An object representing the event source. Identifies the BootstrapClientTreeView control that raised the event. + * @param e An BootstrapClientTreeViewNodeEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientTreeViewNodeEventArgs): void; } -interface BootstrapUIWidgetOptionChangedEventArgs extends BootstrapUIWidgetEventArgsBase { - fullName: string; - name: string; - previousValue: Object; - value: Object; +/** + * Provides data for the ExpandedChanged events. + */ +interface BootstrapClientTreeViewNodeEventArgs extends ASPxClientEventArgs { + /** + * Gets a node object related to the event. + * Value: A BootstrapClientTreeViewNode object, manipulations on which forced the event to be raised. + */ + node: BootstrapClientTreeViewNode; } -interface BootstrapUIWidgetExportingEventHandler { - (source: S, e: BootstrapUIWidgetExportEventArgs): void; +/** + * A method that will handle the Tree View's cancelable client events, concerning manipulations with nodes. + */ +interface BootstrapClientTreeViewNodeCancelEventHandler { + /** + * A method that will handle the Tree View's cancelable client events, concerning manipulations with nodes. + * @param source An object representing the event source. Identifies the BootstrapClientTreeView control that raised the event. + * @param e An BootstrapClientTreeViewNodeCancelEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientTreeViewNodeCancelEventArgs): void; } -interface BootstrapUIWidgetFileSavingEventHandler { - (source: S, e: BootstrapUIWidgetExportEventArgs): void; -} -interface BootstrapUIWidgetExportEventArgs extends BootstrapUIWidgetEventArgsBase { - cancel: boolean; - data: Object; - fileName: string; - format: string; -} -interface BootstrapUIWidgetErrorEventHandler { - (source: S, e: BootstrapUIWidgetErrorEventArgs): void; -} -interface BootstrapUIWidgetErrorEventArgs extends BootstrapUIWidgetEventArgsBase { - target: Object; -} -interface BootstrapUIWidgetElementActionEventArgs extends BootstrapUIWidgetEventArgsBase { - target: Object; -} -interface BootstrapUIWidgetElementClickEventArgs extends BootstrapUIWidgetElementActionEventArgs { - jQueryEvent: Object; +/** + * Provides data for the ExpandedChanging event. + */ +interface BootstrapClientTreeViewNodeCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets a node object related to the event. + * Value: A BootstrapClientTreeViewNode object, manipulations on which forced the event to be raised. + */ + node: BootstrapClientTreeViewNode; } /** * Represents a client-side equivalent of the BootstrapUploadControl. */ interface BootstrapClientUploadControl extends ASPxClientUploadControl { } +/** + * Represents the client BootstrapGridView. + */ interface BootstrapClientGridView extends ASPxClientGridView { } +/** + * Represents the client BootstrapCardView. + */ +interface BootstrapClientCardView extends ASPxClientGridView { +} +/** + * Represents a client-side equivalent of the BootstrapWebClientUIWidget class. + */ +interface BootstrapUIWidgetBase extends ASPxClientControl { + /** + * Fires once, after the widget is initialized. + */ + Init: ASPxClientEvent>; + /** + * Fires when the widget has finished drawing itself. + */ + Drawn: ASPxClientEvent>; + /** + * Fires when the widget is removed from the DOM using the remove(), empty(), or html() jQuery methods only. + */ + Disposing: ASPxClientEvent>; + /** + * Fires after an option of the widget has been changed. + */ + OptionChanged: ASPxClientEvent>; + /** + * Fires before data from the widget is exported. + */ + Exporting: ASPxClientEvent>; + /** + * Fires after data from the widget is exported. + */ + Exported: ASPxClientEvent>; + /** + * Raised before a file with exported data is saved on the user's local storage. + */ + FileSaving: ASPxClientEvent>; + /** + * Fires when an error or warning appears in the widget. + */ + IncidentOccurred: ASPxClientEvent>; + /** + * Gets an instance of the widget. + */ + GetInstance(): Object; + /** + * Sets the widget's options to values specified in the passed object. + * @param options An object containing key-value pairs specifying new option values. + */ + SetOptions(options: Object): void; + /** + * Gets the client data source instance. + * @param dataSource A DevExtreme DataSource object. + */ + SetDataSource(dataSource: Object): void; + /** + * Gets the client data source instance. + */ + GetDataSource(): Object; + /** + * Exports the widget. + * @param format A string specifying the target file format. + * @param fileName A string specifying the file name. + */ + ExportTo(format: string, fileName: string): void; + /** + * Invokes the browser's Print window to print the widget's contents. + */ + Print(): void; +} +/** + * Represents a client-side equivalent of the BootstrapChartBase class. + */ +interface BootstrapClientChartBase extends BootstrapUIWidgetBase { + /** + * Fires when the Series and Points chart elements are ready to be accessed. + */ + Done: ASPxClientEvent>; + /** + * Fires when an item on the chart legend is clicked. + */ + LegendClick: ASPxClientEvent>; + /** + * Fires when a user clicks a series point. + */ + PointClick: ASPxClientEvent>; + /** + * Fires when the hover state of a series point has been changed. + */ + PointHoverChanged: ASPxClientEvent>; + /** + * Fires when the selection state of a series point has been changed. + */ + PointSelectionChanged: ASPxClientEvent>; + /** + * Fires when a point's tooltip becomes hidden. + */ + TooltipHidden: ASPxClientEvent>; + /** + * Fires when a point's tooltip appears. + */ + TooltipShown: ASPxClientEvent>; + /** + * Fires when a user clicks a label on the argument axis. + */ + ArgumentAxisClick: ASPxClientEvent>; + /** + * Fires when a user clicks a series. + */ + SeriesClick: ASPxClientEvent>; + /** + * Fires when the hover state of a series has been changed. + */ + SeriesHoverChanged: ASPxClientEvent>; + /** + * Fires when the selection state of a series has been changed. + */ + SeriesSelectionChanged: ASPxClientEvent>; +} +/** + * Represents a client-side equivalent of the Chart control. + */ +interface BootstrapClientChart extends BootstrapClientChartBase { + /** + * Fires when a chart zooming or scrolling begins. + */ + ZoomStart: ASPxClientEvent>; + /** + * Fires when a chart zooming or scrolling ends. + */ + ZoomEnd: ASPxClientEvent>; +} +/** + * Represents a client-side equivalent of the BootstrapPolarChart control. + */ +interface BootstrapClientPolarChart extends BootstrapClientChartBase { +} +/** + * Represents a client-side equivalent of the BootstrapPieChart control. + */ +interface BootstrapClientPieChart extends BootstrapClientChartBase { +} +/** + * A method that will handle the Done event. + */ +interface BootstrapClientChartBaseDoneEventHandler { + /** + * A method that will handle the Done event. + * @param source The event source. + * @param e A BootstrapUIWidgetEventArgsBase object that contains event data. + */ + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +/** + * A method that will handle the LegendClick event. + */ +interface BootstrapClientChartBaseLegendClickEventHandler { + /** + * A method that will handle the LegendClick event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementClickEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +/** + * A method that will handle the Invoke event. + */ +interface BootstrapClientCoordinateSystemChartArgumentAxisClickEventHandler { + /** + * A method that will handle the Invoke event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementClickEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +/** + * A method that will handle the PointClick event. + */ +interface BootstrapClientChartBasePointClickEventHandler { + /** + * A method that will handle the PointClick event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementClickEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +/** + * A method that will handle the PointHoverChanged event. + */ +interface BootstrapClientChartBasePointHoverChangedEventHandler { + /** + * A method that will handle the PointHoverChanged event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementActionEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +/** + * A method that will handle the PointSelectionChanged event. + */ +interface BootstrapClientChartBasePointSelectionChangedEventHandler { + /** + * A method that will handle the PointSelectionChanged event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementActionEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +/** + * A method that will handle the TooltipHidden event. + */ +interface BootstrapClientChartBaseTooltipHiddenEventHandler { + /** + * A method that will handle the TooltipHidden event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementActionEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +/** + * A method that will handle the TooltipShown event. + */ +interface BootstrapClientChartBaseTooltipShownEventHandler { + /** + * A method that will handle the TooltipShown event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementActionEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +/** + * A method that will handle the SeriesClick event. + */ +interface BootstrapClientCoordinateSystemChartSeriesClickEventHandler { + /** + * A method that will handle the SeriesClick event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementClickEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +/** + * A method that will handle the SeriesHoverChanged event. + */ +interface BootstrapClientCoordinateSystemChartSeriesHoverChangedEventHandler { + /** + * A method that will handle the SeriesHoverChanged event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementActionEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +/** + * A method that will handle the SeriesSelectionChanged event. + */ +interface BootstrapClientCoordinateSystemChartSeriesSelectionChangedEventHandler { + /** + * A method that will handle the SeriesSelectionChanged event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementActionEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +/** + * A method that will handle the ZoomStart event. + */ +interface BootstrapClientChartZoomStartEventHandler { + /** + * A method that will handle the ZoomStart event. + * @param source The event source. + * @param e A BootstrapUIWidgetEventArgsBase object that contains event data. + */ + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +/** + * A method that will handle the ZoomEnd event. + */ +interface BootstrapClientChartZoomEndEventHandler { + /** + * A method that will handle the ZoomEnd event. + * @param source The event source. + * @param e A BootstrapClientChartZoomEndEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientChartZoomEndEventArgs): void; +} +/** + * Provides base data for the client-side events. + */ +interface BootstrapUIWidgetEventArgsBase extends ASPxClientEventArgs { + /** + * The widget instance. + * Value: An object specifying the widget instance. + */ + component: Object; + /** + * The widget's container. + * Value: An object specifying the widget's container. + */ + element: Object; +} +/** + * Provides data for the ZoomEnd event. + */ +interface BootstrapClientChartZoomEndEventArgs extends BootstrapUIWidgetEventArgsBase { + /** + * The value that became the start of the argument axis after zooming or scrolling ended. + * Value: An object specifying the start of the argument axis. + */ + rangeStart: Object; + /** + * The value that became the end of the argument axis after zooming or scrolling ended. + * Value: An object specifying the end of the argument axis. + */ + rangeEnd: Object; +} +/** + * Represents a client-side equivalent of the Range Selector control. + */ +interface BootstrapClientRangeSelector extends BootstrapUIWidgetBase { + /** + * Fires after the selected range has been changed by moving one of the sliders. + */ + ValueChanged: ASPxClientEvent>; + /** + * Gets the Range Selector's selected value range. + */ + GetValue(): Object[]; + /** + * Gets the Range Selector's selected value range. + * @param value An array containing the value range. + */ + SetValue(value: Object[]): void; +} +/** + * Provides data for events which concern manipulations on the selected range. + */ +interface BootstrapClientRangeSelectorValueChangedEventArgs extends BootstrapUIWidgetEventArgsBase { + /** + * The value currently specified for the RangeSelector control. + * Value: A System.Object instance defining the current value specified for a RangeSelector control. + */ + value: Object; + /** + * The previous value of a RangeSelector control. + * Value: A System.Object type defining the previous value specified for a RangeSelector control. + */ + previousValue: Object; +} +/** + * A method that will handle the ValueChanged event. + */ +interface BootstrapClientRangeSelectorValueChangedEventHandler { + /** + * A method that will handle the ValueChanged event. + * @param source The event source. + * @param e A BootstrapClientRangeSelectorValueChangedEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientRangeSelectorValueChangedEventArgs): void; +} +/** + * A method that will handle the Init event. + */ +interface BootstrapUIWidgetInitializedEventHandler { + /** + * A method that will handle the Init event. + * @param source The event source. + * @param e A BootstrapUIWidgetEventArgsBase object that contains event data. + */ + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +/** + * A method that will handle the Drawn event. + */ +interface BootstrapUIWidgetDrawnEventHandler { + /** + * A method that will handle the Drawn event. + * @param source The event source. + * @param e A BootstrapUIWidgetEventArgsBase object that contains event data. + */ + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +/** + * A method that will handle the Disposing event. + */ +interface BootstrapUIWidgetDisposingEventHandler { + /** + * A method that will handle the Disposing event. + * @param source The event source. + * @param e A BootstrapUIWidgetEventArgsBase object that contains event data. + */ + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +/** + * A method that will handle the Exported event. + */ +interface BootstrapUIWidgetExportedEventHandler { + /** + * A method that will handle the Exported event. + * @param source The event source. + * @param e A BootstrapUIWidgetEventArgsBase object that contains event data. + */ + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +/** + * A method that will handle the OptionChanged event. + */ +interface BootstrapUIWidgetOptionChangedEventHandler { + /** + * A method that will handle the OptionChanged event. + * @param source The event source. + * @param e A BootstrapUIWidgetOptionChangedEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetOptionChangedEventArgs): void; +} +/** + * Provides data for client events raised in response to changing the widget's options. + */ +interface BootstrapUIWidgetOptionChangedEventArgs extends BootstrapUIWidgetEventArgsBase { + /** + * The option's full name. + * Value: A string value specifying the option's full name. + */ + fullName: string; + /** + * The option's short name. + * Value: A string value specifying the option's short name. + */ + name: string; + /** + * The option's old value. + * Value: An object that is the option's old value. + */ + previousValue: Object; + /** + * The option's new value. + * Value: An object that is the option's new value. + */ + value: Object; +} +/** + * A method that will handle the Exporting event. + */ +interface BootstrapUIWidgetExportingEventHandler { + /** + * A method that will handle the Exporting event. + * @param source The event source. + * @param e A BootstrapUIWidgetExportEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetExportEventArgs): void; +} +/** + * A method that will handle the FileSaving event. + */ +interface BootstrapUIWidgetFileSavingEventHandler { + /** + * A method that will handle the FileSaving event. + * @param source The event source. + * @param e A BootstrapUIWidgetExportEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetExportEventArgs): void; +} +/** + * Provides data for events related to saving files in the built-in dialogs. + */ +interface BootstrapUIWidgetExportEventArgs extends BootstrapUIWidgetEventArgsBase { + /** + * Allows you to cancel file saving. + * Value: true, to cancel the file saving; otherwise, false. + */ + cancel: boolean; + /** + * Gets the saved data as a BLOB object. + * Value: A BLOB object containing saved data. + */ + data: Object; + /** + * Gets a name of a saved file. + * Value: A string value specifying the saved file's name. + */ + fileName: string; + /** + * Gets the saved file's format. + * Value: A string value specifying the saved file's format. + */ + format: string; +} +/** + * A method that will handle the IncidentOccurred event. + */ +interface BootstrapUIWidgetErrorEventHandler { + /** + * A method that will handle the IncidentOccurred event. + * @param source The event source. + * @param e A BootstrapUIWidgetErrorEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetErrorEventArgs): void; +} +/** + * Provides data for client events raised in response to widget errors. + */ +interface BootstrapUIWidgetErrorEventArgs extends BootstrapUIWidgetEventArgsBase { + /** + * Contains information on the error that occurred. + * Value: An object containing information on the error that occurred. + */ + target: Object; +} +/** + * Provides data for client events related to actions performed on the widget's visual elements. + */ +interface BootstrapUIWidgetElementActionEventArgs extends BootstrapUIWidgetEventArgsBase { + /** + * The DOM element that initiated the event. + * Value: An object that initiated the event. + */ + target: Object; +} +/** + * Provides data for the client-side clicking events. + */ +interface BootstrapUIWidgetElementClickEventArgs extends BootstrapUIWidgetElementActionEventArgs { + /** + * The jQuery event that caused the handler execution. + * Value: An object of the jQuery.Event type. + */ + jQueryEvent: Object; +} /** * A client-side counterpart of the Calendar and CalendarFor extensions. */ @@ -20343,7 +22960,7 @@ interface MVCxClientPopupControl extends ASPxClientPopupControl { */ PerformWindowCallback(window: ASPxClientPopupWindow, data: Object): void; /** - * + * Sends a callback with parameters to update the popup window by processing the related popup window. * @param window * @param parameter */ @@ -20849,6 +23466,27 @@ interface MVCxClientVerticalGrid extends ASPxClientVerticalGrid { */ interface MVCxClientWebDocumentViewer extends ASPxClientWebDocumentViewer { } +interface ANCxClientBeginCallbackEventHandler { + (source: S, e: ANCxClientBeginCallbackEventArgs): void; +} +/** + * Serves as the base class for arguments of the web controls' client-side events. + */ +interface ASPxClientEventArgs { +} +/** + * Provides data for client events related to the beginning of a callback processing round trip. + */ +interface ASPxClientBeginCallbackEventArgs extends ASPxClientEventArgs { + /** + * Gets a command name that identifies which client action forced a callback to be occurred. + * Value: A string value that represents the name of the command which initiated a callback. + */ + command: string; +} +interface ANCxClientBeginCallbackEventArgs extends ASPxClientBeginCallbackEventArgs { + customArgs: Object; +} /** * Serves as the base type for all the objects included in the client-side object model. */ @@ -20871,6 +23509,10 @@ interface ASPxClientControlBase { * @param message A String value that specifies a text. */ SendMessageToAssistiveTechnology(message: string): void; + /** + * Returns a client instance of the control that is the parent for a specified control. + */ + GetParentControl(): Object; /** * Returns a value specifying whether a control is displayed. */ @@ -20969,11 +23611,6 @@ interface ASPxClientCallbackCompleteEventHandler { */ (source: S, e: ASPxClientCallbackCompleteEventArgs): void; } -/** - * Serves as the base class for arguments of the web controls' client-side events. - */ -interface ASPxClientEventArgs { -} /** * Provides data for events concerning the final processing of a callback. */ @@ -21195,11 +23832,6 @@ interface ASPxClientProcessingModeCancelEventArgs extends ASPxClientProcessingMo */ interface KnockoutObservableBoolean { } -/** - * Provides access to observable arrays that allow you to detect and respond to changes in a collection of things. - */ -interface KnockoutObservableArray { -} /** * Represents a JavaScript function which receives callback data obtained via a call to a specific client method (such as the PerformDataCallback). */ @@ -21262,16 +23894,6 @@ interface ASPxClientBeginCallbackEventHandler { */ (source: S, e: ASPxClientBeginCallbackEventArgs): void; } -/** - * Provides data for client events related to the beginning of a callback processing round trip. - */ -interface ASPxClientBeginCallbackEventArgs extends ASPxClientEventArgs { - /** - * Gets a command name that identifies which client action forced a callback to be occurred. - * Value: A string value that represents the name of the command which initiated a callback. - */ - command: string; -} /** * A method that will handle the BeginCallback event. */ @@ -22478,6 +25100,10 @@ interface ASPxClientFileManagerItem { * @param skipRootFolder true, to skip the root folder; otherwise, false. */ GetFullName(separator: string, skipRootFolder: boolean): string; + /** + * Gets the current item's metadata. + */ + GetMetadata(): Object; } /** * Represents the client-side equivalent of the FileManagerFile object. @@ -23523,6 +26149,11 @@ interface ASPxClientHintOptions { * Value: true, to display a hint in a callout box; otherwise, false. */ showCallout: boolean; + /** + * Gets or sets a value that specifies whether a hint's title is displayed. + * Value: true, to display the hint's title; otherwise, false. + */ + showTitle: boolean; /** * Gets or sets where a hint should be positioned. * Value: A string value that specifies a hint position. @@ -24596,7 +27227,7 @@ interface ASPxClientPopupControl extends ASPxClientPopupControlBase { */ GetWindowPopUpReasonMouseEvent(window: ASPxClientPopupWindow): Object; /** - * + * Sends a callback with parameters to update the popup window by processing the related popup window. * @param window * @param parameter */ @@ -24749,6 +27380,103 @@ interface ASPxClientPopupControl extends ASPxClientPopupControlBase { * @param html A string value that represents the HTML code defining the content of the specified popup window. */ SetWindowContentHtml(window: ASPxClientPopupWindow, html: string): void; + /** + * Stretches the popup window in adaptive mode vertically to the full height of the browser window. + */ + StretchVertically(): void; + /** + * Stretches the specified popup window in adaptive mode vertically to the full height of the browser window. + * @param window A ASPxClientPopupWindow object representing the required popup window. + */ + WindowStretchVertically(window: ASPxClientPopupWindow): void; + /** + * Sets the minimum width of the popup window in adaptive mode. + * @param minWidth An integer value specifying the minimum width of the popup window in adaptive mode. + */ + SetAdaptiveMinWidth(minWidth: number): void; + /** + * Sets the minimum width of the popup window in adaptive mode. + * @param minWidth A string value specifying the minimum width of the popup window in adaptive mode as a percentage of the browser window inner width value. + */ + SetAdaptiveMinWidth(minWidth: string): void; + /** + * Sets the minimum width of the specified popup window in adaptive mode. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param minWidth An integer value specifying the minimum width of the popup window in adaptive mode. + */ + SetWindowAdaptiveMinWidth(window: ASPxClientPopupWindow, minWidth: number): void; + /** + * Sets the minimum width of the specified popup window in adaptive mode. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param minWidth An integer value specifying the minimum width of the popup window in adaptive mode as a percentage of the browser window inner width value. + */ + SetWindowAdaptiveMinWidth(window: ASPxClientPopupWindow, minWidth: string): void; + /** + * Sets the maximum width of the popup window in adaptive mode. + * @param maxWidth An integer value specifying the maximum width of the popup window in adaptive mode. + */ + SetAdaptiveMaxWidth(maxWidth: number): void; + /** + * Sets the maximum width of the popup window in adaptive mode. + * @param maxWidth A string value specifying the maximum width of the popup window in adaptive mode as a percentage of the browser window inner width value. + */ + SetAdaptiveMaxWidth(maxWidth: string): void; + /** + * Sets the maximum width of the specified popup window in adaptive mode. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param maxWidth An integer value specifying the maximum width of the popup window in adaptive mode. + */ + SetWindowAdaptiveMaxWidth(window: ASPxClientPopupWindow, maxWidth: number): void; + /** + * Sets the maximum width of the specified popup window in adaptive mode. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param maxWidth An integer value specifying the maximum width of the popup window in adaptive mode as a percentage of the browser window inner width value. + */ + SetWindowAdaptiveMaxWidth(window: ASPxClientPopupWindow, maxWidth: string): void; + /** + * Sets the minimum height of the popup window in adaptive mode. + * @param minHeight An integer value specifying the minimum height of the popup window in adaptive mode. + */ + SetAdaptiveMinHeight(minHeight: number): void; + /** + * Sets the minimum height of the popup window in adaptive mode. + * @param minHeight A string value specifying the minimum height of the popup window in adaptive mode as a percentage of the browser window inner height value. + */ + SetAdaptiveMinHeight(minHeight: string): void; + /** + * Sets the minimum height of the specified popup window in adaptive mode. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param minHeight An integer value specifying the minimum height of the popup window in adaptive mode. + */ + SetWindowAdaptiveMinHeight(window: ASPxClientPopupWindow, minHeight: number): void; + /** + * Sets the minimum height of the specified popup window in adaptive mode. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param minHeight An integer value specifying the minimum height of the popup window in adaptive mode as a percentage of the browser window inner height value. + */ + SetWindowAdaptiveMinHeight(window: ASPxClientPopupWindow, minHeight: string): void; + /** + * Sets the maximum height of the popup window in adaptive mode. + * @param maxHeight An integer value specifying the maximum height of the popup window in adaptive mode. + */ + SetAdaptiveMaxHeight(maxHeight: number): void; + /** + * Sets the maximum height of the popup window in adaptive mode. + * @param maxHeight A string value specifying the maximum height of the popup window in adaptive mode as a percentage of the browser window inner height value. + */ + SetAdaptiveMaxHeight(maxHeight: string): void; + /** + * Sets the maximum height of the specified popup window in adaptive mode. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param maxHeight An integer value specifying the maximum height of the popup window in adaptive mode. + */ + SetWindowAdaptiveMaxHeight(window: ASPxClientPopupWindow, maxHeight: number): void; + /** + * Sets the maximum height of the specified popup window in adaptive mode. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param maxHeight An integer value specifying the maximum height of the popup window in adaptive mode as a percentage of the browser window inner height value. + */ + SetWindowAdaptiveMaxHeight(window: ASPxClientPopupWindow, maxHeight: string): void; /** * Returns an iframe object containing a web page specified via the specified popup window's SetWindowContentUrl client method). * @param window A ASPxClientPopupWindow object representing the required popup window. @@ -28890,7 +31618,7 @@ interface ASPxClientDocumentViewer extends ASPxClientControl { */ EndCallback: ASPxClientEvent>; /** - * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientDocumentViewer. + * Fires on the client if any server error occurs during server-side processing of a callback sent by ASPxClientDocumentViewer. */ CallbackError: ASPxClientEvent>; /** @@ -29011,13 +31739,17 @@ interface ASPxClientQueryBuilder extends ASPxClientControl { */ EndCallback: ASPxClientEvent>; /** - * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientQueryBuilder. + * Fires on the client if any server error occurs during server-side processing of a callback sent by ASPxClientQueryBuilder. */ CallbackError: ASPxClientEvent>; /** * Enables you to customize the menu actions of a Query Builder. */ CustomizeToolbarActions: ASPxClientEvent>; + /** + * Enables you to customize the Query Builder's localization strings. + */ + CustomizeLocalization: ASPxClientEvent>; /** * Occurs when executing the Save command on the client. */ @@ -29034,7 +31766,7 @@ interface ASPxClientQueryBuilder extends ASPxClientControl { */ PerformCallback(arg: string, onSuccess: (arg1: string) => void): void; /** - * Updates the localization settings of the ASPxClientQueryBuilder properties. + * Updates the ASPxClientQueryBuilder properties' localization settings. * @param localization A dictionary containing the property names, along with their localized equivalents. */ UpdateLocalization(localization: { [key: string]: string; }): void; @@ -29091,6 +31823,16 @@ interface ASPxClientQueryBuilderCustomizeToolbarActionsEventHandler { */ (source: S, e: ASPxClientCustomizeMenuActionsEventArgs): void; } +/** + * A method that will handle the CustomizeLocalization event. + */ +interface ASPxClientQueryBuilderCustomizeLocalizationEventHandler { + /** + * A method that will handle the CustomizeLocalization event. + * @param source The event sender. + */ + (source: S): void; +} /** * The client-side equivalent of the Web Report Designer control. */ @@ -29104,7 +31846,7 @@ interface ASPxClientReportDesigner extends ASPxClientControl { */ EndCallback: ASPxClientEvent>; /** - * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientReportDesigner. + * Fires on the client if any server error occurs during server-side processing of a callback sent by ASPxClientReportDesigner. */ CallbackError: ASPxClientEvent>; /** @@ -29112,7 +31854,7 @@ interface ASPxClientReportDesigner extends ASPxClientControl { */ SaveCommandExecute: ASPxClientEvent>; /** - * Enables you to customize the menu actions of the Web Report Designer. + * Enables you to customize the Web Report Designer's menu actions. */ CustomizeMenuActions: ASPxClientEvent>; /** @@ -29143,6 +31885,14 @@ interface ASPxClientReportDesigner extends ASPxClientControl { * Occurs when a report has been opened in the Web Report Designer. */ ReportOpened: ASPxClientEvent>; + /** + * Occurs when a report tab is about to be closed in the Web Report Designer. + */ + ReportTabClosing: ASPxClientEvent>; + /** + * Occurs when a report tab was closed in the Web Report Designer. + */ + ReportTabClosed: ASPxClientEvent>; /** * Occurs on the client each time a server-side error raises. */ @@ -29152,7 +31902,7 @@ interface ASPxClientReportDesigner extends ASPxClientControl { */ ComponentAdded: ASPxClientEvent>; /** - * Enables you to customize UI elements of the Web Report Designer. + * Enables you to customize the Web Report Designer's UI elements. */ CustomizeElements: ASPxClientEvent>; /** @@ -29176,7 +31926,7 @@ interface ASPxClientReportDesigner extends ASPxClientControl { */ PreviewDocumentReady: ASPxClientEvent>; /** - * Occurs each time a value of an editing field changes in Print Preview. + * Occurs each time an editing field's value changes in Print Preview. */ PreviewEditingFieldChanged: ASPxClientEvent>; /** @@ -29188,17 +31938,25 @@ interface ASPxClientReportDesigner extends ASPxClientControl { */ PreviewCustomizeMenuActions: ASPxClientEvent>; /** - * Occurs when the left mouse button has been clicked over a report document in Print Preview. + * Occurs when the left mouse button is clicked on a report document in Print Preview. */ PreviewClick: ASPxClientEvent>; /** - * Occurs after report parameter values have been reset to their default values in Print Preview. + * Occurs after report parameter values are reset to their default values in Print Preview. */ PreviewParametersReset: ASPxClientEvent>; /** - * Occurs after report parameter values have been submitted in Print Preview. + * Occurs after report parameter values are submitted in Print Preview. */ PreviewParametersSubmitted: ASPxClientEvent>; + /** + * Enables you to customize the Web Report Designer's localization strings. + */ + CustomizeLocalization: ASPxClientEvent>; + /** + * Occurs before the Web Report Designer UI is initialized. + */ + BeforeRender: ASPxClientEvent>; /** * Sends a callback to the server with the specified argument. * @param arg A String value, specifying the callback argument. @@ -29211,18 +31969,18 @@ interface ASPxClientReportDesigner extends ASPxClientControl { */ PerformCallback(arg: string, onSuccess: (arg1: string) => void): void; /** - * Updates the localization settings of the ASPxClientReportDesigner properties. + * Updates the Report Designer properties' localization settings. * @param localization A dictionary containing the property names, along with their localized equivalents. */ UpdateLocalization(localization: { [key: string]: string; }): void; /** - * Returns the object model of a Web Report Designer. + * Provides access to a client-side model of a Web Report Designer. */ GetDesignerModel(): Object; /** - * Provides access to the preview model of the ASPxClientReportDesigner. + * Provides access to the Document Viewer's client-side model. */ - GetPreviewModel(): Object; + GetPreviewModel(): ASPxClientSidePreviewModel; /** * Returns information about the specified property of the specified control. * @param controlType A string that specifies the control type. @@ -29313,7 +32071,7 @@ interface ASPxClientReportDesigner extends ASPxClientControl { */ ReportStorageGetUrls(): any; /** - * Opens the specified report on the client side of the Web Report Designer. + * Opens the specified report on the Web Report Designer's client side. * @param url A string that specifies the URL of a report to be opened. */ OpenReport(url: string): void; @@ -29362,12 +32120,42 @@ interface ASPxClientReportDesignerDialogEventArgs extends ASPxClientEventArgs { * Value: An object that specifies the report currently being processed. */ Report: Object; +} +/** + * Provides data for the events related to opening and saving reports in the Web Report Designer. + */ +interface ASPxClientReportDesignerDialogCancelEventArgs extends ASPxClientReportDesignerDialogEventArgs { /** * Specifies whether or not the operation performed with a report should be canceled. * Value: true, if the operation should be canceled; otherwise, false. */ Cancel: boolean; } +/** + * Provides data for the ReportTabClosed event. + */ +interface ASPxClientReportDesignerTabEventArgs extends ASPxClientEventArgs { + /** + * Specifies the report tab currently being processed. + * Value: An object that specifies the report tab currently being processed. + */ + Tab: ASPxDesignerNavigateTab; +} +/** + * Provides data for the ReportTabClosing event. + */ +interface ASPxClientReportDesignerTabClosingEventArgs extends ASPxClientReportDesignerTabEventArgs { + /** + * Specifies whether or not the event was handled. + * Value: true, if the event was handled and no other processing should occur; otherwise, false. + */ + Handled: boolean; + /** + * Specifies the JQueryDeferred object, which when resolved, forces the report tab to be closed. + * Value: A JQueryDeferred object. + */ + ReadyToClose: JQueryDeferred; +} /** * Provides data for the OnServerError event. */ @@ -29513,9 +32301,9 @@ interface ASPxClientReportDesignerReportSavingEventHandler { /** * A method that will handle the ReportSaving event. * @param source The event sender. - * @param e An ASPxClientReportDesignerDialogEventArgs object that contains data related to the event. + * @param e An ASPxClientReportDesignerDialogCancelEventArgs object that contains data related to the event. */ - (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; + (source: S, e: ASPxClientReportDesignerDialogCancelEventArgs): void; } /** * A method that will handle the ReportSaved event. @@ -29535,9 +32323,9 @@ interface ASPxClientReportDesignerReportOpeningEventHandler { /** * A method that will handle the ReportOpening event. * @param source The event sender. - * @param e An ASPxClientReportDesignerDialogEventArgs object that contains data related to the event. + * @param e An ASPxClientReportDesignerDialogCancelEventArgs object that contains data related to the event. */ - (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; + (source: S, e: ASPxClientReportDesignerDialogCancelEventArgs): void; } /** * A method that will handle the ReportOpened event. @@ -29550,6 +32338,28 @@ interface ASPxClientReportDesignerReportOpenedEventHandler { */ (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; } +/** + * A method that will handle the ReportTabClosing event. + */ +interface ASPxClientReportDesignerReportTabClosingEventHandler { + /** + * A method that will handle the ReportTabClosing event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerTabClosingEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerTabClosingEventArgs): void; +} +/** + * A method that will handle the ReportTabClosed event. + */ +interface ASPxClientReportDesignerReportTabClosedEventHandler { + /** + * A method that will handle the ReportTabClosed event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerTabEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerTabEventArgs): void; +} /** * A method that will handle the OnServerError event. */ @@ -29616,6 +32426,27 @@ interface ASPxClientReportDesignerCustomizeToolboxEventHandler { */ (source: S, e: ASPxClientReportDesignerCustomizeToolboxEventArgs): void; } +/** + * A method that will handle the CustomizeLocalization event. + */ +interface ASPxClientReportDesignerCustomizeLocalizationEventHandler { + /** + * A method that will handle the CustomizeLocalization event. + * @param source The event sender. + */ + (source: S): void; +} +/** + * A method that will handle the BeforeRender event. + */ +interface ASPxClientReportDesignerBeforeRenderEventHandler { + /** + * A method that will handle the BeforeRender event. + * @param source The event sender. + * @param designerModel A client-side Report Designer model. + */ + (source: S, designerModel: Object): void; +} /** * Provides information about a value editor used in the Property Grid. */ @@ -29994,7 +32825,7 @@ interface ASPxClientReportViewer extends ASPxClientControl { */ EndCallback: ASPxClientEvent>; /** - * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientReportViewer. + * Fires on the client if any server error occurs during server-side processing of a callback sent by ASPxClientReportViewer. */ CallbackError: ASPxClientEvent>; /** @@ -30147,10 +32978,10 @@ interface ASPxClientMenuAction { */ hotKey: ASPxClientMenuActionHotKey; /** - * Provides access to the value that specifies whether or not the command has a visual separator. + * Specifies whether or not the command has a visual separator. * Value: true, if the command has a visual separator; otherwise, false. */ - hasSeparator: string; + hasSeparator: boolean; /** * Provides access to a value that specifies the command location. * Value: A string that specifies the command location. @@ -30505,6 +33336,11 @@ interface ASPxClientPreviewClickEventArgs extends ASPxClientEventArgs { * Returns a string providing additional information on the Brick. */ GetBrickValue(): string; + /** + * Returns a string providing additional information about the current Brick by the specified key. + * @param key A string that specifies a unique key. + */ + GetBrickValue(key: string): string; } /** * Provides information about a visual brick used to render a report control to construct a document in the Web Document Viewer. @@ -30571,19 +33407,19 @@ interface ASPxClientWebDocumentViewerBrickNavigation { */ interface ASPxClientWebDocumentViewer extends ASPxClientControl { /** - * Occurs after a report document has been loaded to the Web Document Viewer. + * Occurs after the Web Document Viewer loads a report document. */ DocumentReady: ASPxClientEvent>; /** - * Occurs each time a value of an editing field changes. + * Occurs each time an editing field's value changes. */ EditingFieldChanged: ASPxClientEvent>; /** - * Enables you to customize UI elements of the Web Document Viewer. + * Allows you to customize the Web Document Viewer's UI elements. */ CustomizeElements: ASPxClientEvent>; /** - * Enables you to customize the menu actions of a Web Document Viewer. + * Enables you to customize the Web Document Viewer's menu actions. */ CustomizeMenuActions: ASPxClientEvent>; /** @@ -30595,27 +33431,44 @@ interface ASPxClientWebDocumentViewer extends ASPxClientControl { */ CustomizeParameterLookUpSource: ASPxClientEvent>; /** - * Occurs when the left mouse button has been clicked over a report document. + * Occurs when the left mouse button is clicked on a report document. */ PreviewClick: ASPxClientEvent>; /** - * Occurs after report parameter values have been reset to their default values. + * Occurs after report parameter values are reset to their default values. */ ParametersReset: ASPxClientEvent>; /** - * Occurs after report parameter values have been submitted. + * Occurs after report parameter values are submitted. */ ParametersSubmitted: ASPxClientEvent>; /** - * Provides access to the preview model of the ASPxClientWebDocumentViewer. + * Enables you to customize the Web Document Viewer's localization strings. */ - GetPreviewModel(): Object; + CustomizeLocalization: ASPxClientEvent>; /** - * Returns a model for a report parameter. + * Occurs before the Web Document Viewer UI is initialized. */ - GetParametersModel(): Object; + BeforeRender: ASPxClientEvent>; /** - * Opens the specified report on the client side of the Web Document Viewer. + * Provides access to the Document Viewer's client-side model. + */ + GetPreviewModel(): ASPxClientSidePreviewModel; + /** + * Provides access to the report preview. + */ + GetReportPreview(): ASPxClientReportPreview; + /** + * Provide access to the report parameters' client-side model. + */ + GetParametersModel(): ASPxClientSideParametersModel; + /** + * Enables navigation between drill-through reports on the client-side. + * @param customData Provides access to custom client data associated with a currently previewed report. + */ + DrillThrough(customData: string): any; + /** + * Opens the specified report on the Web Document Viewer's client side. * @param url A string that specifies the URL of a report to be opened. */ OpenReport(url: string): any; @@ -30644,7 +33497,7 @@ interface ASPxClientWebDocumentViewer extends ASPxClientControl { */ ExportTo(format: string, inlineResult: boolean): void; /** - * Returns the zero-based index of the currently displayed page. + * Returns the current page's zero-based index. */ GetCurrentPageIndex(): number; /** @@ -30653,11 +33506,11 @@ interface ASPxClientWebDocumentViewer extends ASPxClientControl { */ GoToPage(pageIndex: number): void; /** - * Closes the document currently being opened in the Web Document Viewer. + * Closes the document which is currently opened in the Web Document Viewer. */ Close(): void; /** - * Resets the values of report parameters to their default values. + * Resets the report parameter values to the default values. */ ResetParameters(): void; /** @@ -30665,7 +33518,22 @@ interface ASPxClientWebDocumentViewer extends ASPxClientControl { */ StartBuild(): void; /** - * Updates the localization settings of the ASPxClientWebDocumentViewer properties. + * Performs a custom operation with a currently opened document on the client side. + */ + PerformCustomDocumentOperation(): any; + /** + * Performs a custom operation with a currently opened document on the client-side. + * @param customData Provides access to custom client data associated with a target document operation. + */ + PerformCustomDocumentOperation(customData: string): any; + /** + * Performs a custom operation with a currently opened document on the client-side. + * @param customData Provides access to custom client data associated with a target document operation. + * @param hideMessageFromUser true, to hide a message with the operation result from a user; otherwise, false. + */ + PerformCustomDocumentOperation(customData: string, hideMessageFromUser: boolean): any; + /** + * Updates the Web Document Viewer properties' localization settings. * @param localization A dictionary containing the property names, along with their localized equivalents. */ UpdateLocalization(localization: { [key: string]: string; }): void; @@ -30769,6 +33637,219 @@ interface ASPxClientWebDocumentViewerParametersSubmittedEventHandler { */ (source: S, e: ASPxClientParametersSubmittedEventArgs): void; } +/** + * A method that will handle the CustomizeLocalization event. + */ +interface ASPxClientWebDocumentViewerCustomizeLocalizationEventHandler { + /** + * A method that will handle the CustomizeLocalization event. + * @param source The event sender. + */ + (source: S): void; +} +/** + * A method that will handle the BeforeRender event. + */ +interface ASPxClientWebDocumentViewerBeforeRenderEventHandler { + /** + * A method that will handle the BeforeRender event. + * @param source The event sender. + * @param previewModel A client-side Document Viewer model. + */ + (source: S, previewModel: Object): void; +} +/** + * Provides information about the result of preforming a custom document operation on the client side. + */ +interface ASPxClientWebDocumentViewerDocumentOperationResponse { + /** + * Specifies whether a document operation has been successfully performed. + * Value: true, if the document operation has been successfully performed; otherwise, false. + */ + succeeded: boolean; + /** + * Specifies the error message to display if performing a document operation fails. + * Value: A string specifying the text of the error message. + */ + message: string; + /** + * Specifies custom data associated with the performed document operation. + * Value: A string containing information associated with the document operation. + */ + customData: string; + /** + * Specifies the document ID. + * Value: A string that specifies the document ID. + */ + documentId: string; +} +/** + * Provides information a client-side Document Preview model. + */ +interface ASPxClientSidePreviewModel { + /** + * Provides access to the report preview. + * Value: An object that specifies the report preview. + */ + reportPreview: ASPxClientReportPreview; + /** + * Provides access to a panel at the right of the Document Viewer. + * Value: An object that specifies the panel at the right of the Document Viewer. + */ + tabPanel: ASPxClientDocumentPreviewTabPanel; + /** + * Opens the specified report on the Web Document Viewer's client side. + * @param url A string that specifies the URL of a report to be opened. + */ + OpenReport(url: string): any; + /** + * Prints the current document. + */ + Print(): void; + /** + * Prints the document's page with the specified index. + * @param pageIndex An index of the page to be printed. + */ + Print(pageIndex: number): void; + /** + * Exports the document to a PDF file. + */ + ExportTo(): void; + /** + * Exports the document to a specified file format. + * @param format A String value, specifying the export format. The following formats are currently supported: 'csv', 'html', 'image', 'mht', 'pdf', 'rtf', 'docx', 'txt', 'xls', and 'xlsx'. + */ + ExportTo(format: string): void; + /** + * Exports the document to a specified file format. + * @param format A String value that specifies the export format. The following formats are currently supported: 'csv', 'html', 'image', 'mht', 'pdf', 'rtf', 'docx', 'txt', 'xls', and 'xlsx'. + * @param inlineResult true, to try opening the result file in a new browser tab without a download; otherwise, false. + */ + ExportTo(format: string, inlineResult: boolean): void; + /** + * Returns the current page's zero-based index. + */ + GetCurrentPageIndex(): number; + /** + * Displays the report page with the specified page index. + * @param pageIndex A zero-based integer value that specifies the index of a page to be displayed. + */ + GoToPage(pageIndex: number): void; + /** + * Closes the document which is currently opened in the Web Document Viewer. + */ + Close(): void; + /** + * Resets the report parameter values to the default values. + */ + ResetParameters(): void; + /** + * Starts building a report document. + */ + StartBuild(): void; + /** + * Provide access to the report parameters' client-side model. + */ + GetParametersModel(): ASPxClientSideParametersModel; +} +/** + * Provides information about the Document Viewer's tab panel. + */ +interface ASPxClientDocumentPreviewTabPanel { + /** + * Specifies the width of the panel at the right of the Document Viewer. + * Value: A knockout observable object that specifies the tab panel width. + */ + width: any; + /** + * Specifies whether the panel at the right of the Document Viewer is collapsed. + * Value: A knockout observable object that specifies whether the tab panel is collapsed. + */ + collapsed: any; + /** + * Provides access to the tabs of the panel at the right of the Document Viewer. + * Value: A collection of ASPxClientDocumentPreviewTab objects. + */ + tabs: ASPxClientDocumentPreviewTab[]; +} +/** + * Provides information about a tab available in the Document Viewer. + */ +interface ASPxClientDocumentPreviewTab { + /** + * Provides access to the name of an HTML template used by a tab. + * Value: A knockout observable string that specifies the name of the HTML template used by the tab. + */ + template: string; + /** + * Provides access to the tab text. + * Value: A string that specifies the tab text. + */ + text: string; + /** + * Provides access to a tab model. + * Value: An object that specifies the tab model. + */ + model: Object; + /** + * Provides access to the value that specifies whether a tab is active. + * Value: A knockout observable object that specifies whether the tab is active. + */ + active: any; + /** + * Provides access to the value that specifies whether a tab is visible. + * Value: A knockout observable object that specifies whether the tab is visible. + */ + visible: any; +} +/** + * Provides information about the report parameters' client-side model. + */ +interface ASPxClientSideParametersModel { + /** + * Provides information about the tab for specifying parameter values. + * Value: An object that provides information about the Parameters tab. + */ + tabInfo: ASPxClientDocumentPreviewTab; + /** + * Initiates passing parameter values and generating the report document. + */ + submit(): void; + /** + * Serializes report parameters before passing them to the server. + */ + serializeParameters(): void; +} +/** + * Provides information about a report preview. + */ +interface ASPxClientReportPreview { + /** + * Zooms the Document Viewer's current document. + * Value: A knockout observable object that specifies the zoom factor. + */ + zoom: any; + /** + * Enables the Document Viewer's multi-page mode. + * Value: A knockout observable object that specifies whether the multi-page mode is enabled. + */ + showMultipagePreview: any; + /** + * Provides access to the current document page's index. + * Value: A knockout observable object that specifies the zero-based index of the current page. + */ + pageIndex: any; + /** + * Provides access to document pages. + * Value: An array of objects that specify document pages. + */ + pages: any; + /** + * Provides access to a value that specifies whether the document is currently building. + * Value: A knockout observable object that specifies whether the document is building. + */ + documentBuilding: any; +} interface MVCxClientDashboardViewerStatic extends ASPxClientDashboardViewerStatic { } @@ -30812,7 +33893,7 @@ interface DashboardSpecialValuesStatic { */ OthersValue: string; /** - * Represents an error value for calculated fields. + * Represents an error value (for instance, this can be a calculated field value that cannot be evaluated). */ ErrorValue: string; /** @@ -30890,6 +33971,20 @@ interface DashboardExportScaleModeStatic { */ AutoFitWithinOnePage: string; } +interface DashboardExportDocumentScaleModeStatic { + /** + * The dashboard / dashboard item on the exported page retains its original size. + */ + None: string; + /** + * The size of the dashboard / dashboard item on the exported page is changed according to the scale factor value (ScaleFactor). + */ + UseScaleFactor: string; + /** + * The size of the dashboard / dashboard item is changed according to the width of the exported pages. + */ + AutoFitToPagesWidth: string; +} interface DashboardExportFilterStateStatic { /** * The filter state is not included in the exported document. @@ -31156,6 +34251,18 @@ interface ASPxClientEditStatic extends ASPxClientEditBaseStatic { * Verifies whether visible editors on a page are valid. */ AreEditorsValid(): boolean; + /** + * Attaches a handler to the ASPxClientEdit's event indicating whether the editor has been changed since the previous state. + * @param handler An object representing a handler. + * @param predicate An ASPxClientControlPredicate object representing the predicate criteria. + */ + AttachEditorModificationListener(handler: Object, predicate: ASPxClientControlPredicate): void; + /** + * Detaches a handler from the editor's event if the editor meets the predicate criteria. + * @param handler An object representing a handler. + * @param predicate An ASPxClientControlPredicate object representing a predicate criteria. + */ + DetachEditorModificationListener(handler: Object, predicate: ASPxClientControlPredicate): void; } interface ASPxClientBinaryImageStatic extends ASPxClientEditStatic { /** @@ -31538,11 +34645,41 @@ interface ASPxClientGridViewCallbackCommandStatic { * Default value: "TOOLBAR" */ Toolbar: string; + /** + * Default value: "EXPORT" + */ + Export: string; /** * Default value: "CUSTOMVALUES" */ CustomValues: string; } +interface ASPxClientGridExportFormatStatic { + /** + * Identifies Portable Document Format (.pdf). + */ + Pdf: string; + /** + * Identifies DOCX format (.docx). + */ + Docx: string; + /** + * Identifies Rich Text Format (.rtf). + */ + Rtf: string; + /** + * Identifies Comma Separated Values format (.csv). + */ + Csv: string; + /** + * Identifies Excel Binary File format (.xls). + */ + Xls: string; + /** + * Identifies XML spreadsheet file format (.xlsx). + */ + Xlsx: string; +} interface ASPxClientGridLookupStatic extends ASPxClientDropDownEditBaseStatic { /** * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. @@ -31557,6 +34694,8 @@ interface ASPxClientCardViewStatic extends ASPxClientGridBaseStatic { */ Cast(obj: Object): ASPxClientCardView; } +interface ASPxClientCardViewExportFormatStatic extends ASPxClientGridExportFormatStatic { +} interface ASPxClientGridViewStatic extends ASPxClientGridBaseStatic { /** * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. @@ -31564,6 +34703,8 @@ interface ASPxClientGridViewStatic extends ASPxClientGridBaseStatic { */ Cast(obj: Object): ASPxClientGridView; } +interface ASPxClientGridViewExportFormatStatic extends ASPxClientGridExportFormatStatic { +} interface ASPxClientVerticalGridStatic extends ASPxClientGridBaseStatic { /** * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. @@ -31577,6 +34718,8 @@ interface ASPxClientVerticalGridCallbackCommandStatic { */ ExpandRow: string; } +interface ASPxClientVerticalGridExportFormatStatic extends ASPxClientGridExportFormatStatic { +} interface ASPxClientCommandConstsStatic { /** * Identifies a command that shows a search panel. @@ -32106,6 +35249,27 @@ interface ASPxClientHtmlEditorStatic extends ASPxClientControlStatic { * @param data An object representing custom data associated with a custom dialog. */ CustomDialogComplete(status: Object, data: Object): void; + /** + * Highlights the text. + * @param text A string value specifying the text to be highlighted. + * @param searchContainer An object specifying the container where the specified text should be searched. + */ + HighlightText(text: string, searchContainer: Object): void; + /** + * Highlights the text with the specified settings. + * @param text A string value specifying the text to be highlighted. + * @param searchContainer An object specifying the container where the specified text should be searched. + * @param className A string value specifying the text color. + */ + HighlightText(text: string, searchContainer: Object, className: string): void; + /** + * Highlights the text with the specified text color and background color. + * @param text A string value specifying the text to be highlighted. + * @param searchContainer An object specifying the container where the specified text should be searched. + * @param color A string value specifying the text color. + * @param backgroundColor A string value specifying the background color. + */ + HighlightText(text: string, searchContainer: Object, color: string, backgroundColor: string): void; } interface ASPxClientHtmlEditorMediaPreloadModeStatic { /** @@ -32229,6 +35393,28 @@ interface ASPxClientTreeListStatic extends ASPxClientControlStatic { */ Cast(obj: Object): ASPxClientTreeList; } +interface ASPxClientTreeListExportFormatStatic { + /** + * Identifies Portable Document Format (.pdf). + */ + Pdf: string; + /** + * Identifies DOCX format (.docx). + */ + Docx: string; + /** + * Identifies Rich Text Format (.rtf). + */ + Rtf: string; + /** + * Identifies Excel Binary File format (.xls). + */ + Xls: string; + /** + * Identifies XML spreadsheet file format (.xlsx). + */ + Xlsx: string; +} interface BootstrapClientAccordionStatic extends ASPxClientNavBarStatic { } interface BootstrapClientBinaryImageStatic extends ASPxClientHyperLinkStatic { @@ -32239,14 +35425,6 @@ interface BootstrapClientCalendarStatic extends ASPxClientCalendarStatic { } interface BootstrapClientCallbackPanelStatic extends ASPxClientControlStatic { } -interface BootstrapClientChartBaseStatic extends ASPxClientControlStatic { -} -interface BootstrapClientChartStatic extends BootstrapClientChartBaseStatic { -} -interface BootstrapClientPolarChartStatic extends BootstrapClientChartBaseStatic { -} -interface BootstrapClientPieChartStatic extends BootstrapClientChartBaseStatic { -} interface BootstrapClientCheckBoxStatic extends ASPxClientEditStatic { } interface BootstrapClientRadioButtonStatic extends BootstrapClientCheckBoxStatic { @@ -32281,24 +35459,45 @@ interface BootstrapClientProgressBarStatic extends ASPxClientProgressBarStatic { } interface BootstrapClientSpinEditStatic extends ASPxClientSpinEditStatic { } +interface BootstrapClientTimeEditStatic extends ASPxClientTimeEditStatic { +} interface BootstrapClientTabControlStatic extends ASPxClientTabControlStatic { } interface BootstrapClientPageControlStatic extends ASPxClientPageControlStatic { } +interface BootstrapClientTagBoxStatic extends ASPxClientTokenBoxStatic { +} interface BootstrapClientTextBoxStatic extends ASPxClientTextBoxStatic { } interface BootstrapClientMemoStatic extends ASPxClientMemoStatic { } interface BootstrapClientButtonEditStatic extends ASPxClientButtonEditStatic { } -interface BootstrapClientTreeViewStatic extends ASPxClientTreeViewStatic { +interface BootstrapClientToolbarStatic extends BootstrapClientMenuStatic { } -interface BootstrapUIWidgetBaseStatic extends ASPxClientControlStatic { +interface BootstrapClientTreeViewStatic extends ASPxClientTreeViewStatic { } interface BootstrapClientUploadControlStatic extends ASPxClientUploadControlStatic { } +interface BootstrapClientUtilsStatic { + UpdateDefaultStyles(): void; +} interface BootstrapClientGridViewStatic extends ASPxClientGridViewStatic { } +interface BootstrapClientCardViewStatic extends ASPxClientGridViewStatic { +} +interface BootstrapUIWidgetBaseStatic extends ASPxClientControlStatic { +} +interface BootstrapClientChartBaseStatic extends BootstrapUIWidgetBaseStatic { +} +interface BootstrapClientChartStatic extends BootstrapClientChartBaseStatic { +} +interface BootstrapClientPolarChartStatic extends BootstrapClientChartBaseStatic { +} +interface BootstrapClientPieChartStatic extends BootstrapClientChartBaseStatic { +} +interface BootstrapClientRangeSelectorStatic extends BootstrapUIWidgetBaseStatic { +} interface MVCxClientCalendarStatic extends ASPxClientCalendarStatic { /** * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. @@ -32728,6 +35927,28 @@ interface ASPxClientFileManagerErrorConstsStatic { */ AlreadyExists: number; } +interface ASPxClientFileManagerCallbackCommandStatic { + GetAllItems: string; + GetFileList: string; + Refresh: string; + DeleteItems: string; + MoveItems: string; + CopyItems: string; + RenameItem: string; + Download: string; + ShowFolderBrowserDialog: string; + ShowCreateFolderEditorInTreeView: string; + CreateFolder: string; + SelectedFileOpened: string; + FoldersTreeView: string; + FolderBrowserTreeView: string; + GridView: string; + ChangeFolder: string; + ChangeFolderInTreeView: string; + CustomCallback: string; + VirtualScrolling: string; + GridViewVirtualScrolling: string; +} interface ASPxClientFormLayoutStatic extends ASPxClientControlStatic { /** * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. @@ -33384,10 +36605,10 @@ interface ASPxClientUtilsStatic { DeleteCookie(name: string): void; /** * Returns a specifically generated code that uniquely identifies the combination of keys specified via the parameters. - * @param keyCode An integer value that specifies the code of the key. - * @param isCtrlKey true if the CTRL key should be included into the key combination; otherwise, false. - * @param isShiftKey true if the SHIFT key should be included into the key combination; otherwise, false. - * @param isAltKey true if the ALT key should be included into the key combination; otherwise, false. + * @param keyCode An integer value that specifies the code of the key. Codes are available via the ASPx.KeyCode client object's members. + * @param isCtrlKey true, if the CTRL key should be included into the key combination; otherwise, false. + * @param isShiftKey true, if the SHIFT key should be included into the key combination; otherwise, false. + * @param isAltKey true, if the ALT key should be included into the key combination; otherwise, false. */ GetShortcutCode(keyCode: number, isCtrlKey: boolean, isShiftKey: boolean, isAltKey: boolean): number; /** @@ -33415,6 +36636,17 @@ interface ASPxClientUtilsStatic { * @param str A string value representing the string for trimming. */ TrimEnd(str: string): string; + /** + * Returns values of editors located in the specified container. + * @param containerOrId A container of editors, or its ID. + */ + GetEditorValuesInContainer(containerOrId: Object): Object; + /** + * Returns values of editors located in the specified container. + * @param containerOrId A container of editors, or its ID. + * @param processInvisibleEditors true to process both visible and invisible editors that belong to the specified container; false to process only visible editors. + */ + GetEditorValuesInContainer(containerOrId: Object, processInvisibleEditors: boolean): Object; /** * Specifies the text that Assistive Technologies (screen readers or braille display, for example) will provide to a user. * @param message A String value that specifies a text. @@ -33488,6 +36720,7 @@ declare var DashboardSpecialValues: DashboardSpecialValuesStatic; declare var DashboardExportPageLayout: DashboardExportPageLayoutStatic; declare var DashboardExportPaperKind: DashboardExportPaperKindStatic; declare var DashboardExportScaleMode: DashboardExportScaleModeStatic; +declare var DashboardExportDocumentScaleMode: DashboardExportDocumentScaleModeStatic; declare var DashboardExportFilterState: DashboardExportFilterStateStatic; declare var DashboardStateExportPosition: DashboardStateExportPositionStatic; declare var DashboardStateExcelExportPosition: DashboardStateExcelExportPositionStatic; @@ -33541,11 +36774,15 @@ declare var ASPxClientValidationSummary: ASPxClientValidationSummaryStatic; declare var ASPxClientGaugeControl: ASPxClientGaugeControlStatic; declare var ASPxClientGridBase: ASPxClientGridBaseStatic; declare var ASPxClientGridViewCallbackCommand: ASPxClientGridViewCallbackCommandStatic; +declare var ASPxClientGridExportFormat: ASPxClientGridExportFormatStatic; declare var ASPxClientGridLookup: ASPxClientGridLookupStatic; declare var ASPxClientCardView: ASPxClientCardViewStatic; +declare var ASPxClientCardViewExportFormat: ASPxClientCardViewExportFormatStatic; declare var ASPxClientGridView: ASPxClientGridViewStatic; +declare var ASPxClientGridViewExportFormat: ASPxClientGridViewExportFormatStatic; declare var ASPxClientVerticalGrid: ASPxClientVerticalGridStatic; declare var ASPxClientVerticalGridCallbackCommand: ASPxClientVerticalGridCallbackCommandStatic; +declare var ASPxClientVerticalGridExportFormat: ASPxClientVerticalGridExportFormatStatic; declare var ASPxClientCommandConsts: ASPxClientCommandConstsStatic; declare var ASPxClientHtmlEditor: ASPxClientHtmlEditorStatic; declare var ASPxClientHtmlEditorMediaPreloadMode: ASPxClientHtmlEditorMediaPreloadModeStatic; @@ -33567,15 +36804,12 @@ declare var ASPxClientSpellChecker: ASPxClientSpellCheckerStatic; declare var ASPxClientSpellCheckerStopCheckingReason: ASPxClientSpellCheckerStopCheckingReasonStatic; declare var ASPxClientSpreadsheet: ASPxClientSpreadsheetStatic; declare var ASPxClientTreeList: ASPxClientTreeListStatic; +declare var ASPxClientTreeListExportFormat: ASPxClientTreeListExportFormatStatic; declare var BootstrapClientAccordion: BootstrapClientAccordionStatic; declare var BootstrapClientBinaryImage: BootstrapClientBinaryImageStatic; declare var BootstrapClientButton: BootstrapClientButtonStatic; declare var BootstrapClientCalendar: BootstrapClientCalendarStatic; declare var BootstrapClientCallbackPanel: BootstrapClientCallbackPanelStatic; -declare var BootstrapClientChartBase: BootstrapClientChartBaseStatic; -declare var BootstrapClientChart: BootstrapClientChartStatic; -declare var BootstrapClientPolarChart: BootstrapClientPolarChartStatic; -declare var BootstrapClientPieChart: BootstrapClientPieChartStatic; declare var BootstrapClientCheckBox: BootstrapClientCheckBoxStatic; declare var BootstrapClientRadioButton: BootstrapClientRadioButtonStatic; declare var BootstrapClientComboBox: BootstrapClientComboBoxStatic; @@ -33593,15 +36827,25 @@ declare var BootstrapClientPopupControl: BootstrapClientPopupControlStatic; declare var BootstrapClientPopupMenu: BootstrapClientPopupMenuStatic; declare var BootstrapClientProgressBar: BootstrapClientProgressBarStatic; declare var BootstrapClientSpinEdit: BootstrapClientSpinEditStatic; +declare var BootstrapClientTimeEdit: BootstrapClientTimeEditStatic; declare var BootstrapClientTabControl: BootstrapClientTabControlStatic; declare var BootstrapClientPageControl: BootstrapClientPageControlStatic; +declare var BootstrapClientTagBox: BootstrapClientTagBoxStatic; declare var BootstrapClientTextBox: BootstrapClientTextBoxStatic; declare var BootstrapClientMemo: BootstrapClientMemoStatic; declare var BootstrapClientButtonEdit: BootstrapClientButtonEditStatic; +declare var BootstrapClientToolbar: BootstrapClientToolbarStatic; declare var BootstrapClientTreeView: BootstrapClientTreeViewStatic; -declare var BootstrapUIWidgetBase: BootstrapUIWidgetBaseStatic; declare var BootstrapClientUploadControl: BootstrapClientUploadControlStatic; +declare var BootstrapClientUtils: BootstrapClientUtilsStatic; declare var BootstrapClientGridView: BootstrapClientGridViewStatic; +declare var BootstrapClientCardView: BootstrapClientCardViewStatic; +declare var BootstrapUIWidgetBase: BootstrapUIWidgetBaseStatic; +declare var BootstrapClientChartBase: BootstrapClientChartBaseStatic; +declare var BootstrapClientChart: BootstrapClientChartStatic; +declare var BootstrapClientPolarChart: BootstrapClientPolarChartStatic; +declare var BootstrapClientPieChart: BootstrapClientPieChartStatic; +declare var BootstrapClientRangeSelector: BootstrapClientRangeSelectorStatic; declare var MVCxClientCalendar: MVCxClientCalendarStatic; declare var MVCxClientCallbackPanel: MVCxClientCallbackPanelStatic; declare var MVCxClientCardView: MVCxClientCardViewStatic; @@ -33651,6 +36895,7 @@ declare var ASPxClientDockZone: ASPxClientDockZoneStatic; declare var ASPxClientFileManager: ASPxClientFileManagerStatic; declare var ASPxClientFileManagerCommandConsts: ASPxClientFileManagerCommandConstsStatic; declare var ASPxClientFileManagerErrorConsts: ASPxClientFileManagerErrorConstsStatic; +declare var ASPxClientFileManagerCallbackCommand: ASPxClientFileManagerCallbackCommandStatic; declare var ASPxClientFormLayout: ASPxClientFormLayoutStatic; declare var ASPxClientHiddenField: ASPxClientHiddenFieldStatic; declare var ASPxClientHint: ASPxClientHintStatic; diff --git a/types/devexpress-web/v171/devexpress-web-tests.ts b/types/devexpress-web/v171/devexpress-web-tests.ts new file mode 100644 index 0000000000..ef7eb8de37 --- /dev/null +++ b/types/devexpress-web/v171/devexpress-web-tests.ts @@ -0,0 +1,418 @@ +declare var hiddenField: ASPxClientHiddenField; +declare var mainCallbackPanel: ASPxClientCallbackPanel; +declare var loginPopup: ASPxClientPopupControl; +declare var searchButton: ASPxClientButton; +declare var searchComboBox: ASPxClientComboBox; +declare var roomsNumberSpinEdit: ASPxClientSpinEdit; +declare var adultsNumberSpinEdit: ASPxClientSpinEdit; +declare var childrenNumberSpinEdit: ASPxClientSpinEdit; +declare var checkInDateEdit: ASPxClientDateEdit; +declare var checkOutDateEdit: ASPxClientDateEdit; +declare var backSlider: ASPxClientImageSlider; +declare var locationComboBox: ASPxClientComboBox; +declare var nightyRateTrackBar: ASPxClientTrackBar; +declare var customerRatingTrackBar: ASPxClientTrackBar; +declare var ourRatingCheckBoxList: ASPxClientCheckBoxList; +declare var startFilterPopupControl: ASPxClientPopupControl; +declare var imagePopupControl: ASPxClientPopupControl; +declare var emailTextBox: ASPxClientTextBox; +declare var creditCardEmailTextBox: ASPxClientTextBox; +declare var accountEmailTextBox: ASPxClientTextBox; +declare var bookingPageControl: ASPxClientPageControl; +declare var paymentTypePageControl: ASPxClientPageControl; +declare var offerFormPopup: ASPxClientPopupControl; +declare var roomsSpinEdit: ASPxClientSpinEdit; +declare var adultsSpinEdit: ASPxClientSpinEdit; +declare var childrenSpinEdit: ASPxClientSpinEdit; +declare var hotelDetailsCallbackPanel: ASPxClientCallbackPanel; +declare var leftPanel: ASPxClientPanel; +declare var menuButton: ASPxClientButton; +declare var aboutWindow: ASPxClientPopupControl; +declare var offersZone: ASPxClientDockZone; + +module DXDemo { + function showPage(page: string, params: { [key: string]: any }, skipHistory?: boolean): void { + var queryString = getQueryString(params || {}); + hiddenField.Set("page", page); + hiddenField.Set("parameters", queryString); + hideMenu(); + var uri = queryString.length ? (page + "?" + queryString) : page; + try { + if (!skipHistory && window.history && window.history.pushState) + window.history.pushState(uri, "", uri || "Default.aspx"); + } catch (e) { } + mainCallbackPanel.PerformCallback(uri); + }; + + export function onMainMenuItemClick(s: ASPxClientMenu, e: ASPxClientMenuItemClickEventArgs): void { + switch (e.item.name) { + case "login": + hideMenu(); + setTimeout(function () { loginPopup.ShowAtElementByID("MainCallbackPanel_ContentPane"); }, 300); + break; + case "offers": + showPage("SpecialOffers", {}); + break; + default: + hideMenu(); + setTimeout(function () { showAboutWindow(); }, 300); + break; + } + }; + + export function onLoginButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void { + loginPopup.Hide(); + showAboutWindow(); + }; + + export function onSearchButtonClick(): void { + if (ASPxClientEdit.ValidateGroup("DateEditors")) { + showPage("ShowHotels", { + location: searchComboBox.GetValue(), + checkin: getFormattedDate(checkInDateEdit.GetValue()), + checkout: getFormattedDate(checkOutDateEdit.GetValue()), + rooms: roomsNumberSpinEdit.GetValue() || 1, + adults: adultsNumberSpinEdit.GetValue() || 1, + children: childrenNumberSpinEdit.GetValue() || 0 + }); + } + }; + + export function onSearchComboBoxIndexChanged(s: ASPxClientComboBox, e: ASPxClientProcessingModeEventArgs): void { + hideMenu(); + searchButton.AdjustControl(); + }; + + export function onIndexOfferCloseClick(index: number): void { + var panel = ASPxClientControl.GetControlCollection().GetByName("OfferDockPanel" + index); + var sibPanel = ASPxClientControl.GetControlCollection().GetByName("OfferDockPanel" + (index == 1 ? 2 : 1)); + panel.Hide(); + sibPanel.MakeFloat(); + sibPanel.SetWidth(offersZone.GetWidth()); + sibPanel.Dock(offersZone); + }; + + export function onLogoClick(): void { + showPage("", null, false); + }; + + export function onMenuNavButtonCheckedChanged(s: ASPxClientCheckBox, e: ASPxClientProcessingModeEventArgs): void { + var mainContainer = mainCallbackPanel.GetMainElement(); + if (s.GetChecked()) { + backSlider.Pause(); + showMenu(); + } + else { + hideMenu(); + backSlider.Play(); + } + }; + + export function onBackNavButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void { + var params = getCurrentQueryParams(); + switch (getCurrentPage()) { + case "PrintInvoice": + showPage("Booking", params, false); + break; + case "Booking": + if (bookingPageControl.GetActiveTabIndex() > 0) + bookingPageControl.SetActiveTabIndex(bookingPageControl.GetActiveTabIndex() - 1); + else + showPage("ShowRooms", params, false); + break; + case "ShowRooms": + showPage("ShowHotels", params, false); + break; + case "ShowDetails": + showPage("ShowHotels", params, false); + break; + case "ShowHotels": + case "SpecialOffers": + showPage("", null, false); + break; + } + }; + + export function updateSearchResults(): void { + var params = getCurrentQueryParams(); + params["location"] = locationComboBox.GetValue(); + params["minprice"] = nightyRateTrackBar.GetPositionStart(); + params["maxprice"] = nightyRateTrackBar.GetPositionEnd(); + params["custrating"] = customerRatingTrackBar.GetPosition(); + params["ourrating"] = ourRatingCheckBoxList.GetSelectedValues().join(","); + showPage("ShowHotels", params); + }; + + export function onBookHotelButtonClick(hotelID: string): void { + var queryParams = getCurrentQueryParams(); + queryParams["hotelID"] = hotelID; + showPage("ShowRooms", queryParams); + }; + + export function onDetailsHotelButtonClick(hotelID: string): void { + var queryParams = getCurrentQueryParams(); + queryParams["hotelID"] = hotelID; + showPage("ShowDetails", queryParams); + }; + + export function onShowStartFilterButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void { + startFilterPopupControl.ShowAtElementByID("MainCallbackPanel_ContentPane"); + }; + + export function onChangeStartFilterButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void { + if (ASPxClientEdit.ValidateGroup("DateEditors")) { + var params = getCurrentQueryParams(); + params["checkin"] = getFormattedDate(checkInDateEdit.GetValue()); + params["checkout"] = getFormattedDate(checkOutDateEdit.GetValue()); + params["rooms"] = roomsNumberSpinEdit.GetValue() || 1; + params["adults"] = adultsNumberSpinEdit.GetValue() || 1; + params["children"] = childrenNumberSpinEdit.GetValue() || 0; + startFilterPopupControl.Hide(); + showPage(hiddenField.Get("page").toString(), params); + } + }; + + export function onBookRoomButtonClick(roomID: string): void { + var params = getCurrentQueryParams(); + params["roomID"] = roomID; + showPage("Booking", params); + }; + + export function onShowRoomsButtonClick(): void { + var queryParams = getCurrentQueryParams(); + showPage("ShowRooms", queryParams); + }; + + export function onShowDetailsButtonClick(): void { + var queryParams = getCurrentQueryParams(); + showPage("ShowDetails", queryParams); + }; + + export function onRoomImageNavItemClick(roomID: string, pictureName: string): void { + setTimeout(function () { + imagePopupControl.PerformCallback(roomID + "|" + pictureName); + imagePopupControl.ShowAtElementByID("MainCallbackPanel_ContentPane"); + }, 500); + }; + + export function onRoomsNavBarExpandedChanged(s: ASPxClientNavBar, e: ASPxClientNavBarGroupEventArgs): void { + ASPxClientControl.AdjustControls(s.GetMainElement()); + }; + + export function onNextBookingStepButtonClick(step: number): void { + var valid = true; + var validationGroup = ""; + if (step == 1) + validationGroup = "Account"; + if (step == 2) + validationGroup = "RoomDetails"; + if (step == 3) + validationGroup = "PaymentDetails"; + + switch (step) { + case 1: + valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "Account"); + if (valid) { + emailTextBox.SetValue(accountEmailTextBox.GetValue()); + creditCardEmailTextBox.SetValue(accountEmailTextBox.GetValue()); + showPage("Booking", getCurrentQueryParams()); + return; + } + break; + case 2: + valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "RoomDetails"); + emailTextBox.SetValue(accountEmailTextBox.GetValue()); + break; + case 3: + var paymentType = paymentTypePageControl.GetActiveTabIndex(); + if (paymentType == 0) + valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "CreditCard"); + else if (paymentType == 1) + valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "Cash"); + else if (paymentType == 2) + valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "PayPal"); + break; + } + if (valid) { + bookingPageControl.GetTab(step).SetEnabled(true); + bookingPageControl.SetActiveTabIndex(step); + } + }; + + export function onAccountCaptchaHiddenFieldInit(s: ASPxClientHiddenField, e: ASPxClientEventArgs): void { + if (s.Get("IsCaptchaValid")) { + bookingPageControl.GetTab(1).SetEnabled(true); + bookingPageControl.SetActiveTabIndex(1); + } + }; + + export function onFinishBookingStepButtonClick(): void { + showAboutWindow(); + }; + + export function OnPrintInvoiceButtonClick(): void { + showPage("PrintInvoice", getCurrentQueryParams()); + }; + + export function onOfferClick(offerID: string): void { + offerFormPopup.SetContentHtml(""); + offerFormPopup.PerformCallback(offerID); + var panel = ASPxClientControl.GetControlCollection().GetByName("DockPanel" + offerID); + var panelElement = panel.GetMainElement(); + if (panelElement.offsetWidth < 330 || panelElement.offsetHeight < 250) { + offerFormPopup.SetWidth(400); + offerFormPopup.SetHeight(280); + offerFormPopup.ShowAtElementByID("SpecialOffersContainer"); + } + else { + offerFormPopup.SetWidth(panelElement.offsetWidth); + offerFormPopup.SetHeight(panelElement.offsetHeight); + offerFormPopup.ShowAtElement(panelElement); + } + }; + + export function onSpecialOfferCheckButtonClick(hotelID: string, locationID: string): void { + if (ASPxClientEdit.ValidateGroup("DateEditors")) { + var queryParams: { [key: string]: any } = { + location: locationID, + hotelID: hotelID, + checkin: getFormattedDate(checkInDateEdit.GetValue()), + checkout: getFormattedDate(checkOutDateEdit.GetValue()), + rooms: roomsSpinEdit.GetValue() || 1, + adults: adultsSpinEdit.GetValue() || 1, + children: childrenSpinEdit.GetValue() || 0 + }; + showPage("ShowRooms", queryParams); + } + }; + + export function onIndexOfferClick(): void { + showPage("SpecialOffers", {}); + }; + + export function onControlsInit(): void { + ASPxClientUtils.AttachEventToElement(window, 'popstate', onHistoryPopState); + var pathParts = document.location.href.split("/"); + var url = pathParts[pathParts.length - 1]; + try { + if (window.history) + window.history.replaceState(url, ""); + } catch (e) { } + ASPxClientUtils.AttachEventToElement(window, "resize", onWindowResize); + if (ASPxClientUtils.iOSPlatform) { + // animate + } + }; + + export function updateRatingLabels(ratingControl: ASPxClientTrackBar) { + var start = ratingControl.GetPositionStart().toString(); + var end = ratingControl.GetPositionEnd().toString(); + document.getElementById("cpLeftLabelID").innerHTML = start + " " + end; + }; + + export function onRatingControlItemClick(s: ASPxClientRatingControl, e: ASPxClientRatingControlItemClickEventArgs): void { + hotelDetailsCallbackPanel.PerformCallback(s.GetValue().toString()); + }; + + export function onInputKeyDown(s: ASPxClientTextBox, e: ASPxClientEditKeyEventArgs): void { + var keyCode = ASPxClientUtils.GetKeyCode(e.htmlEvent); + if (keyCode == 13) + (s.GetInputElement()).blur(); + }; + + function getCurrentPage(): string { + var hfPage = hiddenField.Get("page"); + if (hfPage) + return hfPage; + var pathParts = document.location.pathname.split("/"); + return pathParts[pathParts.length - 1]; + }; + + function showAboutWindow(): void { + aboutWindow.ShowAtElementByID("MainCallbackPanel_ContentPane"); + }; + + function hideMenu(): void { + leftPanel.Collapse(); + if (menuButton.GetMainElement() && menuButton.GetChecked()) + menuButton.SetChecked(false); + }; + + function showMenu(): void { + leftPanel.Expand(); + }; + + var _resizeSpecialOffersTimeoutID = -1; + function onWindowResize(): void { + switch (hiddenField.Get("page")) { + case "SpecialOffers": + if (_resizeSpecialOffersTimeoutID == -1) + _resizeSpecialOffersTimeoutID = setTimeout(resizeSpecialOffers, 200); + break; + } + hidePopups("AboutWindow", "StartFilterPopupControl", "LoginPopup", "OfferFormPopup", "ImagePopupControl"); + }; + + function hidePopups(...names: string[]): void { + for (var i = 0; i < names.length; i++) { + var popupControl = ASPxClientControl.GetControlCollection().GetByName(names[i]); + popupControl.Hide(); + } + }; + + function resizeSpecialOffers(): void { + for (var i = 1; i <= 4; i++) { + var panel = ASPxClientControl.GetControlCollection().GetByName("DockPanel" + i); + if (panel && panel.IsVisible()) { + var zone = panel.GetOwnerZone(); + zone.SetWidth(((zone.GetMainElement()).parentNode).offsetWidth) + } + } + _resizeSpecialOffersTimeoutID = -1; + }; + + function getFormattedDate(date: Date): string { + return (date.getMonth() + 1) + "-" + date.getDate() + "-" + date.getFullYear(); + }; + + function getCurrentQueryParams(): { [key:string]: any } { + var hfParams = hiddenField.Get("parameters"); + if (hfParams) + return getParamsByQueryString(hfParams); + var query = document.location.search; + if (query[0] === "?") + query = query.substr(1); + return getParamsByQueryString(query); + }; + + function getQueryString(params: { [key:string]: any }): string { + var queryItems: any[] = []; + for (var key in params) { + if (!params.hasOwnProperty(key)) continue; + queryItems.push(key + "=" + params[key]); + } + if (queryItems.length > 0) + return queryItems.join("&"); + return ""; + }; + + function getParamsByQueryString(queryString: string): { [key: string]: string } { + var result: { [key: string]: any } = {}; + if (queryString) { + var queryStringArray = queryString.split("&"); + for (var i = 0; i < queryStringArray.length; i++) { + var part = queryStringArray[i].split('='); + if (part.length != 2) continue; + result[part[0]] = decodeURIComponent(part[1].replace(/\+/g, " ")); + } + } + return result; + }; + + function onHistoryPopState(evt: any): void { + if (evt.state !== null && evt.state !== undefined) { + var uriParts = evt.state.split("?"); + showPage(uriParts[0], getParamsByQueryString(uriParts[1]), true); + } + }; +} \ No newline at end of file diff --git a/types/devexpress-web/v171/index.d.ts b/types/devexpress-web/v171/index.d.ts new file mode 100644 index 0000000000..50aac382b1 --- /dev/null +++ b/types/devexpress-web/v171/index.d.ts @@ -0,0 +1,33698 @@ +// Type definitions for DevExpress ASP.NET v171.4 +// Project: http://devexpress.com/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * A client-side counterpart of the DashboardViewer extension. + */ +interface MVCxClientDashboardViewer extends ASPxClientDashboardViewer { +} +/** + * Represents a list of records from the dashboard data source. + */ +interface ASPxClientDashboardItemUnderlyingData { + /** + * Gets the number of rows in the underlying data set. + */ + GetRowCount(): number; + /** + * Returns the value of the specified cell within the underlying data set. + * @param rowIndex An integer value that specifies the zero-based index of the required row. + * @param dataMember A String that specifies the required data member. + */ + GetRowValue(rowIndex: number, dataMember: string): Object; + /** + * Returns an array of data members available in a data source. + */ + GetDataMembers(): string[]; + /** + * Returns whether or not a request for underlying data was successful. + */ + IsDataReceived(): boolean; + /** + * Returns a callstack containing the error caused by an unsuccessful request for underlying data. + */ + GetRequestDataError(): string; +} +/** + * Contains parameters used to obtain the underlying data for the dashboard item. + */ +interface ASPxClientDashboardItemRequestUnderlyingDataParameters { + /** + * Gets or sets an array of data member identifiers used to obtain underlying data. + * Value: An array of string values that specify data member identifiers. + */ + DataMembers: string[]; + /** + * Gets or sets axis points used to obtain the underlying data. + * Value: An array of ASPxClientDashboardItemDataAxisPoint objects that represent axis points. + */ + AxisPoints: ASPxClientDashboardItemDataAxisPoint[]; + /** + * Gets or sets the dimension value used to obtain the underlying data. + * Value: The dimension value. + */ + ValuesByAxisName: Object; + /** + * Gets or sets the unique dimension value used to obtain the underlying data. + * Value: The unique dimension value. + */ + UniqueValuesByAxisName: Object; +} +/** + * References a method executed after an asynchronous request is complete. + */ +interface ASPxClientDashboardItemRequestUnderlyingDataCompleted { + /** + * References a method executed after an asynchronous request is completed. + * @param data An ASPxClientDashboardItemUnderlyingData object that represents a list of records from the dashboard data source. + */ + (data: ASPxClientDashboardItemUnderlyingData): void; +} +/** + * References a method that will handle the ItemClick events. + */ +interface ASPxClientDashboardItemClickEventHandler { + /** + * References a method that will handle the ItemClick events. + * @param source The event source. + * @param e A ASPxClientDashboardItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemClickEventArgs): void; +} +/** + * Provides data for the ItemClick events. + */ +interface ASPxClientDashboardItemClickEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dashboard item for which the event has been raised. + * Value: A string value that is the dashboard item name. + */ + ItemName: string; + /** + * Gets the dashboard item's client data. + */ + GetData(): ASPxClientDashboardItemData; + /** + * Returns the axis point corresponding to the clicked visual element. + * @param axisName A string value returned by the DashboardDataAxisNames class that specifies the name of the data axis. + */ + GetAxisPoint(axisName: string): ASPxClientDashboardItemDataAxisPoint; + /** + * Gets measures corresponding to the clicked visual element. + */ + GetMeasures(): ASPxClientDashboardItemDataMeasure[]; + /** + * Gets deltas corresponding to the clicked visual element. + */ + GetDeltas(): ASPxClientDashboardItemDataDelta[]; + /** + * Gets the dimensions used to create a hierarchy of axis points for the specified axis. + * @param axisName A string value returned by the DashboardDataAxisNames class that specifies the name of the data axis. + */ + GetDimensions(axisName: string): ASPxClientDashboardItemDataDimension[]; + /** + * Requests underlying data corresponding to the clicked visual element. + * @param onCompleted A ASPxClientDashboardItemRequestUnderlyingDataCompleted object that references a method executed after the request is completed. + * @param dataMembers An array of string values that specify data members used to obtain underlying data. + */ + RequestUnderlyingData(onCompleted: ASPxClientDashboardItemRequestUnderlyingDataCompleted, dataMembers: string[]): void; +} +/** + * References a method that will handle the ItemVisualInteractivity events. + */ +interface ASPxClientDashboardItemVisualInteractivityEventHandler { + /** + * References a method that will handle the ItemVisualInteractivity events. + * @param source The event source. + * @param e A ASPxClientDashboardItemVisualInteractivityEventArgs object containing event data. + */ + (source: S, e: ASPxClientDashboardItemVisualInteractivityEventArgs): void; +} +/** + * Provides data for the ItemVisualInteractivity events. + */ +interface ASPxClientDashboardItemVisualInteractivityEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item for which the event was raised. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; + /** + * Gets the selection mode for dashboard item elements. + */ + GetSelectionMode(): string; + /** + * Sets the selection mode for dashboard item elements. + * @param selectionMode A String that specifies the selection mode. + */ + SetSelectionMode(selectionMode: string): void; + /** + * Returns whether or not highlighting is enabled for the current dashboard item. + */ + IsHighlightingEnabled(): boolean; + /** + * Enables highlighting for the current dashboard item. + * @param enableHighlighting true, to enable highlighting; otherwise, false. + */ + EnableHighlighting(enableHighlighting: boolean): void; + /** + * Gets data axes used to perform custom interactivity actions. + */ + GetTargetAxes(): string[]; + /** + * Sets data axes used to perform custom interactivity actions. + * @param targetAxes An array of String objects that specify names of data axes. + */ + SetTargetAxes(targetAxes: string[]): void; + /** + * Gets the default selection for the current dashboard item. + */ + GetDefaultSelection(): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Sets the default selection for the current dashboard item. + * @param values An array of ASPxClientDashboardItemDataAxisPointTuple objects specifying axis point tuples used to select default elements. + */ + SetDefaultSelection(values: ASPxClientDashboardItemDataAxisPointTuple[]): void; +} +/** + * References a method that will handle the ItemSelectionChanged events. + */ +interface ASPxClientDashboardItemSelectionChangedEventHandler { + /** + * References a method that will handle the ItemSelectionChanged events. + * @param source The event source. + * @param e A ASPxClientDashboardItemSelectionChangedEventArgs object containing event data. + */ + (source: S, e: ASPxClientDashboardItemSelectionChangedEventArgs): void; +} +/** + * Provides data for the ItemSelectionChanged events. + */ +interface ASPxClientDashboardItemSelectionChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item for which the event was raised. + * Value: A string that is the component name of the dashboard item. + */ + ItemName: string; + /** + * Gets currently selected elements. + */ + GetCurrentSelection(): ASPxClientDashboardItemDataAxisPointTuple[]; +} +/** + * References a method that will handle the ItemElementCustomColor event. + */ +interface ASPxClientDashboardItemElementCustomColorEventHandler { + /** + * References a method that will handle the ItemElementCustomColor events. + * @param source The event source. + * @param e An ASPxClientDashboardItemElementCustomColorEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemElementCustomColorEventArgs): void; +} +/** + * Provides data for the ItemElementCustomColor events. + */ +interface ASPxClientDashboardItemElementCustomColorEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item for which the event was raised. + * Value: A string value that is the component name of the dashboard item for which the event was raised. + */ + ItemName: string; + /** + * Gets the axis point tuple that corresponds to the current dashboard item element. + */ + GetTargetElement(): ASPxClientDashboardItemDataAxisPointTuple; + /** + * Gets the color of the current dashboard item element. + */ + GetColor(): string; + /** + * Sets the color of the current dashboard item element. + * @param color A String that specifies the color of the current dashboard item element. + */ + SetColor(color: string): void; + /** + * Gets measures corresponding to the current dashboard item element. + */ + GetMeasures(): ASPxClientDashboardItemDataMeasure[]; +} +/** + * References a method that will handle the ItemWidgetCreated events. + */ +interface ASPxClientDashboardItemWidgetCreatedEventHandler { + /** + * References a method that will handle the ItemWidgetCreated events. + * @param source The event source. + * @param e A ASPxClientDashboardItemWidgetEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemWidgetEventArgs): void; +} +/** + * References a method that will handle the ItemWidgetUpdating event. + */ +interface ASPxClientDashboardItemWidgetUpdatingEventHandler { + /** + * References a method that will handle the ItemWidgetUpdating event. + * @param source The event source. + * @param e A ASPxClientDashboardItemWidgetEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemWidgetEventArgs): void; +} +/** + * References a method that will handle the ItemWidgetUpdated event. + */ +interface ASPxClientDashboardItemWidgetUpdatedEventHandler { + /** + * References a method that will handle the ItemWidgetUpdated event. + * @param source The event source. + * @param e A ASPxClientDashboardItemWidgetEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemWidgetEventArgs): void; +} +/** + * References a method that will handle the ItemBeforeWidgetDisposed events. + */ +interface ASPxClientDashboardItemBeforeWidgetDisposedEventHandler { + /** + * References a method that will handle the ItemBeforeWidgetDisposed events. + * @param source The event source. + * @param e A ASPxClientDashboardItemWidgetEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemWidgetEventArgs): void; +} +/** + * Provides data for events related to client widgets used to visualize data in dashboard items. + */ +interface ASPxClientDashboardItemWidgetEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item for which the event was raised. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; + /** + * Returns an underlying widget corresponding to the current dashboard item. + */ + GetWidget(): Object; +} +/** + * Represents multidimensional data visualized in the dashboard item. + */ +interface ASPxClientDashboardItemData { + /** + * Gets the names of the axes that constitute the current ASPxClientDashboardItemData. + */ + GetAxisNames(): string[]; + /** + * Returns the specified data axis. + * @param axisName A string value returned by the DashboardDataAxisNames class that specifies the name of the data axis. + */ + GetAxis(axisName: string): ASPxClientDashboardItemDataAxis; + /** + * Gets the dimensions used to create a hierarchy of axis points for the specified axis. + * @param axisName A string value returned by the DashboardDataAxisNames class that specifies the name of the data axis. + */ + GetDimensions(axisName: string): ASPxClientDashboardItemDataDimension[]; + /** + * Gets the measures for the current ASPxClientDashboardItemData object. + */ + GetMeasures(): ASPxClientDashboardItemDataMeasure[]; + /** + * Gets the deltas for the current ASPxClientDashboardItemData object. + */ + GetDeltas(): ASPxClientDashboardItemDataDelta[]; + /** + * Gets the slice of the current ASPxClientDashboardItemData object by the specified axis point tuple. + * @param tuple A ASPxClientDashboardItemDataAxisPointTuple object that is a tuple of axis points. + */ + GetSlice(tuple: ASPxClientDashboardItemDataAxisPointTuple): ASPxClientDashboardItemData; + /** + * Gets the slice of the current ASPxClientDashboardItemData object by the specified axis point. + * @param axisPoint An ASPxClientDashboardItemDataAxisPoint object that is the data point in a multidimensional space. + */ + GetSlice(axisPoint: ASPxClientDashboardItemDataAxisPoint): ASPxClientDashboardItemData; + /** + * Returns a total summary value for the specified measure. + * @param measureId A String that is the measure identifier. + */ + GetMeasureValue(measureId: string): ASPxClientDashboardItemDataMeasureValue; + /** + * Gets the summary value for the specified delta. + * @param deltaId A String that is the data item identifier. + */ + GetDeltaValue(deltaId: string): ASPxClientDashboardItemDataDeltaValue; + /** + * Returns an array of data members available in a data source. + */ + GetDataMembers(): string[]; + /** + * Creates a tuple based on the specified axes names and corresponding values. + * @param values An array of name-value pairs containing the axis name and corresponding values. + */ + CreateTuple(values: Object[]): ASPxClientDashboardItemDataAxisPointTuple; + /** + * Creates a tuple based on the specified axis points. + * @param axisPoints An array of ASPxClientDashboardItemDataAxisPoint objects that specify axis points belonging to different data axes. + */ + CreateTuple(axisPoints: ASPxClientDashboardItemDataAxisPoint[]): ASPxClientDashboardItemDataAxisPointTuple; +} +/** + * An axis that contains data points corresponding to the specified value hierarchy. + */ +interface ASPxClientDashboardItemDataAxis { + /** + * Gets the dimensions used to create a hierarchy of axis points belonging to the current axis. + */ + GetDimensions(): ASPxClientDashboardItemDataDimension[]; + /** + * Gets the root axis point belonging to the current ASPxClientDashboardItemDataAxis. + */ + GetRootPoint(): ASPxClientDashboardItemDataAxisPoint; + /** + * Returns axis points corresponding to values of the last-level dimension. + */ + GetPoints(): ASPxClientDashboardItemDataAxisPoint[]; + /** + * Returns axis points corresponding to the specified dimension. + * @param dimensionId A String that is the dimension identifier. + */ + GetPointsByDimension(dimensionId: string): ASPxClientDashboardItemDataAxisPoint[]; + /** + * Returns the data point for the specified axis by unique values. + * @param uniqueValues A hierarchy of unique values identifying the required data point. + */ + GetPointByUniqueValues(uniqueValues: Object[]): ASPxClientDashboardItemDataAxisPoint; +} +/** + * Contains the dimension metadata. + */ +interface ASPxClientDashboardItemDataDimension { + /** + * Gets the dimension identifier. + * Value: A string value that is the dimension identifier. + */ + Id: string; + /** + * Gets or sets the name of the dimension. + * Value: A string value that is the name of the dimension. + */ + Name: string; + /** + * Gets the data member identifier for the current dimension. + * Value: A string value that identifies a data member. + */ + DataMember: string; + /** + * Gets the group interval for date-time values for the current dimension. + * Value: A string value that represents how date-time values are grouped. + */ + DateTimeGroupInterval: string; + /** + * Gets the group interval for string values. + * Value: A string value that specifies the group interval for string values. + */ + TextGroupInterval: string; + /** + * Formats the specified value using format settings of the current dimension. + * @param value A value to be formatted. + */ + Format(value: Object): string; +} +/** + * Contains the measure metadata. + */ +interface ASPxClientDashboardItemDataMeasure { + /** + * Gets the measure identifier. + * Value: A string value that is the measure identifier. + */ + Id: string; + /** + * Gets the name of the measure. + * Value: A string value that is the name of the measure. + */ + Name: string; + /** + * Gets the data member that identifies the data source list used to provide data for the current measure. + * Value: A string value that identifies the data source list used to provide data for the current measure. + */ + DataMember: string; + /** + * Gets the type of summary function calculated against the current measure. + * Value: A string value that identifies the type of summary function calculated against the current measure. + */ + SummaryType: string; + /** + * Formats the specified value using format settings of the current measure. + * @param value A value to be formatted. + */ + Format(value: Object): string; +} +/** + * Contains the delta metadata. + */ +interface ASPxClientDashboardItemDataDelta { + /** + * Gets the data item identifier. + * Value: A string that is the data item identifier. + */ + Id: string; + /** + * Gets the name of the data item container. + * Value: A string value that is the name of the data item container. + */ + Name: string; + /** + * Gets the identifier for the measure that provides actual values. + * Value: A string value that is the measure identifier. + */ + ActualMeasureId: string; + /** + * Gets the identifier for the measure that provides target values. + * Value: A string value that is the measure identifier. + */ + TargetMeasureId: string; +} +/** + * Provides dimension values at the specified axis point. + */ +interface ASPxClientDashboardItemDataDimensionValue { + /** + * Gets the current dimension value. + */ + GetValue(): Object; + /** + * Gets the unique value for the current dimension value. + */ + GetUniqueValue(): Object; + /** + * Gets the display text for the current dimension value. + */ + GetDisplayText(): string; +} +/** + * Provides the measure value and display text. + */ +interface ASPxClientDashboardItemDataMeasureValue { + /** + * Gets the measure value. + */ + GetValue(): Object; + /** + * Gets the measure display text. + */ + GetDisplayText(): string; +} +/** + * Provides delta element values. + */ +interface ASPxClientDashboardItemDataDeltaValue { + /** + * Provides access to the actual value displayed within the delta element. + */ + GetActualValue(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the target value. + */ + GetTargetValue(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the absolute difference between the actual and target values. + */ + GetAbsoluteVariation(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the percent of variation between the actual and target values. + */ + GetPercentVariation(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the percentage of the actual value in the target value. + */ + GetPercentOfTarget(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the main delta value. + */ + GetDisplayValue(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the first additional delta value. + */ + GetDisplaySubValue1(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the second additional delta value. + */ + GetDisplaySubValue2(): ASPxClientDashboardItemDataMeasureValue; + /** + * Gets the value specifying the condition for displaying the delta indication. + */ + GetIsGood(): ASPxClientDashboardItemDataMeasureValue; + /** + * Gets the type of delta indicator. + */ + GetIndicatorType(): ASPxClientDashboardItemDataMeasureValue; +} +/** + * A point on the data axis. + */ +interface ASPxClientDashboardItemDataAxisPoint { + /** + * Gets the name of the axis to which the current axis point belongs. + */ + GetAxisName(): string; + /** + * Gets the last level dimension corresponding to the current axis point. + */ + GetDimension(): ASPxClientDashboardItemDataDimension; + /** + * Gets the collection of dimensions used to create a hierarchy of axis points from the root point to the current axis point. + */ + GetDimensions(): ASPxClientDashboardItemDataDimension[]; + /** + * Gets the value corresponding to the current axis point. + */ + GetValue(): Object; + /** + * Gets the display text corresponding to the current axis point. + */ + GetDisplayText(): string; + /** + * Gets the unique value corresponding to the current axis point. + */ + GetUniqueValue(): Object; + /** + * Gets the dimension values at the specified axis point. + */ + GetDimensionValue(): ASPxClientDashboardItemDataDimensionValue; + /** + * Gets the dimension value at the current axis point. + * @param dimensionId A String value that specifies the dimension identifier. + */ + GetDimensionValue(dimensionId: string): ASPxClientDashboardItemDataDimensionValue; + /** + * Gets the child axis points for the current axis point. + */ + GetChildren(): ASPxClientDashboardItemDataAxisPoint[]; + /** + * Gets the parent axis point for the current axis point. + */ + GetParent(): ASPxClientDashboardItemDataAxisPoint; +} +/** + * Represents a tuple of axis points. + */ +interface ASPxClientDashboardItemDataAxisPointTuple { + /** + * Returns the axis point belonging to the default data axis. + */ + GetAxisPoint(): ASPxClientDashboardItemDataAxisPoint; + /** + * Returns the axis point belonging to the specified data axis. + * @param axisName A string value returned by the DashboardDataAxisNames class that specifies the name of the data axis. + */ + GetAxisPoint(axisName: string): ASPxClientDashboardItemDataAxisPoint; +} +/** + * A range in the Range Filter dashboard item. + */ +interface ASPxClientDashboardRangeFilterSelection { + /** + * Gets or sets a maximum value in the range of the Range Filter dashboard item. + * Value: A maximum value in the range of the Range Filter dashboard item. + */ + Maximum: Object; + /** + * Gets or sets a minimum value in the range of the Range Filter dashboard item. + * Value: A minimum value in the range of the Range Filter dashboard item. + */ + Minimum: Object; +} +/** + * A collection of ASPxClientDashboardParameter objects. + */ +interface ASPxClientDashboardParameters { + /** + * Returns an array of dashboard parameters from the ASPxClientDashboardParameters collection. + */ + GetParameterList(): ASPxClientDashboardParameter[]; + /** + * Returns a dashboard parameter by its name. + * @param name A String object that specifies the parameter name. + */ + GetParameterByName(name: string): ASPxClientDashboardParameter; + /** + * Returns a dashboard parameter by its index in the ASPxClientDashboardParameters collection. + * @param index An integer value that specifies the parameter index. + */ + GetParameterByIndex(index: number): ASPxClientDashboardParameter; +} +/** + * A client-side dashboard parameter. + */ +interface ASPxClientDashboardParameter { + /** + * Gets the dashboard parameter name on the client side. + * Value: A string value that is the dashboard parameter name on the client side. + */ + Name: string; + /** + * Gets the dashboard parameter value on the client side. + * Value: A string value that specifies the dashboard parameter value on the client side. + */ + Value: Object; + /** + * Returns a parameter name. + */ + GetName(): string; + /** + * Returns a current parameter value(s). + */ + GetValue(): Object; + /** + * Specifies the current parameter value(s). + * @param value The current parameter value(s). + */ + SetValue(value: Object): void; + /** + * Returns a default parameter value. + */ + GetDefaultValue(): Object; + /** + * Returns the parameter's description displayed to an end-user. + */ + GetDescription(): string; + /** + * Returns a parameter type. + */ + GetType(): string; + /** + * Returns possible parameter values. + */ + GetValues(): ASPxClientDashboardParameterValue[]; +} +/** + * Provides access to the parameter value and display text. + */ +interface ASPxClientDashboardParameterValue { + /** + * Returns the parameter display text. + */ + GetDisplayText(): string; + /** + * Returns a parameter value. + */ + GetValue(): Object; +} +/** + * Contains settings that specify parameters affecting how the dashboard or dashboard item is exported in Image format. + */ +interface ImageFormatOptions { + /** + * Gets or sets an image format in which the dashboard (dashboard item) is exported. + * Value: A value returned by the DashboardExportImageFormat class that specifies an image format in which the dashboard (dashboard item) is exported. + */ + Format: string; + /** + * Gets or sets the resolution (in dpi) used to export a dashboard (dashboard item) in Image format. + * Value: An integer value that specifies the resolution (in dpi) used to export a dashboard (dashboard item) in Image format. + */ + Resolution: number; +} +/** + * Contains options which define how the dashboard item is exported to Excel format. + */ +interface ExcelFormatOptions { + /** + * Gets or sets the Excel format in which the dashboard item is exported. + * Value: A value returned by the DashboardExportExcelFormat class that specifies the Excel format in which the dashboard item is exported. + */ + Format: string; + /** + * Gets or sets a character used to separate values in a CSV document. + * Value: A string value that specifies the character used to separate values in a CSV document. + */ + CsvValueSeparator: string; +} +/** + * Contains settings that specify parameters affecting how the Grid dashboard item is exported. + */ +interface GridExportOptions { + /** + * Gets or sets whether the size of the Grid dashboard item is changed according to the width of the exported page. + * Value: true, to change the size of the Grid dashboard item according to the width of the exported page; otherwise, false. + */ + FitToPageWidth: boolean; + /** + * Gets or sets whether to print column headers of the Grid dashboard item on every page. + * Value: true, to print column headers on every page; otherwise, false. + */ + PrintHeadersOnEveryPage: boolean; +} +/** + * Contains settings that specify parameters affecting how the Pivot dashboard item is exported. + */ +interface PivotExportOptions { + /** + * Gets or sets whether to print the column headers of the Pivot dashboard item on every page. + * Value: true, to print column headers on every page; otherwise, false. + */ + PrintHeadersOnEveryPage: boolean; +} +/** + * Contains settings that specify parameters affecting how the Pie dashboard item is exported. + */ +interface PieExportOptions { + /** + * Gets or sets whether dashboard item elements are arranged automatically on the exported page. + * Value: true, to arrange dashboard item elements automatically on the exported page; otherwise, false. + */ + AutoArrangeContent: boolean; +} +/** + * Contains settings that specify parameters affecting how the Gauge dashboard item is exported. + */ +interface GaugeExportOptions { + /** + * Gets or sets whether dashboard item elements are arranged automatically on the exported page. + * Value: true, to arrange dashboard item elements automatically on the exported page; otherwise, false. + */ + AutoArrangeContent: boolean; +} +/** + * Contains settings that specify parameters affecting how the Card dashboard item is exported. + */ +interface CardExportOptions { + /** + * Gets or sets whether dashboard item elements are arranged automatically on the exported page. + * Value: true, to arrange dashboard item elements automatically on the exported page; otherwise, false. + */ + AutoArrangeContent: boolean; +} +/** + * Contains settings that specify parameters affecting how the Range Filter dashboard item is exported. + */ +interface RangeFilterExportOptions { + /** + * Gets or sets whether the page orientation used to export a Range Filter dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export a Range Filter dashboard item; otherwise, false. + */ + AutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Range Filter dashboard item. + * Value: A value returned by the RangeFilterExportSizeMode class that specifies the export size mode for the Range Filter dashboard item. + */ + SizeMode: string; +} +/** + * Contains settings that specify parameters affecting how Chart dashboard items are exported. + */ +interface ChartExportOptions { + /** + * Gets or sets whether the page orientation used to export a Chart dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export a Chart dashboard item; otherwise, false. + */ + AutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Chart dashboard item. + * Value: A value returned by the ChartExportSizeMode class that specifies the export size mode for the Chart dashboard item. + */ + SizeMode: string; +} +/** + * Contains settings that specify parameters affecting how Map dashboard items are exported. + */ +interface MapExportOptions { + /** + * Gets or sets whether the page orientation used to export a map dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export a map dashboard item; otherwise, false. + */ + AutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the map dashboard item. + * Value: A value returned by the MapExportSizeMode class that specifies specifies the export size mode for the map dashboard item. + */ + SizeMode: string; +} +/** + * Contains settings that specify parameters affecting how the dashboard (dashboard item) is exported. + */ +interface ASPxClientDashboardExportOptions { + /** + * Gets or sets the standard paper size. + * Value: A string value returned by the DashboardExportPaperKind class that specifies the standard paper size. + */ + PaperKind: string; + /** + * Gets or sets the page orientation used to export a dashboard (dashboard item). + * Value: A string value returned by the DashboardExportPageLayout class that specifies the page orientation used to export a dashboard (dashboard item). + */ + PageLayout: string; + /** + * Gets or sets the mode for scaling when exporting a dashboard (dashboard item). + * Value: A string value returned by the DashboardExportScaleMode class that specifies the mode for scaling when exporting a dashboard (dashboard item). + */ + ScaleMode: string; + /** + * Gets or sets the scale factor (in fractions of 1) by which a dashboard (dashboard item) is scaled. + * Value: A Single value that specifies the scale factor by which a dashboard (dashboard item) is scaled. + */ + ScaleFactor: number; + /** + * Gets or sets the number of horizontal/vertical pages spanning the total width/height of a dashboard (dashboard item). + * Value: An integer value that specifies the number of horizontal/vertical pages spanning the total width/height of a dashboard (dashboard item). + */ + AutoFitPageCount: number; + /** + * Gets or sets the title of the exported document. + * Value: A string value that specifies the title of the exported document. + */ + Title: string; + /** + * Gets or sets whether a dashboard title (or dashboard item's caption) is included as the exported document title. + * Value: A boolean value that specifies whether a dashboard title (or dashboard item's caption) is included as the exported document title. + */ + ShowTitle: boolean; + /** + * Gets or sets the filter state's location on the exported document. + * Value: A string value returned by the DashboardExportFilterState class that specifies the filter state's location on the exported document. + */ + FilterState: string; + /** + * Provides access to options for exporting a dashboard or individual items in Image format. + * Value: An ImageFormatOptions object containing settings that specify parameters affecting how the dashboard or dashboard item is exported in Image format. + */ + ImageOptions: ImageFormatOptions; + /** + * Provides access to options for exporting individual dashboard items in Excel format. + * Value: An ExcelFormatOptions object containing settings that specify parameters affecting how the dashboard item is exported in Excel format. + */ + ExcelOptions: ExcelFormatOptions; + /** + * Provides access to options for exporting a Grid dashboard item. + * Value: A GridExportOptions object containing settings that specify parameters that affect how Grid dashboard items are exported. + */ + GridOptions: GridExportOptions; + /** + * Provides access to options for exporting a Pivot dashboard item. + * Value: A PivotExportOptions object containing settings that specify parameters that affect how Pivot dashboard items are exported. + */ + PivotOptions: PivotExportOptions; + /** + * Provides access to options for exporting a Pie dashboard item. + * Value: A PieExportOptions object containing settings that specify parameters that affect how Pie dashboard items are exported. + */ + PieOptions: PieExportOptions; + /** + * Provides access to options for exporting a Gauge dashboard item. + * Value: A GaugeExportOptions object containing settings that specify parameters that affect how Gauge dashboard items are exported. + */ + GaugeOptions: GaugeExportOptions; + /** + * Provides access to options for exporting a Card dashboard item. + * Value: A CardExportOptions object containing settings that specify parameters that affect how Card dashboard items are exported. + */ + CardOptions: CardExportOptions; + /** + * Provides access to options for exporting a Range Filter dashboard item. + * Value: A RangeFilterExportOptions object containing settings that specify parameters affecting how the Range Filter dashboard item is exported. + */ + RangeFilterOptions: RangeFilterExportOptions; + /** + * Provides access to options for exporting a Chart dashboard item. + * Value: A ChartExportOptions object containing settings that specify parameters that affect how Chart dashboard items are exported. + */ + ChartOptions: ChartExportOptions; + /** + * Provides access to options for exporting map dashboard items. + * Value: A MapExportOptions object containing settings that specify parameters that affect how map dashboard items are exported. + */ + MapOptions: MapExportOptions; +} +/** + * Contains options related to exporting a dashboard/dashboard item to the PDF format. + */ +interface DashboardPdfExportOptions { + /** + * Gets or sets the type of paper for the exported document. + * Value: A DashboardExportPaperKind value that specifies the type of paper for the exported document. + */ + PaperKind: string; + /** + * Gets or sets the page orientation used to export a dashboard/dashboard item. + * Value: A DashboardExportPageLayout value that specifies the page orientation used to export a dashboard/dashboard item. + */ + PageLayout: string; + /** + * Gets or sets the mode for scaling a dashboard/dashboard item in the exported document. + * Value: A DashboardExportScaleMode value that specifies the mode for scaling a dashboard/dashboard item in the exported document. + */ + ScaleMode: string; + /** + * Gets or sets the scale factor (in fractions of 1), by which a dashboard/dashboard item is scaled in the exported document. + * Value: A Single value that specifies the scale factor by which a dashboard/dashboard item is scaled in the exported document. + */ + ScaleFactor: number; + /** + * Gets or sets the number of horizontal/vertical pages spanning the total width/height of a dashboard/dashboard item. + * Value: An integer value that specifies the number of horizontal/vertical pages spanning the total width/height of a dashboard/dashboard item. + */ + AutoFitPageCount: number; + /** + * Gets or sets the title of the exported document. + * Value: A string value that specifies the title of the exported document. + */ + Title: string; + /** + * Gets or sets whether a dashboard title (or dashboard item's caption) is included as the exported document title. + * Value: A boolean value that specifies whether a dashboard title (or dashboard item's caption) is included as the exported document title. + */ + ShowTitle: boolean; + /** + * Gets or sets whether to add the state of master filter items to the exported document. + * Value: true, to add the state of master filter items to the exported document; otherwise, false. + */ + ExportFilters: boolean; + /** + * Gets or sets whether to add current parameter values to the exported document. + * Value: true, to add current parameter values to the exported document; otherwise, false. + */ + ExportParameters: boolean; + /** + * Gets or sets whether to add current values of a hidden parameter to the exported document. + * Value: true, to add current values of a hidden parameter to the exported document; otherwise, false. + */ + IncludeHiddenParameters: boolean; + /** + * Gets or sets a position of the dashboard state (such as master filter or current parameter values) in the exported document. + * Value: A DashboardStateExportPosition object that specifies the position of the dashboard state in the exported document. + */ + DashboardStatePosition: string; + /** + * Gets or sets whether cards within the Card dashboard item are arranged automatically on the exported page. + * Value: true, to arrange cards automatically on the exported page; otherwise, false. + */ + CardAutoArrangeContent: boolean; + /** + * Gets or sets whether the page orientation used to export the Chart dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export the Chart dashboard item; otherwise, false. + */ + ChartAutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Chart dashboard item. + * Value: A ChartExportSizeMode value that specifies the export size mode for the Chart dashboard item. + */ + ChartSizeMode: string; + /** + * Gets or sets whether gauges within the Gauge dashboard item are arranged automatically on the exported page. + * Value: true, to arrange gauges automatically on the exported page; otherwise, false. + */ + GaugeAutoArrangeContent: boolean; + /** + * Gets or sets whether the size of the Grid dashboard item is changed according to the width of the exported page. + * Value: true, to change the size of the Grid dashboard item according to the width of the exported page; otherwise, false. + */ + GridFitToPageWidth: boolean; + /** + * Gets or sets whether to add column headers of the Grid dashboard item to every page. + * Value: true, to add column headers to every page; otherwise, false. + */ + GridPrintHeadersOnEveryPage: boolean; + /** + * Gets or sets whether the page orientation used to export the Map dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export the Map dashboard item; otherwise, false. + */ + MapAutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Map dashboard item. + * Value: A MapExportSizeMode value that specifies the export size mode for the Map dashboard item. + */ + MapSizeMode: string; + /** + * Gets or sets whether pies within the Pie dashboard item are arranged automatically on the exported page. + * Value: true, to arrange pies automatically on the exported page; otherwise, false. + */ + PieAutoArrangeContent: boolean; + /** + * Gets or sets whether to add column headers of the Pivot dashboard item to every page. + * Value: true, to add column headers to every page; otherwise, false. + */ + PivotPrintHeadersOnEveryPage: boolean; + /** + * Gets or sets whether the page orientation used to export the Range Filter dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export the Range Filter dashboard item; otherwise, false. + */ + RangeFilterAutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Range Filter dashboard item. + * Value: A RangeFilterExportSizeMode value that specifies the export size mode for the Range Filter dashboard item. + */ + RangeFilterSizeMode: string; + /** + * Gets or sets whether the page orientation used to export the Treemap dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export the Treemap dashboard item; otherwise, false. + */ + TreemapAutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Treemap dashboard item. + * Value: A TreemapExportSizeMode value that specifies the export size mode for the Treemap dashboard item. + */ + TreemapSizeMode: string; +} +/** + * Contains options related to exporting a dashboard/dashboard item to an image. + */ +interface DashboardImageExportOptions { + /** + * Gets or sets a title of the exported document. + * Value: A string value that specifies the title of the exported document. + */ + Title: string; + /** + * Gets or sets whether a dashboard title (or dashboard item's caption) is included as the exported document title. + * Value: true, to include a dashboard title (or dashboard item's caption) as the exported document title; otherwise, false. + */ + ShowTitle: boolean; + /** + * Gets or sets whether to add the state of master filter items to the exported document. + * Value: true, to add the state of master filter items to the exported document; otherwise, false. + */ + ExportFilters: boolean; + /** + * Gets or sets whether to add current parameter values to the exported document. + * Value: true, to add current parameter values to the exported document; otherwise, false. + */ + ExportParameters: boolean; + /** + * Gets or sets whether to add current values of a hidden parameter to the exported document. + * Value: true, to add current values of a hidden parameter to the exported document; otherwise, false. + */ + IncludeHiddenParameters: boolean; + /** + * Gets or sets an image format in which the dashboard/dashboard item is exported. + * Value: A DashboardExportImageFormat value that specifies an image format in which the dashboard/dashboard item is exported. + */ + Format: string; + /** + * Gets or sets the resolution (in dpi) used to export a dashboard/dashboard item to an image. + * Value: An integer value that specifies the resolution (in dpi) used to export a dashboard/dashboard item to an image. + */ + Resolution: number; + /** + * Gets or sets the scale factor (in fractions of 1), by which a dashboard/dashboard item is scaled in the exported document. + * Value: A string value that specifies the scale factor by which a dashboard/dashboard item is scaled in the exported document. + */ + ScaleFactor: number; +} +/** + * Contains options related to exporting a dashboard/dashboard item to the Excel format. + */ +interface DashboardExcelExportOptions { + /** + * Gets or sets the Excel format in which the dashboard item is exported. + * Value: A DashboardExportExcelFormat value that specifies the Excel format in which the dashboard item is exported. + */ + Format: string; + /** + * Gets or sets a character used to separate values in a CSV document. + * Value: A string value that specifies the character used to separate values in a CSV document. + */ + CsvValueSeparator: string; + /** + * Gets or sets whether to add the state of master filter items to the exported document. + * Value: true, to add the state of master filter items to the exported document; otherwise, false. + */ + ExportFilters: boolean; + /** + * Gets or sets whether to add current parameter values to the exported document. + * Value: true, to add current parameter values to the exported document; otherwise, false. + */ + ExportParameters: boolean; + /** + * Gets or sets whether to add current values of a hidden parameter to the exported document. + * Value: true, to add current values of a hidden parameter to the exported document; otherwise, false. + */ + IncludeHiddenParameters: boolean; + /** + * Gets or sets the position of the dashboard state (such as master filter or current parameter values) in the exported document. + * Value: A DashboardStateExcelExportPosition object that specifies the position of the dashboard state in the exported document. + */ + DashboardStatePosition: string; +} +/** + * A client-side equivalent of the ASPxDashboard control. + */ +interface ASPxClientDashboard extends ASPxClientControl { + /** + * Fires when a round trip to the server has been initiated by a call to the client PerformDataCallback method. + */ + CustomDataCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs after the state of the dashboard displayed in the ASPxClientDashboard is changed. + */ + DashboardStateChanged: ASPxClientEvent>; + /** + * Occurs after a new dashboard is displayed in the ASPxClientDashboard. + */ + DashboardChanged: ASPxClientEvent>; + /** + * For internal use. + */ + CustomizeMenuItems: ASPxClientEvent>; + /** + * Occurs before any element in the Web Dashboard control has been rendered. + */ + BeforeRender: ASPxClientEvent>; + /** + * Occurs when an end-user clicks a dashboard item. + */ + ItemClick: ASPxClientEvent>; + /** + * Allows you to provide custom visual interactivity for data-bound dashboard items that support element selection and highlighting. + */ + ItemVisualInteractivity: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemWidgetCreated: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemWidgetUpdating: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemWidgetUpdated: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemBeforeWidgetDisposed: ASPxClientEvent>; + /** + * Occurs after the selection within the dashboard item is changed. + */ + ItemSelectionChanged: ASPxClientEvent>; + /** + * Allows you to color the required dashboard item elements using the specified colors. + */ + ItemElementCustomColor: ASPxClientEvent>; + /** + * Occurs when a master filter state is changed. + */ + ItemMasterFilterStateChanged: ASPxClientEvent>; + /** + * Occurs when a drill-down/drill-up is performed. + */ + ItemDrillDownStateChanged: ASPxClientEvent>; + /** + * Occurs after the available interactivity actions have changed for the specific dashboard item. + */ + ActionAvailabilityChanged: ASPxClientEvent>; + /** + * Occurs after parameter values provided using a Dynamic List are loaded. + */ + DynamicLookUpValuesLoaded: ASPxClientEvent>; + /** + * Occurs when a dashboard item update is initiated. + */ + ItemBeginUpdate: ASPxClientEvent>; + /** + * Occurs after the dashboard item update is performed. + */ + ItemEndUpdate: ASPxClientEvent>; + /** + * Occurs when a dashboard update is initiated. + */ + DashboardBeginUpdate: ASPxClientEvent>; + /** + * Occurs after the dashboard update is performed. + */ + DashboardEndUpdate: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientDataCallback object that represents the JavaScript function which receives the callback data as a parameter. + */ + PerformDataCallback(parameter: string, onCallback: ASPxClientDataCallback): void; + /** + * Gets an inner part of the ASPxClientDashboard control. + */ + GetDashboardControl(): DashboardControl; + /** + * Switches the ASPxClientDashboard to the viewer mode. + */ + SwitchToViewer(): void; + /** + * Switches the ASPxClientDashboard to the designer mode. + */ + SwitchToDesigner(): void; + /** + * Gets the current working mode of the Web Dashboard. + */ + GetWorkingMode(): string; + /** + * Gets the identifier of the dashboard that is displayed in the ASPxClientDashboard. + */ + GetDashboardId(): string; + /** + * Gets the name of the dashboard that is displayed in the ASPxClientDashboard. + */ + GetDashboardName(): string; + /** + * Gets the state of the dashboard displayed in the ASPxClientDashboard. + */ + GetDashboardState(): string; + /** + * Sets the state of the dashboard displayed in the ASPxClientDashboard. + * @param dashboardState A JSON object that specifies the dashboard state. + */ + SetDashboardState(dashboardState: Object): void; + /** + * Sets the state of the dashboard displayed in the ASPxClientDashboard. + * @param dashboardStateString A string value that specifies the state of the dashboard displayed in the ASPxClientDashboard. + */ + SetDashboardState(dashboardStateString: string): void; + /** + * Loads a dashboard with the specified identifier from the dashboard storage. + * @param dashboardId A string value that specifies the dashboard identifier. + */ + LoadDashboard(dashboardId: string): void; + /** + * Saves a current dashboard to the dashboard storage. + */ + SaveDashboard(): void; + /** + * Invokes the Dashboard Parameters dialog. + */ + ShowParametersDialog(): void; + /** + * Closes the Dashboard Parameters dialog. + */ + HideParametersDialog(): void; + /** + * Returns dashboard parameter settings and metadata. + */ + GetParameters(): ASPxClientDashboardParameters; + /** + * Invokes the dialog that allows end-users to export the entire dashboard to the specified format. + * @param format A string value that specifies the format. For instance, you can use 'PDF' or 'Image'. + */ + ShowExportDashboardDialog(format: string): void; + /** + * Invokes the dialog that allows end-users to export the dashboard item to the specified format. + * @param itemComponentName A string value that specifies the component name of the dashboard item to export. + * @param format A string value that specifies the format. For instance, you can use 'PDF, 'Image' or 'Excel'. Note that some items (i.e., ImageDashboardItem) do not support exporting to the 'Excel' format. + */ + ShowExportDashboardItemDialog(itemComponentName: string, format: string): void; + /** + * Hides the dialog that allows end-users to export the dashboard/dashboard item. + */ + HideExportDialog(): void; + /** + * Returns settings that specify parameters affecting how the dashboard is exported. + */ + GetExportOptions(): ASPxClientDashboardExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to the PDF format. + */ + GetPdfExportOptions(): DashboardPdfExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to an image. + */ + GetImageExportOptions(): DashboardImageExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to the Excel format. + */ + GetExcelExportOptions(): DashboardExcelExportOptions; + /** + * Specifies settings that specify parameters affecting how the dashboard is exported. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + */ + SetExportOptions(options: ASPxClientDashboardExportOptions): void; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to the PDF format. + * @param options A DashboardPdfExportOptions object containing options related to exporting a dashboard/dashboard item to the PDF format. + */ + SetPdfExportOptions(options: DashboardPdfExportOptions): void; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to an image. + * @param options A DashboardImageExportOptions object containing options related to exporting a dashboard/dashboard item to an image. + */ + SetImageExportOptions(options: DashboardImageExportOptions): void; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to the Excel format. + * @param options A DashboardExcelExportOptions object containing options related to exporting a dashboard item to the Excel format. + */ + SetExcelExportOptions(options: DashboardExcelExportOptions): void; + /** + * Exports a dashboard to a PDF file and writes it to the Response. + */ + ExportToPdf(): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + */ + ExportToPdf(options: DashboardPdfExportOptions): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToPdf(options: DashboardPdfExportOptions, fileName: string): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + */ + ExportToPdf(options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToPdf(options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports a dashboard to an Image file and writes it to the Response. + */ + ExportToImage(): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A DashboardImageExportOptions object containing image-specific export options. + */ + ExportToImage(options: DashboardImageExportOptions): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A DashboardImageExportOptions object containing image-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToImage(options: DashboardImageExportOptions, fileName: string): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + */ + ExportToImage(options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToImage(options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports dashboard data to the specified file in Excel format. + */ + ExportToExcel(): void; + /** + * Exports dashboard data to the specified file in Excel format. + * @param options A DashboardExcelExportOptions object containing Excel-specific options. + */ + ExportToExcel(options: DashboardExcelExportOptions): void; + /** + * Exports dashboard data to the specified file in Excel format. + * @param options A DashboardExcelExportOptions object containing Excel-specific options. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportToExcel(options: DashboardExcelExportOptions, fileName: string): void; + /** + * Exports a dashboard item to a PDF file and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + */ + ExportDashboardItemToPdf(itemName: string): void; + /** + * Exports a dashboard item to a PDF file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + */ + ExportDashboardItemToPdf(itemName: string, options: DashboardPdfExportOptions): void; + /** + * Exports a dashboard item to a PDF file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportDashboardItemToPdf(itemName: string, options: DashboardPdfExportOptions, fileName: string): void; + /** + * Exports a dashboard item to a PDF file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + */ + ExportDashboardItemToPdf(itemName: string, options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard item to a PDF file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + * @param fileName A string that specifies the name of the exported file. + */ + ExportDashboardItemToPdf(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports a dashboard item to an Image file and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + */ + ExportDashboardItemToImage(itemName: string): void; + /** + * Exports a dashboard item to an Image file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardImageExportOptions object containing image-specific export options. + */ + ExportDashboardItemToImage(itemName: string, options: DashboardImageExportOptions): void; + /** + * Exports a dashboard item to an Image file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardImageExportOptions object containing image-specific export options. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportDashboardItemToImage(itemName: string, options: DashboardImageExportOptions, fileName: string): void; + /** + * Exports a dashboard item to an Image file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + */ + ExportDashboardItemToImage(itemName: string, options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard item to an Image file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportDashboardItemToImage(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports a dashboard item to an Excel file and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + */ + ExportDashboardItemToExcel(itemName: string): void; + /** + * Exports a dashboard item to an Excel file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardExcelExportOptions object containing Excel export options. + */ + ExportDashboardItemToExcel(itemName: string, options: DashboardExcelExportOptions): void; + /** + * Exports a dashboard item to an Excel file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardExcelExportOptions object containing Excel export options. + * @param fileName A string that specifies the name of the exported Excel file. + */ + ExportDashboardItemToExcel(itemName: string, options: DashboardExcelExportOptions, fileName: string): void; + /** + * Exports a dashboard item to an Excel file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + */ + ExportDashboardItemToExcel(itemName: string, options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard item to an Excel file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + * @param fileName A string that specifies the name of the exported Excel file. + */ + ExportDashboardItemToExcel(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Returns whether or not master filtering can be applied in the current state of the specified master filter item. + * @param itemName A string that specifies the component name of the master filter item. + */ + CanSetMasterFilter(itemName: string): boolean; + /** + * Returns whether or not the specified master filter can be cleared in the current state. + * @param itemName A string that specifies the component name of the master filter item. + */ + CanClearMasterFilter(itemName: string): boolean; + /** + * Returns whether or not drill down is possible in the current state of the specified dashboard item. + * @param itemName A string that specifies the component name of the dashboard item. + */ + CanPerformDrillDown(itemName: string): boolean; + /** + * Returns whether or not drill up is possible in the current state of the specified dashboard item. + * @param itemName A string that specifies the component name of the dashboard item. + */ + CanPerformDrillUp(itemName: string): boolean; + /** + * Selects required elements by their values in the specified master filter item. + * @param itemName A String that specifies the component name of the master filter item. + * @param values Values that will be used to select elements in the master filter item. + */ + SetMasterFilter(itemName: string, values: Object[][]): void; + /** + * Selects the required elements in the specified master filter item. + * @param itemName A String that species the component name of the master filter item. + * @param axisPointTuples An array of ASPxClientDashboardItemDataAxisPointTuple objects used to identify master filter elements. + */ + SetMasterFilter(itemName: string, axisPointTuples: ASPxClientDashboardItemDataAxisPointTuple[]): void; + /** + * Performs a drill-down into the required element by its value. + * @param itemName A String that species the component name of the dashboard item. + * @param value A value that will be used to perform a drill-down for the required element. + */ + PerformDrillDown(itemName: string, value: Object): void; + /** + * Performs a drill-down into the required element. + * @param itemName A String that specifies the component name of the dashboard item. + * @param axisPointTuple A ASPxClientDashboardItemDataAxisPointTuple object representing a set of axis points. + */ + PerformDrillDown(itemName: string, axisPointTuple: ASPxClientDashboardItemDataAxisPointTuple): void; + /** + * Clears the specified master filter item. + * @param itemName A string that specifies the component name of the master filter item. + */ + ClearMasterFilter(itemName: string): void; + /** + * Performs a drill-up for the specified dashboard item. + * @param itemName A String that specifies the component name of the dashboard item. + */ + PerformDrillUp(itemName: string): void; + /** + * Returns axis point tuples identifying elements that can be used to perform drill-down in the specified dashboard item. + * @param itemName A String that is the component name of the dashboard item. + */ + GetAvailableDrillDownValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Returns the axis point tuple identifying the current drill-down state. + * @param itemName A String that is the component name of the dashboard item. + */ + GetCurrentDrillDownValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple; + /** + * Returns axis point tuples identifying elements that can be selected in the current state of the master filter item. + * @param itemName A String that is the component name of the master filter item. + */ + GetAvailableFilterValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Returns axis point tuples identifying currently selected elements in the master filter item. + * @param itemName A String that is the component name of the master filter item. + */ + GetCurrentFilterValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Returns currently selected elements in the master filter item. + * @param itemName A String that specifies a component name of the master filter item. + */ + GetCurrentSelection(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Returns the client data for the specified dashboard item. + * @param itemName A string that specifies the component name of the dashboard item. + */ + GetItemData(itemName: string): ASPxClientDashboardItemData; + /** + * Refreshes an entire dashboard displayed in the Web Dashboard control. + */ + Refresh(): void; + /** + * Refreshes the specific item from the dashboard displayed in the Web Dashboard control. + * @param itemName A string value that specifies the component name of the dashboard item to be refreshed. + */ + Refresh(itemName: string): void; + /** + * Refreshes specific items from the dashboard displayed in the Web Dashboard control. + * @param itemName An array of string values that specify the component names of the dashboard items to be refreshed. + */ + Refresh(itemName: string[]): void; + /** + * Requests underlying data for the specified dashboard item. + * @param itemName A string that specifies the component name of the dashboard item. + * @param args A ASPxClientDashboardItemRequestUnderlyingDataParameters object containing parameters used to obtain the underlying data. + * @param onCompleted A ASPxClientDashboardItemRequestUnderlyingDataCompleted object that references a method executed after the request is completed. + */ + RequestUnderlyingData(itemName: string, args: ASPxClientDashboardItemRequestUnderlyingDataParameters, onCompleted: ASPxClientDashboardItemRequestUnderlyingDataCompleted): void; + /** + * Returns the currently selected range in the specified Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter dashboard item. + */ + GetCurrentRange(itemName: string): ASPxClientDashboardRangeFilterSelection; + /** + * Returns the visible range for the specified Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter dashboard item. + */ + GetEntireRange(itemName: string): ASPxClientDashboardRangeFilterSelection; + /** + * Selects the required range in the specified Range Filter dashboard item. + * @param itemName A String that specifies the component name of the Range Filter dashboard item. + * @param range A ASPxClientDashboardRangeFilterSelection object that specifies a range to be selected. + */ + SetRange(itemName: string, range: ASPxClientDashboardRangeFilterSelection): void; + /** + * Selects a predefined range in the Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter. + * @param dateTimePeriodName A String value that specifies the predefined range name. + */ + SetPredefinedRange(itemName: string, dateTimePeriodName: string): void; + /** + * Returns names of the predefined ranges available for the specified Range Filter. + * @param itemName A string value that specifies the component name of the Range Filter dashboard item. + */ + GetAvailablePredefinedRanges(itemName: string): string[]; + /** + * Returns the name of the currently selected predefined range. + * @param itemName A string value that specifies the component name of the Range Filter dashboard item. + */ + GetCurrentPredefinedRange(itemName: string): string; +} +/** + * References a method that will handle the DashboardStateChanged event. + */ +interface ASPxClientDashboardStateChangedEventHandler { + /** + * References a method that will handle the DashboardStateChanged event. + * @param source The event source. + * @param e A ASPxClientDashboardStateChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardStateChangedEventArgs): void; +} +/** + * Provides data for the DashboardStateChanged event. + */ +interface ASPxClientDashboardStateChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the current state of the dashboard. + * Value: A string value that is the current state of the dashboard. + */ + DashboardState: string; +} +/** + * References a method that will handle the DashboardChanged event. + */ +interface ASPxClientDashboardChangedEventHandler { + /** + * References a method that will handle the DashboardChanged event. + * @param source The event source. + * @param e A ASPxClientDashboardChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardChangedEventArgs): void; +} +/** + * Provides data for the DashboardChanged event. + */ +interface ASPxClientDashboardChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the identifier of a newly opened dashboard. + * Value: A string value that is an identifier of newly opened dashboard. + */ + DashboardId: string; + /** + * Gets the name of a newly opened dashboard. + * Value: A string value that is the name of newly opened dashboard. + */ + DashboardName: string; +} +interface ASPxClientDashboardCustomizeMenuItemsEventHandler { + (source: S, e: ASPxClientDashboardCustomizeMenuItemsEventArgs): void; +} +interface ASPxClientDashboardMenuItem { + id: string; + title: string; + template: string; + selected: boolean; + disabled: boolean; + hasSeparator: boolean; + click: Function; + hotKey: number; +} +interface ASPxClientDashboardCustomizeMenuItemsEventArgs extends ASPxClientEventArgs { + Items: ASPxClientDashboardMenuItem[]; + FindById(itemId: string): ASPxClientDashboardMenuItem; +} +/** + * References a method that will handle the BeforeRender event. + */ +interface ASPxClientDashboardBeforeRenderEventHandler { + /** + * References a method that will handle the BeforeRender event. + * @param source The event source. + * @param e An ASPxClientEventArgs object that contains event data. + */ + (source: S, e: ASPxClientEventArgs): void; +} +/** + * Serves as the base class for classes that provide data for client-side events related to dashboard items. + */ +interface ASPxClientDashboardItemEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; + /** + * Returns whether or not the specified value is null. + * @param value The specified value. + */ + IsNullValue(value: Object): boolean; + /** + * Returns whether or not the specified value is 'others'. + * @param value The specified value. + */ + IsOthersValue(value: Object): boolean; +} +/** + * References a method that will handle the ItemMasterFilterStateChanged event. + */ +interface ASPxClientDashboardItemMasterFilterStateChangedEventHandler { + /** + * References a method that will handle the ItemMasterFilterStateChanged event. + * @param source The event source. + * @param e An ASPxClientDashboardItemMasterFilterStateChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemMasterFilterStateChangedEventArgs): void; +} +/** + * Provides data for the ItemMasterFilterStateChanged event. + */ +interface ASPxClientDashboardItemMasterFilterStateChangedEventArgs extends ASPxClientDashboardItemEventArgs { + /** + * Gets the currently selected values. + * Value: An array of objects that are the currently selected values. + */ + Values: Object[][]; +} +/** + * References a method that will handle the ItemDrillDownStateChanged event. + */ +interface ASPxClientDashboardItemDrillDownStateChangedEventHandler { + /** + * References a method that will handle the ItemDrillDownStateChanged event. + * @param source The event source. + * @param e An ASPxClientDashboardItemDrillDownStateChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemDrillDownStateChangedEventArgs): void; +} +/** + * Provides data for the ItemDrillDownStateChanged event. + */ +interface ASPxClientDashboardItemDrillDownStateChangedEventArgs extends ASPxClientDashboardItemEventArgs { + /** + * Gets the drill-down action performed in the dashboard item. + * Value: A string value that is the drill-down action performed in the dashboard item. + */ + Action: string; + /** + * Gets values from the current drill-down hierarchy. + * Value: An array of values from the current drill-down hierarchy. + */ + Values: Object[]; +} +/** + * References a method that will handle the ActionAvailabilityChanged event. + */ +interface ASPxClientActionAvailabilityChangedEventHandler { + /** + * References a method that will handle the ActionAvailabilityChanged event. + * @param source The event source. + * @param e A ASPxClientActionAvailabilityChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientActionAvailabilityChangedEventArgs): void; +} +/** + * Provides data for the ActionAvailabilityChanged event. + */ +interface ASPxClientActionAvailabilityChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; +} +/** + * References a method that will handle the DynamicLookUpValuesLoaded event. + */ +interface ASPxClientDynamicLookUpValuesLoadedEventHandler { + /** + * References a method that will handle the DynamicLookUpValuesLoaded event. + * @param source The event source. + * @param e A ASPxClientDynamicLookUpValuesLoadedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDynamicLookUpValuesLoadedEventArgs): void; +} +/** + * Provides data for the DynamicLookUpValuesLoaded event. + */ +interface ASPxClientDynamicLookUpValuesLoadedEventArgs extends ASPxClientEventArgs { + /** + * Gets the dashboard parameter name whose values have been loaded. + * Value: A string value that is the dashboard parameter name whose values have been loaded. + */ + ParameterName: string; +} +/** + * References a method that will handle the ItemBeginUpdate event. + */ +interface ASPxClientItemBeginUpdateEventHandler { + /** + * References a method that will handle the ItemBeginUpdate event. + * @param source The event source. + * @param e A ASPxClientItemBeginUpdateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientItemBeginUpdateEventArgs): void; +} +/** + * Provides data for the ItemBeginUpdate event. + */ +interface ASPxClientItemBeginUpdateEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; +} +/** + * References a method that will handle the ItemEndUpdate event. + */ +interface ASPxClientItemEndUpdateEventHandler { + /** + * References a method that will handle the ItemEndUpdate event. + * @param source The event source. + * @param e A ASPxClientItemEndUpdateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientItemEndUpdateEventArgs): void; +} +/** + * Provides data for the ItemEndUpdate event. + */ +interface ASPxClientItemEndUpdateEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; +} +/** + * References a method that will handle the DashboardBeginUpdate event. + */ +interface ASPxClientDashboardBeginUpdateEventHandler { + /** + * References a method that will handle the DashboardBeginUpdate event. + * @param source The event source. + * @param e A ASPxClientDashboardBeginUpdateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardBeginUpdateEventArgs): void; +} +/** + * Provides data for the DashboardBeginUpdate event. + */ +interface ASPxClientDashboardBeginUpdateEventArgs extends ASPxClientEventArgs { + /** + * Gets the identifier of the dashboard for which the event was raised. + * Value: A string value that is the dashboard identifier. + */ + DashboardId: string; +} +/** + * References a method that will handle the DashboardEndUpdate event. + */ +interface ASPxClientDashboardEndUpdateEventHandler { + /** + * References a method that will handle the DashboardEndUpdate event. + * @param source The event source. + * @param e An ASPxClientDashboardEndUpdateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardEndUpdateEventArgs): void; +} +/** + * Provides data for the DashboardEndUpdate event. + */ +interface ASPxClientDashboardEndUpdateEventArgs extends ASPxClientEventArgs { + /** + * Gets the identifier of the dashboard for which the event was raised. + * Value: A string value that is the dashboard identifier. + */ + DashboardId: string; +} +/** + * A client-side equivalent of the ASPxDashboardViewer control. + */ +interface ASPxClientDashboardViewer extends ASPxClientControl { + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs after the available interactivity actions have changed. + */ + ActionAvailabilityChanged: ASPxClientEvent>; + /** + * Occurs when an end-user changes the state of the master filter. + */ + MasterFilterSet: ASPxClientEvent>; + /** + * Occurs when an end-user clears the selection in the master filter item. + */ + MasterFilterCleared: ASPxClientEvent>; + /** + * Provides the capability to handle data loading errors in the ASPxClientDashboardViewer. + */ + DataLoadingError: ASPxClientEvent>; + /** + * Occurs after a drill-down is performed. + */ + DrillDownPerformed: ASPxClientEvent>; + /** + * Occurs after a drill-up is performed. + */ + DrillUpPerformed: ASPxClientEvent>; + /** + * Occurs after the ASPxClientDashboardViewer is loaded. + */ + Loaded: ASPxClientEvent>; + /** + * Occurs when an end-user clicks a dashboard item. + */ + ItemClick: ASPxClientEvent>; + /** + * Allows you to provide custom visual interactivity for data-bound dashboard items that support element selection and highlighting. + */ + ItemVisualInteractivity: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemWidgetCreated: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemWidgetUpdating: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemWidgetUpdated: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemBeforeWidgetDisposed: ASPxClientEvent>; + /** + * Occurs after the selection within the dashboard item is changed. + */ + ItemSelectionChanged: ASPxClientEvent>; + /** + * Allows you to color the required dashboard item elements using the specified colors. + */ + ItemElementCustomColor: ASPxClientEvent>; + /** + * Reloads data in the data sources. + */ + ReloadData(): void; + /** + * Reloads data in the data sources. + * @param parameters An array of ASPxClientDashboardParameter objects that specify dashboard parameters on the client side. + */ + ReloadData(parameters: ASPxClientDashboardParameter[]): void; + /** + * Returns dashboard parameter settings and metadata. + */ + GetParameters(): ASPxClientDashboardParameters; + /** + * Locks the EndUpdateParameters method call. + */ + BeginUpdateParameters(): void; + /** + * Unlocks the BeginUpdateParameters method and applies changes made to the parameter settings. + */ + EndUpdateParameters(): void; + /** + * Returns the currently selected range in the specified Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter dashboard item. + */ + GetCurrentRange(itemName: string): ASPxClientDashboardRangeFilterSelection; + /** + * Returns the visible range for the specified Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter dashboard item. + */ + GetEntireRange(itemName: string): ASPxClientDashboardRangeFilterSelection; + /** + * Selects the required range in the specified Range Filter dashboard item. + * @param itemName A String that specifies the component name of the Range Filter dashboard item. + * @param range A ASPxClientDashboardRangeFilterSelection object that specifies a range to be selected. + */ + SetRange(itemName: string, range: ASPxClientDashboardRangeFilterSelection): void; + /** + * Selects a predefined range in the Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter. + * @param dateTimePeriodName A String value that specifies the predefined range name. + */ + SetPredefinedRange(itemName: string, dateTimePeriodName: string): void; + /** + * Returns names of the predefined ranges available for the specified Range Filter. + * @param itemName A string value that specifies the component name of the Range Filter dashboard item. + */ + GetAvailablePredefinedRanges(itemName: string): string[]; + /** + * Returns the name of the currently selected predefined range. + * @param itemName A string value that specifies the component name of the Range Filter dashboard item. + */ + GetCurrentPredefinedRange(itemName: string): string; + /** + * Returns axis point tuples identifying elements that can be used to perform drill-down in the specified dashboard item. + * @param itemName A String that is the component name of the dashboard item. + */ + GetAvailableDrillDownValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Returns the axis point tuple identifying the current drill-down state. + * @param itemName A String that is the component name of the dashboard item. + */ + GetCurrentDrillDownValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple; + /** + * Returns axis point tuples identifying elements that can be selected in the current state of the master filter item. + * @param itemName A String that is the component name of the master filter item. + */ + GetAvailableFilterValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Returns axis point tuples identifying currently selected elements in the master filter item. + * @param itemName A String that is the component name of the master filter item. + */ + GetCurrentFilterValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Returns currently selected elements in the master filter item. + * @param itemName A String that specifies a component name of the master filter item. + */ + GetCurrentSelection(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Requests underlying data for the specified dashboard item. + * @param itemName A string that specifies the component name of the dashboard item. + * @param args A ASPxClientDashboardItemRequestUnderlyingDataParameters object containing parameters used to obtain the underlying data. + * @param onCompleted A ASPxClientDashboardItemRequestUnderlyingDataCompleted object that references a method executed after the request is completed. + */ + RequestUnderlyingData(itemName: string, args: ASPxClientDashboardItemRequestUnderlyingDataParameters, onCompleted: ASPxClientDashboardItemRequestUnderlyingDataCompleted): void; + /** + * Invokes the Dashboard Parameters dialog. + */ + ShowParametersDialog(): void; + /** + * Closes the Dashboard Parameters dialog. + */ + HideParametersDialog(): void; + /** + * Returns settings that specify parameters affecting how the dashboard is exported. + */ + GetExportOptions(): ASPxClientDashboardExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to the PDF format. + */ + GetPdfExportOptions(): DashboardPdfExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to an image. + */ + GetImageExportOptions(): DashboardImageExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to the Excel format. + */ + GetExcelExportOptions(): DashboardExcelExportOptions; + /** + * Specifies settings that specify parameters affecting how the dashboard is exported. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + */ + SetExportOptions(options: ASPxClientDashboardExportOptions): void; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to the PDF format. + * @param options A DashboardPdfExportOptions object containing options related to exporting a dashboard/dashboard item to the PDF format. + */ + SetPdfExportOptions(options: DashboardPdfExportOptions): void; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to an image. + * @param options A DashboardImageExportOptions object containing options related to exporting a dashboard/dashboard item to an image. + */ + SetImageExportOptions(options: DashboardImageExportOptions): void; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to the Excel format. + * @param options A DashboardExcelExportOptions object containing options related to exporting a dashboard item to the Excel format. + */ + SetExcelExportOptions(options: DashboardExcelExportOptions): void; + /** + * Exports a dashboard to a PDF file and writes it to the Response. + */ + ExportToPdf(): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + */ + ExportToPdf(options: DashboardPdfExportOptions): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToPdf(options: DashboardPdfExportOptions, fileName: string): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + */ + ExportToPdf(options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToPdf(options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports a dashboard to an Image file and writes it to the Response. + */ + ExportToImage(): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A DashboardImageExportOptions object containing image-specific export options. + */ + ExportToImage(options: DashboardImageExportOptions): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A DashboardImageExportOptions object containing image-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToImage(options: DashboardImageExportOptions, fileName: string): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + */ + ExportToImage(options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToImage(options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports dashboard data to the specified file in Excel format. + */ + ExportToExcel(): void; + /** + * Exports dashboard data to the specified file in Excel format. + * @param options A DashboardExcelExportOptions object containing Excel-specific options. + */ + ExportToExcel(options: DashboardImageExportOptions): void; + /** + * Exports dashboard data to the specified file in Excel format. + * @param options A DashboardExcelExportOptions object containing Excel-specific options. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportToExcel(options: DashboardImageExportOptions, fileName: string): void; + /** + * Exports a dashboard item to a PDF file and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + */ + ExportDashboardItemToPdf(itemName: string): void; + /** + * Exports a dashboard item to a PDF file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + */ + ExportDashboardItemToPdf(itemName: string, options: DashboardPdfExportOptions): void; + /** + * Exports a dashboard item to a PDF file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportDashboardItemToPdf(itemName: string, options: DashboardPdfExportOptions, fileName: string): void; + /** + * Exports a dashboard item to a PDF file with the specified export options and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + */ + ExportDashboardItemToPdf(itemName: string, options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard item to a PDF file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + * @param fileName A string that specifies the name of the exported file. + */ + ExportDashboardItemToPdf(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports a dashboard item to an Image file and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + */ + ExportDashboardItemToImage(itemName: string): void; + /** + * Exports a dashboard item to an Image file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardImageExportOptions object containing image-specific export options. + */ + ExportDashboardItemToImage(itemName: string, options: DashboardImageExportOptions): void; + /** + * Exports a dashboard item to an Image file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardImageExportOptions object containing image-specific export options. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportDashboardItemToImage(itemName: string, options: DashboardImageExportOptions, fileName: string): void; + /** + * Exports a dashboard item to an Image file with the specified export options and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + */ + ExportDashboardItemToImage(itemName: string, options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard item to an Image file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportDashboardItemToImage(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports a dashboard item to an Excel file and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + */ + ExportDashboardItemToExcel(itemName: string): void; + /** + * Exports a dashboard item to an Excel file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardExcelExportOptions object containing Excel export options. + */ + ExportDashboardItemToExcel(itemName: string, options: DashboardExcelExportOptions): void; + /** + * Exports a dashboard item to an Excel file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardExcelExportOptions object containing Excel export options. + * @param fileName A string that specifies the name of the exported Excel file. + */ + ExportDashboardItemToExcel(itemName: string, options: DashboardExcelExportOptions, fileName: string): void; + /** + * Exports a dashboard item to an Excel file with the specified export options and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + */ + ExportDashboardItemToExcel(itemName: string, options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard item to an Excel file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options. + * @param fileName A string that specifies the name of the exported Excel file. + */ + ExportDashboardItemToExcel(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Returns the dashboard width. + */ + GetWidth(): number; + /** + * Returns the dashboard height. + */ + GetHeight(): number; + /** + * Specifies the dashboard width. + * @param width An integer value that specifies the dashboard width. + */ + SetWidth(width: number): void; + /** + * Specifies the dashboard height. + * @param height An integer value that specifies the dashboard height. + */ + SetHeight(height: number): void; + /** + * Specifies the dashboard size. + * @param width An integer value that specifies the dashboard width. + * @param height An integer value that specifies the dashboard height. + */ + SetSize(width: number, height: number): void; + /** + * Selects required elements by their values in the specified master filter item. + * @param itemName A String that species the component name of the master filter item. + * @param values Values that will be used to select elements in the master filter item. + */ + SetMasterFilter(itemName: string, values: Object[][]): void; + /** + * Selects the required elements in the specified master filter item. + * @param itemName A String that specifies the component name of the master filter item. + * @param axisPointTuples An array of ASPxClientDashboardItemDataAxisPointTuple objects used to identify master filter elements. + */ + SetMasterFilter(itemName: string, axisPointTuples: ASPxClientDashboardItemDataAxisPointTuple[]): void; + /** + * Performs a drill-down for the required element by its value. + * @param itemName A String that species the component name of the dashboard item. + * @param value A value that will be used to perform a drill-down for the required element. + */ + PerformDrillDown(itemName: string, value: Object): void; + /** + * Performs a drill-down for the required element. + * @param itemName A String that specifies the component name of the dashboard item. + * @param axisPointTuple A ASPxClientDashboardItemDataAxisPointTuple object representing a set of axis points. + */ + PerformDrillDown(itemName: string, axisPointTuple: ASPxClientDashboardItemDataAxisPointTuple): void; + /** + * Clears the specified master filter item. + * @param itemName A String that specifies the component name of the master filter item. + */ + ClearMasterFilter(itemName: string): void; + /** + * Performs a drill-up for the specified dashboard item. + * @param itemName A String that specifies the component name of the dashboard item. + */ + PerformDrillUp(itemName: string): void; + /** + * Returns whether or not the specified master filter item allows selecting one or more elements. + * @param itemName A String that specifies the component name of the master filter item. + */ + CanSetMasterFilter(itemName: string): boolean; + /** + * Returns whether or not the specified master filter can be cleared in the current state. + * @param itemName A String that specifies the component name of the master filter item. + */ + CanClearMasterFilter(itemName: string): boolean; + /** + * Returns whether or not drill down is possible in the current state of the specified dashboard item. + * @param itemName A String that specifies the component name of the dashboard item. + */ + CanPerformDrillDown(itemName: string): boolean; + /** + * Returns whether or not drill up is possible in the current state of the specified dashboard item. + * @param itemName A String that specifies the component name of the dashboard item. + */ + CanPerformDrillUp(itemName: string): boolean; + /** + * Returns the client data for the specified dashboard item. + * @param itemName A string that specifies the component name of the dashboard item. + */ + GetItemData(itemName: string): ASPxClientDashboardItemData; +} +/** + * References a method that will handle the ActionAvailabilityChanged event. + */ +interface ASPxClientDashboardActionAvailabilityChangedEventHandler { + /** + * References a method that will handle the ActionAvailabilityChanged event. + * @param source The event source. + * @param e A ASPxClientDashboardActionAvailabilityChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardActionAvailabilityChangedEventArgs): void; +} +/** + * Provides data for the ActionAvailabilityChanged event. + */ +interface ASPxClientDashboardActionAvailabilityChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets whether or not data reloading is available in the current state of dashboard item. + * Value: true, if data reloading is available in the current state of dashboard item; otherwise, false. + */ + IsReloadDataAvailable: boolean; + /** + * Gets interactivity actions currently available for the dashboard item. + * Value: An array of ASPxClientDashboardItemAction objects that represent interactivity actions currently available for the dashboard item. + */ + ItemActions: ASPxClientDashboardItemAction[]; +} +/** + * References a method that will handle the DataLoadingError event. + */ +interface ASPxClientDashboardDataLoadingErrorEventHandler { + /** + * References a method that will handle the DataLoadingError event. + * @param source The event source. + * @param e A ASPxClientDashboardDataLoadingErrorEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardDataLoadingErrorEventArgs): void; +} +/** + * Provides data for the DataLoadingError event. + */ +interface ASPxClientDashboardDataLoadingErrorEventArgs extends ASPxClientEventArgs { + /** + * Allows you to determine whether or not the error message will be shown. + */ + IsErrorMessageShown(): boolean; + /** + * Allows you to specify whether to show the error message. + * @param value true, to show the error message; otherwise, false. + */ + ShowErrorMessage(value: boolean): void; + /** + * Allows you to obtain the displayed error message. + */ + GetError(): string; + /** + * Allows you to specify the displayed error message. + * @param value A string value that specifies the displayed error message. + */ + SetError(value: string): void; +} +/** + * Represents an interactivity action in the dashboard item. + */ +interface ASPxClientDashboardItemAction { + /** + * Gets the name of the dashboard item. + * Value: A string that specifies the name of the dashboard item. + */ + ItemName: string; + /** + * Gets interactivity actions performed on a dashboard item. + * Value: An array of ASPxClientDashboardAction values that specify interactivity actions performed on a dashboard item. + */ + Actions: any[]; +} +declare enum ASPxClientDashboardAction { + SetMasterFilter=0, + ClearMasterFilter=1, + DrillDown=2, + DrillUp=3 +} +/** + * References a method that will handle the MasterFilterSet event. + */ +interface ASPxClientDashboardMasterFilterSetEventHandler { + /** + * References a method that will handle the MasterFilterSet event. + * @param source The event source. + * @param e A ASPxClientDashboardMasterFilterSetEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardMasterFilterSetEventArgs): void; +} +/** + * Provides data for the MasterFilterSet event. + */ +interface ASPxClientDashboardMasterFilterSetEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dashboard item. + * Value: A string value that specifies the component name of the dashboard item. + */ + ItemName: string; + /** + * Gets values of currently selected elements in the master filter item. + * Value: Values of currently selected elements in the master filter item. + */ + Values: Object[][]; + /** + * Returns whether or not the specified value is NullValue. + * @param value The specified value. + */ + IsNullValue(value: Object): boolean; + /** + * Returns whether or not the specified value is OthersValue. + * @param value The specified value. + */ + IsOthersValue(value: Object): boolean; +} +/** + * References a method that will handle the MasterFilterCleared event. + */ +interface ASPxClientDashboardMasterFilterClearedEventHandler { + /** + * References a method that will handle the MasterFilterCleared event. + * @param source The event source. + * @param e A ASPxClientDashboardMasterFilterClearedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardMasterFilterClearedEventArgs): void; +} +/** + * Provides data for the MasterFilterCleared event. + */ +interface ASPxClientDashboardMasterFilterClearedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dashboard item. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; +} +/** + * References a method that will handle the DrillDownPerformed event. + */ +interface ASPxClientDashboardDrillDownPerformedEventHandler { + /** + * References a method that will handle the DrillDownPerformed event. + * @param source The event source. + * @param e A ASPxClientDashboardDrillDownPerformedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardDrillDownPerformedEventArgs): void; +} +/** + * Provides data for the DrillDownPerformed event. + */ +interface ASPxClientDashboardDrillDownPerformedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dashboard item. + * Value: A string that specifies the name of the dashboard item. + */ + ItemName: string; + /** + * Gets values from the current drill-down hierarchy. + * Value: An array of values from the current drill-down hierarchy. + */ + Values: Object[]; + /** + * Returns whether or not the specified value is NullValue. + * @param value The specified value. + */ + IsNullValue(value: Object): boolean; + /** + * Returns whether or not the specified value is OthersValue. + * @param value The specified value. + */ + IsOthersValue(value: Object): boolean; +} +/** + * References a method that will handle the DrillUpPerformed event. + */ +interface ASPxClientDashboardDrillUpPerformedEventHandler { + /** + * References a method that will handle the DrillUpPerformed event. + * @param source The event source. + * @param e A ASPxClientDashboardDrillUpPerformedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardDrillUpPerformedEventArgs): void; +} +/** + * Provides data for the DrillUpPerformed event. + */ +interface ASPxClientDashboardDrillUpPerformedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dashboard item. + * Value: A string that is the name of the dashboard item. + */ + ItemName: string; +} +interface CardWidgetCustomizeTextEventArgs { + getValue(): Object; + getDefaultText(): string; +} +/** + * A Card widget that visualizes a Card dashboard item's data. + */ +interface CardWidget { + /** + * Gets or sets the background color for a card. + * Value: A string that specifies the HTML color used to paint a card's background. + */ + cardBackColor: string; + onCustomizeText: Object; +} +/** + * When implemented, represents the Web Dashboard extension. + */ +interface IExtension { + /** + * Gets a unique name of a Web Dashboard extension. + * Value: A string value that is a unique name of a Web Dashboard extension. + */ + name: string; + /** + * Contains code that will be invoked when you register the dashboard extension. + */ + start(): void; + /** + * Contains code that will be invoked when you unregister the dashboard extension. + */ + stop(): void; +} +/** + * An inner part of the ASPxClientDashboard control. + */ +interface DashboardControl { + /** + * Gets or sets knockout templates that you can use in the Web Dashboard. + * Value: A object that is a knockout template collection. + */ + customTemplates: KnockoutObservableArray; + /** + * Provides an access to the collection of registered dashboard extensions. + * Value: An array of IExtension objects that are dashboard extensions. + */ + extensions: IExtension[]; + /** + * Initializes a new dashboard with the specified name and JSON model. + * @param id A string value that is a unique name of the created dashboard. + * @param dashboardJson A dashboard model encoded in the specified JSON string. + */ + initializeDashboard(id: string, dashboardJson: string): void; + /** + * Initializes a new dashboard with the specified name, JSON model and initial state. + * @param id A string value that is a unique name of the created dashboard. + * @param dashboardJson A dashboard model encoded in the specified JSON string. + * @param initialState A JSON object that specifies the dashboard state. + */ + initializeDashboard(id: string, dashboardJson: string, initialState: Object): void; + /** + * Allows you to register a dashboard extension to add its functionality to the Web Dashboard. + * @param extension An IExtension object that is a dashboard extension. + */ + registerExtension(extension: IExtension): void; + /** + * Allows you to get access to the extension. + * @param extensionName A string value that is the dashboard extension name. + */ + findExtension(extensionName: string): IExtension; + /** + * Allows you to unregister a dashboard extension to disable its functionality in the Web Dashboard. + * @param extensionName A string value that is a dashboard extension name. + */ + unregisterExtension(extensionName: string): void; +} +interface DashboardParameterDialogExtension extends IExtension { +} +interface DashboardExportExtension extends IExtension { +} +interface DashboardClientApiExtension extends IExtension { +} +interface DashboardCurrencyEditorExtension extends IExtension { +} +interface DataSourceBrowserExtension extends IExtension { +} +interface DataSourceWizardExtension extends IExtension { +} +interface DashboadItemMenuExtension extends IExtension { +} +/** + * A Web Dashboard extension that allows you to keep track of all user actions, and cancel or repeat them. + */ +interface UndoRedoExtension extends IExtension { + /** + * Allows you to track whether the Web Dashboard has unsaved changes. + */ + isChanged(): boolean; +} +/** + * An extension that is the dashboard item's Binding menu allowing you to create and modify data binding. + */ +interface BindingPanelExtension extends IExtension { +} +/** + * A Web Dashboard extension that allows you to configure color schemes. + */ +interface DashboardColorSchemeEditorExtension extends IExtension { +} +/** + * An extension that is the dashboard item's Convert To menu allowing you to convert or duplicate the current item. + */ +interface ConversionPanelExtension extends IExtension { +} +/** + * A Web Dashboard extension that allows you to save the current dashboard. + */ +interface SaveDashboardExtension extends IExtension { + /** + * Allows you to save the current dashboard with a specified unique name and JSON model. + * @param dashboardId A string value that is a unique name of the created dashboard. + * @param dashboardJson A dashboard model encoded in the specified JSON string. + */ + performSaveDashboard(dashboardId: string, dashboardJson: string): void; + /** + * Allows you to invoke a custom function while you save a dashboard. + * @param action A custom function that is invoked when the dashboard is about to be saved. + */ + ensureDashboardSaved(action: Function): void; + /** + * Saves the opened dashboard. + */ + saveDashboard(): void; +} +/** + * A Web Dashboard extension that allows you to create a new dashboard. + */ +interface CreateDashboardExtension extends IExtension { + /** + * Creates a new dashboard with a specified name and JSON model. + * @param dashboardName A string value that is the name of the created dashboard. + * @param dashboardJson A dashboard model encoded in the specified JSON string. + */ + performCreateDashboard(dashboardName: string, dashboardJson: string): void; +} +/** + * A Web Dashboard extension that allows you to open the created dashboards. + */ +interface OpenDashboardExtension extends IExtension { + /** + * Loads a dashboard with the specified identifier from the dashboard storage. + * @param id A String value that specifies the unique dashboard name. + */ + loadDashboard(id: string): void; +} +/** + * An extension that is the dashboard item's Interactivity menu containing settings that affect on interaction between various dashboard items. + */ +interface InteractivityPanelExtension extends IExtension { +} +/** + * An extension that is the dashboard item's Options menu containing specific options and settings related to the current dashboard item. + */ +interface OptionsPanelExtension extends IExtension { +} +/** + * An extension that is the Web Dashboard title editor. + */ +interface DashboardTitleEditorExtension extends IExtension { +} +/** + * The Dashboard Panel extension that displays a list of available dashboards and lets you switch between the designer and viewer modes. + */ +interface DashboardPanelExtension extends IExtension { + /** + * Gets or sets the width of the Dashboard Panel extension. + * Value: An integer value that specifies the Dashboard Panel's width. + */ + panelWidth: number; + /** + * Gets or sets whether the Dashboard Panel is visible. + * Value: true, to display the Dashboard Panel; otherwise, false. + */ + visible: KnockoutObservableBoolean; + /** + * Gets or sets whether you can switch into the designer mode. + * Value: true, to display the Edit in Designer button on the dashboard panel; otherwise, false. + */ + allowSwitchToDesigner: KnockoutObservableBoolean; +} +/** + * An extension that is a list of available data sources used to provide data to the Web Dashboard. + */ +interface AvailableDataSourcesExtension extends IExtension { +} +/** + * A dashboard menu item. + */ +interface DashboardMenuItem { + /** + * Gets or sets a unique identifier of a dashboard menu item. + * Value: A string value that is a menu item's unique identifier. + */ + id: string; + /** + * Gets or sets a dashboard menu item title. + * Value: A string value that is a dashboard menu item title. + */ + title: string; + /** + * Gets or sets a position of the dashboard menu item within the dashboard menu. + * Value: A zero-based integer specifying the position of the current dashboard menu item. + */ + index: number; + /** + * Gets or sets a code of the key used in the keyboard shortcut. This shortcut allows you to invoke the current menu item. + * Value: An integer value that specifies a key code. + */ + hotKey: number; + /** + * Gets or sets a custom function that is invoked when a click occurs. + * Value: A custom function that is invoked when a click occurs. + */ + click: Function; + /** + * Gets or sets a knockout template for the extension. + * Value: A string value that is an id of the knockout template. + */ + template: string; + /** + * Gets or sets whether the dashboard menu item is selected. + * Value: true, if the dashboard menu item is selected; otherwise, false; + */ + selected: KnockoutObservableBoolean; + /** + * Gets whether a dashboard menu item is disabled. + * Value: true, if a dashboard menu item should be disabled; otherwise, false. + */ + disabled: KnockoutObservableBoolean; + /** + * Gets or sets whether a dashboard menu item has a separator. + * Value: true, if a dashboard menu item has a separator; otherwise, false. + */ + hasSeparator: boolean; + /** + * Gets or sets data that is used by a menu item. + * Value: An object that contains data used by a menu item. + */ + data: Object; +} +/** + * A toolbox item of the specified dashboard toolbox group. + */ +interface DashboardToolboxItem { + /** + * Gets or sets a dashboard item type. + * Value: A string value that is a dashboard item type. + */ + type: string; + /** + * Gets or sets an icon of the dashboard toolbox item. + * Value: A string value that is the icon id from the SVG definition. + */ + icon: string; + /** + * Gets or sets a unique name of the dashboard toolbox item. + * Value: A string value that is a toolbox item's unique name. + */ + name: string; + /** + * Gets or sets a dashboard toolbox item title. + * Value: A string value that is a dashboard toolbox item title. + */ + title: string; + /** + * Gets or sets whether a toolbox item should be disabled. + * Value: true, if a toolbox item should be disabled; otherwise, false. + */ + disabled: KnockoutObservableBoolean; + /** + * Gets or sets a custom function that is invoked when a click occurs. + * Value: A custom function that is invoked when a click occurs. + */ + click: Function; +} +/** + * A toolbar item of the specified dashboard toolbar group. + */ +interface DashboardToolbarItem { + /** + * Gets or sets an icon of the dashboard toolbar item. + * Value: A string value that is the icon id from the SVG definition. + */ + icon: string; + /** + * Gets or sets a unique name of the dashboard toolbar item. + * Value: A string value that is a unique toolbar item name. + */ + name: string; + /** + * Gets or sets a dashboard toolbar item title. + * Value: A string value that is a dashboard toolbar item title. + */ + title: string; + /** + * Gets or sets whether a toolbar item should be disabled. + * Value: true, if a toolbar item is disabled; otherwise, false. + */ + disabled: KnockoutObservableBoolean; + /** + * Gets or sets a knockout extension template. + * Value: A string value that is an id of the knockout template. + */ + template: string; + /** + * Gets or sets a custom function that is invoked when a click occurs. + * Value: A custom function that is invoked when a click occurs. + */ + click: Function; +} +/** + * A toolbox group that contains dashboard toolbox items. + */ +interface DashboardToolboxGroup { + /** + * Gets or sets a unique name of the dashboard toolbox group. + * Value: A string value that is a unique toolbox group name. + */ + name: string; + /** + * Gets or sets a dashboard toolbox group title. + * Value: A string value that is a dashboard toolbox group title. + */ + title: string; + /** + * Gets or sets a position of the toolbox group within the Toolbox. + * Value: A zero-based integer specifying the position of the current toolbox group. + */ + index: number; + /** + * Provide an access to the collection of toolbox items obtained from the specified toolbox group. + * Value: A object that is an array of items obtained from the specified toolbox group. + */ + items: KnockoutObservableArray; +} +/** + * A toolbar group that contains dashboard toolbar items. + */ +interface DashboardToolbarGroup { + /** + * Gets or sets a unique name of the dashboard toolbar group. + * Value: A string value that is a unique toolbar group name. + */ + name: string; + /** + * Gets or sets a dashboard toolbar group title. + * Value: A string value that is a dashboard toolbar group title. + */ + title: string; + /** + * Gets or sets a position of the toolbar group within the Toolbox. + * Value: A zero-based integer specifying the position of the current toolbar group. + */ + index: number; + /** + * Provide an access to the collection of toolbox items obtained from the specified toolbar group. + * Value: A object that is an array of items obtained from the specified toolbar group. + */ + items: KnockoutObservableArray; +} +/** + * The Web Dashboard Toolbox extension that provides access to the dashboard menu and allows you to add dashboard items, as well as undo or repeat user actions. + */ +interface ToolboxExtension extends IExtension { + /** + * Gets or sets the visibility of the dashboard menu. + * Value: true, to display the dashboard menu; otherwise, false. + */ + menuVisible: KnockoutObservableBoolean; + /** + * Provide an access to the collection of menu items obtained from the dashboard menu. + * Value: A object that is a collection the dashboard menu items . + */ + menuItems: KnockoutObservableArray; + /** + * Provide an access to the collection of toolbox groups obtained from the Toolbox. + * Value: A object that is a collection the toolbox groups. + */ + toolboxGroups: KnockoutObservableArray; + /** + * Provide an access to the collection of toolbar groups obtained from the Toolbox. + * Value: A object that is a collection the toolbar groups. + */ + toolbarGroups: KnockoutObservableArray; + /** + * Allows you to add a specified menu item to the dashboard menu. + * @param menuItem A DashboardMenuItem object that is a dashboard menu item. + */ + addMenuItem(menuItem: DashboardMenuItem): void; + /** + * Removes the specified dashboard item from the dashboard menu. + * @param menuItemId A string value that is a unique dashboard item name. + */ + removeMenuItem(menuItemId: string): void; + /** + * Simulates a dashboard menu item selection. + * @param menuItem A DashboardMenuItem object that is a dashboard menu item. + */ + selectMenuItem(menuItem: DashboardMenuItem): void; + /** + * Allows you to add a specified toolbox item into a specified toolbox group. + * @param groupName A string value that is a toolbox group name. To get a toolbox group name, use the name property. + * @param toolboxItem A DashboardToolboxItem object that is a dashboard toolbox item. + */ + addToolboxItem(groupName: string, toolboxItem: DashboardToolboxItem): void; + /** + * Removes the specified toolbox item from the specified toolbox group. + * @param groupName A string value that is a unique toolbox group name. + * @param toolboxItemName A string value that is a unique toolbox item name. + */ + removeToolboxItem(groupName: string, toolboxItemName: string): void; + /** + * Allows you to add a specified toolbar item into a specified toolbar group. + * @param groupName A string value that is a toolbar group name. To get a toolbar group name, use the name property. + * @param toolbarItem A DashboardToolbarItem object that is a dashboard toolbar item. + */ + addToolbarItem(groupName: string, toolbarItem: DashboardToolbarItem): void; + /** + * Removes the specified toolbar item from the specified toolbar group. + * @param groupName A string value that is a unique toolbar group name. + * @param toolbarItemName A string value that is a unique toolbar item name. + */ + removeToolbarItem(groupName: string, toolbarItemName: string): void; +} +/** + * A Web Dashboard extension that allows you to create and edit dashboard parameters. + */ +interface DashboardParameterEditorExtension extends IExtension { +} +/** + * Serves as the base object for all the editors included in the client-side object model. + */ +interface ASPxClientEditBase extends ASPxClientControl { + /** + * Returns the editor's value. + */ + GetValue(): Object; + /** + * Changes the editor's value. + * @param value An object representing the data to be assigned to the editor's edit value. + */ + SetValue(value: Object): void; + /** + * Returns a value indicating whether an editor is enabled. + */ + GetEnabled(): boolean; + /** + * Specifies whether an editor is enabled. + * @param value true to enable the editor; otherwise, false. + */ + SetEnabled(value: boolean): void; + /** + * Returns the text displayed in the editor caption. + */ + GetCaption(): string; + /** + * Specifies the text displayed in the editor caption. + * @param caption A string value specifying the editor caption. + */ + SetCaption(caption: string): void; +} +/** + * Serves as the base object for all the editors that support validation. + */ +interface ASPxClientEdit extends ASPxClientEditBase { + /** + * Fires on the client side when the editor receives input focus. + */ + GotFocus: ASPxClientEvent>; + /** + * Fires on the client side when the editor loses input focus. + */ + LostFocus: ASPxClientEvent>; + /** + * Allows you to specify whether the value entered into the editor is valid, and whether the editor is allowed to lose focus. + */ + Validation: ASPxClientEvent>; + /** + * Fires after the editor's value has been changed by end-user interactions. + */ + ValueChanged: ASPxClientEvent>; + /** + * Returns an HTML element that represents the control's input element. + */ + GetInputElement(): Object; + /** + * Sets input focus to the editor. + */ + Focus(): void; + /** + * Gets a value that indicates whether the editor's value passes validation. + */ + GetIsValid(): boolean; + /** + * Gets the error text to be displayed within the editor's error frame if the editor's validation fails. + */ + GetErrorText(): string; + /** + * Sets a value that specifies whether the editor's value is valid. + * @param isValid True if the editor's value is valid; otherwise, False. + */ + SetIsValid(isValid: boolean): void; + /** + * Sets the error text to be displayed within the editor's error frame if the editor's validation fails. + * @param errorText A string value representing the error text. + */ + SetErrorText(errorText: string): void; + /** + * Performs the editor's validation. + */ + Validate(): void; +} +/** + * Represents the client-side equivalent of the ASPxBinaryImage control. + */ +interface ASPxClientBinaryImage extends ASPxClientEdit { + /** + * Occurs on the client side after an image is clicked. + */ + Click: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client side if any server error occurs during server-side processing of a callback sent by the ASPxClientBinaryImage. + */ + CallbackError: ASPxClientEvent>; + /** + * Sets the size of the image editor. + * @param width An integer value that specifies the control's width. + * @param height An integer value that specifies the control's height. + */ + SetSize(width: number, height: number): void; + /** + * For internal use only. + */ + GetValue(): Object; + /** + * For internal use only. + * @param value + */ + SetValue(value: Object): void; + /** + * Removes an image from the editor content. + */ + Clear(): void; + /** + * Returns a name of the last uploaded file. + */ + GetUploadedFileName(): string; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that contains any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that contains any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * Represents the client-side equivalent of the ASPxButton control. + */ +interface ASPxClientButton extends ASPxClientControl { + /** + * Occurs on the client side when the button's checked state is changed. + */ + CheckedChanged: ASPxClientEvent>; + /** + * Fires on the client side when the button receives input focus. + */ + GotFocus: ASPxClientEvent>; + /** + * Fires on the client side when the button loses input focus. + */ + LostFocus: ASPxClientEvent>; + /** + * Occurs on the client side after a button is clicked. + */ + Click: ASPxClientEvent>; + /** + * Simulates a mouse click action on the button control. + */ + DoClick(): void; + /** + * Returns a value indicating whether the button is checked. + */ + GetChecked(): boolean; + /** + * Sets a value that specifies the button's checked status. + * @param value true if the button is checked; otherwise, false. + */ + SetChecked(value: boolean): void; + /** + * Returns the text displayed within the button. + */ + GetText(): string; + /** + * Sets the text to be displayed within the button. + * @param value A string value specifying the text to be displayed within the button. + */ + SetText(value: string): void; + /** + * Returns the URL pointing to the image displayed within the button. + */ + GetImageUrl(): string; + /** + * Sets the URL pointing to the image displayed within the button. + * @param value A string value that is the URL to the image displayed within the button. + */ + SetImageUrl(value: string): void; + /** + * Sets a value specifying whether the button is enabled. + * @param value true to enable the button; false to disable it. + */ + SetEnabled(value: boolean): void; + /** + * Returns a value indicating whether the button is enabled. + */ + GetEnabled(): boolean; + /** + * Sets input focus to the button. + */ + Focus(): void; +} +/** + * A method that will handle the client Click event. + */ +interface ASPxClientButtonClickEventHandler { + /** + * A method that will handle the client Click event. + * @param source An object that is the event's source. + * @param e An ASPxClientButtonClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientButtonClickEventArgs): void; +} +/** + * Provides data for the Click event. + */ +interface ASPxClientButtonClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Specifies whether both the event's default action and the event's bubbling upon the hierarchy of event handlers should be canceled. + * Value: true to cancel the event's default action and the event's bubbling upon the hierarchy of event handlers; otherwise, false. + */ + cancelEventAndBubble: boolean; +} +/** + * Represents the client-side equivalent of the ASPxCalendar control. + */ +interface ASPxClientCalendar extends ASPxClientEdit { + /** + * Fires on the client side after the selected date has been changed within the calendar. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the month displayed within the calendar is changed. + */ + VisibleMonthChanged: ASPxClientEvent>; + /** + * Allows you to disable the calendar's days. + */ + CustomDisabledDate: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user presses a key while the editor has focus. + */ + KeyDown: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user presses and releases a key while the editor has focus. + */ + KeyPress: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user releases a pressed key while the editor has focus. + */ + KeyUp: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after the callback server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientCalendar. + */ + CallbackError: ASPxClientEvent>; + /** + * Tests whether the specified date is selected. + * @param date A date-time value that specifies the date to test. + */ + IsDateSelected(date: Date): boolean; + /** + * Sets the date that specifies the month and year to be displayed in the calendar. + * @param date The date that specifies calendar's visible month and year. + */ + SetVisibleDate(date: Date): void; + /** + * Sets the calendar's selected date. + * @param date A date object that specifies the calendar's selected date. + */ + SetSelectedDate(date: Date): void; + /** + * Returns the calendar's selected date. + */ + GetSelectedDate(): Date; + /** + * Gets the date that determines the month and year that are currently displayed in the calendar. + */ + GetVisibleDate(): Date; + /** + * Selects the specified date within the calendar. + * @param date A date-time value that specifies the selected date. + */ + SelectDate(date: Date): void; + /** + * Selects the specified range of dates within the calendar. + * @param start A date-time value that specifies the range's first date. + * @param end A date-time value that specifies the range's last date. + */ + SelectRange(start: Date, end: Date): void; + /** + * Deselects the specified date within the calendar. + * @param date A date-time value that specifies the date to deselect. + */ + DeselectDate(date: Date): void; + /** + * Deselects the specified range of dates within the calendar. + * @param start A date-time value that specifies the range's first date. + * @param end A date-time value that specifies the range's last date. + */ + DeselectRange(start: Date, end: Date): void; + /** + * Deselects all the selected dates within the calendar. + */ + ClearSelection(): void; + /** + * Returns a list of dates which are selected within the calendar. + */ + GetSelectedDates(): Date[]; + /** + * Gets the minimum date on the calendar. + */ + GetMinDate(): Date; + /** + * Sets the minimum date of the calendar. + * @param date A DateTime object representing the minimum date. + */ + SetMinDate(date: Date): void; + /** + * Gets the maximum date on the calendar. + */ + GetMaxDate(): Date; + /** + * Sets the maximum date of the calendar. + * @param date A DateTime object representing the maximum date. + */ + SetMaxDate(date: Date): void; +} +/** + * Provides data for the CustomDisabledDate event. + */ +interface ASPxClientCalendarCustomDisabledDateEventArgs extends ASPxClientEventArgs { + /** + * Gets the date processed in the calendar. + * Value: A DateTime value containing processed data. + */ + date: Date; + /** + * Gets or sets a value specifying whether selection of the processed calendar date is disabled. + * Value: true, if the date is disabled; otherwise, false. + */ + isDisabled: boolean; +} +/** + * A method that will handle the client CustomDisabledDate event. + */ +interface ASPxClientCalendarCustomDisabledDateEventHandler { + /** + * A method that will handle the client CustomDisabledDate event. + * @param source The event source. + * @param e An ASPxClientCalendarCustomDisabledDateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCalendarCustomDisabledDateEventArgs): void; +} +/** + * Represents the client-side equivalent of the ASPxCaptcha control. + */ +interface ASPxClientCaptcha extends ASPxClientControl { + /** + * Sets input focus to the control's text box. + */ + Focus(): void; + /** + * Refreshes the code displayed within the editor's challenge image. + */ + Refresh(): void; +} +/** + * Represents the client-side equivalent of the ASPxCheckBox control. + */ +interface ASPxClientCheckBox extends ASPxClientEdit { + /** + * Occurs on the client side when the editor's checked state is changed. + */ + CheckedChanged: ASPxClientEvent>; + /** + * Returns a value indicating whether the check box editor is checked. + */ + GetChecked(): boolean; + /** + * Sets a value which specifies the checked status of the check box editor. + * @param isChecked true if the check box editor is checked; otherwise, false. + */ + SetChecked(isChecked: boolean): void; + /** + * Returns the text displayed within the editor. + */ + GetText(): string; + /** + * Returns a value which specifies a check box checked state. + */ + GetCheckState(): string; + /** + * Sets a value specifying the state of a check box. + * @param checkState A string value matches one of the CheckState enumeration values. + */ + SetCheckState(checkState: string): void; + /** + * Sets the text to be displayed within the editor. + * @param text A string value specifying the text to be displayed within the editor. + */ + SetText(text: string): void; +} +/** + * Represents the client-side equivalent of the ASPxRadioButton control. + */ +interface ASPxClientRadioButton extends ASPxClientCheckBox { + /** + * Returns a value indicating whether the radio button is checked. + */ + GetChecked(): boolean; + /** + * Sets a value which specifies the radio button's checked status. + * @param isChecked true if the radio button is checked; otherwise, false. + */ + SetChecked(isChecked: boolean): void; +} +/** + * Represents a base for client-side objects which allow single-line text input. + */ +interface ASPxClientTextEdit extends ASPxClientEdit { + /** + * Occurs on the client-side when an end-user presses a key while the editor has focus. + */ + KeyDown: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user presses and releases a key while the editor has focus. + */ + KeyPress: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user releases a pressed key while the editor has focus. + */ + KeyUp: ASPxClientEvent>; + /** + * Fires on the client side when the editor's text is changed and focus moves out of the editor by end-user interactions. + */ + TextChanged: ASPxClientEvent>; + /** + * Returns the text displayed within the editor. + */ + GetText(): string; + /** + * Sets the text to be displayed within the editor. + * @param text A string value specifying the text to be displayed within the editor. + */ + SetText(text: string): void; + /** + * Selects all text in the text editor. + */ + SelectAll(): void; + /** + * Sets the caret position within the edited text. + * @param position An integer value that specifies the zero-based index of a text character that shall precede the caret. + */ + SetCaretPosition(position: number): void; + /** + * Obtains the caret position within the edited text. + */ + GetCaretPosition(): number; + /** + * Selects the specified portion of the editor's text. + * @param startPos A zero-based integer value specifying the selection's starting position. + * @param endPos A zero-based integer value specifying the selection's ending position. + * @param scrollToSelection true to scroll the editor's contents to make the selection visible; otherwise, false. + */ + SetSelection(startPos: number, endPos: number, scrollToSelection: boolean): void; +} +/** + * Represents a base for client-side editors which are capable of displaying and editing text data in their edit regions. + */ +interface ASPxClientTextBoxBase extends ASPxClientTextEdit { +} +/** + * Represents a base for client button editor objects. + */ +interface ASPxClientButtonEditBase extends ASPxClientTextBoxBase { + /** + * Occurs on the client side after an editor button is clicked. + */ + ButtonClick: ASPxClientEvent>; + /** + * Specifies whether the button is visible. + * @param number An integer value specifying the button's index within the Buttons collection. + * @param value true, to make the button visible; otherwise, false. + */ + SetButtonVisible(number: number, value: boolean): void; + /** + * Returns a value specifying whether a button is displayed. + * @param number An integer value specifying the button's index within the Buttons collection. + */ + GetButtonVisible(number: number): boolean; +} +/** + * Represents a base class for the editors that contain a drop down window. + */ +interface ASPxClientDropDownEditBase extends ASPxClientButtonEditBase { + /** + * Occurs on the client-side when the drop down window is opened. + */ + DropDown: ASPxClientEvent>; + /** + * Occurs on the client side when the drop down window is closed. + */ + CloseUp: ASPxClientEvent>; + /** + * Occurs on the client side before the drop down window is closed and allows you to cancel the operation. + */ + QueryCloseUp: ASPxClientEvent>; + /** + * Modifies the size of the drop down window in accordance with its content. + */ + AdjustDropDownWindow(): void; + /** + * Invokes the editor's drop down window. + */ + ShowDropDown(): void; + /** + * Closes the opened drop down window of the editor. + */ + HideDropDown(): void; +} +/** + * Represents the client-side equivalent of the ASPxColorEdit control. + */ +interface ASPxClientColorEdit extends ASPxClientDropDownEditBase { + /** + * Fires after the selected color has been changed within the color editor via end-user interaction. + */ + ColorChanged: ASPxClientEvent>; + /** + * This event is not in effect for the ASPxClientColorEdit. Use the ColorChanged event instead. + */ + TextChanged: ASPxClientEvent>; + /** + * Returns the color editor's value. + */ + GetColor(): string; + /** + * Specifies the color value for the color editor. + * @param value A string value specifying the editor color. + */ + SetColor(value: string): void; + /** + * Indicates whether the automatic color item is selected. + */ + IsAutomaticColorSelected(): boolean; +} +/** + * Represent the client-side equivalent of the ASPxComboBox control. + */ +interface ASPxClientComboBox extends ASPxClientDropDownEditBase { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientComboBox. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side after a different item in the list has been selected (focus has been moved from one item to another). + */ + SelectedIndexChanged: ASPxClientEvent>; + /** + * Specifies the text displayed within the editor's edit box. + * @param text A string value specifying the editor's text. + */ + SetText(text: string): void; + /** + * Adds a new item to the editor specifying the item's display text and returns the index of the added item. + * @param text A string value specifying the item's display text. + */ + AddItem(text: string): number; + /** + * Adds a new item to the editor specifying the item's display text and associated value, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + */ + AddItem(text: string, value: Object): number; + /** + * Adds a new item to the editor specifying the item's display text, associated value and displayed image, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + * @param imageUrl A string value specifying the path to the image displayed by the item. + */ + AddItem(text: string, value: Object, imageUrl: string): number; + /** + * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + * @param imageUrl A string value specifying the path to the image displayed by the item. + */ + InsertItem(index: number, text: string, value: Object, imageUrl: string): void; + /** + * Inserts a new item specified by its display text and associated value into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + */ + InsertItem(index: number, text: string, value: Object): void; + /** + * Inserts a new item specified by its display text into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + */ + InsertItem(index: number, text: string): void; + /** + * Removes an item specified by its index from the client list editor. + * @param index An integer value representing the index of the list item to be removed. + */ + RemoveItem(index: number): void; + /** + * Removes all items from the client combo box editor. + */ + ClearItems(): void; + /** + * Prevents the client combobox editor from being rendered until the EndUpdate method is called. + */ + BeginUpdate(): void; + /** + * Re-enables editor render operations after a call to the BeginUpdate method and forces an immediate re-rendering. + */ + EndUpdate(): void; + /** + * Scrolls the editor's item list, so that the specified item becomes visible. + * @param index An integer value that specifies the item's index within the editor's client item list. + */ + MakeItemVisible(index: number): void; + /** + * Returns an item specified by its index within the combo box editor's item collection. + * @param index An integer value specifying the zero-based index of the item to search for. + */ + GetItem(index: number): ASPxClientListEditItem; + /** + * Returns a combo box item by its text. + * @param text A string that specifies the item's text. + */ + FindItemByText(text: string): ASPxClientListEditItem; + /** + * Returns a combo box item by its value. + * @param value An object that specifies the item's value. + */ + FindItemByValue(value: Object): ASPxClientListEditItem; + /** + * Gets the number of items contained in the editor's item collection. + */ + GetItemCount(): number; + /** + * Returns the index of the selected item within the combo box editor. + */ + GetSelectedIndex(): number; + /** + * Sets the combobox editor's selected item specified by its index. + * @param index An integer value specifying the zero-based index of the item to select. + */ + SetSelectedIndex(index: number): void; + /** + * Returns the combo box editor's selected item. + */ + GetSelectedItem(): ASPxClientListEditItem; + /** + * Sets the list editor's selected item. + * @param item An ASPxClientListEditItem object that specifies the item to select. + */ + SetSelectedItem(item: ASPxClientListEditItem): void; + /** + * Gets the text displayed in the editor's edit box. + */ + GetText(): string; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + */ + AddItem(texts: string[]): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + */ + AddItem(texts: string[], value: Object): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + * @param imageUrl A string value specifying the path to the image displayed by the item. + */ + AddItem(texts: string[], value: Object, imageUrl: string): number; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + * @param imageUrl A String value specifying the path to the image displayed by the item. + */ + InsertItem(index: number, texts: string[], value: Object, imageUrl: string): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + */ + InsertItem(index: number, texts: string[], value: Object): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + */ + InsertItem(index: number, texts: string[]): void; + /** + * Determines whether the drop-down content is loaded; if not - loads the content. + * @param callbackFunction An object that is the JavaScript function that receives the callback data as a parameter. The function is performed after the combo box content is loaded. + */ + EnsureDropDownLoaded(callbackFunction: Object): void; + /** + * Defines the HTML content for the specified combo box item. + * @param index An integer value specifying the zero-based index of the item. + * @param html A string value that is the HTML code defining the content of the combo box item. + */ + SetItemHtml(index: number, html: string): void; + /** + * Sets the tooltip text for the combo box editor's item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param tooltip A string value specifying the tooltip text. + */ + SetItemTooltip(index: number, tooltip: string): void; + /** + * Sets the CSS class for a combo box item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param className A string value specifying the CSS class name. + */ + AddItemCssClass(index: number, className: string): void; + /** + * Removes the CSS class from a combo box item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param className A string value specifying the CSS class name. + */ + RemoveItemCssClass(index: number, className: string): void; + /** + * Defines the HTML content for the specified combo box item's text cell. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param html A string value that is the HTML code defining the content of the combo box item. + */ + SetItemTextCellHtml(itemIndex: number, textCellIndex: number, html: string): void; + /** + * Sets the tooltip text for the text cell of the editor's item specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param tooltip A string value specifying the tooltip text. + */ + SetItemTextCellTooltip(itemIndex: number, textCellIndex: number, tooltip: string): void; + /** + * Sets the CSS class for a combo box item's text cell specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param className A string value specifying the CSS class name. + */ + AddItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; + /** + * Removes the CSS class from a combo box item's text cell specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param className A string value specifying the CSS class name. + */ + RemoveItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; +} +/** + * Represents the client-side equivalent of the ASPxDateEdit control. + */ +interface ASPxClientDateEdit extends ASPxClientDropDownEditBase { + /** + * Fires after the selected date has been changed within the date editor. + */ + DateChanged: ASPxClientEvent>; + /** + * Enables you to convert the value entered by an end user into the value that will be stored by the date editor. + */ + ParseDate: ASPxClientEvent>; + /** + * Allows you to disable the calendar's days. + */ + CalendarCustomDisabledDate: ASPxClientEvent>; + /** + * This event is not in effect for the ASPxClientDateEdit. Use the DateChanged event instead. + */ + TextChanged: ASPxClientEvent>; + /** + * Returns the calendar of the date editor. + */ + GetCalendar(): ASPxClientCalendar; + /** + * Returns the built-in time edit control. + */ + GetTimeEdit(): ASPxClientTimeEdit; + /** + * Specifies the date for the editor. + * @param date A DateTime object that is the date. + */ + SetDate(date: Date): void; + /** + * Gets the date that is the editor's value. + */ + GetDate(): Date; + /** + * Returns the number of days in a range selected within a date edit. + */ + GetRangeDayCount(): number; + /** + * Gets the minimum date of the editor. + */ + GetMinDate(): Date; + /** + * Sets the minimum date of the editor. + * @param date A DateTime object representing the minimum date. + */ + SetMinDate(date: Date): void; + /** + * Gets the maximum date of the editor. + */ + GetMaxDate(): Date; + /** + * Sets the maximum date of the editor. + * @param date A DateTime object representing the maximum date. + */ + SetMaxDate(date: Date): void; +} +/** + * Provides data for the ParseDate client-side event that parses a string entered into a date editor. + */ +interface ASPxClientParseDateEventArgs extends ASPxClientEventArgs { + /** + * Gets the value entered into the date editor by an end user. + * Value: The string value entered into the date editor by an end user. + */ + value: string; + /** + * Gets or sets the edit value of the date editor. + * Value: A date/time value representing the edit value of the date editor. + */ + date: Date; + /** + * Gets or sets a value specifying whether the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * A method that will handle the client ParseDate event, that parses a date editor's value when entered. + */ +interface ASPxClientParseDateEventHandler { + /** + * A method that will handle the ParseDate event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientParseDateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientParseDateEventArgs): void; +} +/** + * Represents a base for client editor objects realizing the dropdown editor functionality. + */ +interface ASPxClientDropDownEdit extends ASPxClientDropDownEditBase { + /** + * Obtains the key value associated with the text displayed within the editor's edit box. + */ + GetKeyValue(): string; + /** + * Specifies the key value associated with the text displayed within the editor's edit box. + * @param keyValue A string specifying the key value associated with the editor's value (displayed text). + */ + SetKeyValue(keyValue: string): void; +} +/** + * A method that will handle the client events involving a keyboard key being pressed or released. + */ +interface ASPxClientEditKeyEventHandler { + /** + * A method that will handle the client events concerning a keyboard key being pressed. + * @param source The event source. This parameter identifies the editor which raised the event. + * @param e An ASPxClientEditKeyEventArgs object that contains event data. + */ + (source: S, e: ASPxClientEditKeyEventArgs): void; +} +/** + * Provides data for the client events involved with a key being pressed or released. + */ +interface ASPxClientEditKeyEventArgs extends ASPxClientEventArgs { + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle client validation events. + */ +interface ASPxClientEditValidationEventHandler { + /** + * A method that will handle client validation events. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientEditValidationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientEditValidationEventArgs): void; +} +/** + * Provides data for the client events that are related to data validation (see Validate). + */ +interface ASPxClientEditValidationEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets the error description. + * Value: A string representing the error description. + */ + errorText: string; + /** + * Gets or sets a value specifying whether the validated value is valid. + * Value: true if the value is valid; otherwise, false. + */ + isValid: boolean; + /** + * Gets or sets the editor's value being validated. + * Value: An object that represents the validated value. + */ + value: string; +} +/** + * Represents the client ASPxFilterControl. + */ +interface ASPxClientFilterControl extends ASPxClientControl { + /** + * Occurs after a new filter expression has been applied. + */ + Applied: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientFilterControl. + */ + CallbackError: ASPxClientEvent>; + /** + * Returns the filter expression. + */ + GetFilterExpression(): string; + /** + * Returns the applied filter expression. + */ + GetAppliedFilterExpression(): string; + /** + * Returns the editor used to edit operand values for the specified filter column. + * @param editorIndex An integer value that identifies the filter column by its index within the collection. + */ + GetEditor(editorIndex: number): ASPxClientEditBase; + /** + * Returns a value indicating whether the filter expression being currently composed on the client side is valid - all expression conditions are filled. + */ + IsFilterExpressionValid(): boolean; + /** + * Applies a filter constructed by an end-user. + */ + Apply(): void; + /** + * Resets the current filter expression to a previously applied filter expression. + */ + Reset(): void; +} +/** + * A method that will handle the Applied event. + */ +interface ASPxClientFilterAppliedEventHandler { + /** + * A method that will handle the Applied event. + * @param source The event source. + * @param e An ASPxClientFilterAppliedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFilterAppliedEventArgs): void; +} +/** + * Provides data for the Applied event. + */ +interface ASPxClientFilterAppliedEventArgs extends ASPxClientEventArgs { + /** + * Gets the filter expression currently being applied. + * Value: A string value that specifies the filter expression currently being applied. + */ + filterExpression: string; +} +/** + * Represents a base for client editor objects that display a list of items. + */ +interface ASPxClientListEdit extends ASPxClientEdit { + /** + * Occurs on the client side after a different item in the list has been selected (focus has been moved from one item to another). + */ + SelectedIndexChanged: ASPxClientEvent>; + /** + * Returns the list editor's selected item. + */ + GetSelectedItem(): ASPxClientListEditItem; + /** + * Returns the index of the selected item within the list editor. + */ + GetSelectedIndex(): number; + /** + * Sets the list editor's selected item. + * @param item An ASPxClientListEditItem object that specifies the item to select. + */ + SetSelectedItem(item: ASPxClientListEditItem): void; + /** + * Sets the list editor's selected item specified by its index. + * @param index An integer value specifying the zero-based index of the item to select. + */ + SetSelectedIndex(index: number): void; +} +/** + * Represents the client-side equivalent of the ListEditItem object. + */ +interface ASPxClientListEditItem { + /** + * Gets a value that indicates whether a list edit item is selected. + * Value: true if a list edit item is selected; otherwise, false. + */ + selected: boolean; + /** + * Gets an editor to which the current item belongs. + * Value: An ASPxClientListEdit object that represents the item's owner editor. + */ + listEditBase: ASPxClientListEdit; + /** + * Gets the item's index. + * Value: An integer value that represents the item's index within the corresponding editor's item collection. + */ + index: number; + /** + * Gets the item's associated image. + * Value: A string value that represents the path to the image displayed by the item. + */ + imageUrl: string; + /** + * Gets the item's display text. + * Value: A string value that represents the item's display text. + */ + text: string; + /** + * Gets the item's associated value. + * Value: An object that represents the value associated with the item. + */ + value: Object; + /** + * Returns the list item's value that corresponds to a column specified by its index. + * @param columnIndex An integer value that specifies the column's index within the editor's Columns collection. + */ + GetColumnText(columnIndex: number): string; + /** + * Returns the list item's value that corresponds to a column specified by its field name. + * @param columnName A string value that specifies the column's field name defined via the FieldName property. + */ + GetColumnText(columnName: string): string; +} +/** + * Represents the client-side equivalent of the ASPxListBox control. + */ +interface ASPxClientListBox extends ASPxClientListEdit { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientListBox. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side when an end-user presses a key while the editor has focus. + */ + KeyDown: ASPxClientEvent>; + /** + * Occurs on the client side when an end-user presses and releases a key while the editor has focus. + */ + KeyPress: ASPxClientEvent>; + /** + * Occurs on the client side when an end-user releases a pressed key while the editor has focus. + */ + KeyUp: ASPxClientEvent>; + /** + * Occurs on the client side after a different item in the list box has been selected (focus has been moved from one item to another). + */ + SelectedIndexChanged: ASPxClientEvent>; + /** + * Occurs on the client when the editor's item is double clicked. + */ + ItemDoubleClick: ASPxClientEvent>; + /** + * Gets the number of items contained in the editor's item collection. + */ + GetItemCount(): number; + /** + * Returns an item specified by its index within the list box editor's item collection. + * @param index An integer value specifying the zero-based index of the item to search for. + */ + GetItem(index: number): ASPxClientListEditItem; + /** + * Returns an array of the list editor's selected items indices. + */ + GetSelectedIndices(): number[]; + /** + * Returns an array of the list editor's selected items values. + */ + GetSelectedValues(): Object[]; + /** + * Returns an array of the list editor's selected items. + */ + GetSelectedItems(): ASPxClientListEditItem[]; + /** + * Selects all list box items. + */ + SelectAll(): void; + /** + * Unselects all list box items. + */ + UnselectAll(): void; + /** + * Selects the items with the specified indices within a list box. + * @param indices An array of integer values that represent the items indices. + */ + SelectIndices(indices: number[]): void; + /** + * Unselects an array of the list box items with the specified indices. + * @param indices An array of integer values that represent the indices. + */ + UnselectIndices(indices: number[]): void; + /** + * Selects the specified items within a list box. + * @param items An array of ASPxClientListEditItem objects that represent the items. + */ + SelectItems(items: ASPxClientListEditItem[]): void; + /** + * Unselects an array of the specified list box items. + * @param items An array of ASPxClientListEditItem objects that represent the items. + */ + UnselectItems(items: ASPxClientListEditItem[]): void; + /** + * Select the items with the specified values within a list box. + * @param values An array of Object[] objects that represent the item's values. + */ + SelectValues(values: Object[]): void; + /** + * Unselects an array of the list box items with the specified values. + * @param values An array of Object[] objects that represent the values. + */ + UnselectValues(values: Object[]): void; + /** + * Scrolls the editor's item list, so that the specified item becomes visible. + * @param index An integer value that specifies the item's index within the editor's client item list. + */ + MakeItemVisible(index: number): void; + /** + * Initializes the ASPxClientListBox client object when its parent container becomes visible dynamically, on the client side. + */ + InitOnContainerMadeVisible(): void; + /** + * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. + * @param text A string value specifying the item's display text. + */ + AddItem(text: string): number; + /** + * Adds a new item to the editor, specifying the item's display text and associated value, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + */ + AddItem(text: string, value: Object): number; + /** + * Adds a new item to the editor, specifying the item's display text, associated value and displayed image, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + * @param imageUrl A string value specifying the path to the image displayed by the item. + */ + AddItem(text: string, value: Object, imageUrl: string): number; + /** + * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + * @param imageUrl A string value specifying the path to the image displayed by the item. + */ + InsertItem(index: number, text: string, value: Object, imageUrl: string): void; + /** + * Inserts a new item specified by its display text and associated value into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + */ + InsertItem(index: number, text: string, value: Object): void; + /** + * Inserts a new item specified by its display text into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + */ + InsertItem(index: number, text: string): void; + /** + * Prevents the client list box editor from being rendered until the EndUpdate method is called. + */ + BeginUpdate(): void; + /** + * Re-enables editor render operations after a call to the BeginUpdate method, and forces an immediate re-rendering. + */ + EndUpdate(): void; + /** + * Removes all items from the client list box editor. + */ + ClearItems(): void; + /** + * Removes an item specified by its index from the client list editor. + * @param index An integer value representing the index of the list item to be removed. + */ + RemoveItem(index: number): void; + /** + * Returns a list box item by its text. + * @param text A string that specifies the item's text. + */ + FindItemByText(text: string): ASPxClientListEditItem; + /** + * Returns a list box item by its value. + * @param value An object that specifies the item's value. + */ + FindItemByValue(value: Object): ASPxClientListEditItem; + /** + * Sends a callback to the server, and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Adds a new item to the end of the editor's items collection, specifying the item's display text, and returns the index of the added item. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + */ + AddItem(texts: string[]): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + */ + AddItem(texts: string[], value: Object): number; + /** + * Adds a new item to the end of the editor's items collection, specifying the item's display text, associated value and displayed image, and returns the index of the added item. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + * @param imageUrl A String value specifying the path to the image displayed by the item. + */ + AddItem(texts: string[], value: Object, imageUrl: string): number; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + * @param imageUrl A String value specifying the path to the image displayed by the item. + */ + InsertItem(index: number, texts: string[], value: Object, imageUrl: string): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + */ + InsertItem(index: number, texts: string[], value: Object): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + */ + InsertItem(index: number, texts: string[]): void; + /** + * Defines the HTML content for the specified list box item. + * @param index An integer value specifying the zero-based index of the item. + * @param html A string value that is the HTML code defining the content of the list box item. + */ + SetItemHtml(index: number, html: string): void; + /** + * Sets the tooltip text for the list box editor's item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param tooltip A string value specifying the tooltip text. + */ + SetItemTooltip(index: number, tooltip: string): void; + /** + * Sets the CSS class for a list box item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param className A string value specifying the CSS class name. + */ + AddItemCssClass(index: number, className: string): void; + /** + * Removes the CSS class from a list box item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param className A string value specifying the CSS class name. + */ + RemoveItemCssClass(index: number, className: string): void; + /** + * Defines the HTML content for the specified list box item's text cell. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param html A string value that is the HTML code defining the content of the list box item. + */ + SetItemTextCellHtml(itemIndex: number, textCellIndex: number, html: string): void; + /** + * Sets the tooltip text for the text cell of the editor's item specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param tooltip A string value specifying the tooltip text. + */ + SetItemTextCellTooltip(itemIndex: number, textCellIndex: number, tooltip: string): void; + /** + * Sets the CSS class for a list box item's text cell specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param className A string value specifying the CSS class name. + */ + AddItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; + /** + * Removes the CSS class from a list box item's text cell specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param className A string value specifying the CSS class name. + */ + RemoveItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; +} +/** + * Serves as the base type for the ASPxClientRadioButtonList objects. + */ +interface ASPxClientCheckListBase extends ASPxClientListEdit { + /** + * Gets the number of items contained in the editor's item collection. + */ + GetItemCount(): number; + /** + * Returns the editor's item specified by its index. + * @param index An integer value specifying the zero-based index of the item to be retrieved. + */ + GetItem(index: number): ASPxClientListEditItem; +} +/** + * Represents the client-side equivalent of the ASPxRadioButtonList control. + */ +interface ASPxClientRadioButtonList extends ASPxClientCheckListBase { +} +/** + * A client-side equivalent of the ASPxCheckBoxList object. + */ +interface ASPxClientCheckBoxList extends ASPxClientCheckListBase { + /** + * Occurs on the client side after a different item in the check box list has been selected (focus has been moved from one item to another). + */ + SelectedIndexChanged: ASPxClientEvent>; + /** + * Returns an array of the check box list editor's selected items indices. + */ + GetSelectedIndices(): number[]; + /** + * Returns an array of the check box list editor's selected items values. + */ + GetSelectedValues(): Object[]; + /** + * Returns an array of the check box list editor's selected items. + */ + GetSelectedItems(): ASPxClientListEditItem[]; + /** + * Selects all check box list items. + */ + SelectAll(): void; + /** + * Unselects all check box list items. + */ + UnselectAll(): void; + /** + * Selects items with the specified indices within a check box list. + * @param indices An array of integer values that are the item indices. + */ + SelectIndices(indices: number[]): void; + /** + * Selects the specified items within a check box list. + * @param items An array of ASPxClientListEditItem objects that are the items. + */ + SelectItems(items: ASPxClientListEditItem[]): void; + /** + * Selects items with the specified values within a check box list. + * @param values An array of Object[] objects that are the item values. + */ + SelectValues(values: Object[]): void; + /** + * Unselects items with the specified indices within a check box list. + * @param indices An array of integer values that are the item indices. + */ + UnselectIndices(indices: number[]): void; + /** + * Unselects the specified items within a check box list. + * @param items An array of ASPxClientListEditItem objects that are the items. + */ + UnselectItems(items: ASPxClientListEditItem[]): void; + /** + * Unselects items with the specified values within a check box list. + * @param values An array of Object[] objects that are the item values. + */ + UnselectValues(values: Object[]): void; +} +/** + * A method that will handle the SelectedIndexChanged event. + */ +interface ASPxClientListEditItemSelectedChangedEventHandler { + /** + * A method that will handle the SelectedIndexChanged event. + * @param source The event source. + * @param e An ASPxClientListEditItemSelectedChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientListEditItemSelectedChangedEventArgs): void; +} +/** + * Provides data for the SelectedIndexChanged event. + */ +interface ASPxClientListEditItemSelectedChangedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the index of the item related to the event. + * Value: An integer value that represents the item's index within the corresponding editor's item collection. + */ + index: number; + /** + * Gets whether the item has been selected. + * Value: true if the item is selected; otherwise, false. + */ + isSelected: boolean; +} +/** + * Represents a client-side equivalent of the ASPxProgressBar control. + */ +interface ASPxClientProgressBar extends ASPxClientEditBase { + /** + * Sets the position of the operation's progress. + * @param position An integer value specifying the progress position. + */ + SetPosition(position: number): void; + /** + * Gets the position of the operation's progress. + */ + GetPosition(): number; + /** + * Sets the pattern used to format the displayed text for the progress bar. + * @param text A value that is the format pattern. + */ + SetCustomDisplayFormat(text: string): void; + /** + * Returns the text displayed within the progress bar. + */ + GetDisplayText(): string; + /** + * Sets the percentage representation of the progress position. + */ + GetPercent(): number; + /** + * Sets the minimum range value of the progress bar. + * @param min An integer value specifying the minimum value of the progress bar range. + */ + SetMinimum(min: number): void; + /** + * Sets the maximum range value of the progress bar. + * @param max An integer value specifying the maximum value of the progress bar range. + */ + SetMaximum(max: number): void; + /** + * Gets the minimum range value of the progress bar. + */ + GetMinimum(): number; + /** + * Gets the maximum range value of the progress bar. + */ + GetMaximum(): number; + /** + * Sets the minimum and maximum range values of the progress bar. + * @param minValue An integer value specifying the minimum value of the progress bar range. + * @param maxValue An integer value specifying the maximum value of the progress bar range. + */ + SetMinMaxValues(minValue: number, maxValue: number): void; +} +/** + * Represents a base class for the ASPxClientSpinEdit object. + */ +interface ASPxClientSpinEditBase extends ASPxClientButtonEditBase { + /** + * This event is not in effect for the ASPxClientSpinEditBase. Use the ASPxClientTimeEdit. + */ + TextChanged: ASPxClientEvent>; +} +/** + * Represents the client-side equivalent of the ASPxSpinEdit control. + */ +interface ASPxClientSpinEdit extends ASPxClientSpinEditBase { + /** + * Occurs on the client side when the editor's value is altered in any way. + */ + NumberChanged: ASPxClientEvent>; + /** + * Specifies the value of the spin edit control on the client side. + * @param number A Decimal value specifying the control value. + */ + SetValue(number: number): void; + /** + * Sets the spin editor's value. + * @param number A decimal number specifying the value to assign to the spin editor. + */ + SetNumber(number: number): void; + /** + * Gets a number which represents the spin editor's value. + */ + GetNumber(): number; + /** + * Returns the text displayed within the editor. + */ + GetText(): string; + /** + * Sets the minimum value of the editor. + * @param value A decimal value specifying the minimum value of the editor. + */ + SetMinValue(value: number): void; + /** + * Gets the minimum value of the editor. + */ + GetMinValue(): number; + /** + * Sets the maximum value of the editor. + * @param value A decimal value specifying the maximum value of the editor. + */ + SetMaxValue(value: number): void; + /** + * Gets the maximum value of the editor. + */ + GetMaxValue(): number; + /** + * Changes the editor's value. + * @param value An object representing the data to be assigned to the editor's edit value. + */ + SetValue(value: Object): void; +} +/** + * Represents the client-side equivalent of the ASPxTimeEdit control. + */ +interface ASPxClientTimeEdit extends ASPxClientSpinEditBase { + /** + * Fires after the selected date has been changed within the time editor. + */ + DateChanged: ASPxClientEvent>; + /** + * Specifies the date for the editor. + * @param date A DateTime object that is the date. + */ + SetDate(date: Date): void; + /** + * Gets the date that is the editor's value. + */ + GetDate(): Date; +} +/** + * Represents a base for client-side static editors whose values cannot be visually changed by end users. + */ +interface ASPxClientStaticEdit extends ASPxClientEditBase { + /** + * Occurs on the client side after an end-user clicks within a static editor. + */ + Click: ASPxClientEvent>; +} +/** + * A method that will handle client-side events which concern clicking within editors. + */ +interface ASPxClientEditEventHandler { + /** + * A method that will handle client-side events which concern clicking within editors. + * @param source An object representing the event source. Identifies the editor that raised the event. + * @param e An ASPxClientEditClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientEditClickEventArgs): void; +} +/** + * Provides data for the client-side events which concern clicking within editors. + */ +interface ASPxClientEditClickEventArgs extends ASPxClientEventArgs { + /** + * Gets the HTML element related to the event. + * Value: An object that represents the clicked HTML element. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Represents the client-side equivalent of the ASPxHyperLink control. + */ +interface ASPxClientHyperLink extends ASPxClientStaticEdit { + /** + * Gets an URL which defines the navigation location for the editor's hyperlink. + */ + GetNavigateUrl(): string; + /** + * Specifies an URL which defines the navigation location for the editor's hyperlink. + * @param url A string value which specifies an URL to where the client web browser will navigate when a hyperlink in the editor is clicked. + */ + SetNavigateUrl(url: string): void; + /** + * Gets the text caption displayed for the hyperlink in the hyperlink editor. + */ + GetText(): string; + /** + * Specifies the text caption displayed for the hyperlink in the hyperlink editor. + * @param text A string value specifying the text caption for the hyperlink in the editor. + */ + SetText(text: string): void; +} +/** + * Represents a base for client-side editors which are capable of displaying images. + */ +interface ASPxClientImageBase extends ASPxClientStaticEdit { + /** + * Sets the size of the image displayed within the image editor. + * @param width An integer value that specifies the image's width. + * @param height An integer value that specifies the image's height. + */ + SetSize(width: number, height: number): void; +} +/** + * Represents the client-side equivalent of the ASPxImage control. + */ +interface ASPxClientImage extends ASPxClientImageBase { + /** + * Returns the URL pointing to the image displayed within the image editor. + */ + GetImageUrl(): string; + /** + * Sets the URL which points to the image displayed within the image editor. + * @param url A string value specifying the URL to the image displayed within the editor. + */ + SetImageUrl(url: string): void; +} +/** + * Represents the client-side equivalent of the ASPxLabel control. + */ +interface ASPxClientLabel extends ASPxClientStaticEdit { + /** + * Returns the text displayed within the editor. + */ + GetText(): string; + /** + * Sets the text to be displayed within the editor. + * @param text A string value specifying the text to be displayed within the editor. + */ + SetText(text: string): void; +} +/** + * Represents the client-side equivalent of the ASPxTextBox control. + */ +interface ASPxClientTextBox extends ASPxClientTextBoxBase { +} +/** + * Represents the client-side equivalent of the ASPxMemo control. + */ +interface ASPxClientMemo extends ASPxClientTextEdit { +} +/** + * Represents the client-side equivalent of the ASPxButtonEdit control. + */ +interface ASPxClientButtonEdit extends ASPxClientButtonEditBase { +} +/** + * A method that will handle the ButtonClick event. + */ +interface ASPxClientButtonEditClickEventHandler { + /** + * A method that will handle the ButtonClick event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientButtonEditClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientButtonEditClickEventArgs): void; +} +/** + * Provides data for the ButtonClick event. + */ +interface ASPxClientButtonEditClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the index of the clicked button. + * Value: An integer value representing the index of the clicked button within the editor's Buttons collection. + */ + buttonIndex: number; +} +/** + * A client-side equivalent of the ASPxTokenBox object. + */ +interface ASPxClientTokenBox extends ASPxClientComboBox { + /** + * Fires on the client side after the token collection has been changed. + */ + TokensChanged: ASPxClientEvent>; + /** + * Adds a new token with the specified text to the end of the control's token collection. + * @param text A string value specifying the token's text. + */ + AddToken(text: string): void; + /** + * Removes a token specified by its text from the client token box. + * @param text A string value that is the text of the token to be removed. + */ + RemoveTokenByText(text: string): void; + /** + * Removes a token specified by its index from the client token box. + * @param index An integer value that is the index of the token to be removed. + */ + RemoveToken(index: number): void; + /** + * Returns an HTML span element that corresponds to the specified token. + * @param index An integer value that is the token index. + */ + GetTokenHtmlElement(index: number): Object; + /** + * Returns an HTML span element that corresponds to the specified token's text. + * @param index An integer value that is the token index. + */ + GetTokenTextHtmlElement(index: number): Object; + /** + * Returns an HTML span element that corresponds to the specified token's remove button. + * @param index An integer value that is the token index. + */ + GetTokenRemoveButtonHtmlElement(index: number): Object; + /** + * Returns a collection of tokens. + */ + GetTokenCollection(): string[]; + /** + * Sets a collection of tokens. + * @param collection A object that is the collection of tokens. + */ + SetTokenCollection(collection: string[]): void; + /** + * Removes all tokens contained in the token box. + */ + ClearTokenCollection(): void; + /** + * Returns the index of a token specified by its text. + * @param text A string value that specifies the text of the token. + */ + GetTokenIndexByText(text: string): number; + /** + * Gets the token texts, separated with a sign, specified by the TextSeparator property. + */ + GetText(): string; + /** + * Sets the token texts, separated with a sign, specified by the TextSeparator property. + * @param text A string value that is the token texts separated with a text separator. + */ + SetText(text: string): void; + /** + * Gets the editor value. + */ + GetValue(): string; + /** + * Sets the editor value. + * @param value A string that is the editor value. + */ + SetValue(value: string): void; + /** + * Returns a value that indicates if the specified token (string) is a custom token. + * @param text A string value that is a token. + * @param caseSensitive true, if tokens are case sensitive; otherwise, false. + */ + IsCustomToken(text: string, caseSensitive: boolean): boolean; + /** + * Changes the editor's value. + * @param value An object representing the data to be assigned to the editor's edit value. + */ + SetValue(value: Object): void; +} +/** + * The client-side equivalent of the ASPxTrackBar control. + */ +interface ASPxClientTrackBar extends ASPxClientEdit { + /** + * Fires on the client side before a track bar position is changed and allows you to cancel the action. + */ + PositionChanging: ASPxClientEvent>; + /** + * Fires after the editor's position has been changed. + */ + PositionChanged: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user moves a cursor while the drag handle is held down. + */ + Track: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user presses a drag handle and moves it. + */ + TrackStart: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user releases a drag handle after moving it. + */ + TrackEnd: ASPxClientEvent>; + /** + * Returns a track bar item index by the item's value. + * @param value An object that specifies the item's value. + */ + GetItemIndexByValue(value: Object): number; + /** + * Returns a track bar item's associated value. + * @param index An integer value that specifies the required item's index. + */ + GetItemValue(index: number): Object; + /** + * Returns a track bar item text. + * @param index An integer value that specifies the required item's index. + */ + GetItemText(index: number): string; + /** + * Returns a track bar item's tooltip text. + * @param index An integer value that specifies the required item's index. + */ + GetItemToolTip(index: number): string; + /** + * Returns the number of the track bar items that are maintained by the item collection. + */ + GetItemCount(): number; + /** + * Specifies the secondary drag handle position. + * @param position A value that specifies the position. + */ + SetPositionEnd(position: number): void; + /** + * Specifies the main drag handle position. + * @param position A value that specifies the position. + */ + SetPositionStart(position: number): void; + /** + * Returns the secondary drag handle position. + */ + GetPositionEnd(): number; + /** + * Returns the main drag handle position. + */ + GetPositionStart(): number; + /** + * Gets a drag handle position. + */ + GetPosition(): number; + /** + * Specifies a drag handle position. + * @param position A value that specifies the position. + */ + SetPosition(position: number): void; +} +/** + * A method that will handle the client PositionChanging event. + */ +interface ASPxClientTrackBarPositionChangingEventHandler { + /** + * A method that will handle the PositionChanging event. + * @param source The event source. Identifies the ASPxTrackBar control that raised the event. + * @param e A ASPxClientTrackBarPositionChangingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTrackBarPositionChangingEventArgs): void; +} +/** + * Provides data for the PositionChanging event. + */ +interface ASPxClientTrackBarPositionChangingEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; + /** + * Gets the current drag handle position. + * Value: A value that is the drag handle position. + */ + currentPosition: number; + /** + * Gets the current secondary drag handle position. + * Value: A value that is the drag handle position. + */ + currentPositionEnd: number; + /** + * Gets the current main drag handle position. + * Value: A value that is the drag handle position. + */ + currentPositionStart: number; + /** + * Gets a position where the drag handle is being moved. + * Value: A value that is the drag handle position. + */ + newPosition: number; + /** + * Gets a position where the secondary drag handle is being moved. + * Value: A value that is the drag handle position. + */ + newPositionEnd: number; + /** + * Gets a position where the main drag handle is being moved. + * Value: A value that is the drag handle position. + */ + newPositionStart: number; +} +/** + * Represents the client-side equivalent of the ASPxValidationSummary control. + */ +interface ASPxClientValidationSummary extends ASPxClientControl { + /** + * Occurs on the client side when the validation summary's visibility is changed. + */ + VisibilityChanged: ASPxClientEvent>; +} +/** + * A method that will handle the VisibilityChanged event. + */ +interface ASPxClientValidationSummaryVisibilityChangedEventHandler { + /** + * A method that will handle the VisibilityChanged client event. + * @param source An object representing the event source. + * @param e A ASPxClientValidationSummaryVisibilityChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientValidationSummaryVisibilityChangedEventArgs): void; +} +/** + * Provides data for the VisibilityChanged event. + */ +interface ASPxClientValidationSummaryVisibilityChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether the editor is visible on the client. + * Value: true if the editor is visible; otherwise, false. + */ + visible: boolean; +} +/** + * Represents the client ASPxGaugeControl. + */ +interface ASPxClientGaugeControl extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires when errors have occurred during callback processing. + */ + CallbackError: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * Lists values that specify the position relative to the target column in which a moved column should be placed. + */ +interface ASPxClientGridColumnMovingTargetPosition { + /** + * A moved column should be placed to the right of the target column. + */ + Right: number; + /** + * A moved column should be placed to the left of the target column. + */ + Left: number; + /** + * A moved column should be placed at the top of the target column. + */ + Top: number; + /** + * A moved column should be placed at the bottom of the target column. + */ + Bottom: number; +} +/** + * Represents the client ASPxGridView. + */ +interface ASPxClientGridBase extends ASPxClientControl { + /** + * Fires after a toolbar item has been clicked. + */ + ToolbarItemClick: ASPxClientEvent>; + /** + * Returns a toolbar specified by its name. + * @param name A string value specifying the toolbar name. + */ + GetToolbarByName(name: string): ASPxClientMenu; + /** + * Returns a grid's toolbar specified by its index. + * @param index An integer value specifying the zero-based index of the toolbar object to retrieve. + */ + GetToolbar(index: number): ASPxClientMenu; +} +/** + * Serves as a base object implementing the client column functionality. + */ +interface ASPxClientGridColumnBase { +} +/** + * A method that will handle the ToolbarItemClick event. + */ +interface ASPxClientGridToolbarItemClickEventHandler { + /** + * A method that will handle the ToolbarItemClick event. + * @param source The event source. + * @param e An ASPxClientGridToolbarItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridToolbarItemClickEventArgs): void; +} +/** + * Provides data for the ToolbarItemClick event. + */ +interface ASPxClientGridToolbarItemClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the toolbar index. + * Value: An integer value that is the toolbar index. + */ + toolbarIndex: number; + /** + * Gets the toolbar name. + * Value: A string value that is the toolbar name. + */ + toolbarName: string; + /** + * Gets the clicked toolbar item. + * Value: A ASPxClientMenuItem object that is the toolbar item. + */ + item: ASPxClientMenuItem; + /** + * Specifies whether a postback or a callback is used to finally process the event on the server side. + * Value: true to perform the round trip to the server side via postback; false to perform the round trip to the server side via callback. + */ + usePostBack: boolean; +} +/** + * The client-side equivalent of the ASPxGridLookup control. + */ +interface ASPxClientGridLookup extends ASPxClientDropDownEditBase { + /** + * Fires on the client when a data row is clicked within the built-in dropdown grid. + */ + RowClick: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Returns a client object representing the built-in dropdown grid. + */ + GetGridView(): ASPxClientGridView; + /** + * Confirms the current selection made by an end-user within the editor's dropdown grid. + */ + ConfirmCurrentSelection(): void; + /** + * Cancels the current selection made by an end-user within the editor's dropdown grid and rolls back to the last confirmed selection. The selection can be confirmed by either pressing the Enter key or calling the ConfirmCurrentSelection method. + */ + RollbackToLastConfirmedSelection(): void; +} +/** + * Represents the client ASPxCardView. + */ +interface ASPxClientCardView extends ASPxClientGridBase { + /** + * Provides access to the batch editing client API. + * Value: A object that exposes the batch editing client API methods. + */ + batchEditApi: ASPxClientCardViewBatchEditApi; + /** + * Occurs when a custom command button has been clicked. + */ + CustomButtonClick: ASPxClientEvent>; + /** + * Fires after the selection has been changed. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Enables you to prevent columns from being sorted. + */ + ColumnSorting: ASPxClientEvent>; + /** + * Occurs when a grid switches to batch edit mode. + */ + BatchEditStartEditing: ASPxClientEvent>; + /** + * Occurs when a grid leaves batch edit mode. + */ + BatchEditEndEditing: ASPxClientEvent>; + /** + * Enables you to prevent a batch edit confirmation message from being displayed. + */ + BatchEditConfirmShowing: ASPxClientEvent>; + /** + * Enables you to provide navigation for editors contained in a templated cell in Batch Edit mode. + */ + BatchEditTemplateCellFocused: ASPxClientEvent>; + /** + * Enables you to specify whether card data is valid and provide an error text. + */ + BatchEditCardValidating: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are saved in batch edit mode. + */ + BatchEditChangesSaving: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are canceled in batch edit mode. + */ + BatchEditChangesCanceling: ASPxClientEvent>; + /** + * Occurs on the client side before a card is inserted in batch edit mode. + */ + BatchEditCardInserting: ASPxClientEvent>; + /** + * Occurs on the client side before a card is deleted in batch edit mode. + */ + BatchEditCardDeleting: ASPxClientEvent>; + /** + * Occurs on the client side when the focused cell is about to be changed. + */ + FocusedCellChanging: ASPxClientEvent>; + /** + * Fires on the client when a card is clicked. + */ + CardClick: ASPxClientEvent>; + /** + * Fires on the client when a card is double clicked. + */ + CardDblClick: ASPxClientEvent>; + /** + * Fires in response to changing card focus. + */ + FocusedCardChanged: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any unhandled server error occurs during server-side processing of a callback sent by the ASPxClientCardView. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires after the customization window has been closed. + */ + CustomizationWindowCloseUp: ASPxClientEvent>; + /** + * Returns the value of the specified edit cell. + * @param column An ASPxClientCardViewColumn object that represents the data column within the client grid. + */ + GetEditValue(column: ASPxClientCardViewColumn): string; + /** + * Returns the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column within the grid's column collection. + */ + GetEditValue(columnIndex: number): string; + /** + * Returns the value of the specified edit cell. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + GetEditValue(columnFieldNameOrId: string): string; + /** + * Moves focus to the specified edit cell within the edited card. + * @param column An ASPxClientCardViewColumn object that represents the data column within the client grid. + */ + FocusEditor(column: ASPxClientCardViewColumn): void; + /** + * Moves focus to the specified edit cell within the edited card. + * @param columnIndex An integer value that specifies the column's position within the columns collection. + */ + FocusEditor(columnIndex: number): void; + /** + * Moves focus to the specified edit cell within the edited card. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + FocusEditor(columnFieldNameOrId: string): void; + /** + * Sets the value of the specified edit cell. + * @param column An ASPxClientCardViewColumn object that represents the data column within the client grid. + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(column: ASPxClientCardViewColumn, value: string): void; + /** + * Sets the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column within the grid's column collection. + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(columnIndex: number, value: string): void; + /** + * Sets the value of the specified edit cell. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(columnFieldNameOrId: string, value: string): void; + /** + * Displays the Filter Control. + */ + ShowFilterControl(): void; + /** + * Hides the Filter Control. + */ + CloseFilterControl(): void; + /** + * Enables or disables the current filter. + * @param isFilterEnabled true to enable the current filter; otherwise, false. + */ + SetFilterEnabled(isFilterEnabled: boolean): void; + /** + * Returns the current vertical scroll position of the grid's content. + */ + GetVerticalScrollPosition(): number; + /** + * Specifies the vertical scroll position for the grid's content. + * @param position An integer value specifying the vertical scroll position. + */ + SetVerticalScrollPosition(position: number): void; + /** + * Gets information about a focused cell. + */ + GetFocusedCell(): ASPxClientCardViewCellInfo; + /** + * Focuses the specified cell. + * @param cardVisibleIndex An value that specifies the visible index of the card. + * @param columnIndex A zero-based index that identifies the column in the column collection (the column's Index property value). + */ + SetFocusedCell(cardVisibleIndex: number, columnIndex: number): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientCardViewColumn object that represents the data column. + */ + SortBy(column: ASPxClientCardViewColumn): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + SortBy(columnIndex: number): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + SortBy(columnFieldNameOrId: string): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientCardViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(column: ASPxClientCardViewColumn, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(columnIndex: number, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(columnFieldNameOrId: string, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientCardViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(column: ASPxClientCardViewColumn, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(columnIndex: number, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(columnFieldNameOrId: string, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param column An ASPxClientCardViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex + */ + SortBy(column: ASPxClientCardViewColumn, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based column's index among the sorted columns. -1 if data is not sorted by this column. + */ + SortBy(columnIndex: number, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based column's index among the sorted columns. -1 if data is not sorted by this column. + */ + SortBy(columnFieldNameOrId: string, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Hides the specified column. + * @param column An ASPxClientCardViewColumn object that represents the column to hide. + */ + MoveColumn(column: ASPxClientCardViewColumn): void; + /** + * Hides the specified column. + * @param columnIndex An integer value that specifies the absolute index of the column to hide. + */ + MoveColumn(columnIndex: number): void; + /** + * Hides the specified column. + * @param columnFieldNameOrId A string value that identifies the column to be hidden by the name of the data source field to which the column is bound, or by the column's name. + */ + MoveColumn(columnFieldNameOrId: string): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param column An ASPxClientCardViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the ASPxCardView. + */ + MoveColumn(column: ASPxClientCardViewColumn, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the grid. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param columnFieldNameOrId A string value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the ASPxCardView. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param column An ASPxClientCardViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the CardView. + * @param moveBefore true, to move the column before the target column; otherwise, false. + */ + MoveColumn(column: ASPxClientCardViewColumn, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param columnFieldNameOrId A string value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Returns the key value of the specified card. + * @param visibleIndex An integer value that specifies the card's visible index. + */ + GetCardKey(visibleIndex: number): string; + /** + * Switches the CardView to edit mode. + * @param visibleIndex A zero-based integer that identifies a card to be edited. + */ + StartEditCard(visibleIndex: number): void; + /** + * Switches the ASPxCardView to edit mode. + * @param key An object that uniquely identifies a card to be edited. + */ + StartEditCardByKey(key: Object): void; + /** + * Indicates whether or not a new card is being edited. + */ + IsNewCardEditing(): boolean; + /** + * Adds a new record. + */ + AddNewCard(): void; + /** + * Deletes the specified card. + * @param visibleIndex An integer value that identifies the card. + */ + DeleteCard(visibleIndex: number): void; + /** + * Deletes a card with the specified key value. + * @param key An object that uniquely identifies the card. + */ + DeleteCardByKey(key: Object): void; + /** + * Returns the focused card's index. + */ + GetFocusedCardIndex(): number; + /** + * Moves focus to the specified card. + * @param visibleIndex An integer value that specifies the focused card's index. + */ + SetFocusedCardIndex(visibleIndex: number): void; + /** + * Selects all the unselected cards within the CardView. + */ + SelectCards(): void; + /** + * Selects the specified card displayed within the CardView. + * @param visibleIndex A zero-based integer value that specifies the card's visible index. + */ + SelectCards(visibleIndex: number): void; + /** + * Selects the specified cards within the CardView. + * @param visibleIndices An array of zero-based indices that identify data cards within the grid. + */ + SelectCards(visibleIndices: number[]): void; + /** + * Selects or deselects the specified cards within the CardView. + * @param visibleIndices An array of zero-based indices that identify data cards within the grid. + * @param selected true to select the specified cards; false to deselect the cards. + */ + SelectCards(visibleIndices: number[], selected: boolean): void; + /** + * Selects or deselects the specified card within the GridView. + * @param visibleIndex An integer zero-based index that identifies the data card within the grid. + * @param selected true to select the specified card; false to deselect the card. + */ + SelectCards(visibleIndex: number, selected?: boolean): void; + /** + * Selects or deselects the specified cards displayed within the CardView. + * @param keys An array of objects that uniquely identify the cards. + * @param selected true to select the specified cards; false to deselect the cards. + */ + SelectCardsByKey(keys: Object[], selected?: boolean): void; + /** + * Selects or deselects the specified card displayed within the CardView. + * @param key An object that uniquely identifies the card. + * @param selected true to select the specified card; false to deselect the card. + */ + SelectCardsByKey(key: Object, selected?: boolean): void; + /** + * Selects the specified cards displayed within the CardView. + * @param keys An array of objects that uniquely identify the cards. + */ + SelectCardsByKey(keys: Object[]): void; + /** + * Selects a card displayed within the CardView by its key. + * @param key An object that uniquely identifies the card. + */ + SelectCardsByKey(key: Object): void; + /** + * Deselects the specified cards displayed within the ASPxCardView. + * @param keys An array of objects that uniquely identify the cards. + */ + UnselectCardsByKey(keys: Object[]): void; + /** + * Deselects the specified card displayed within the ASPxCardView. + * @param key An object that uniquely identifies the card. + */ + UnselectCardsByKey(key: Object): void; + /** + * Deselects all the selected cards within the ASPxCardView. + */ + UnselectCards(): void; + /** + * Deselects the specified cards (if selected) within the ASPxCardView. + * @param visibleIndices An array of zero-based indices that identify data cards within the grid. + */ + UnselectCards(visibleIndices: number[]): void; + /** + * Deselects the specified cards (if selected) within the ASPxCardView. + * @param visibleIndex A zero-based integer value that specifies the card's visible index. + */ + UnselectCards(visibleIndex: number): void; + /** + * Deselects all grid cards that match the filter criteria currently applied to the CardView. + */ + UnselectFilteredCards(): void; + /** + * Selects the specified card displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the card's visible index. + */ + SelectCardOnPage(visibleIndex: number): void; + /** + * Selects or deselects the specified card displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the card's visible index. + * @param selected true to select the specified card; false to deselect the card. + */ + SelectCardOnPage(visibleIndex: number, selected?: boolean): void; + /** + * Deselects the specified cards (if selected) displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the card's visible index. + */ + UnselectCardOnPage(visibleIndex: number): void; + /** + * Selects all unselected cards displayed on the current page. + */ + SelectAllCardsOnPage(): void; + /** + * Allows you to select or deselect all cards displayed on the current page based on the parameter passed. + * @param selected true to select all unselected cards displayed on the current page; false to deselect all selected cards on the page. + */ + SelectAllCardsOnPage(selected: boolean): void; + /** + * Deselects all selected cards displayed on the current page. + */ + UnselectAllCardsOnPage(): void; + /** + * Returns the number of selected cards. + */ + GetSelectedCardCount(): number; + /** + * Indicates whether or not the specified card is selected within the current page. + * @param visibleIndex An integer value that identifies the card by its visible index. + */ + IsCardSelectedOnPage(visibleIndex: number): boolean; + /** + * Applies the specified search panel filter criterion to grid data. + * @param value A string value that specifies the filter criterion. + */ + ApplySearchPanelFilter(value: string): void; + /** + * Applies the specified filter expression to the grid. + * @param filterExpression A string value that specifies the filter expression. + */ + ApplyFilter(filterExpression: string): void; + /** + * Clears the filter expression applied to a client CardView. + */ + ClearFilter(): void; + /** + * Gets the Popup Edit Form. + */ + GetPopupEditForm(): ASPxClientPopupControl; + /** + * Sets input focus to the grid. + */ + Focus(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Selects the specified page. + * @param pageIndex An integer value that specifies the active page's index. + */ + GotoPage(pageIndex: number): void; + /** + * Gets the index of the page currently being selected. + */ + GetPageIndex(): number; + /** + * Gets the number of pages to which the grid's data is divided. + */ + GetPageCount(): number; + /** + * Activates the next page. + */ + NextPage(): void; + /** + * Activates the previous page. + */ + PrevPage(): void; + /** + * Returns the index of the first card displayed within the grid's active page. + */ + GetTopVisibleIndex(): number; + /** + * Indicates whether the grid is in edit mode. + */ + IsEditing(): boolean; + /** + * Saves all the changes made and switches the grid to browse mode. + */ + UpdateEdit(): void; + /** + * Cancels all the changes made and switches the CardView to browse mode. + */ + CancelEdit(): void; + /** + * Updates data displayed within the grid. + */ + Refresh(): void; + /** + * Indicates whether the customization window is displayed. + */ + IsCustomizationWindowVisible(): boolean; + /** + * Invokes the customization window. + */ + ShowCustomizationWindow(): void; + /** + * Invokes the customization window and displays it over the specified HTML element. + * @param showAtElement An object that specifies the HTML element relative to whose position the customization window is invoked. + */ + ShowCustomizationWindow(showAtElement?: Object): void; + /** + * Closes the customization window. + */ + HideCustomizationWindow(): void; + /** + * Returns the number of columns within the client grid. + */ + GetColumnCount(): number; + /** + * Returns the card values displayed within all selected cards. + * @param fieldNames The names of data source fields separated via a semicolon, whose values within the selected cards are returned. + * @param onCallback An ASPxClientCardViewValuesCallback object that represents the JavaScript function which receives the list of card values as a parameter. + */ + GetSelectedFieldValues(fieldNames: string, onCallback: ASPxClientCardViewValuesCallback): void; + /** + * Returns key values of selected cards displayed within the current page. + */ + GetSelectedKeysOnPage(): Object[]; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback An ASPxClientCardViewValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientCardViewValuesCallback): void; + /** + * Returns the values of the specified data source fields within the specified card. + * @param visibleIndex An integer value that identifies the data card. + * @param fieldNames The names of data source fields separated via a semicolon, whose values within the specified card are returned. + * @param onCallback An ASPxClientCardViewValuesCallback object that represents the JavaScript function which receives the list of card values as a parameter. + */ + GetCardValues(visibleIndex: number, fieldNames: string, onCallback: ASPxClientCardViewValuesCallback): void; + /** + * Returns the card values displayed within the current page. + * @param fieldNames The names of data source fields whose values are returned. + * @param onCallback An ASPxClientCardViewValuesCallback object that represents the JavaScript function which receives the list of card values as a parameter. + */ + GetPageCardValues(fieldNames: string, onCallback: ASPxClientCardViewValuesCallback): void; + /** + * Returns the number of cards actually displayed within the active page. + */ + GetVisibleCardsOnPage(): number; + /** + * Returns the client column that resides at the specified position within the column collection. + * @param columnIndex A zero-based index that identifies the column within the column collection (the column's Index property value). + */ + GetColumn(columnIndex: number): ASPxClientCardViewColumn; + /** + * Returns the column with the specified unique identifier. + * @param columnId A string value that specifies the column's unique identifier (the column's Name property value). + */ + GetColumnById(columnId: string): ASPxClientCardViewColumn; + /** + * Returns the client column which is bound to the specified data source field. + * @param columnFieldName A string value that specifies the name of the data source field to which the column is bound (the column's FieldName property value). + */ + GetColumnByField(columnFieldName: string): ASPxClientCardViewColumn; + /** + * Returns the editor used to edit the specified column's values. + * @param column An ASPxClientCardViewColumn object that specifies the required column within the client grid. + */ + GetEditor(column: ASPxClientCardViewColumn): ASPxClientEdit; + /** + * Returns the editor used to edit the specified column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + GetEditor(columnIndex: number): ASPxClientEdit; + /** + * Returns the editor used to edit the specified column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + GetEditor(columnFieldNameOrId: string): ASPxClientEdit; +} +/** + * Represents a client column. + */ +interface ASPxClientCardViewColumn extends ASPxClientGridColumnBase { + /** + * Gets the name that uniquely identifies the column. + * Value: A string value assigned to the column's Name property. + */ + name: string; + /** + * Gets the column's position within the collection. + * Value: An integer zero-bazed index that specifies the column's position within the collection. + */ + index: number; + /** + * Gets the name of the database field assigned to the current column. + * Value: A string value that specifies the name of a data field. + */ + fieldName: string; + /** + * Gets whether the column is visible. + * Value: true to display the column; otherwise, false. + */ + visible: boolean; +} +/** + * Represents a JavaScript function which receives the list of card values when the client GetSelectedFieldValues method is called. + */ +interface ASPxClientCardViewValuesCallback { + /** + * Represents a JavaScript function which receives the list of card values when the client GetSelectedFieldValues method is called. + * @param result An object that represents the list of card values received from the server. + */ + (result: Object): void; +} +/** + * A method that will handle the cancelable events of a client ASPxCardView column. + */ +interface ASPxClientCardViewColumnCancelEventHandler { + /** + * A method that will handle the cancelable events of a client ASPxCardView column. + * @param source The event source. This parameter identifies the ASPxClientCardView object that raised the event. + * @param e An ASPxClientCardViewColumnCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewColumnCancelEventArgs): void; +} +/** + * Provides data for the cancelable events of a client ASPxCardView column. + */ +interface ASPxClientCardViewColumnCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed client column. + * Value: An ASPxClientCardViewColumn object that represents the processed column. + */ + column: ASPxClientCardViewColumn; +} +/** + * A method that will handle the CardClick event. + */ +interface ASPxClientCardViewCardClickEventHandler { + /** + * A method that will handle the CardClick event. + * @param source The event source. This parameter identifies the ASPxClientCardView object that raised the event. + * @param e An ASPxClientCardViewCardClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewCardClickEventArgs): void; +} +/** + * Provides data for the CardClick event. + */ +interface ASPxClientCardViewCardClickEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed card's visible index. + * Value: An integer zero-based index that identifies the processed record. + */ + visibleIndex: number; + /** + * Provides access to the parameters associated with the CardClick event. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; +} +/** + * A method that will handle the CustomButtonClick event. + */ +interface ASPxClientCardViewCustomButtonEventHandler { + /** + * A method that will handle the CustomButtonClick event. + * @param source The event source. This parameter identifies the ASPxClientCardView object that raised the event. + * @param e An ASPxClientCardViewCustomButtonEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewCustomButtonEventArgs): void; +} +/** + * Provides data for the CustomButtonClick event. + */ +interface ASPxClientCardViewCustomButtonEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the value which identifies the card whose custom button has been clicked. + * Value: An integer value that identifies the card whose custom button has been clicked. + */ + visibleIndex: number; + /** + * Gets the value which identifies the custom button. + * Value: A string value that identifies the clicked custom button. + */ + buttonID: string; +} +/** + * A method that will handle the SelectionChanged event. + */ +interface ASPxClientCardViewSelectionEventHandler { + /** + * A method that will handle the SelectionChanged event. + * @param source The event source. + * @param e An ASPxClientCardViewSelectionEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewSelectionEventArgs): void; +} +/** + * Provides data for the SelectionChanged event. + */ +interface ASPxClientCardViewSelectionEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the visible index of the card whose selected state has been changed. + * Value: An value that specifies the visible index of the card. + */ + visibleIndex: number; + /** + * Gets whether the card has been selected. + * Value: true if the card has been selected; otherwise, false. + */ + isSelected: boolean; + /** + * Gets whether all cards displayed within a page have been selected or unselected. + * Value: true if all cards displayed within a page have been selected or unselected; otherwise, false. + */ + isAllRecordsOnPage: boolean; + /** + * Gets whether a selection has been changed on the server. + * Value: true if a selection has been changed on the server; otherwise, false. + */ + isChangedOnServer: boolean; +} +/** + * A method that will handle the client BatchEditStartEditing event. + */ +interface ASPxClientCardViewBatchEditStartEditingEventHandler { + /** + * A method that will handle the BatchEditStartEditing event. + * @param source The event source. + * @param e An ASPxClientCardViewBatchEditStartEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditStartEditingEventArgs): void; +} +/** + * Provides data for the BatchEditStartEditing event. + */ +interface ASPxClientCardViewBatchEditStartEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the card whose cells are about to be edited. + * Value: An value that specifies the visible index of the card. + */ + visibleIndex: number; + /** + * Gets the CardView column that owns a cell that is about to be edited. + * Value: An object that is the focused CardView column. + */ + focusedColumn: ASPxClientCardViewColumn; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: A hashtable that stores information about editable cells. + */ + cardValues: Object; +} +/** + * A method that will handle the client BatchEditEndEditing event. + */ +interface ASPxClientCardViewBatchEditEndEditingEventHandler { + /** + * A method that will handle the BatchEditEndEditing event. + * @param source The event source. + * @param e An ASPxClientCardViewBatchEditEndEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditEndEditingEventArgs): void; +} +/** + * Provides data for the BatchEditEndEditing event. + */ +interface ASPxClientCardViewBatchEditEndEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the card whose cells have been edited. + * Value: An value that specifies the visible index of the card. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: A hashtable that stores information about editable cells. + */ + cardValues: Object; +} +/** + * A method that will handle the client BatchEditCardValidating event. + */ +interface ASPxClientCardViewBatchEditCardValidatingEventHandler { + /** + * A method that will handle the BatchEditCardValidating event. + * @param source The event source. + * @param e An ASPxClientCardViewBatchEditCardValidatingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditCardValidatingEventArgs): void; +} +/** + * Provides data for the BatchEditCardValidating event. + */ +interface ASPxClientCardViewBatchEditCardValidatingEventArgs extends ASPxClientEventArgs { + /** + * Gets the processed card's visible index. + * Value: An integer value that specifies the processed card's visible index. + */ + visibleIndex: number; + /** + * Provides validation information of a card currently being validated. + * Value: An object that is a hashtable containing validation information. + */ + validationInfo: Object; +} +/** + * Represents an object that will handle the client-side BatchEditConfirmShowing event. + */ +interface ASPxClientCardViewBatchEditConfirmShowingEventHandler { + /** + * A method that will handle the BatchEditConfirmShowing client event. + * @param source The event source. + * @param e An ASPxClientCardViewBatchEditConfirmShowingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditConfirmShowingEventArgs): void; +} +/** + * Provides data for the BatchEditConfirmShowing event. + */ +interface ASPxClientCardViewBatchEditConfirmShowingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the client identifier of an object that initiates a send request. + * Value: A string value that specifies the object client identifier. + */ + requestTriggerID: string; +} +/** + * A method that will handle the client BatchEditTemplateCellFocused event. + */ +interface ASPxClientCardViewBatchEditTemplateCellFocusedEventHandler { + /** + * A method that will handle the BatchEditTemplateCellFocused event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientCardViewBatchEditTemplateCellFocusedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditTemplateCellFocusedEventArgs): void; +} +/** + * Provides data for the BatchEditTemplateCellFocused event. + */ +interface ASPxClientCardViewBatchEditTemplateCellFocusedEventArgs extends ASPxClientEventArgs { + /** + * Gets the currently processed column. + * Value: An object that is the client-side column object. + */ + column: ASPxClientCardViewColumn; + /** + * Gets or sets a value specifying whether the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * A method that will handle the BatchEditChangesSaving event. + */ +interface ASPxClientCardViewBatchEditChangesSavingEventHandler { + /** + * A method that will handle the BatchEditChangesSaving event. + * @param source The event source. This parameter identifies the card view object which raised the event. + * @param e An ASPxClientCardViewBatchEditChangesSavingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditChangesSavingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesSaving event. + */ +interface ASPxClientCardViewBatchEditChangesSavingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * A method that will handle the BatchEditChangesCanceling event. + */ +interface ASPxClientCardViewBatchEditChangesCancelingEventHandler { + /** + * A method that will handle the BatchEditChangesCanceling event. + * @param source The event source. This parameter identifies the card view object which raised the event. + * @param e An ASPxClientCardViewBatchEditChangesCancelingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditChangesCancelingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesCanceling event. + */ +interface ASPxClientCardViewBatchEditChangesCancelingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * A method that will handle the BatchEditCardInserting event. + */ +interface ASPxClientCardViewBatchEditCardInsertingEventHandler { + /** + * A method that will handle the BatchEditCardInserting event. + * @param source The event source. This parameter identifies the card view object which raised the event. + * @param e An ASPxClientCardViewBatchEditCardInsertingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditCardInsertingEventArgs): void; +} +/** + * Provides data for the BatchEditCardInserting event. + */ +interface ASPxClientCardViewBatchEditCardInsertingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed card visible index. + * Value: An integer value that specifies the processed card visible index. + */ + visibleIndex: number; +} +/** + * A method that will handle the BatchEditCardDeleting event. + */ +interface ASPxClientCardViewBatchEditCardDeletingEventHandler { + /** + * A method that will handle the BatchEditCardDeleting event. + * @param source The event source. This parameter identifies the card view object which raised the event. + * @param e An ASPxClientCardViewBatchEditCardDeletingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditCardDeletingEventArgs): void; +} +/** + * Provides data for the BatchEditCardDeleting event. + */ +interface ASPxClientCardViewBatchEditCardDeletingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed card visible index. + * Value: An integer value that specifies the processed card visible index. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + cardValues: Object; +} +/** + * A method that will handle the FocusedCellChanging event. + */ +interface ASPxClientCardViewFocusedCellChangingEventHandler { + /** + * A method that will handle the FocusedCellChanging event. + * @param source The event source. + * @param e An ASPxClientCardViewFocusedCellChangingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewFocusedCellChangingEventArgs): void; +} +/** + * Provides data for the FocusedCellChanging event. + */ +interface ASPxClientCardViewFocusedCellChangingEventArgs extends ASPxClientCancelEventArgs { + /** + * Provides information of a card's cell currently being focused. + * Value: A ASPxClientCardViewCellInfo object that provides information about the card's cell. + */ + cellInfo: ASPxClientCardViewCellInfo; +} +/** + * Provides members related to Batch Edit Mode + */ +interface ASPxClientCardViewBatchEditApi { + /** + * Performs validation of CardView data contained in the cards when the CardView operates in Batch Edit mode. + * @param validateOnlyModified true, if only modified cards should be validated; otherwise, false. + */ + ValidateCards(validateOnlyModified?: boolean): boolean; + /** + * Performs validation of CardView data contained in the specified card when the CardView operates in Batch Edit mode. + * @param visibleIndex An integer value specifying the visible index of the validated card. + */ + ValidateCard(visibleIndex: number): boolean; + /** + * Returns an array of card visible indices. + * @param includeDeleted true, to include visible indices of deleted cards to the returned array; otherwise, false. + */ + GetCardVisibleIndices(includeDeleted: boolean): number[]; + /** + * Returns an array of the deleted card visible indices. + */ + GetDeletedCardIndices(): number[]; + /** + * Returns an array of the inserted card visible indices. + */ + GetInsertedCardIndices(): number[]; + /** + * Indicates if the card with the specified visible index is deleted. + * @param visibleIndex An integer value that identifies the card by its visible index. + */ + IsDeletedCard(visibleIndex: number): boolean; + /** + * Indicates if the card with the specified visible index is newly created. + * @param visibleIndex An integer value that identifies the card by its visible index. + */ + IsNewCard(visibleIndex: number): boolean; + /** + * Programmatically moves the focus to the previous cell in the card + */ + MoveFocusBackward(): boolean; + /** + * Programmatically moves the focus to the next cell in the card. + */ + MoveFocusForward(): boolean; + /** + * Sets the value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the card containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param value An object that contains the new cell value. + */ + SetCellValue(visibleIndex: number, columnFieldNameOrId: string, value: Object): void; + /** + * Sets the value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the card containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param value An object that contains the new cell value. + * @param displayText A string value that specifies the cell display text. + * @param cancelCellHighlighting true to cancel highlighting of the modified cell, false to highlight the modified cell. + */ + SetCellValue(visibleIndex: number, columnFieldNameOrId: string, value: Object, displayText: string, cancelCellHighlighting?: boolean): void; + /** + * Gets the value of the specified cell. + * @param visibleIndex A zero-based integer value that specifies the visible index of a card containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param initial true, to return the initial (server) value; false, to return a value currently contained on the client side (modified value). + */ + GetCellValue(visibleIndex: number, columnFieldNameOrId: string, initial?: boolean): Object; + /** + * Gets a container holding a data cell content. + * @param visibleIndex An integer value that is the visible index. + * @param columnFieldNameOrId A string value that is the column's Field Name or ID. + */ + GetCellTextContainer(visibleIndex: number, columnFieldNameOrId: string): Object; + /** + * Gets information about the cell currently being edited. + */ + GetEditCellInfo(): ASPxClientCardViewCellInfo; + /** + * Returns a value that indicates whether the card view has changed data. + */ + HasChanges(): boolean; + /** + * Returns a value that indicates whether the specified card has changed data. + * @param visibleIndex An integer value that specifies the visible index of a card. + */ + HasChanges(visibleIndex: number): boolean; + /** + * Returns a value that indicates whether the specified cell's data has been changed. + * @param visibleIndex An integer value that specifies the visible index of a card. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + HasChanges(visibleIndex: number, columnFieldNameOrId: string): boolean; + /** + * Resets changes in the specified card. + * @param visibleIndex An integer value that specifies the visible index of a card. + */ + ResetChanges(visibleIndex: number): void; + /** + * Resets changes in the specified cell. + * @param visibleIndex An integer value that specifies the visible index of a card containing the processed cell. + * @param columnIndex A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + */ + ResetChanges(visibleIndex: number, columnIndex: number): void; + /** + * Switches the specified cell to edit mode. + * @param visibleIndex A zero-based integer value that specifies the visible index of a card containing the processed cell. + * @param columnIndex A zero-based integer value that identifies the column which contains the processed cell in the column collection. + */ + StartEdit(visibleIndex: number, columnIndex: number): void; + /** + * Ends cell or card editing. + */ + EndEdit(): void; +} +/** + * Contains information on a grid cell. + */ +interface ASPxClientCardViewCellInfo { + /** + * Gets the visible index of the card that contains the cell currently being processed. + * Value: An value that specifies the visible index of the card. + */ + cardVisibleIndex: number; + /** + * Gets the data column that contains the cell currently being processed. + * Value: An object that is the data column which contains the processed cell. + */ + column: ASPxClientCardViewColumn; +} +/** + * A client-side equivalent of the ASPxGridView object. + */ +interface ASPxClientGridView extends ASPxClientGridBase { + /** + * Provides access to the batch editing client API. + * Value: A object that exposes the batch editing client API methods. + */ + batchEditApi: ASPxClientGridViewBatchEditApi; + /** + * Occurs when a custom command button has been clicked. + */ + CustomButtonClick: ASPxClientEvent>; + /** + * Fires after the selection has been changed. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Enables you to prevent columns from being sorted. + */ + ColumnSorting: ASPxClientEvent>; + /** + * Fires in response to changing row focus. + */ + FocusedRowChanged: ASPxClientEvent>; + /** + * Enables you to cancel data grouping. + */ + ColumnGrouping: ASPxClientEvent>; + /** + * Fires when an end-user starts dragging the column's header and enables you to cancel this operation. + */ + ColumnStartDragging: ASPxClientEvent>; + /** + * Enables you to prevent columns from being resized. + */ + ColumnResizing: ASPxClientEvent>; + /** + * Occurs after a column's width has been changed by an end-user. + */ + ColumnResized: ASPxClientEvent>; + /** + * Enables you to control column movement. + */ + ColumnMoving: ASPxClientEvent>; + /** + * Fires before a group row is expanded. + */ + RowExpanding: ASPxClientEvent>; + /** + * Fires before a group row is collapsed. + */ + RowCollapsing: ASPxClientEvent>; + /** + * Fires before a detail row is expanded. + */ + DetailRowExpanding: ASPxClientEvent>; + /** + * Fires before a detail row is collapsed. + */ + DetailRowCollapsing: ASPxClientEvent>; + /** + * Fires on the client when a data row is clicked. + */ + RowClick: ASPxClientEvent>; + /** + * Fires on the client when a data row is double clicked. + */ + RowDblClick: ASPxClientEvent>; + /** + * Occurs after an end-user right clicks in the GridView, and enables you to provide a custom context menu. + */ + ContextMenu: ASPxClientEvent>; + /** + * Fires on the client side when a context menu item has been clicked. + */ + ContextMenuItemClick: ASPxClientEvent>; + /** + * Enables you to specify whether row data is valid and provide an error text. + */ + BatchEditRowValidating: ASPxClientEvent>; + /** + * Enables you to prevent a batch edit confirmation message from being displayed. + */ + BatchEditConfirmShowing: ASPxClientEvent>; + /** + * Occurs when a grid switches to batch edit mode. + */ + BatchEditStartEditing: ASPxClientEvent>; + /** + * Occurs when a grid leaves the batch edit mode. + */ + BatchEditEndEditing: ASPxClientEvent>; + /** + * Enables you to provide navigation for editors contained in a templated cell in Batch Edit mode. + */ + BatchEditTemplateCellFocused: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are saved in batch edit mode. + */ + BatchEditChangesSaving: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are canceled in batch edit mode. + */ + BatchEditChangesCanceling: ASPxClientEvent>; + /** + * Occurs on the client side before a data row is inserted in batch edit mode. + */ + BatchEditRowInserting: ASPxClientEvent>; + /** + * Occurs on the client side before a data row is deleted in batch edit mode. + */ + BatchEditRowDeleting: ASPxClientEvent>; + /** + * Occurs on the client side when the focused cell is about to be changed. + */ + FocusedCellChanging: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any unhandled server error occurs during server-side processing of a callback sent by the ASPxClientGridView. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires after the Customization Window has been closed. + */ + CustomizationWindowCloseUp: ASPxClientEvent>; + /** + * Selects or deselects the specified row displayed within the grid. + * @param key An object that uniquely identifies the row. + * @param selected true to select the specified row; false to deselect the row. + */ + SelectRowsByKey(key: Object, selected?: boolean): void; + /** + * Selects the specified rows displayed within the grid. + * @param keys An array of objects that uniquely identify the rows. + */ + SelectRowsByKey(keys: Object[]): void; + /** + * Selects a grid row by its key. + * @param key An object that uniquely identifies the row. + */ + SelectRowsByKey(key: Object): void; + /** + * Deselects the specified rows displayed within the grid. + * @param keys An array of objects that uniquely identify the rows. + */ + UnselectRowsByKey(keys: Object[]): void; + /** + * Deselects the specified row displayed within the grid. + * @param key An object that uniquely identifies the row. + */ + UnselectRowsByKey(key: Object): void; + /** + * Deselects all the selected rows within the grid. + */ + UnselectRows(): void; + /** + * Deselects the specified rows (if selected) within the grid. + * @param visibleIndices An array of zero-based indices that identify data rows within the grid. + */ + UnselectRows(visibleIndices: number[]): void; + /** + * Deselects the specified row (if selected) within the grid. + * @param visibleIndex A zero-based integer value that specifies the row's visible index. + */ + UnselectRows(visibleIndex: number): void; + /** + * Deselects all grid rows that match the filter criteria currently applied to the grid. + */ + UnselectFilteredRows(): void; + /** + * Selects the specified row displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the row's visible index. + */ + SelectRowOnPage(visibleIndex: number): void; + /** + * Selects or deselects the specified row displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the row's visible index. + * @param selected true to select the specified row; false to deselect the row. + */ + SelectRowOnPage(visibleIndex: number, selected?: boolean): void; + /** + * Deselects the specified row (if selected) displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the row's visible index. + */ + UnselectRowOnPage(visibleIndex: number): void; + /** + * Selects all unselected rows displayed on the current page. + */ + SelectAllRowsOnPage(): void; + /** + * Allows you to select or deselect all rows displayed on the current page based on the parameter passed. + * @param selected true to select all unselected rows displayed on the current page; false to deselect all selected rows on the page. + */ + SelectAllRowsOnPage(selected: boolean): void; + /** + * Deselects all selected rows displayed on the current page. + */ + UnselectAllRowsOnPage(): void; + /** + * Returns the number of selected rows. + */ + GetSelectedRowCount(): number; + /** + * Indicates whether or not the specified row is selected within the current page. + * @param visibleIndex An integer value that identifies the row by its visible index. + */ + IsRowSelectedOnPage(visibleIndex: number): boolean; + /** + * Indicates whether the specified row is a group row. + * @param visibleIndex An integer value that identifies the row by its visible index. + */ + IsGroupRow(visibleIndex: number): boolean; + /** + * Indicates whether the specified row is a data row. + * @param visibleIndex An integer value that identifies the row by its visible index. + */ + IsDataRow(visibleIndex: number): boolean; + /** + * Indicates whether the specified group row is expanded. + * @param visibleIndex An integer value that identifies the group row by its visible index. + */ + IsGroupRowExpanded(visibleIndex: number): boolean; + /** + * Returns the current vertical scroll position of the grid's content. + */ + GetVertScrollPos(): number; + /** + * Returns the current horizontal scroll position of the grid's content. + */ + GetHorzScrollPos(): number; + /** + * Returns the current horizontal scroll position of the grid's content. + */ + GetHorizontalScrollPosition(): number; + /** + * Specifies the vertical scroll position for the grid's content. + * @param position An integer value specifying the vertical scroll position. + */ + SetVertScrollPos(position: number): void; + /** + * Specifies the horizontal scroll position for the grid's content. + * @param position An integer value specifying the horizontal scroll position. + */ + SetHorzScrollPos(position: number): void; + /** + * Specifies the horizontal scroll position for the grid's content. + * @param position An integer value specifying the horizontal scroll position. + */ + SetHorizontalScrollPosition(position: number): void; + /** + * Sets the scrollability of various types of grid rows when the grid displays fixed columns. + * @param scrollableRowSettings An object specifying which types of grid rows should or should not be scrollable. + */ + SetFixedColumnScrollableRows(scrollableRowSettings: Object): void; + /** + * Applies a filter specified in the filter row to the GridView. + */ + ApplyOnClickRowFilter(): void; + /** + * Returns the editor used to edit the value in the auto filter row for the specified data column. + * @param column An ASPxClientGridViewColumn object that represents the data colum within the ASPxGridView. + */ + GetAutoFilterEditor(column: ASPxClientGridViewColumn): Object; + /** + * Returns the editor used to edit the value in the auto filter row for the specified data column. + * @param columnIndex An integer value that identifies the data column by its index. + */ + GetAutoFilterEditor(columnIndex: number): Object; + /** + * Returns the editor used to edit the value in the auto filter row for the specified data column. + * @param columnFieldNameOrId A string value that specifies the column's name or its data base field name. + */ + GetAutoFilterEditor(columnFieldNameOrId: string): Object; + /** + * Applies a filter to the specified data column. + * @param column An ASPxClientGridViewColumn object that represents the data column within the client GridView. + * @param val A string value that specifies the filter expression. + */ + AutoFilterByColumn(column: ASPxClientGridViewColumn, val: string): void; + /** + * Applies a filter to the specified data column. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param val A string value that specifies the filter expression. + */ + AutoFilterByColumn(columnIndex: number, val: string): void; + /** + * Applies a filter to the specified data column. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param val A string value that specifies the filter expression. + */ + AutoFilterByColumn(columnFieldNameOrId: string, val: string): void; + /** + * Applies the specified search panel filter criterion to grid data. + * @param value A string value that specifies the filter criterion. + */ + ApplySearchPanelFilter(value: string): void; + /** + * Applies the specified filter expression to the GridView. + * @param filterExpression A string value that specifies the filter expression. + */ + ApplyFilter(filterExpression: string): void; + /** + * Clears the filter expression applied to a client GridView. + */ + ClearFilter(): void; + /** + * Gets the Popup Edit Form. + */ + GetPopupEditForm(): ASPxClientPopupControl; + /** + * Sets input focus to the grid. + */ + Focus(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Selects the specified page. + * @param pageIndex An integer value that specifies the active page's index. + */ + GotoPage(pageIndex: number): void; + /** + * Gets the index of the page currently being selected. + */ + GetPageIndex(): number; + /** + * Gets the number of pages to which the grid's data is divided. + */ + GetPageCount(): number; + /** + * Activates the next page. + */ + NextPage(): void; + /** + * Activates the previous page. + */ + PrevPage(): void; + /** + * Returns the index of the first data row displayed within the GridView's active page. + */ + GetTopVisibleIndex(): number; + /** + * Indicates whether the grid is in edit mode. + */ + IsEditing(): boolean; + /** + * Saves all the changes made and switches the grid to browse mode. + */ + UpdateEdit(): void; + /** + * Cancels all the changes made and switches the GridView to browse mode. + */ + CancelEdit(): void; + /** + * Updates data displayed within the grid. + */ + Refresh(): void; + /** + * Indicates whether the Customization Window is displayed. + */ + IsCustomizationWindowVisible(): boolean; + /** + * Invokes the Customization Window. + */ + ShowCustomizationWindow(): void; + /** + * Invokes the Customization Window and displays it over the specified HTML element. + * @param showAtElement An object that specifies the HTML element relative to whose position the customization window is invoked. + */ + ShowCustomizationWindow(showAtElement?: Object): void; + /** + * Closes the Customization Window. + */ + HideCustomizationWindow(): void; + /** + * Returns the number of columns within the client GridView. + */ + GetColumnsCount(): number; + /** + * Returns the number of columns within the client GridView. + */ + GetColumnCount(): number; + /** + * Returns the row values displayed within all selected rows. + * @param fieldNames The names of data source fields separated via a semicolon, whose values within the selected rows are returned. + * @param onCallback A ASPxClientGridViewValuesCallback object that represents the JavaScript function which receives the list of row values as a parameter. + */ + GetSelectedFieldValues(fieldNames: string, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Returns key values of selected rows displayed within the current page. + */ + GetSelectedKeysOnPage(): Object[]; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientGridViewValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Returns the values of the specified data source fields within the specified row. + * @param visibleIndex An integer value that identifies the data row. + * @param fieldNames The names of data source fields separated via a semicolon, whose values within the specified row are returned. + * @param onCallback An ASPxClientGridViewValuesCallback object that represents the JavaScript function which receives the list of row values as a parameter. + */ + GetRowValues(visibleIndex: number, fieldNames: string, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Returns the row values displayed within the current page. + * @param fieldNames The names of data source fields whose values are returned. + * @param onCallback A ASPxClientGridViewValuesCallback object that represents the JavaScript function which receives the list of row values as a parameter. + */ + GetPageRowValues(fieldNames: string, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Returns the number of rows actually displayed within the active page. + */ + GetVisibleRowsOnPage(): number; + /** + * Returns the client column that resides at the specified position within the column collection. + * @param columnIndex A zero-based index that identifies the column within the column collection (the column's Index property value). + */ + GetColumn(columnIndex: number): ASPxClientGridViewColumn; + /** + * Returns the column with the specified unique identifier. + * @param columnId A string value that specifies the column's unique identifier (the column's Name property value). + */ + GetColumnById(columnId: string): ASPxClientGridViewColumn; + /** + * Returns the client column which is bound to the specified data source field. + * @param columnFieldName A string value that specifies the name of the data source field to which the column is bound (the column's FieldName property value). + */ + GetColumnByField(columnFieldName: string): ASPxClientGridViewColumn; + /** + * Returns the editor used to edit the specified column's values. + * @param column An ASPxClientGridViewColumn object that specifies the required column within the client grid. + */ + GetEditor(column: ASPxClientGridViewColumn): ASPxClientEdit; + /** + * Returns the editor used to edit the specified column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + GetEditor(columnIndex: number): ASPxClientEdit; + /** + * Returns the editor used to edit the specified column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + GetEditor(columnFieldNameOrId: string): ASPxClientEdit; + /** + * Returns the value of the specified edit cell. + * @param column An ASPxClientGridViewColumn object that represents the data column within the client grid. + */ + GetEditValue(column: ASPxClientGridViewColumn): string; + /** + * Returns the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column within the grid's column collection. + */ + GetEditValue(columnIndex: number): string; + /** + * Returns the value of the specified edit cell. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + GetEditValue(columnFieldNameOrId: string): string; + /** + * Moves focus to the specified edit cell within the edited row. + * @param column An ASPxClientGridViewColumn object that represents the data column within the client grid. + */ + FocusEditor(column: ASPxClientGridViewColumn): void; + /** + * Moves focus to the specified edit cell within the edited row. + * @param columnIndex An integer value that specifies the column's position within the columns collection. + */ + FocusEditor(columnIndex: number): void; + /** + * Moves focus to the specified edit cell within the edited row. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + FocusEditor(columnFieldNameOrId: string): void; + /** + * Sets the value of the specified edit cell. + * @param column An ASPxClientGridViewColumn object that represents the data column within the client grid. + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(column: ASPxClientGridViewColumn, value: string): void; + /** + * Sets the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column within the grid's column collection. + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(columnIndex: number, value: string): void; + /** + * Sets the value of the specified edit cell. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(columnFieldNameOrId: string, value: string): void; + /** + * Displays the Filter Control. + */ + ShowFilterControl(): void; + /** + * Hides the Filter Control. + */ + CloseFilterControl(): void; + /** + * Enables or disables the current filter. + * @param isFilterEnabled true to enable the current filter; otherwise, false. + */ + SetFilterEnabled(isFilterEnabled: boolean): void; + /** + * Returns the current vertical scroll position of the grid's content. + */ + GetVerticalScrollPosition(): number; + /** + * Specifies the vertical scroll position for the grid's content. + * @param position An integer value specifying the vertical scroll position. + */ + SetVerticalScrollPosition(position: number): void; + /** + * Gets information about a focused cell. + */ + GetFocusedCell(): ASPxClientGridViewCellInfo; + /** + * Focuses the specified cell. + * @param rowVisibleIndex An integer value that specifies the visible index of the row. + * @param columnIndex A zero-based index that identifies the column in the column collection (the column's Index property value). + */ + SetFocusedCell(rowVisibleIndex: number, columnIndex: number): void; + /** + * Invokes the Customization Dialog and displays it over the grid. + */ + ShowCustomizationDialog(): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientGridViewColumn object that represents the data column. + */ + SortBy(column: ASPxClientGridViewColumn): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + SortBy(columnIndex: number): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + SortBy(columnFieldNameOrId: string): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientGridViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(column: ASPxClientGridViewColumn, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(columnIndex: number, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(columnFieldNameOrId: string, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientGridViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(column: ASPxClientGridViewColumn, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(columnIndex: number, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(columnFieldNameOrId: string, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param column An ASPxClientGridViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based column's index among the sorted columns. -1 if data is not sorted by this column. + */ + SortBy(column: ASPxClientGridViewColumn, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based column's index among the sorted columns. -1 if data is not sorted by this column. + */ + SortBy(columnIndex: number, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based column's index among the sorted columns. -1 if data is not sorted by this column. + */ + SortBy(columnFieldNameOrId: string, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Hides the specified column. + * @param column An ASPxClientGridViewColumn object that represents the column to hide. + */ + MoveColumn(column: ASPxClientGridViewColumn): void; + /** + * Hides the specified column. + * @param columnIndex An integer value that specifies the absolute index of the column to hide. + */ + MoveColumn(columnIndex: number): void; + /** + * Hides the specified column. + * @param columnFieldNameOrId A String value that identifies the column to be hidden by the name of the data source field to which the column is bound, or by the column's name. + */ + MoveColumn(columnFieldNameOrId: string): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param column An ASPxClientGridViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the grid. + */ + MoveColumn(column: ASPxClientGridViewColumn, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the grid. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param columnFieldNameOrId A String value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the grid. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param column An ASPxClientGridViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + */ + MoveColumn(column: ASPxClientGridViewColumn, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param columnFieldNameOrId A string value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups the grid's data by this column. + * @param column An ASPxClientGridViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the grid's data by the column; otherwise, false. + */ + MoveColumn(column: ASPxClientGridViewColumn, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups the grid's data by this column. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the ASPxGridView's data by the column; otherwise, false. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups the grid's data by this column. + * @param columnFieldNameOrId A string value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the grid's data by the column; otherwise, false. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups or ungroups the grid's data by this column. + * @param column An ASPxClientGridViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the grid's data by the column; otherwise, false. + * @param moveFromGroup true to ungroup the grid's data by the column; otherwise, false. + */ + MoveColumn(column: ASPxClientGridViewColumn, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean, moveFromGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups or ungroups the grid's data by this column. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the grid's data by the column; otherwise, false. + * @param moveFromGroup true to ungroup the grid's data by the column; otherwise, false. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean, moveFromGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups or ungroups the grid's data by this column. + * @param columnFieldNameOrId A string value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the grid's data by the column; otherwise, false. + * @param moveFromGroup true to ungroup the grid's data by the column; otherwise, false. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean, moveFromGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the grid. + * @param targetPosition An ASPxClientGridColumnMovingTargetPosition enumeration value specifying the position relative to the target column in which to place the moved column. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, targetPosition: ASPxClientGridColumnMovingTargetPosition): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param columnFieldNameOrId A String value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the grid. + * @param targetPosition An ASPxClientGridColumnMovingTargetPosition enumeration value specifying the position relative to the target column in which to place the moved column. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, targetPosition: ASPxClientGridColumnMovingTargetPosition): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups or ungroups the grid's data by this column. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param targetPosition An ASPxClientGridColumnMovingTargetPosition enumeration value specifying the position relative to the target column in which to place the moved column. + * @param moveToGroup true, to group the ASPxGridView's data by the column; otherwise, false. + * @param moveFromGroup true, to ungroup the grid's data by the column; otherwise, false. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, targetPosition: ASPxClientGridColumnMovingTargetPosition, moveToGroup: boolean, moveFromGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups or ungroups the grid's data by this column. + * @param columnFieldNameOrId A string value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param targetPosition An ASPxClientGridColumnMovingTargetPosition enumeration value specifying the position relative to the target column in which to place the moved column. + * @param moveToGroup true, to group the grid's data by the column; otherwise, false. + * @param moveFromGroup true, to ungroup the grid's data by the column; otherwise, false. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, targetPosition: ASPxClientGridColumnMovingTargetPosition, moveToGroup: boolean, moveFromGroup: boolean): void; + /** + * Groups data by the values of the specified column. + * @param column An ASPxClientGridViewColumn object that represents the data column by whose values data is grouped. + */ + GroupBy(column: ASPxClientGridViewColumn): void; + /** + * Groups data by the values of the specified column. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + GroupBy(columnIndex: number): void; + /** + * Groups data by the values of the specified column. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + GroupBy(columnFieldNameOrId: string): void; + /** + * Groups data by the values of the specified data column. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param column An ASPxClientGridViewColumn object that represents the data column by whose values data is grouped. + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + */ + GroupBy(column: ASPxClientGridViewColumn, groupIndex: number): void; + /** + * Groups data by the values of the specified data column. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + */ + GroupBy(columnIndex: number, groupIndex: number): void; + /** + * Groups data by the values of the specified data column. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + */ + GroupBy(columnFieldNameOrId: string, groupIndex: number): void; + /** + * Groups data by the values of the specified data column with the specified sort order. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param column An ASPxClientGridViewColumn object that represents the data column by whose values data is grouped. + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + * @param sortOrder A string value that specifies the column's sort order. + */ + GroupBy(column: ASPxClientGridViewColumn, groupIndex: number, sortOrder: string): void; + /** + * Groups data by the values of the specified data column with the specified sort order. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + * @param sortOrder A string value that specifies the column's sort order. + */ + GroupBy(columnIndex: number, groupIndex: number, sortOrder: string): void; + /** + * Groups data by the values of the specified data column with the specified sort order. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + * @param sortOrder A string value that specifies the column's sort order. + */ + GroupBy(columnFieldNameOrId: string, groupIndex: number, sortOrder: string): void; + /** + * Ungroups data by the values of the specified column. + * @param column An ASPxClientGridViewColumn object that represents the data column within the ASPxGridView. + */ + UnGroup(column: ASPxClientGridViewColumn): void; + /** + * Ungroups data by the values of the specified column. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + UnGroup(columnIndex: number): void; + /** + * Ungroups data by the values of the specified column. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + UnGroup(columnFieldNameOrId: string): void; + /** + * Ungroups data by the values of a specified column. + * @param column A ASPxClientGridViewColumn object that is the grid column. + */ + Ungroup(column: ASPxClientGridViewColumn): void; + /** + * Ungroups data by the values of a specified column. + * @param columnIndex An integer value that is the column index. + */ + Ungroup(columnIndex: number): void; + /** + * Ungroups data by the values of a specified column. + * @param columnFieldNameOrId A string value that is the column's FieldName or ID. + */ + Ungroup(columnFieldNameOrId: string): void; + /** + * Expands all group rows. + */ + ExpandAll(): void; + /** + * Collapses all group rows. + */ + CollapseAll(): void; + /** + * Expands all detail rows. + */ + ExpandAllDetailRows(): void; + /** + * Collapses all detail rows. + */ + CollapseAllDetailRows(): void; + /** + * Expands the specified group row preserving the collapsed state of any child group row. + * @param visibleIndex An integer value that identifies the group row. + */ + ExpandRow(visibleIndex: number): void; + /** + * Expands the specified group row and optionally child group rows at all nesting levels. + * @param visibleIndex An integer value that identifies the group row. + * @param recursive true to expand any child group rows at all nesting levels; false to preserve the collapsed state of any child group rows. + */ + ExpandRow(visibleIndex: number, recursive?: boolean): void; + /** + * Collapses the specified group row preserving the expanded state of child group rows. + * @param visibleIndex An integer value that identifies the group row by its visible index. + */ + CollapseRow(visibleIndex: number): void; + /** + * Collapses the specified group row and optionally child group rows at all nesting levels. + * @param visibleIndex An integer value that identifies the group row by its visible index. + * @param recursive true to collapse child group rows at all nesting levels; false to preserve the expanded state of any child group row. + */ + CollapseRow(visibleIndex: number, recursive?: boolean): void; + /** + * Scrolls the view to the specified row. + * @param visibleIndex An integer value that identifies a row by its visible index. + */ + MakeRowVisible(visibleIndex: number): void; + /** + * Expands the specified detail row. + * @param visibleIndex A zero-based integer index that identifies the detail row. + */ + ExpandDetailRow(visibleIndex: number): void; + /** + * Collapses the specified detail row. + * @param visibleIndex A zero-based integer index that identifies the detail row. + */ + CollapseDetailRow(visibleIndex: number): void; + /** + * Returns the key value of the specified data row. + * @param visibleIndex An integer value that specifies the row's visible index. + */ + GetRowKey(visibleIndex: number): string; + /** + * Switches the grid to edit mode. + * @param visibleIndex A zero-based integer that identifies a data row to be edited. + */ + StartEditRow(visibleIndex: number): void; + /** + * Switches the grid to edit mode. + * @param key An object that uniquely identifies a data row to be edited. + */ + StartEditRowByKey(key: Object): void; + /** + * Indicates whether or not a new row is being edited. + */ + IsNewRowEditing(): boolean; + /** + * Adds a new record. + */ + AddNewRow(): void; + /** + * Deletes the specified row. + * @param visibleIndex An integer value that identifies the row. + */ + DeleteRow(visibleIndex: number): void; + /** + * Deletes a row with the specified key value. + * @param key An object that uniquely identifies the row. + */ + DeleteRowByKey(key: Object): void; + /** + * Returns the focused row's index. + */ + GetFocusedRowIndex(): number; + /** + * Moves focus to the specified row. + * @param visibleIndex An integer value that specifies the focused row's index. + */ + SetFocusedRowIndex(visibleIndex: number): void; + /** + * Selects all the unselected rows within the grid. + */ + SelectRows(): void; + /** + * Selects the specified row displayed within the grid. + * @param visibleIndex A zero-based integer value that specifies the row's visible index. + */ + SelectRows(visibleIndex: number): void; + /** + * Selects the specified rows within the grid. + * @param visibleIndices An array of zero-based indices that identify data rows within the grid. + */ + SelectRows(visibleIndices: number[]): void; + /** + * Selects or deselects the specified rows within the grid. + * @param visibleIndices An array of zero-based indices that identify data rows within the grid. + * @param selected true to select the specified rows; false to deselect the rows. + */ + SelectRows(visibleIndices: number[], selected: boolean): void; + /** + * Selects or deselects the specified row within the grid. + * @param visibleIndex An integer zero-based index that identifies the data row within the grid. + * @param selected true to select the specified row; false to deselect the row. + */ + SelectRows(visibleIndex: number, selected?: boolean): void; + /** + * Selects or deselects the specified rows displayed within the grid. + * @param keys An array of objects that uniquely identify the rows. + * @param selected true to select the specified rows; false to deselect the rows. + */ + SelectRowsByKey(keys: Object[], selected?: boolean): void; +} +/** + * A client grid column. + */ +interface ASPxClientGridViewColumn extends ASPxClientGridColumnBase { + /** + * Gets the column's unique identifier. + * Value: A string value that specifies the column's unique identifier. + */ + id: string; + /** + * Gets the name that uniquely identifies the column. + * Value: A string value assigned to the column's Name property. + */ + name: string; + /** + * Gets the column's position within the collection. + * Value: An integer zero-bazed index that specifies the column's position within the collection. + */ + index: number; + /** + * Gets the name of the database field assigned to the current column. + * Value: A string value that specifies the name of a data field. + */ + fieldName: string; + /** + * Gets whether the column is visible. + * Value: true to display the column; otherwise, false. + */ + visible: boolean; +} +/** + * Represents a JavaScript function which receives the list of row values when the client GetSelectedFieldValues method is called. + */ +interface ASPxClientGridViewValuesCallback { + /** + * Represents a JavaScript function which receives the list of row values when the client GetSelectedFieldValues method is called. + * @param result An object that represents the list of row values received from the server. + */ + (result: Object): void; +} +/** + * A method that will handle the cancelable events of a client ASPxGridView column. + */ +interface ASPxClientGridViewColumnCancelEventHandler { + /** + * A method that will handle the cancelable events of a client ASPxGridView column. + * @param source The event source. + * @param e An ASPxClientGridViewColumnCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewColumnCancelEventArgs): void; +} +/** + * Provides data for the cancelable events of a client ASPxGridView column. + */ +interface ASPxClientGridViewColumnCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed client column. + * Value: An ASPxClientGridViewColumn object that represents the processed column. + */ + column: ASPxClientGridViewColumn; +} +/** + * A method that will handle the client events concerned with column processing. + */ +interface ASPxClientGridViewColumnProcessingModeEventHandler { + /** + * A method that will handle the client events concerned with column processing. + * @param source The event source. + * @param e A ASPxClientGridViewColumnProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewColumnProcessingModeEventArgs): void; +} +/** + * Provides data for the client events concerned with column processing, and that allow the event's processing to be passed to the server side. + */ +interface ASPxClientGridViewColumnProcessingModeEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets a grid column related to the event. + * Value: An ASPxClientGridViewColumn object representing the column related to the event. + */ + column: ASPxClientGridViewColumn; +} +/** + * A method that will handle the RowExpanding events. + */ +interface ASPxClientGridViewRowCancelEventHandler { + /** + * A method that will handle the RowExpanding events. + * @param source The event source. + * @param e An ASPxClientGridViewRowCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewRowCancelEventArgs): void; +} +/** + * Provides data for the RowExpanding events. + */ +interface ASPxClientGridViewRowCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed row's visible index. + * Value: An integer zero-based index that identifies the processed row. + */ + visibleIndex: number; +} +/** + * A method that will handle the SelectionChanged event. + */ +interface ASPxClientGridViewSelectionEventHandler { + /** + * A method that will handle the SelectionChanged event. + * @param source The event source. + * @param e An ASPxClientGridViewSelectionEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewSelectionEventArgs): void; +} +/** + * Provides data for the SelectionChanged event. + */ +interface ASPxClientGridViewSelectionEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the visible index of the row whose selected state has been changed. + * Value: An value that specifies the visible index of the row. + */ + visibleIndex: number; + /** + * Gets whether the row has been selected. + * Value: true if the row has been selected; otherwise, false. + */ + isSelected: boolean; + /** + * Gets whether all rows displayed within a page have been selected or unselected. + * Value: true if all rows displayed within a page have been selected or unselected; otherwise, false. + */ + isAllRecordsOnPage: boolean; + /** + * Gets whether a selection has been changed on the server. + * Value: true if a selection has been changed on the server; otherwise, false. + */ + isChangedOnServer: boolean; +} +/** + * A method that will handle the RowClick events. + */ +interface ASPxClientGridViewRowClickEventHandler { + /** + * A method that will handle the RowClick event. + * @param source The event source. This parameter identifies the ASPxClientGridView object that raised the event. + * @param e An ASPxClientGridViewRowClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewRowClickEventArgs): void; +} +/** + * Provides data for the RowClick event. + */ +interface ASPxClientGridViewRowClickEventArgs extends ASPxClientGridViewRowCancelEventArgs { + /** + * Provides access to the parameters associated with the RowClick event. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; +} +/** + * A method that will handle the ContextMenu event. + */ +interface ASPxClientGridViewContextMenuEventHandler { + /** + * A method that will handle the ContextMenu event. + * @param source The event source. + * @param e An ASPxClientGridViewContextMenuEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewContextMenuEventArgs): void; +} +/** + * Provides data for the ContextMenu event. + */ +interface ASPxClientGridViewContextMenuEventArgs extends ASPxClientEventArgs { + /** + * Gets which grid element has been right clicked by the user. + * Value: A String value that specifies grid element. + */ + objectType: string; + /** + * Identifies the grid element being right clicked by the user. + * Value: A zero-based integer index that identifies the grid element being clicked by the user. + */ + index: number; + /** + * Provides access to the parameters associated with the ContextMenu event. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; + /** + * Gets the currently processed menu object. + * Value: An object that is the currently processed menu. + */ + menu: Object; + /** + * Specifies whether a browser context menu should be displayed. + * Value: true, to display a browser context menu; otherwise, false. The default is false. + */ + showBrowserMenu: boolean; +} +/** + * A method that will handle the client ContextMenuItemClick event. + */ +interface ASPxClientGridViewContextMenuItemClickEventHandler { + /** + * A method that will handle the ContextMenuItemClick event. + * @param source The event source. + * @param e An ASPxClientGridViewContextMenuItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewContextMenuItemClickEventArgs): void; +} +/** + * Provides data for the ContextMenuItemClick event. + */ +interface ASPxClientGridViewContextMenuItemClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the clicked context menu item. + * Value: An object, manipulations on which forced the event to be raised. + */ + item: ASPxClientMenuItem; + /** + * Gets which grid element has been right clicked by the user. + * Value: A String value that specifies the grid element. + */ + objectType: string; + /** + * Returns the processed element index. + * Value: An integer value that specifies the processed element index. + */ + elementIndex: number; + /** + * Specifies whether a postback or a callback is used to finally process the event on the server side. + * Value: true to perform the round trip to the server side via postback; false to perform the round trip to the server side via callback. + */ + usePostBack: boolean; + /** + * Specifies whether default context menu item click is handled manually, so no default processing is required. + * Value: true if no default processing is required; otherwise false. + */ + handled: boolean; +} +/** + * A method that will handle the CustomButtonClick event. + */ +interface ASPxClientGridViewCustomButtonEventHandler { + /** + * A method that will handle the CustomButtonClick event. + * @param source The event source. This parameter identifies the ASPxClientGridView object that raised the event. + * @param e An ASPxClientGridViewCustomButtonEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewCustomButtonEventArgs): void; +} +/** + * Provides data for the CustomButtonClick event. + */ +interface ASPxClientGridViewCustomButtonEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the value which identifies the row whose custom button has been clicked. + * Value: An integer value that identifies the row whose custom button has been clicked. + */ + visibleIndex: number; + /** + * Gets the value which identifies the custom button. + * Value: A string value that identifies the clicked custom button. + */ + buttonID: string; +} +/** + * A method that will handle the ColumnMoving event. + */ +interface ASPxClientGridViewColumnMovingEventHandler { + /** + * A method that will handle the ColumnMoving event. + * @param source The event source. + * @param e An ASPxClientGridViewColumnMovingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewColumnMovingEventArgs): void; +} +/** + * Provides data for the ColumnMoving event. + */ +interface ASPxClientGridViewColumnMovingEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether a column is allowed to be moved. + * Value: true to allow column moving; otherwise, false. + */ + allow: boolean; + /** + * Gets the column currently being dragged by an end-user. + * Value: An ASPxClientGridViewColumn object that represents the column currently being dragged by an end-user. + */ + sourceColumn: ASPxClientGridViewColumn; + /** + * Gets the target column, before or after which the source column will be inserted (if dropped). + * Value: An ASPxClientGridViewColumn object that represents the target column. null (Nothing in Visual Basic) if the source column isn't over the column header panel. + */ + destinationColumn: ASPxClientGridViewColumn; + /** + * Gets whether the source column will be inserted before the target column (if dropped). + * Value: true if the source column will be inserted before the target column (if dropped); otherwise, false. + */ + isDropBefore: boolean; + /** + * Gets whether the source column is currently over the Group Panel. + * Value: true if the source column is currently over the Group Panel; otherwise, false. + */ + isGroupPanel: boolean; +} +/** + * Represents an object that will handle the client-side BatchEditConfirmShowing event. + */ +interface ASPxClientGridViewBatchEditConfirmShowingEventHandler { + /** + * A method that will handle the BatchEditConfirmShowing client event. + * @param source The event source. + * @param e An ASPxClientGridViewBatchEditConfirmShowingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditConfirmShowingEventArgs): void; +} +/** + * Provides data for the BatchEditConfirmShowing event. + */ +interface ASPxClientGridViewBatchEditConfirmShowingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the client identifier of an object that initiates a send request. + * Value: A string value that specifies the object client identifier. + */ + requestTriggerID: string; +} +/** + * A method that will handle the client BatchEditStartEditing event. + */ +interface ASPxClientGridViewBatchEditStartEditingEventHandler { + /** + * A method that will handle the BatchEditStartEditing event. + * @param source The event source. + * @param e An ASPxClientGridViewBatchEditStartEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditStartEditingEventArgs): void; +} +/** + * Provides data for the BatchEditStartEditing event. + */ +interface ASPxClientGridViewBatchEditStartEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the row whose cells are about to be edited. + * Value: An value that specifies the visible index of the row. + */ + visibleIndex: number; + /** + * Gets the grid column that owns a cell that is about to be edited. + * Value: An object that is the focused grid column. + */ + focusedColumn: ASPxClientGridViewColumn; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: A hashtable that stores information about editable cells. + */ + rowValues: Object; +} +/** + * A method that will handle the client BatchEditEndEditing event. + */ +interface ASPxClientGridViewBatchEditEndEditingEventHandler { + /** + * A method that will handle the BatchEditEndEditing event. + * @param source The event source. + * @param e An ASPxClientGridViewBatchEditEndEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditEndEditingEventArgs): void; +} +/** + * Provides data for the BatchEditEndEditing event. + */ +interface ASPxClientGridViewBatchEditEndEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the row whose cells has been edited. + * Value: An value that specifies the visible index of the row. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: A hashtable that stores information about editable cells. + */ + rowValues: Object; +} +/** + * A method that will handle the client BatchEditRowValidating event. + */ +interface ASPxClientGridViewBatchEditRowValidatingEventHandler { + /** + * A method that will handle the BatchEditRowValidating event. + * @param source The event source. + * @param e An ASPxClientGridViewBatchEditRowValidatingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditRowValidatingEventArgs): void; +} +/** + * Provides data for the BatchEditRowValidating event. + */ +interface ASPxClientGridViewBatchEditRowValidatingEventArgs extends ASPxClientEventArgs { + /** + * Gets the processed row's visible index. + * Value: An integer value that specifies the processed row's visible index. + */ + visibleIndex: number; + /** + * Provides validation information of a row currently being validated. + * Value: An object that is a hashtable containing validation information. + */ + validationInfo: Object; +} +/** + * A method that will handle the client BatchEditTemplateCellFocused event. + */ +interface ASPxClientGridViewBatchEditTemplateCellFocusedEventHandler { + /** + * A method that will handle the BatchEditTemplateCellFocused event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientGridViewBatchEditTemplateCellFocusedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditTemplateCellFocusedEventArgs): void; +} +/** + * Provides data for the BatchEditTemplateCellFocused event. + */ +interface ASPxClientGridViewBatchEditTemplateCellFocusedEventArgs extends ASPxClientEventArgs { + /** + * Gets the currently processed column. + * Value: A object that is the client-side column object. + */ + column: ASPxClientGridViewColumn; + /** + * Gets or sets a value specifying whether the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * A method that will handle the BatchEditChangesSaving event. + */ +interface ASPxClientGridViewBatchEditChangesSavingEventHandler { + /** + * A method that will handle the BatchEditChangesSaving event. + * @param source The event source. This parameter identifies the grid view object which raised the event. + * @param e An ASPxClientGridViewBatchEditChangesSavingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditChangesSavingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesSaving event. + */ +interface ASPxClientGridViewBatchEditChangesSavingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * A method that will handle the BatchEditChangesCanceling event. + */ +interface ASPxClientGridViewBatchEditChangesCancelingEventHandler { + /** + * A method that will handle the BatchEditChangesCanceling event. + * @param source The event source. This parameter identifies the grid view object which raised the event. + * @param e An ASPxClientGridViewBatchEditChangesCancelingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditChangesCancelingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesCanceling event. + */ +interface ASPxClientGridViewBatchEditChangesCancelingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * A method that will handle the BatchEditRowInserting event. + */ +interface ASPxClientGridViewBatchEditRowInsertingEventHandler { + /** + * A method that will handle the BatchEditRowInserting event. + * @param source The event source. This parameter identifies the card view object which raised the event. + * @param e An ASPxClientGridViewBatchEditRowInsertingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditRowInsertingEventArgs): void; +} +/** + * Provides data for the BatchEditRowInserting event. + */ +interface ASPxClientGridViewBatchEditRowInsertingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed row's visible index. + * Value: An integer value that specifies the processed row's visible index. + */ + visibleIndex: number; +} +/** + * A method that will handle the BatchEditRowDeleting event. + */ +interface ASPxClientGridViewBatchEditRowDeletingEventHandler { + /** + * A method that will handle the BatchEditRowDeleting event. + * @param source The event source. This parameter identifies the grid view object which raised the event. + * @param e An ASPxClientGridViewBatchEditRowDeletingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditRowDeletingEventArgs): void; +} +/** + * Provides data for the BatchEditRowDeleting event. + */ +interface ASPxClientGridViewBatchEditRowDeletingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed row's visible index. + * Value: An integer value that specifies the processed row's visible index. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + rowValues: Object; +} +/** + * A method that will handle the FocusedCellChanging event. + */ +interface ASPxClientGridViewFocusedCellChangingEventHandler { + /** + * A method that will handle the FocusedCellChanging event. + * @param source The event source. + * @param e An ASPxClientGridViewFocusedCellChangingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewFocusedCellChangingEventArgs): void; +} +/** + * Provides data for the FocusedCellChanging event. + */ +interface ASPxClientGridViewFocusedCellChangingEventArgs extends ASPxClientCancelEventArgs { + /** + * Provides information on a cell currently being focused. + * Value: A ASPxClientGridViewCellInfo object that is the cell information. + */ + cellInfo: ASPxClientGridViewCellInfo; +} +/** + * Contains information on a grid cell. + */ +interface ASPxClientGridViewCellInfo { + /** + * Gets the visible index of the row that contains the cell currently being processed. + * Value: An value that specifies the visible index of the row. + */ + rowVisibleIndex: number; + /** + * Gets the data column that contains the cell currently being processed. + * Value: An object that is the data column which contains the processed cell. + */ + column: ASPxClientGridViewColumn; +} +/** + * Provides members related to Batch Edit Mode + */ +interface ASPxClientGridViewBatchEditApi { + /** + * Performs validation of grid data contained in all rows when the grid operates in Batch Edit mode. + * @param validateOnlyModified true, if only modified rows should be validated; otherwise, false. + */ + ValidateRows(validateOnlyModified?: boolean): boolean; + /** + * Performs validation of grid data contained in the specified row when the grid operates in Batch Edit mode. + * @param visibleIndex An integer value specifying the visible index of the validated row. + */ + ValidateRow(visibleIndex: number): boolean; + /** + * Returns an array of row visible indices. + * @param includeDeleted true, to include visible indices of deleted rows to the returned array; otherwise, false. + */ + GetRowVisibleIndices(includeDeleted: boolean): number[]; + /** + * Returns an array of the deleted row visible indices. + */ + GetDeletedRowIndices(): number[]; + /** + * Returns an array of the inserted row visible indices. + */ + GetInsertedRowIndices(): number[]; + /** + * Indicates if the row with specified visible index is deleted. + * @param visibleIndex An integer value that identifies the row by its visible index. + */ + IsDeletedRow(visibleIndex: number): boolean; + /** + * Indicates if the row with specified visible index is newly created. + * @param visibleIndex An integer value that identifies the row by its visible index. + */ + IsNewRow(visibleIndex: number): boolean; + /** + * Programmatically moves the focus to the previous cell in the row. + */ + MoveFocusBackward(): boolean; + /** + * Programmatically moves the focus to the next cell in the row. + */ + MoveFocusForward(): boolean; + /** + * Sets a value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the row containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param value An object that contains the new cell value. + */ + SetCellValue(visibleIndex: number, columnFieldNameOrId: string, value: Object): void; + /** + * Sets the value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the row containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param value An object that contains the new cell value. + * @param displayText A string value that specifies the cell display text. + * @param cancelCellHighlighting true to cancel highlighting of the modified cell, false to highlight the modified cell. + */ + SetCellValue(visibleIndex: number, columnFieldNameOrId: string, value: Object, displayText: string, cancelCellHighlighting?: boolean): void; + /** + * Gets the value of the specified cell. + * @param visibleIndex A zero-based integer value that specifies a visible index of a row containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param initial true, to return the initial (server) value; false, to return a value currently contained on the client side (modified value). + */ + GetCellValue(visibleIndex: number, columnFieldNameOrId: string, initial?: boolean): Object; + /** + * Gets a container holding a data cell content. + * @param visibleIndex An integer value that is the visible index. + * @param columnFieldNameOrId A string value that is the column's Field Name or ID. + */ + GetCellTextContainer(visibleIndex: number, columnFieldNameOrId: string): Object; + /** + * Gets information about the cell currently being edited. + */ + GetEditCellInfo(): ASPxClientGridViewCellInfo; + /** + * Returns a value that indicates whether the grid has changed data. + */ + HasChanges(): boolean; + /** + * Returns a value that indicates whether the specified row has changed data. + * @param visibleIndex An integer value that specifies the visible index of a row. + */ + HasChanges(visibleIndex: number): boolean; + /** + * Returns a value that indicates whether the specified data cell's data has been changed. + * @param visibleIndex An integer value that specifies the visible index of a row. + * @param columnFieldNameOrId A string value that identifies the column by the name of the data source field to which the column is bound, or by the column's name. + */ + HasChanges(visibleIndex: number, columnFieldNameOrId: string): boolean; + /** + * Resets changes in the specified row. + * @param visibleIndex An integer value that specifies the visible index of a row. + */ + ResetChanges(visibleIndex: number): void; + /** + * Resets changes in the specified cell. + * @param visibleIndex An integer value that specifies the visible index of a row containing the processed cell. + * @param columnIndex A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + */ + ResetChanges(visibleIndex: number, columnIndex: number): void; + /** + * Switches the specified cell to edit mode. + * @param visibleIndex A zero-based integer value that specifies the visible index of a row containing the processed cell. + * @param columnIndex A zero-based integer value that identifies the column which contains the processed cell in the column collection. + */ + StartEdit(visibleIndex: number, columnIndex: number): void; + /** + * Ends cell or row editing. + */ + EndEdit(): void; +} +/** + * A client-side equivalent of the ASPxVerticalGrid object. + */ +interface ASPxClientVerticalGrid extends ASPxClientGridBase { + /** + * Provides access to the batch editing client API. + * Value: A object that exposes the batch editing client API methods. + */ + batchEditApi: ASPxClientVerticalGridBatchEditApi; + /** + * Occurs when a custom command button has been clicked. + */ + CustomButtonClick: ASPxClientEvent>; + /** + * Fires after the selection has been changed. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Occurs when a grid switches to batch edit mode. + */ + BatchEditStartEditing: ASPxClientEvent>; + /** + * Occurs when a grid leaves the batch edit mode. + */ + BatchEditEndEditing: ASPxClientEvent>; + /** + * Enables you to prevent a batch edit confirmation message from being displayed. + */ + BatchEditConfirmShowing: ASPxClientEvent>; + /** + * Enables you to provide navigation for editors contained in a templated cell in Batch Edit mode. + */ + BatchEditTemplateCellFocused: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are saved in batch edit mode. + */ + BatchEditChangesSaving: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are canceled in batch edit mode. + */ + BatchEditChangesCanceling: ASPxClientEvent>; + /** + * Occurs on the client side before a record is inserted in batch edit mode. + */ + BatchEditRecordInserting: ASPxClientEvent>; + /** + * Occurs on the client side before a record is deleted in batch edit mode. + */ + BatchEditRecordDeleting: ASPxClientEvent>; + /** + * Enables you to specify whether record data is valid and provide an error text. + */ + BatchEditRecordValidating: ASPxClientEvent>; + /** + * Occurs on the client side when the focused cell is about to be changed. + */ + FocusedCellChanging: ASPxClientEvent>; + /** + * Enables you to prevent rows from being sorted. + */ + RowSorting: ASPxClientEvent>; + /** + * Fires on the client side before the expansion state of a row is changed by end-user interaction. + */ + RowExpandedChanging: ASPxClientEvent>; + /** + * Fires on the client side after a row's expansion state has been changed by end-user interaction. + */ + RowExpandedChanged: ASPxClientEvent>; + /** + * Fires on the client when a record is clicked. + */ + RecordClick: ASPxClientEvent>; + /** + * Fires on the client when a record is double clicked. + */ + RecordDblClick: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any unhandled server error occurs during server-side processing of a callback sent by the ASPxClientVerticalGrid. + */ + CallbackError: ASPxClientEvent>; + /** + * Sorts data by the specified data row's values. + * @param row An ASPxClientVerticalGridRow object that represents the data row. + */ + SortBy(row: ASPxClientVerticalGridRow): void; + /** + * Sorts data by the specified data row's values. + * @param rowIndex An integer value that specifies the row's position within the row collection. + */ + SortBy(rowIndex: number): void; + /** + * Sorts data by the specified data row's values. + * @param rowFieldNameOrId A string value that specifies the row's field name or unique identifier (the row's Name property value). + */ + SortBy(rowFieldNameOrId: string): void; + /** + * Sorts data by the specified data row's values. + * @param row An ASPxClientVerticalGridRow object that represents the data row. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(row: ASPxClientVerticalGridRow, sortOrder: string): void; + /** + * Sorts data by the specified data row's values. + * @param rowIndex An integer value that specifies the row's position within the row collection. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(rowIndex: number, sortOrder: string): void; + /** + * Sorts data by the specified data row's values. + * @param rowFieldNameOrId A string value that specifies the row's field name or unique identifier (the row's Name property value). + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(rowFieldNameOrId: string, sortOrder: string): void; + /** + * Sorts data by the specified data row's values. + * @param row An ASPxClientVerticalGridRow object that represents the data row. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(row: ASPxClientVerticalGridRow, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data row's values. + * @param rowIndex An integer value that specifies the row's position within the row collection. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true, to clear any previous sorting; otherwise, false. + */ + SortBy(rowIndex: number, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data row's values. + * @param rowFieldNameOrId A string value that specifies the row's field name or unique identifier (the row's Name property value). + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(rowFieldNameOrId: string, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data row's values, and places the row to the specified position among the sorted rows. + * @param row An ASPxClientGridViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based row's index among the sorted rows. -1 if data is not sorted by this row. + */ + SortBy(row: ASPxClientVerticalGridRow, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data row's values, and places the row to the specified position among the sorted rows. + * @param rowIndex An integer value that specifies the row's position within the row collection. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex + */ + SortBy(rowIndex: number, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data row's values, and places the row to the specified position among the sorted rows. + * @param rowFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based row's index among the sorted rows. -1 if data is not sorted by this row. + */ + SortBy(rowFieldNameOrId: string, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Returns the key value of the specified data row (record in the vertical grid). + * @param visibleIndex An integer value that specifies the record's visible index. + */ + GetRecordKey(visibleIndex: number): string; + /** + * Adds a new record. + */ + AddNewRecord(): void; + /** + * Deletes the specified record. + * @param visibleIndex An integer value that identifies the record. + */ + DeleteRecord(visibleIndex: number): void; + /** + * Deletes a record with the specified key value. + * @param key An object that uniquely identifies the record. + */ + DeleteRecordByKey(key: Object): void; + /** + * Selects all the unselected records within the grid. + */ + SelectRecords(): void; + /** + * Selects the specified record displayed within the grid. + * @param visibleIndex A zero-based integer value that specifies the record's visible index. + */ + SelectRecords(visibleIndex: number): void; + /** + * Selects the specified rercords within the grid. + * @param visibleIndices An array of zero-based indices that identify records within the grid. + */ + SelectRecords(visibleIndices: number[]): void; + /** + * Selects or deselects the specified records within the grid. + * @param visibleIndices An array of zero-based indices that identify records within the grid. + * @param selected true to select the specified records; false to deselect the records. + */ + SelectRecords(visibleIndices: number[], selected: boolean): void; + /** + * Selects or deselects the specified record within the grid. + * @param visibleIndex An integer zero-based index that identifies the record within the grid. + * @param selected true to select the specified record; false to deselect the record. + */ + SelectRecords(visibleIndex: number, selected?: boolean): void; + /** + * Selects or deselects the specified records displayed within the grid. + * @param keys An array of objects that uniquely identify the records. + * @param selected true to select the specified records; false to deselect the records. + */ + SelectRecordsByKey(keys: Object[], selected?: boolean): void; + /** + * Selects or deselects the specified record displayed within the grid. + * @param key An object that uniquely identifies the record. + * @param selected true to select the specified record; false to deselect the record. + */ + SelectRecordsByKey(key: Object, selected?: boolean): void; + /** + * Selects the specified records displayed within the grid. + * @param keys An array of objects that uniquely identify the records. + */ + SelectRecordsByKey(keys: Object[]): void; + /** + * Selects a grid record by its key. + * @param key An object that uniquely identifies the record. + */ + SelectRecordsByKey(key: Object): void; + /** + * Deselects all the selected records within the grid. + */ + UnselectRecords(): void; + /** + * Deselects the specified records (if selected) within the grid. + * @param visibleIndices An array of zero-based indices that identify records within the grid. + */ + UnselectRecords(visibleIndices: number[]): void; + /** + * Deselects the specified record (if selected) within the grid. + * @param visibleIndex A zero-based integer value that specifies the record's visible index. + */ + UnselectRecords(visibleIndex: number): void; + /** + * Deselects the specified records displayed within the grid. + * @param keys An array of objects that uniquely identify the records. + */ + UnselectRecordsByKey(keys: Object[]): void; + /** + * Deselects the specified record displayed within the grid. + * @param key An object that uniquely identifies the record. + */ + UnselectRecordsByKey(key: Object): void; + /** + * Deselects all grid records that match the filter criteria currently applied to the grid. + */ + UnselectFilteredRecords(): void; + /** + * Selects the specified record displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the record's visible index. + */ + SelectRecordOnPage(visibleIndex: number): void; + /** + * Selects or deselects the specified record displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the record's visible index. + * @param selected true to select the specified record; false to deselect the record. + */ + SelectRecordOnPage(visibleIndex: number, selected?: boolean): void; + /** + * Deselects the specified record (if selected) displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the record's visible index. + */ + UnselectRecordOnPage(visibleIndex: number): void; + /** + * Selects all unselected records displayed on the current page. + */ + SelectAllRecordsOnPage(): void; + /** + * Allows you to select or deselect all records displayed on the current page based on the parameter passed. + * @param selected true to select all unselected records displayed on the current page; false to deselect all selected records on the page. + */ + SelectAllRecordsOnPage(selected: boolean): void; + /** + * Deselects all selected records displayed on the current page. + */ + UnselectAllRecordsOnPage(): void; + /** + * Returns the number of selected records. + */ + GetSelectedRecordCount(): number; + /** + * Indicates whether or not the specified record is selected within the current page. + * @param visibleIndex An integer value that identifies the record by its visible index. + */ + IsRecordSelectedOnPage(visibleIndex: number): boolean; + /** + * Returns the values of the specified data source fields within the specified record. + * @param visibleIndex An integer value that identifies the record. + * @param fieldNames The names of data source fields separated using a semicolon, whose values within the specified record are returned. + * @param onCallback An ASPxClientVerticalGridValuesCallback object that represents the JavaScript function which receives the list of record values as a parameter. + */ + GetRecordValues(visibleIndex: number, fieldNames: string, onCallback: ASPxClientVerticalGridValuesCallback): void; + /** + * Returns the record values displayed within the current page. + * @param fieldNames The names of data source fields whose values are returned. + * @param onCallback A ASPxClientVerticalGridValuesCallback object that represents the JavaScript function which receives the list of record values as a parameter. + */ + GetPageRecordValues(fieldNames: string, onCallback: ASPxClientVerticalGridValuesCallback): void; + /** + * Returns the number of records actually displayed within the active page. + */ + GetVisibleRecordsOnPage(): number; + /** + * Returns the number of rows within the client vertical grid. + */ + GetRowCount(): number; + /** + * Applies the specified search panel filter criterion to grid data. + * @param value A string value that specifies the filter criterion. + */ + ApplySearchPanelFilter(value: string): void; + /** + * Applies the specified filter expression to the ASPxVerticalGrid. + * @param filterExpression A string value that specifies the filter expression. + */ + ApplyFilter(filterExpression: string): void; + /** + * Clears the filter expression applied to a client vertical grid. + */ + ClearFilter(): void; + /** + * Sets input focus to the grid. + */ + Focus(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Selects the specified page. + * @param pageIndex An integer value that specifies the active page's index. + */ + GotoPage(pageIndex: number): void; + /** + * Gets the index of the page currently being selected. + */ + GetPageIndex(): number; + /** + * Gets the number of pages to which the grid's data is divided. + */ + GetPageCount(): number; + /** + * Activates the next page. + */ + NextPage(): void; + /** + * Activates the previous page. + */ + PrevPage(): void; + /** + * Returns the index of the first record displayed within the vertical grid's active page. + */ + GetTopVisibleIndex(): number; + /** + * Saves all the changes made and switches the grid to browse mode. + */ + UpdateEdit(): void; + /** + * Cancels all the changes made and switches the ASPxVerticalGrid to browse mode. + */ + CancelEdit(): void; + /** + * Updates data displayed within the grid. + */ + Refresh(): void; + /** + * Returns the record values displayed within all selected records. + * @param fieldNames The names of data source fields separated by a semicolon, whose values within the selected records are returned. + * @param onCallback A ASPxClientVerticalGridValuesCallback object that represents the JavaScript function which receives the list of record values as a parameter. + */ + GetSelectedFieldValues(fieldNames: string, onCallback: ASPxClientVerticalGridValuesCallback): void; + /** + * Returns key values of selected records displayed within the current page. + */ + GetSelectedKeysOnPage(): Object[]; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientVerticalGridValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientVerticalGridValuesCallback): void; + /** + * Returns the editor used to edit the specified row's values. + * @param row An ASPxClientVerticalGridRowobject that specifies the required row within the client grid. + */ + GetEditor(row: ASPxClientVerticalGridRow): ASPxClientEdit; + /** + * Returns the editor used to edit the specified row's values. + * @param rowIndex An integer value that specifies the row's position within the rows collection. + */ + GetEditor(rowIndex: number): ASPxClientEdit; + /** + * Returns the editor used to edit the specified row's values. + * @param rowFieldNameOrId A string value that specifies the row's field name or unique identifier (the row's Name property value). + */ + GetEditor(rowFieldNameOrId: string): ASPxClientEdit; + /** + * Displays the Filter Control. + */ + ShowFilterControl(): void; + /** + * Hides the Filter Control. + */ + CloseFilterControl(): void; + /** + * Enables or disables the current filter. + * @param isFilterEnabled true to enable the current filter; otherwise, false. + */ + SetFilterEnabled(isFilterEnabled: boolean): void; + /** + * Returns the client row that resides at the specified position within the row collection. + * @param rowIndex A zero-based index that identifies the row within the row collection (the row's Index property value). + */ + GetRow(rowIndex: number): ASPxClientVerticalGridRow; + /** + * Returns the row with the specified unique identifier. + * @param rowId A string value that specifies the row's unique identifier (the row's Name property value). + */ + GetRowById(rowId: string): ASPxClientVerticalGridRow; + /** + * Returns the client row which is bound to the specified data source field. + * @param rowFieldName A string value that specifies the name of the data source field to which the row is bound (the row's fieldName property value). + */ + GetRowByField(rowFieldName: string): ASPxClientVerticalGridRow; + /** + * Returns the current vertical scroll position of the grid's content. + */ + GetVerticalScrollPosition(): number; + /** + * Returns the current horizontal scroll position of the grid's content. + */ + GetHorizontalScrollPosition(): number; + /** + * Specifies the vertical scroll position for the grid's content. + * @param position An integer value specifying the vertical scroll position. + */ + SetVerticalScrollPosition(position: number): void; + /** + * Specifies the horizontal scroll position for the grid's content. + * @param position An integer value specifying the horizontal scroll position. + */ + SetHorizontalScrollPosition(position: number): void; + /** + * Gets the value that specifies whether the required row is expanded. + * @param row An ASPxClientVerticalGridRowobject that specifies the row. + */ + GetRowExpanded(row: ASPxClientVerticalGridRow): boolean; + /** + * Gets the value that specifies whether the row with the specified index is expanded. + * @param rowIndex An integer value specifying the row's index. + */ + GetRowExpanded(rowIndex: number): boolean; + /** + * Gets the value that specifies whether the row with the specified field name or ID is expanded. + * @param rowFieldNameOrId A string value specifying the row's field name or ID. + */ + GetRowExpanded(rowFieldNameOrId: string): boolean; + /** + * Sets a value indicating whether the row is expanded. + * @param row An ASPxClientVerticalGridRowobject that specifies the required row within the client grid. + * @param value true, to expand the row; otherwise, false. + */ + SetRowExpanded(row: ASPxClientVerticalGridRow, value: boolean): void; + /** + * Sets a value indicating whether the row is expanded. + * @param rowIndex An integer value specifying the index of the row. + * @param value true, to expand the row; otherwise, false. + */ + SetRowExpanded(rowIndex: number, value: boolean): void; + /** + * Sets a value indicating whether the row is expanded. + * @param rowFieldNameOrId A string value that specifies the row's field name or unique identifier (the row's Name property value). + * @param value true, to expand the row; otherwise, false. + */ + SetRowExpanded(rowFieldNameOrId: string, value: boolean): void; +} +/** + * A client grid row. + */ +interface ASPxClientVerticalGridRow extends ASPxClientGridColumnBase { + /** + * Gets the name that uniquely identifies the row. + * Value: A string value assigned to the row's Name property. + */ + name: string; + /** + * Gets the row's position within the collection. + * Value: An integer zero-bazed index that specifies the row's position within the collection. + */ + index: number; + /** + * Gets the name of the database field assigned to the current row. + * Value: A string value that specifies the name of a data field. + */ + fieldName: string; + /** + * Gets whether the row is visible. + * Value: true, to display the row; otherwise, false. + */ + visible: boolean; +} +/** + * Represents a JavaScript function which receives the list of record values when the client GetSelectedFieldValues method is called. + */ +interface ASPxClientVerticalGridValuesCallback { + /** + * Represents a JavaScript function which receives the list of record values when the client GetSelectedFieldValues method is called. + * @param result An object that represents the list of record values received from the server. + */ + (result: Object): void; +} +/** + * A method that will handle the CustomButtonClick event. + */ +interface ASPxClientVerticalGridRowCancelEventHandler { + /** + * A method that will handle the cancelable events of a client ASPxVerticalGrid row. + * @param source The event source. + * @param e An ASPxClientVerticalGridRowCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridRowCancelEventArgs): void; +} +/** + * Provides data for the cancelable events of a client ASPxVerticalGrid row. + */ +interface ASPxClientVerticalGridRowCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed client row. + * Value: An ASPxClientVerticalGridRow object that represents the processed row. + */ + row: ASPxClientVerticalGridRow; +} +/** + * A method that will handle the RecordClick event. + */ +interface ASPxClientVerticalGridRecordClickEventHandler { + /** + * A method that will handle the RecordClick event. + * @param source The event source. This parameter identifies the ASPxClientVerticalGrid object that raised the event. + * @param e An ASPxClientVerticalGridRecordClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridRecordClickEventArgs): void; +} +/** + * Provides data for the RecordClick event. + */ +interface ASPxClientVerticalGridRecordClickEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed record's visible index. + * Value: An integer zero-based index that identifies the processed record. + */ + visibleIndex: number; + /** + * Provides access to the parameters associated with the RecordClick event. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; +} +/** + * A method that will handle the CustomButtonClick event. + */ +interface ASPxClientVerticalGridCustomButtonEventHandler { + /** + * A method that will handle the CustomButtonClick event. + * @param source The event source. This parameter identifies the ASPxClientVerticalGrid object that raised the event. + * @param e An ASPxClientVerticalGridCustomButtonEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridCustomButtonEventArgs): void; +} +/** + * Provides data for the CustomButtonClick event. + */ +interface ASPxClientVerticalGridCustomButtonEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the value which identifies the record whose custom button has been clicked. + * Value: An integer value that identifies the record whose custom button has been clicked. + */ + visibleIndex: number; + /** + * Gets the value which identifies the custom button. + * Value: A string value that identifies the clicked custom button. + */ + buttonID: string; +} +/** + * A method that will handle the SelectionChanged event. + */ +interface ASPxClientVerticalGridSelectionEventHandler { + /** + * A method that will handle the SelectionChanged event. + * @param source The event source. + * @param e An ASPxClientVerticalGridSelectionEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridSelectionEventArgs): void; +} +/** + * Provides data for the SelectionChanged event. + */ +interface ASPxClientVerticalGridSelectionEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the visible index of the record whose selected state has been changed. + * Value: An value that specifies the visible index of the record. + */ + visibleIndex: number; + /** + * Gets whether the record has been selected. + * Value: true, if the record has been selected; otherwise, false. + */ + isSelected: boolean; + /** + * Gets whether all records displayed within a page have been selected or unselected. + * Value: true if all records displayed within a page have been selected or unselected; otherwise, false. + */ + isAllRecordsOnPage: boolean; + /** + * Gets whether a selection has been changed on the server. + * Value: true if a selection has been changed on the server; otherwise, false. + */ + isChangedOnServer: boolean; +} +/** + * A method that will handle the RowExpandedChanged event. + */ +interface ASPxClientVerticalGridRowExpandedEventHandler { + /** + * A method that will handle the RowExpandedChanged event. + * @param source The event source. + * @param e An ASPxClientVerticalGridRowExpandedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridRowExpandedEventArgs): void; +} +/** + * Provides data for the RowExpandedChanged event. + */ +interface ASPxClientVerticalGridRowExpandedEventArgs extends ASPxClientEventArgs { + /** + * Gets the expanded row. + * Value: An ASPxClientVerticalGridRow object that represents the expanded row. + */ + row: ASPxClientVerticalGridRow; +} +/** + * A method that will handle the RowExpandedChanging event. + */ +interface ASPxClientVerticalGridRowExpandingEventHandler { + /** + * A method that will handle the RowExpandedChanging event. + * @param source The event source. + * @param e An ASPxClientVerticalGridRowExpandedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridRowExpandingEventArgs): void; +} +/** + * Provides data for the RowExpandedChanging event. + */ +interface ASPxClientVerticalGridRowExpandingEventArgs extends ASPxClientVerticalGridRowExpandedEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true, if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * Represents an object that will handle the client-side BatchEditStartEditing event. + */ +interface ASPxClientVerticalGridBatchEditStartEditingEventHandler { + /** + * A method that will handle the BatchEditStartEditing event. + * @param source The event source. + * @param e An ASPxClientVerticalGridBatchEditStartEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditStartEditingEventArgs): void; +} +/** + * Provides data for the BatchEditStartEditing event. + */ +interface ASPxClientVerticalGridBatchEditStartEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the record whose cells are about to be edited. + * Value: An value that specifies the visible index of the record. + */ + visibleIndex: number; + /** + * Gets the grid row that owns a cell that is about to be edited. + * Value: An object that is the focused grid row. + */ + focusedRow: ASPxClientVerticalGridRow; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: A hashtable that stores information about editable cells. + */ + recordValues: Object; +} +/** + * Represents an object that will handle the client-side BatchEditEndEditing event. + */ +interface ASPxClientVerticalGridBatchEditEndEditingEventHandler { + /** + * A method that will handle the BatchEditEndEditing event. + * @param source The event source. + * @param e An ASPxClientVerticalGridBatchEditEndEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditEndEditingEventArgs): void; +} +/** + * Provides data for the BatchEditEndEditing event. + */ +interface ASPxClientVerticalGridBatchEditEndEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the record whose cells have been edited. + * Value: An value that specifies the visible index of the record. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: Gets a hashtable that maintains information about editable cells. + */ + recordValues: Object; +} +/** + * Represents an object that will handle the client-side BatchEditRecordValidating event. + */ +interface ASPxClientVerticalGridBatchEditRecordValidatingEventHandler { + /** + * A method that will handle the BatchEditRecordValidating event. + * @param source The event source. + * @param e An ASPxClientVerticalGridBatchEditRecordValidatingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditRecordValidatingEventArgs): void; +} +/** + * Provides data for the BatchEditRecordValidating event. + */ +interface ASPxClientVerticalGridBatchEditRecordValidatingEventArgs extends ASPxClientEventArgs { + /** + * Gets the processed record's visible index. + * Value: An integer value that specifies the processed record's visible index. + */ + visibleIndex: number; + /** + * Provides validation information on the record currently being validated. + * Value: An object that is a hashtable containing validation information. + */ + validationInfo: Object; +} +/** + * Represents an object that will handle the client-side BatchEditConfirmShowing event. + */ +interface ASPxClientVerticalGridBatchEditConfirmShowingEventHandler { + /** + * A method that will handle the BatchEditConfirmShowing client event. + * @param source The event source. + * @param e An ASPxClientVerticalGridBatchEditConfirmShowingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditConfirmShowingEventArgs): void; +} +/** + * Provides data for the BatchEditConfirmShowing event. + */ +interface ASPxClientVerticalGridBatchEditConfirmShowingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the client identifier of an object that initiates a send request. + * Value: A string value that specifies the object client identifier. + */ + requestTriggerID: string; +} +/** + * Represents an object that will handle the client-side BatchEditTemplateCellFocused event. + */ +interface ASPxClientVerticalGridBatchEditTemplateCellFocusedEventHandler { + /** + * A method that will handle the BatchEditTemplateCellFocused event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientVerticalGridBatchEditTemplateCellFocusedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditTemplateCellFocusedEventArgs): void; +} +/** + * Provides data for the BatchEditTemplateCellFocused event. + */ +interface ASPxClientVerticalGridBatchEditTemplateCellFocusedEventArgs extends ASPxClientEventArgs { + /** + * Gets the currently processed row. + * Value: A object that is the client-side row object. + */ + row: ASPxClientVerticalGridRow; + /** + * Gets or sets a value specifying whether the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * Represents an object that will handle the client-side BatchEditChangesSaving event. + */ +interface ASPxClientVerticalGridBatchEditChangesSavingEventHandler { + /** + * A method that will handle the BatchEditChangesSaving event. + * @param source The event source. This parameter identifies the vertical grid object which raised the event. + * @param e An ASPxClientVerticalGridBatchEditChangesSavingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditChangesSavingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesSaving event. + */ +interface ASPxClientVerticalGridBatchEditChangesSavingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * Represents an object that will handle the client-side BatchEditChangesCanceling event. + */ +interface ASPxClientVerticalGridBatchEditChangesCancelingEventHandler { + /** + * A method that will handle the BatchEditChangesCanceling event. + * @param source The event source. This parameter identifies the vertical grid object which raised the event. + * @param e An ASPxClientVerticalGridBatchEditChangesCancelingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditChangesCancelingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesCanceling event. + */ +interface ASPxClientVerticalGridBatchEditChangesCancelingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * Represents an object that will handle the client-side BatchEditRecordInserting event. + */ +interface ASPxClientVerticalGridBatchEditRecordInsertingEventHandler { + /** + * A method that will handle the BatchEditRecordInserting event. + * @param source The event source. This parameter identifies the vertical grid object which raised the event. + * @param e An ASPxClientVerticalGridBatchEditRecordInsertingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditRecordInsertingEventArgs): void; +} +/** + * Provides data for the BatchEditRecordInserting event. + */ +interface ASPxClientVerticalGridBatchEditRecordInsertingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed record's visible index. + * Value: An integer value that specifies the processed record's visible index. + */ + visibleIndex: number; +} +/** + * Represents an object that will handle the client-side BatchEditRecordDeleting event. + */ +interface ASPxClientVerticalGridBatchEditRecordDeletingEventHandler { + /** + * A method that will handle the BatchEditRecordDeleting event. + * @param source The event source. This parameter identifies the vertical grid object which raised the event. + * @param e An ASPxClientVerticalGridBatchEditRecordDeletingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditRecordDeletingEventArgs): void; +} +/** + * Provides data for the BatchEditRecordDeleting event. + */ +interface ASPxClientVerticalGridBatchEditRecordDeletingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed record's visible index. + * Value: An integer value that specifies the processed record's visible index. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + recordValues: Object; +} +/** + * A method that will handle the FocusedCellChanging event. + */ +interface ASPxClientVerticalGridFocusedCellChangingEventHandler { + /** + * A method that will handle the FocusedCellChanging event. + * @param source The event source. + * @param e An ASPxClientVerticalGridFocusedCellChangingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridFocusedCellChangingEventArgs): void; +} +/** + * Provides data for the FocusedCellChanging event. + */ +interface ASPxClientVerticalGridFocusedCellChangingEventArgs extends ASPxClientCancelEventArgs { + /** + * Provides information on a cell currently being focused. + * Value: A ASPxClientVerticalGridCellInfo object that is the cell information. + */ + cellInfo: ASPxClientVerticalGridCellInfo; +} +/** + * Contains information on a cell that is being edited. + */ +interface ASPxClientVerticalGridCellInfo { + /** + * Gets the row that contains the cell currently being processed. + * Value: An object that is the row which contains the processed cell. + */ + row: ASPxClientVerticalGridRow; + /** + * Gets the visible index of the record that contains the cell currently being processed. + * Value: An value that specifies the visible index of the record. + */ + recordVisibleIndex: number; +} +/** + * Provides members related to Batch Edit Mode + */ +interface ASPxClientVerticalGridBatchEditApi { + /** + * Performs validation of grid data contained in all records when the grid operates in batch edit mode. + * @param validateOnlyModified true, if only modified records should be validated; otherwise, false. + */ + ValidateRecords(validateOnlyModified?: boolean): boolean; + /** + * Performs validation of grid data contained in the specified record when the grid operates in batch edit mode. + * @param visibleIndex An integer value specifying the visible index of the validated record. + */ + ValidateRecord(visibleIndex: number): boolean; + /** + * Returns an array of record visible indices. + * @param includeDeleted true, to include visible indices of deleted records to the returned array; otherwise, false. + */ + GetRecordVisibleIndices(includeDeleted: boolean): number[]; + /** + * Returns an array of the deleted record visible indices. + */ + GetDeletedRecordIndices(): number[]; + /** + * Returns an array of the inserted record visible indices. + */ + GetInsertedRecordIndices(): number[]; + /** + * Indicates if the record with the specified visible index is deleted. + * @param visibleIndex An integer value that identifies the record by its visible index. + */ + IsDeletedRecord(visibleIndex: number): boolean; + /** + * Indicates if the record with specified visible index is newly created. + * @param visibleIndex An integer value that identifies the record by its visible index. + */ + IsNewRecord(visibleIndex: number): boolean; + /** + * Programmatically moves the focus to the previous cell in the record. + */ + MoveFocusBackward(): boolean; + /** + * Programmatically moves the focus to the next cell in the record. + */ + MoveFocusForward(): boolean; + /** + * Sets a value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the record containing the processed cell. + * @param rowFieldNameOrId A string value that specifies the field name or unique identifier (the row's Name property value) of a row containing the processed cell. + * @param value An object that contains the new cell value. + */ + SetCellValue(visibleIndex: number, rowFieldNameOrId: string, value: Object): void; + /** + * Sets the value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the row containing the processed cell. + * @param rowFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param value An object that contains the new cell value. + * @param displayText A string value that specifies the cell display text. + * @param cancelCellHighlighting true to cancel highlighting of the modified cell, false to highlight the modified cell. + */ + SetCellValue(visibleIndex: number, rowFieldNameOrId: string, value: Object, displayText: string, cancelCellHighlighting?: boolean): void; + /** + * Gets the value of the specified cell. + * @param visibleIndex A zero-based integer value that specifies a visible index of a record containing the processed cell. + * @param rowFieldNameOrId A string value that specifies the field name or unique identifier (the row's Name property value) of a row containing the processed cell. + * @param initial true, to return the initial (server) value; false, to return a value currently contained on the client side (modified value). + */ + GetCellValue(visibleIndex: number, rowFieldNameOrId: string, initial?: boolean): Object; + /** + * Gets a container holding the data cell content. + * @param visibleIndex An integer value that is the visible index. + * @param columnFieldNameOrId A string value that is the column's Field Name or ID. + */ + GetCellTextContainer(visibleIndex: number, columnFieldNameOrId: string): Object; + /** + * Gets information about the cell currently being edited. + */ + GetEditCellInfo(): ASPxClientVerticalGridCellInfo; + /** + * Returns a value that indicates whether the vertical grid has changed data. + */ + HasChanges(): boolean; + /** + * Returns a value that indicates whether the specified record has changed data. + * @param visibleIndex An integer value that specifies the visible index of a record. + */ + HasChanges(visibleIndex: number): boolean; + /** + * Returns a value that indicates whether the specified data cell's data has been changed. + * @param visibleIndex An integer value that specifies the visible index of a record. + * @param rowFieldNameOrId A string value that identifies the row by the name of the data source field to which the row is bound, or by the row's name. + */ + HasChanges(visibleIndex: number, rowFieldNameOrId: string): boolean; + /** + * Resets changes in the specified record. + * @param visibleIndex An integer value that specifies the visible index of a record. + */ + ResetChanges(visibleIndex: number): void; + /** + * Resets changes in the specified cell. + * @param visibleIndex An integer value that specifies the visible index of a record containing the processed cell. + * @param rowIndex A string value that specifies the field name or unique identifier (the row's Name property value) of a row containing the processed cell. + */ + ResetChanges(visibleIndex: number, rowIndex: number): void; + /** + * Switches the specified cell to batch edit mode. + * @param visibleIndex A zero-based integer value that specifies the visible index of a record containing the processed cell. + * @param rowIndex A zero-based integer value that identifies the row which contains the processed cell in the rows collection. + */ + StartEdit(visibleIndex: number, rowIndex: number): void; + /** + * Ends the cell(s) editing. + */ + EndEdit(): void; +} +/** + * Contains style settings related to media elements in ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorCommandStyleSettings { + /** + * Gets or sets a media element's CSS class name. + * Value: A string that specifies a class name. + */ + className: string; + /** + * Gets or sets an element's width. + * Value: A string that specifies an element's width in any correct format. + */ + width: string; + /** + * Gets or sets an element's height. + * Value: A string that specifies an element's height in any correct format. + */ + height: string; + /** + * Gets or sets a media element's border width. + * Value: A string that specifies a border width in any correct format. + */ + borderWidth: string; + /** + * Gets or sets a media element's border color. + * Value: A string that specifies a border color in any correct format. + */ + borderColor: string; + /** + * Gets or sets a media element's border style. + * Value: A string that specifies a border style in any correct format. + */ + borderStyle: string; + /** + * Gets or sets an element's top margin. + * Value: A string that specifies an element's top margin in any correct format. + */ + marginTop: string; + /** + * Gets or sets an element's right margin. + * Value: A string that specifies an element's right margin in any correct format. + */ + marginRight: string; + /** + * Gets or sets an element's bottom margin. + * Value: A string that specifies an element's bottom margin in any correct format. + */ + marginBottom: string; + /** + * Gets or sets an element's left margin. + * Value: A string that specifies an element's left margin in any correct format. + */ + marginLeft: string; + /** + * Gets or sets a media element's background color. + * Value: A string that specifies a background color in any correct format. + */ + backgroundColor: string; + /** + * Gets or sets the element's text alignment. + * Value: A string value that specifies the element's text alignment in any correct format. + */ + textAlign: string; + /** + * Gets or sets the element's vertical alignment. + * Value: A string value that specifies the element's vertical alignment in any correct format. + */ + verticalAlign: string; +} +/** + * The base class for parameters used in the ASPxHtmlEditor's client-side commands. + */ +interface ASPxClientHtmlEditorCommandArguments { + /** + * Gets the currently selected element in the ASPxHtmlEditor. + * Value: An HTML object which is the currently selected element. + */ + selectedElement: Object; +} +/** + * Contains settings related to the INSERTIMAGE_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertImageCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Specifies the source of the target image. + * Value: A string specifying the source of the target image. + */ + src: string; + /** + * Creates an alternate text for the target image. + * Value: A string that specifies an alternate text for the target image. + */ + alt: string; + /** + * Determines if the target image is wrapped with text. + * Value: true, if the target image is wrapped with text; otherwise, false. + */ + useFloat: boolean; + /** + * Determines the position of the target image. + * Value: A string value defining the position of the target image. + */ + align: string; + /** + * Contains the style settings specifying the appearance of the target image. + * Value: An object that contains the style settings specifying the appearance of the target image. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; +} +/** + * Contains settings related to the CHANGEIMAGE_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorChangeImageCommandArguments extends ASPxClientHtmlEditorInsertImageCommandArguments { +} +/** + * Contains settings related to the INSERTLINK_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertLinkCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Specifies the url of the page the target link goes to. + * Value: A string value specifying the target link url. + */ + url: string; + /** + * Specifiies the text of the target link. + * Value: A string value specifying the text of the target link. + */ + text: string; + /** + * Determines where to open the target link. + * Value: A string that specifies where to open the target link in any correct format. + */ + target: string; + /** + * Defines the title of the target link. + * Value: A string value defining the title of the target link. + */ + title: string; + /** + * Contains the style settings defining the appearance of the target link element. + * Value: An object that contains the style settings defining the appearance of the target link element. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; +} +/** + * The base class for parameters related to inserting or changing media elements in the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorChangeMediaElementCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Defines the HTML "id" attribute of the target media element. + * Value: A string value which is a unique identifier for the element. + */ + id: string; + /** + * Defines the source of the target media element. + * Value: A string defining the source of the target media element. + */ + src: string; + /** + * Determines the position of the target media element. + * Value: A string value indicating the position of the target media element. + */ + align: string; + /** + * Contains the style settings defining the appearance of the target media element. + * Value: An object that contains the style settings defining the appearance of the target media element. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; + /** + * Returns the name of the client-side command corresponding to the parameter. + */ + GetCommandName(): string; +} +/** + * The base class for parameters related to inserting or changing HTML5 media elements (Audio and Video) in the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorChangeHtml5MediaElementCommandArguments extends ASPxClientHtmlEditorChangeMediaElementCommandArguments { + /** + * Determines if a media file will start playing automatically. + * Value: true, if autoplay is enabled; otherwise, false. + */ + autoPlay: boolean; + /** + * Determines if a media file repeats indefinitely, or stops when it reaches the last frame. + * Value: true, to loop playback; otherwise, false. + */ + loop: boolean; + /** + * Determines if the media player controls should be displayed. + * Value: true, if media player controls are displayed; otherwise, false. + */ + showPlayerControls: boolean; + /** + * Determines how a media file should be loaded when the page loads. + * Value: One of the ASPxClientHtmlEditorMediaPreloadMode enumeration values. + */ + preloadMode: string; +} +/** + * Contains settings related to the INSERTAUDIO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertAudioCommandArguments extends ASPxClientHtmlEditorChangeHtml5MediaElementCommandArguments { +} +/** + * Contains settings related to the CHANGEAUDIO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorChangeAudioCommandArguments extends ASPxClientHtmlEditorInsertAudioCommandArguments { +} +/** + * Contains settings related to the INSERTVIDEO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertVideoCommandArguments extends ASPxClientHtmlEditorChangeHtml5MediaElementCommandArguments { + /** + * Defines the URL of an image that is shown while the video file is downloading, or until an end-user clicks the play button. + * Value: A string value that specifies the poster image URL. + */ + posterUrl: string; +} +/** + * Contains settings related to the CHANGEVIDEO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorChangeVideoCommandArguments extends ASPxClientHtmlEditorInsertVideoCommandArguments { +} +/** + * Contains settings related to the INSERTFLASH_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertFlashCommandArguments extends ASPxClientHtmlEditorChangeMediaElementCommandArguments { + /** + * Determines if the target flash element will start playing automatically. + * Value: true, if autoplay is enabled; otherwise, false. + */ + autoPlay: boolean; + /** + * Defines if the target flash element repeats indefinitely, or stops when it reaches the last frame. + * Value: true, to loop playback; otherwise, false. + */ + loop: boolean; + /** + * Determines if the flash related items are displayed in the context menu of the target flash element. + * Value: true, if the specific context menu items are displayed; otherwise, false + */ + enableFlashMenu: boolean; + /** + * Determines if the target flash element can be displayed in the fullscreen mode. + * Value: true, if the fullscreen mode is allowed; otherwise, false. + */ + allowFullscreen: boolean; + /** + * Defines the rendering quality level used for the target flash element. + * Value: A string value that specifies the target flash element rendering quality. + */ + quality: string; +} +/** + * Contains settings related to the CHANGEFLASH_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorChangeFlashCommandArguments extends ASPxClientHtmlEditorInsertFlashCommandArguments { +} +/** + * Contains settings related to the INSERTYOUTUBEVIDEO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertYouTubeVideoCommandArguments extends ASPxClientHtmlEditorChangeMediaElementCommandArguments { + /** + * Determines if suggested videos are shown after the target YouTube video finishes. + * Value: true, to show suggested videos; otherwise, false + */ + showRelatedVideos: boolean; + /** + * Determines if the target YouTube video title and player actions (Watch later, Share) are shown. + * Value: true, to display the title and player actions; otherwise, false. + */ + showVideoInfo: boolean; + /** + * Determines if the privacy-enhanced mode is enabled for the target YouTube video. + * Value: true, if the privace-enhanced mode is enabled; otherwise, false + */ + enablePrivacyEnhancedMode: boolean; + /** + * Determines if the player controls are displayed for the target YouTube video. + * Value: true, if the player controls are displayed; otherwise, false. + */ + showPlayerControls: boolean; +} +/** + * Contains settings related to the CHANGEYOUTUBEVIDEO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorChangeYouTubeVideoCommandArguments extends ASPxClientHtmlEditorInsertYouTubeVideoCommandArguments { +} +/** + * Contains settings related to the TABLEPROPERTIES_DIALOG_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorTablePropertiesCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Contains the style settings defining the appearance of the target table element. + * Value: An object that contains the style settings defining the appearance of the target table element. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; + /** + * Determines the position of the target table element. + * Value: A string value indicating the position of the target table element. + */ + align: string; + /** + * Gets or sets a table cell padding. + * Value: An integer value that is the cell padding. + */ + cellPadding: number; + /** + * Gets or sets the table cell spacing. + * Value: An integer value that is the table cell spacing. + */ + cellSpacing: number; + /** + * Gets or sets a value that is the table caption. + * Value: A string value that is the caption. + */ + caption: string; + /** + * Gets or sets a value indicating whether the first row/column serves as the table's header. + * Value: A string value that specifies whether the first row/column serves as the table's header. + */ + headers: string; + /** + * Gets or sets the table's summary. + * Value: A string value that is the table's summary. + */ + summary: string; +} +/** + * Contains settings related to the INSERTTABLE_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertTableCommandArguments extends ASPxClientHtmlEditorTablePropertiesCommandArguments { + /** + * Gets or sets the count of columns in the table. + * Value: An integer value that is the count of columns. + */ + columns: number; + /** + * Gets or sets the count of rows in the table. + * Value: An integer value that is the count of rows. + */ + rows: number; + /** + * Gets or sets a value indicating whether all table columns should have equal width. + * Value: true, to create equal widths for all columns; otherwise, false. + */ + isEqualColumnWidth: boolean; +} +/** + * Contains settings related to the TABLECELLPROPERTIES_DIALOG_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorTableCellPropertiesCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Contains the style settings defining the appearance of the target cell element. + * Value: An object that contains the style settings defining the appearance of the target cell element. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; + /** + * Gets or sets a value that indicates whether the cell settings should be applied to all cells in the table. + * Value: true, if the cell settings should be applied to all cells in the table; otherwise, false. + */ + applyForAll: boolean; +} +/** + * Contains settings related to the TABLEROWPROPERTIES_DIALOG_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorTableRowPropertiesCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Contains the style settings specifying the appearance of the specified table row. + * Value: An object that contains the style settings specifying the appearance of the specified table row. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; +} +/** + * Contains settings related to the TABLECOLUMNPROPERTIES_DIALOG_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorTableColumnPropertiesCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Contains the style settings defining the appearance of the target column element. + * Value: An object that contains the style settings defining the appearance of the target column element. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; +} +/** + * A method that will handle the DialogInitialized client event. + */ +interface ASPxClientHtmlEditorDialogInitializedEventHandler { + /** + * A method that will handle the client DialogInitialized event. + * @param source An object representing the event's source. + * @param e An ASPxClientHtmlEditorDialogInitializedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorDialogInitializedEventArgs): void; +} +/** + * Provides data for the DialogInitialized client event. + */ +interface ASPxClientHtmlEditorDialogInitializedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dialog that has been initialized. + * Value: A string value that is the name of the initialized dialog. + */ + dialogName: string; + /** + * Gets a dialog object related to the event. + * Value: A ASPxClientHtmlEditorDialogBase object that is the dialog. + */ + dialog: ASPxClientHtmlEditorDialogBase; +} +/** + * Provides data for the event that fires when the HTML Editor dialogs are closed or are going to be closed. + */ +interface ASPxClientHtmlEditorDialogCloseEventArgs extends ASPxClientEventArgs { + /** + * Gets the dialog name related to the event. + * Value: A string value that is the dialog name. + */ + dialogName: string; + /** + * Gets the dialog object related to the event. + * Value: An ASPxClientHtmlEditorDialogBase object that is the dialog. + */ + dialog: ASPxClientHtmlEditorDialogBase; + /** + * Gets a string that contains specific information (if any) passed from the client side for server-side processing. + * Value: A string value representing specific information passed from the client to the server side. + */ + parameter: Object; +} +/** + * A method that will handle the DialogClosing event. + */ +interface ASPxClientHtmlEditorDialogClosingEventHandler { + /** + * A method that will handle the DialogClosing event. + * @param source The event source. + * @param e An ASPxClientHtmlEditorDialogClosingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorDialogClosingEventArgs): void; +} +/** + * Provides data for the DialogClosing event. + */ +interface ASPxClientHtmlEditorDialogClosingEventArgs extends ASPxClientHtmlEditorDialogCloseEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true, if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the DialogClosed event. + */ +interface ASPxClientHtmlEditorDialogClosedEventHandler { + /** + * A method that will handle the DialogClosed event. + * @param source The event source. + * @param e An ASPxClientHtmlEditorDialogClosedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorDialogClosedEventArgs): void; +} +/** + * Provides data for the DialogClosed event. + */ +interface ASPxClientHtmlEditorDialogClosedEventArgs extends ASPxClientHtmlEditorDialogCloseEventArgs { +} +/** + * A method that will handle the CommandExecuting event. + */ +interface ASPxClientHtmlEditorCommandExecutingEventHandler { + /** + * A method that will handle the client CommandExecuted event. + * @param source The event's source. + * @param e An ASPxClientHtmlEditorCommandExecutingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorCommandExecutingEventArgs): void; +} +/** + * Provides data for the CommandExecuting event. + */ +interface ASPxClientHtmlEditorCommandExecutingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value specifying the processed command's name. + */ + commandName: string; + /** + * Gets an optional parameter that complements the processed command. + * Value: An object containing additional information about the processed command. + */ + parameter: Object; +} +/** + * A method that will handle the client events related to command processing. + */ +interface ASPxClientHtmlEditorCommandEventHandler { + /** + * A method that will handle the corresponding client event. + * @param source The event source. This parameter identifies the editor which raised the event. + * @param e An ASPxClientHtmlEditorCommandEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorCommandEventArgs): void; +} +/** + * Provides data for client events that relate to command processing (CustomCommand). + */ +interface ASPxClientHtmlEditorCommandEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value representing the processed command's name. + */ + commandName: string; + /** + * Gets an optional parameter that complements the processed command. + * Value: A string value containing additional information about the processed command. + */ + parameter: Object; +} +/** + * A method that will handle the client events that relate to custom dialog operations. + */ +interface ASPxClientHtmlEditorCustomDialogEventHandler { + /** + * A method that will handle the client CustomDialogOpened event. + * @param source An object representing the event's source. + * @param e An ASPxClientHtmlEditorCustomDialogEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorCustomDialogEventArgs): void; +} +/** + * Provides data for client events that relate to custom dialog operations. + */ +interface ASPxClientHtmlEditorCustomDialogEventArgs extends ASPxClientEventArgs { + /** + * Gets the name that uniquely identifies the processed custom dialog. + * Value: A string value that represents the value assigned to the processed custom dialog's Name property. + */ + name: string; +} +/** + * Provides data for client events that relate to closing a custom dialog. + */ +interface ASPxClientHtmlEditorCustomDialogCloseEventArgsBase extends ASPxClientHtmlEditorCustomDialogEventArgs { + /** + * Gets the status of the closed custom dialog. + * Value: An object representing a custom dialog's closing status. By default, it's the "cancel" string if the dialog operation is canceled, or the "ok" string if a dialog is closed by submitting a file. You can also provide your custom status, if your dialog contains additional buttons. + */ + status: Object; +} +/** + * A method that will handle the CustomDialogClosing client event. + */ +interface ASPxClientHtmlEditorCustomDialogClosingEventHandler { + /** + * A method that will handle the client CustomDialogClosing event. + * @param source An object representing the event's source. + * @param e An ASPxClientHtmlEditorCustomDialogClosingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorCustomDialogClosingEventArgs): void; +} +/** + * Provides data for the CustomDialogClosing client event. + */ +interface ASPxClientHtmlEditorCustomDialogClosingEventArgs extends ASPxClientHtmlEditorCustomDialogCloseEventArgsBase { + /** + * Gets or sets a value specifying whether the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * A method that will handle the CustomDialogClosed client event. + */ +interface ASPxClientHtmlEditorCustomDialogClosedEventHandler { + /** + * A method that will handle the client CustomDialogClosed event. + * @param source An object representing the event's source. + * @param e An ASPxClientHtmlEditorCustomDialogClosedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorCustomDialogClosedEventArgs): void; +} +/** + * Provides data for the CustomDialogClosed client event. + */ +interface ASPxClientHtmlEditorCustomDialogClosedEventArgs extends ASPxClientHtmlEditorCustomDialogCloseEventArgsBase { + /** + * Gets an object associated with the closed dialog. + * Value: An object containing custom data associated with dialog closing. + */ + data: Object; +} +/** + * A method that will handle the Validation client event. + */ +interface ASPxClientHtmlEditorValidationEventHandler { + /** + * A method that will handle the client Validation event. + * @param source An object representing the event's source. + * @param e An ASPxClientHtmlEditorValidationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorValidationEventArgs): void; +} +/** + * Provides data for the Validation client event. + */ +interface ASPxClientHtmlEditorValidationEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets the HTML markup that is the ASPxHtmlEditor's content. + * Value: A string value that specifies the HTML content to validate. + */ + html: string; + /** + * Gets or sets a value specifying whether the validated value is valid. + * Value: true if the validation has been completed successfully; otherwise, false. + */ + isValid: boolean; + /** + * Gets or sets the error text to be displayed within the editor's error frame if the editor's validation fails. + * Value: A string value specifying the error description. + */ + errorText: string; +} +/** + * A method that will handle the ActiveTabChanged event. + */ +interface ASPxClientHtmlEditorTabEventHandler { + /** + * A method that will handle the client ActiveTabChanged event. + * @param source The event's source. + * @param e An ASPxClientHtmlEditorTabEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorTabEventArgs): void; +} +/** + * Provides data for the ActiveTabChanged event that concerns manipulations on tabs. + */ +interface ASPxClientHtmlEditorTabEventArgs extends ASPxClientEventArgs { + /** + * Gets the name that uniquely identifies an editor tab. + * Value: A string value that is the tab name. + */ + name: string; +} +/** + * A method that will handle the ActiveTabChanging event. + */ +interface ASPxClientHtmlEditorTabCancelEventHandler { + /** + * A method that will handle the client ActiveTabChanging event. + * @param source The event's source. + * @param e An ASPxClientHtmlEditorTabCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorTabCancelEventArgs): void; +} +/** + * Provides data for the cancellable ActiveTabChanging event that concerns manipulations on tabs. + */ +interface ASPxClientHtmlEditorTabCancelEventArgs extends ASPxClientHtmlEditorTabEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event, should be canceled. + * Value: true, if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the BeforePaste event. + */ +interface ASPxClientHtmlEditorBeforePasteEventHandler { + /** + * A method that will handle the BeforePaste event. + * @param source The event source. This parameter identifies the HTML editor object that raised the event. + * @param e An ASPxClientHtmlEditorBeforePasteEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorBeforePasteEventArgs): void; +} +/** + * Provides data for the BeforePaste event. + */ +interface ASPxClientHtmlEditorBeforePasteEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value identifying the command's name. + */ + commandName: string; + /** + * Gets or sets the HTML markup that is about to be pasted to the ASPxHtmlEditor's content. + * Value: A string value that specifies the HTML content to paste. + */ + html: string; +} +/** + * Represents a client-side equivalent of the ASPxHtmlEditor control. + */ +interface ASPxClientHtmlEditor extends ASPxClientControl { + /** + * Occurs on the client side after a dialog has been initialized. + */ + DialogInitialized: ASPxClientEvent>; + /** + * Fires on the client side before a dialog is going to be closed. + */ + DialogClosing: ASPxClientEvent>; + /** + * Occurs on the client side after a dialog is closed. + */ + DialogClosed: ASPxClientEvent>; + /** + * Occurs before a default or custom command has been executed and allows you to cancel the action. + */ + CommandExecuting: ASPxClientEvent>; + /** + * Enables you to implement a custom command's logic. + */ + CustomCommand: ASPxClientEvent>; + /** + * Occurs after a default or custom command has been executed on the client side. + */ + CommandExecuted: ASPxClientEvent>; + /** + * Fires on the client side when the editor's Design View Area receives input focus. + */ + GotFocus: ASPxClientEvent>; + /** + * Fires on the client side when the editor's Design View Area loses input focus. + */ + LostFocus: ASPxClientEvent>; + /** + * Occurs on the client when a selection is changed within the ASPxHtmlEditor. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the content of the editor changes. + */ + HtmlChanged: ASPxClientEvent>; + /** + * Occurs on the client side after a custom dialog is opened. + */ + CustomDialogOpened: ASPxClientEvent>; + /** + * Fires on the client side before a custom dialog is closed. + */ + CustomDialogClosing: ASPxClientEvent>; + /** + * Occurs on the client side after a custom dialog is closed. + */ + CustomDialogClosed: ASPxClientEvent>; + /** + * Allows you to specify whether the value entered into the ASPxHtmlEditor is valid. + */ + Validation: ASPxClientEvent>; + /** + * Occurs on the client side before a context menu is shown. + */ + ContextMenuShowing: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientHtmlEditor. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires after a callback, sent by the CustomDataCallback event handler. + */ + CustomDataCallback: ASPxClientEvent>; + /** + * Occurs on the client side after the editor content is spell checked. + */ + SpellingChecked: ASPxClientEvent>; + /** + * Fires on the client side after the active tab has been changed within a control. + */ + ActiveTabChanged: ASPxClientEvent>; + /** + * Fires on the client side before the active tab is changed within a control. + */ + ActiveTabChanging: ASPxClientEvent>; + /** + * Occurs before an HTML code is pasted to editor content, and allows you to modify it. + */ + BeforePaste: ASPxClientEvent>; + /** + * Returns the document object generated by an iframe element within a design view area. + */ + GetDesignViewDocument(): Object; + /** + * Provides access to the client ASPxPopupControl object that is a Html Editor's dialog. + */ + GetDialogPopupControl(): ASPxClientPopupControl; + /** + * Returns the document object generated by an iframe element within a preview area. + */ + GetPreviewDocument(): Object; + /** + * Returns a collection of client context menu objects. + */ + GetContextMenu(): ASPxClientPopupMenu; + /** + * Returns a value indicating whether an editor is enabled. + */ + GetEnabled(): boolean; + /** + * Specifies whether an editor is enabled. + * @param value true to enable the editor; false to disable it. + */ + SetEnabled(value: boolean): void; + /** + * Sets input focus to the ASPxHtmlEditor's edit region. + */ + Focus(): void; + /** + * Gets the HTML markup that represents the editor's content. + */ + GetHtml(): string; + /** + * Specifies the HTML markup that represents the editor's content. + * @param html A string value that specifies the HTML markup. + */ + SetHtml(html: string): void; + /** + * Sets the HTML markup that represents the editor's content. + * @param html A string value that specifies the HTML markup. + * @param clearUndoHistory true to clear the undo stack; otherwise, false. + */ + SetHtml(html: string, clearUndoHistory: boolean): void; + /** + * Replaces placeholders with the specified values. + * @param html A string value that specifies the HTML code to process. + * @param placeholders An array of objects that specify the placeholders and values to replace them. + */ + ReplacePlaceholders(html: string, placeholders: Object[]): string; + /** + * Creates a parameter for ASPxHtmlEditor's client-side commands related to changing media elements. + * @param element An element that is being changed. + */ + CreateChangeMediaElementCommandArguments(element: Object): ASPxClientHtmlEditorChangeMediaElementCommandArguments; + /** + * Executes the specified command. + * @param commandName A string value that specifies the command to perform. + * @param parameter A string value specifying additional information about the command to perform. + * @param addToUndoHistory true, to add the specified command to the undo stack; otherwise, false. + */ + ExecuteCommand(commandName: string, parameter: Object, addToUndoHistory: boolean): boolean; + /** + * Adds the current editor state to the undo/redo history. + */ + SaveToUndoHistory(): void; + /** + * Returns the selection in the ASPxHtmlEditor. + */ + GetSelection(): ASPxClientHtmlEditorSelection; + /** + * Restores the selection within the ASPxHtmlEditor. + */ + RestoreSelection(): boolean; + /** + * Sets the value of the combo box within the HtmlEditor on the client side. + * @param commandName A string value that identifies the combo box's command name within the HtmlEditor's control collection. + * @param value A string value that specifies the combo box's new value. + */ + SetToolbarComboBoxValue(commandName: string, value: string): void; + /** + * Sets the value of the dropdown item picker in the HtmlEditor on the client side. + * @param commandName A string value that identifies the dropdown item picker by its command name. This value is contained in the CommandName property. + * @param value A string value that specifies the dropdown item picker's new value, i.e., the ToolbarItemPickerItem object. + */ + SetToolbarDropDownItemPickerValue(commandName: string, value: string): void; + /** + * Specifies the visibility of a ribbon context tab category specified by its name. + * @param categoryName A Name property value of the required category. + * @param active true to make a category visible; false to make it hidden. + */ + SetRibbonContextTabCategoryVisible(categoryName: string, active: string): void; + /** + * Provides access to an object implementing the HtmlEditor's ribbon UI. + */ + GetRibbon(): ASPxClientRibbon; + /** + * Gets a value that indicates whether the editor's value passes validation. + */ + GetIsValid(): boolean; + /** + * Gets the error text to be displayed within the editor's error frame if the editor's validation fails. + */ + GetErrorText(): string; + /** + * Sets a value that specifies whether the editor's value passes validation. + * @param isValid true if the editor's value passes validation; otherwise, false. + */ + SetIsValid(isValid: boolean): void; + /** + * Sets the error text to be displayed within the editor's error frame if the editor's validation fails. + * @param errorText A string value representing the error text. + */ + SetErrorText(errorText: string): void; + /** + * Performs validation of the editor's content. + */ + Validate(): void; + /** + * Set an active tab specified by its name. + * @param name A string value that is the name of the tab. + */ + SetActiveTabByName(name: string): void; + /** + * Returns the name of the active HTML editor tab. + */ + GetActiveTabName(): string; + /** + * Reconnect the control to an external ribbon. + */ + ReconnectToExternalRibbon(): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientDataCallback object that represents the JavaScript function which receives the callback data as a parameter. + */ + PerformDataCallback(parameter: string, onCallback: ASPxClientDataCallback): void; +} +/** + * Provides client functionality for dialogs within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the client ASPxFormLayout object that arranges all editors in the Html Editor's dialogs. + */ + GetFormLayout(): ASPxClientFormLayout; + /** + * Provides access to the client object of the "OK" button in the Html Editor's dialogs. + */ + GetOkButton(): ASPxClientButton; + /** + * Provides access to the client object of the "Cancel" button in the Html Editor's dialogs. + */ + GetCancelButton(): ASPxClientButton; +} +/** + * Provides client functionality for Html Editor dialogs operated with its elements. + */ +interface ASPxClientHtmlEditorEditElementDialog extends ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the client object of the "Border style" combo box in the Html Editor's dialogs (Style Settings). + */ + GetBorderStyleComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Border width" spin editor in the Html Editor's dialogs (Style Settings). + */ + GetBorderWidthSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Border color" color editor in the Html Editor's dialogs (Style Settings). + */ + GetBorderColorColorEdit(): ASPxClientColorEdit; + /** + * Provides access to the client object of the "Top margin" text box in the Html Editor's dialogs (Style Settings). + */ + GetTopMarginTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Bottom margin" text box in the Html Editor's dialogs (Style Settings). + */ + GetBottomMarginTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Left margin" text box in the Html Editor's dialogs (Style Settings). + */ + GetLeftMarginTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Right margin" text box in the Html Editor's dialogs (Style Settings). + */ + GetRightMarginTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "CSS class" combo box in the Html Editor's dialogs (Style Settings). + */ + GetCssClassNameComboBox(): ASPxClientComboBox; +} +/** + * Provides client functionality for the Change Element Properties dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorChangeElementPropertiesDialog extends ASPxClientHtmlEditorEditElementDialog { + /** + * Provides access to the client object of the "ID" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetIdTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Title" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetTitleTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Direction" combo box in the Html Editor's "Change Element Properties" dialog. + */ + GetDirectionComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Value" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetValueTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Tab index" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetTabIndexTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Disabled" check box in the Html Editor's "Change Element Properties" dialog. + */ + GetDisabledCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Input type" combo box in the Html Editor's "Change Element Properties" dialog. + */ + GetInputTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "For" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetForTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Name" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetNameTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Method" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetMethodTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Action" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetActionTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Checked" check box in the Html Editor's "Change Element Properties" dialog. + */ + GetCheckedCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Max length" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetMaxLengthTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Size" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetSizeTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Readonly" check box in the Html Editor's "Change Element Properties" dialog. + */ + GetReadonlyCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Src" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetSrcTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Accept" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetAcceptTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Alt" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetAltTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Start" spin editor in the Html Editor's "Change Element Properties" dialog. + */ + GetStartSpinEdit(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Width" spin editor in the Html Editor's "Change Element Properties" dialog. + */ + GetWidthValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client ASPxComboBox object that allows you to specify the element width measurement unit in the Html Editor's "Change Element Properties" dialog. + */ + GetWidthValueTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Height" spin editor in the Html Editor's "Change Element Properties" dialog. + */ + GetHeightValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client ASPxComboBox object that allows to specify the element height measurement unit in the Html Editor's "Change Element Properties" dialog. + */ + GetHeightValueTypeComboBox(): ASPxClientComboBox; +} +/** + * Provides client functionality for the Link dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorLinkDialog extends ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the client object of the "E-mail to" text box in the Html Editor's Link dialog. + */ + GetEmailTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Text" text box in the Html Editor's Link dialog. + */ + GetTextTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "ToolTip" text box in the Html Editor's Link dialog. + */ + GetTooltipTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Subject" text box in the Html Editor's Link dialog. + */ + GetSubjectTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "URL" text box in the Html Editor's Link dialog. + */ + GetUrlTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the file manager used in the Link dialog's "Select Document" popup window. + */ + GetFileManager(): ASPxClientFileManager; + /** + * Provides access to the client object of the "Cancel" button in the Link dialog's "Select Document" popup window. + */ + GetSelectDocumentPopupCancelButton(): ASPxClientButton; + /** + * Provides access to the client object of the "Select" button in the Link dialog's "Select Document" popup window. + */ + GetSelectDocumentPopupSelectButton(): ASPxClientButton; + /** + * Provides access to the client popup control object that is the "Select Document" popup window in the Html Editor's Link dialog. + */ + GetSelectDocumentPopupControl(): ASPxClientPopupControl; + /** + * Provides access to the client object of the "Open in new window" check box in the Html Editor's Link dialog. + */ + GetOpenInNewWindowCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client radio button list object used to specify the link type in the Html Editor's Link dialog. + */ + GetLinkTypeRadioButtonList(): ASPxClientRadioButtonList; +} +/** + * Provides client functionality for the Placeholder dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorPlaceholderDialog extends ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the ASPxListBox client object that lists placeholder names in the Html Editor's Placeholder dialog. + */ + GetPlaceholderNameListBox(): ASPxClientListBox; +} +/** + * Provides client functionality for the Paste From Word dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorPasteFromWordDialog extends ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the client object of the "Remove font family" check box in the Html Editor's Flash dialog. + */ + GetRemoveFontFamilyCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for the media dialogs within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorMediaDialogBase extends ASPxClientHtmlEditorEditElementDialog { + /** + * Provides access to the client object of the media file selector that allows you to insert/change media files in the Html Editor's Audio/Video/Flash dialogs. + */ + GetMediaFileSelector(): ASPxClientMediaFileSelector; + /** + * Provides access to the client object of the "More options" check box in the Html Editor's Audio/Video/Flash/Image dialogs. + */ + GetMoreOptionsCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Width" spin editor in the Html Editor's Audio/Video/Flash dialogs. + */ + GetWidthSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Height" spin editor in the Html Editor's Audio/Video/Flash dialogs. + */ + GetHeightSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Position" combo box in the Html Editor's Audio/Video/Flash/Image dialogs. + */ + GetPositionComboBox(): ASPxClientComboBox; +} +/** + * Provides client functionality for the Image dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorImageDialog extends ASPxClientHtmlEditorMediaDialogBase { + /** + * Provides access to the client object of the "Size" combo box in the Html Editor's Image dialog. + */ + GetSizeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Create thumbnail" check box in the Html Editor's Image dialog. + */ + GetCreateThumbnailCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "New image name" text box in the Html Editor's Image dialog. + */ + GetThumbnailNameTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Wrap text around image" check box in the Html Editor's Image dialog. + */ + GetWrapTextCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Description" text box in the Html Editor's Image dialog. + */ + GetDescriptionTextBox(): ASPxClientTextBox; +} +/** + * Provides client functionality for the Flash dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorFlashDialog extends ASPxClientHtmlEditorMediaDialogBase { + /** + * Provides access to the client object of the "Quality" combo box in the Html Editor's Flash dialog. + */ + GetQualityComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Auto play" check box in the Html Editor's Flash dialog. + */ + GetAutoPlayCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Enable flash menu" check box in the Html Editor's Flash dialog. + */ + GetEnableFlashMenuCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Loop" check box in the Html Editor's Flash dialog. + */ + GetLoopCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Allow fullscreen" check box in the Html Editor's Flash dialog. + */ + GetAllowFullscreenCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for the Audio dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorAudioDialog extends ASPxClientHtmlEditorMediaDialogBase { + /** + * Provides access to the client object of the "Auto play" check box in the Html Editor's Audio dialogs. + */ + GetAutoPlayCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Preload mode" combo box in the Html Editor's Audio dialogs. + */ + GetPreloadModeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Loop" check box in the Html Editor's Audio dialogs. + */ + GetLoopCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Show player controls" check box in the Html Editor's Audio dialogs. + */ + GetShowPlayerControlsCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for the Video dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorVideoDialog extends ASPxClientHtmlEditorMediaDialogBase { + /** + * Provides access to the client object of the "Auto play" check box in the Html Editor's Video dialog. + */ + GetAutoPlayCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Preload mode" combo box in the Html Editor's Video dialog. + */ + GetPreloadModeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Loop" check box in the Html Editor's Video dialog. + */ + GetLoopCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Show player controls" check box in the Html Editor's Video dialog. + */ + GetShowPlayerControlsCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Poster URL" text box in the Html Editor's Video dialog. + */ + GetPosterTextBox(): ASPxClientTextBox; +} +/** + * Provides client functionality for the YouTube Video dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorYouTubeDialog extends ASPxClientHtmlEditorEditElementDialog { + /** + * Provides access to the client object of the "Enable privacy-enhanced mode" check box in the Html Editor's YouTube Video dialog. + */ + GetConfidentModeCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Show suggested videos when the video finishes" check box in the Html Editor's YouTube Video dialog. + */ + GetShowSameVideosCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Show video title and player actions" check box in the Html Editor's YouTube Video dialog. + */ + GetShowVideoNameCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Show player controls" check box in the Html Editor's YouTube Video dialog. + */ + GetShowPlayerControlsCheckBox(): ASPxClientCheckBox; +} +/** + * Provides base client functionality for the Table dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableDialogBase extends ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the client object of the "Background color" color editor in the Html Editor's Table dialogs. + */ + GetBackgroundColorColorEdit(): ASPxClientColorEdit; +} +/** + * Provides client functionality for the Table dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableDialog extends ASPxClientHtmlEditorTableDialogBase { + /** + * Provides access to the client object of the "Width" combo box in the Html Editor's Table dialogs. + */ + GetWidthTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the spin editor in the Html Editor's Table dialogs that allows you to specify the table width value. + */ + GetWidthValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the combo box in the Html Editor's Table dialogs that allows you to specify the table width measurement unit. + */ + GetWidthValueTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Height" combo box in the Html Editor's Table dialogs. + */ + GetHeightTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the spin editor in the Html Editor's Table dialogs that allows you specify the table height value. + */ + GetHeightValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the combo box in the Html Editor's Table dialogs that allows you to specify the table height measurement unit. + */ + GetHeightValueTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Cell padding" spin editor in the Html Editor's Table dialogs. + */ + GetCellPaddingSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Cell spacing" spin editor in the Html Editor's Table dialogs. + */ + GetCellSpacingSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Alignment" combo box in the Html Editor's Table dialogs. + */ + GetAlignmentComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Border Color" color editor in the Html Editor's Table dialogs. + */ + GetBorderColorColorEdit(): ASPxClientColorEdit; + /** + * Provides access to the client object of the "Border size" spin editor in the Html Editor's Table dialogs. + */ + GetBorderWidthSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Headers" combo box in the Html Editor's Table dialogs. + */ + GetHeadersComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Caption" text box in the Html Editor's Table dialogs. + */ + GetCaptionTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Summary" text box in the Html Editor's Table dialogs. + */ + GetSummaryTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Accessibility" check box related to the Html Editor's Table dialogs. + */ + GetAccessibilityCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for the Insert Table dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorInsertTableDialog extends ASPxClientHtmlEditorTableDialog { + /** + * Provides access to the client object of the "Columns" spin editor in the Html Editor's Table dialogs. + */ + GetColumnCountSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Rows" spin editor in the Html Editor's Table dialogs. + */ + GetRowCountSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Equal column widths" check box in the Html Editor's Table dialogs. + */ + GetEqualWidthCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for Table dialogs within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableElementPropertiesDialog extends ASPxClientHtmlEditorTableDialogBase { + /** + * Provides access to the client object of the "Horizontal" combo box in the Html Editor's Row/Column/Cell Properties dialog's Alignment group. + */ + GetHorizontalAlignmentComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Vertical" combo box in the Html Editor's Row/Column/Cell Properties dialog's Alignment group. + */ + GetVerticalAlignmentComboBox(): ASPxClientComboBox; +} +/** + * Provides client functionality for the Cell Properties dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableCellPropertiesDialog extends ASPxClientHtmlEditorTableElementPropertiesDialog { + /** + * Provides access to the client object of the "Apply to all cells in the table" check box in the Html Editor's Cell Properties dialog. + */ + GetApplyToAllCellsCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for the Row Properties dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableRowPropertiesDialog extends ASPxClientHtmlEditorTableElementPropertiesDialog { + /** + * Provides access to the client object of the "Height" combo box in the Html Editor's "Row Properties" dialog. + */ + GetHeightTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client ASPxSpinEdit object that allows you to specify the row height in the Html Editor's "Row Properties" dialog. + */ + GetHeightValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client ASPxComboBox object that allows you to specify the row height measurement unit in the Html Editor's "Row Properties" dialog. + */ + GetHeightValueTypeComboBox(): ASPxClientComboBox; +} +/** + * Provides client functionality for the Column Properties dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableColumnPropertiesDialog extends ASPxClientHtmlEditorTableElementPropertiesDialog { + /** + * Provides access to the client object of the "Width" combo box in the Html Editor's "Column Properties" dialog. + */ + GetWidthTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the spin editor that allows you to set the column width value in the Html Editor's "Column Properties" dialog. + */ + GetWidthValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the combo box that allows you to specify the column width measurement unit in the Html Editor's "Column Properties" dialog. + */ + GetWidthValueTypeComboBox(): ASPxClientComboBox; +} +/** + * A selection in the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorSelection { + /** + * Returns a DOM element that relates to the current selection. + */ + GetSelectedElement(): Object; + /** + * Returns the HTML markup specifying the currently selected ASPxHtmlEditor content. + */ + GetHtml(): string; + /** + * Returns the text within the currently selected ASPxHtmlEditor content. + */ + GetText(): string; + /** + * Returns an array of the currently selected elements. + */ + GetElements(): Object[]; + /** + * Sets the new HTML markup in place of the currently selected within ASPxHtmlEditor content. + * @param html A string value specifying the new HTML markup. + * @param addToHistory true to add this operation to the history; otherwise, false. + */ + SetHtml(html: string, addToHistory: boolean): void; +} +/** + * The client-side equivalent of the ASPxPivotGrid control. + */ +interface ASPxClientPivotGrid extends ASPxClientControl { + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientPivotGrid. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires after a callback that has been processed on the server returns back to the client. + */ + AfterCallback: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Fires before a callback is sent to the server for server-side processing. + */ + BeforeCallback: ASPxClientEvent>; + /** + * Fires on the client side after the customization form's visible state has been changed. + */ + CustomizationFieldsVisibleChanged: ASPxClientEvent>; + /** + * Occurs when a cell is clicked. + */ + CellClick: ASPxClientEvent>; + /** + * Occurs when a cell is double clicked. + */ + CellDblClick: ASPxClientEvent>; + /** + * Occurs when a custom menu item has been clicked. + */ + PopupMenuItemClick: ASPxClientEvent>; + /** + * Indicates whether the Defer Layout Update check box is enabled. + */ + IsDeferUpdatesChecked(): boolean; + /** + * Indicates whether the Filter Editor (Prefilter) is visible. + */ + IsPrefilterVisible(): boolean; + /** + * Shows the Filter Editor. + */ + ShowPrefilter(): void; + /** + * Hides the Filter Editor. + */ + HidePrefilter(): void; + /** + * Clears the filter expression applied using the Prefilter (Filter Editor). + */ + ClearPrefilter(): void; + /** + * Enables or disables the current filter applied by the Filter Editor (Prefilter). + */ + ChangePrefilterEnabled(): void; + /** + * Returns a value that specifies whether the customization form is visible. + */ + GetCustomizationFieldsVisibility(): boolean; + /** + * Specifies the visibility of the customization form. + * @param value true to display the customization form; false to hide the customization form. + */ + SetCustomizationFieldsVisibility(value: boolean): void; + /** + * Switches the customization form's visible state. + */ + ChangeCustomizationFieldsVisibility(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; +} +/** + * A method that will handle the CellDblClick event. + */ +interface ASPxClientClickEventHandler { + /** + * A method that will handle the CellDblClick event. + * @param source The event source. + * @param e An ASPxClientClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientClickEventArgs): void; +} +/** + * Provides data for the CellDblClick client events. + */ +interface ASPxClientClickEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the parameters associated with the CellDblClick events. + * Value: An object that contains parameters associated with the CellDblClick events. + */ + HtmlEvent: Object; + /** + * Gets the processed cell's value. + * Value: An object that represents the processed cell's value. + */ + Value: Object; + /** + * Gets the index of a column that owns the processed cell. + * Value: An integer value that identifies a column. + */ + ColumnIndex: number; + /** + * Gets the index of a row that owns the processed cell. + * Value: An integer value that identifies a row. + */ + RowIndex: number; + /** + * Gets a column field value. + * Value: An object that represents a column field value. + */ + ColumnValue: Object; + /** + * Gets a row field value. + * Value: An object that represents a row field value. + */ + RowValue: Object; + /** + * Gets a column field name. + * Value: A String value that represents a column field name. + */ + ColumnFieldName: string; + /** + * Gets a row field name. + * Value: A String value that represents a row field name. + */ + RowFieldName: string; + /** + * Gets a column value type. + * Value: A String value that represents a column value type. + */ + ColumnValueType: string; + /** + * Gets a row value type. + * Value: A String value that represents a row value type. + */ + RowValueType: string; + /** + * Gets the index of the data field which corresponds to the clicked summary value. + * Value: An integer value that identifies the data field. + */ + DataIndex: number; +} +/** + * A method that will handle the PopupMenuItemClick event. + */ +interface ASPxClientPivotMenuItemClickEventHandler { + /** + * A method that will handle the PopupMenuItemClick event. + * @param source The event source. + * @param e An ASPxClientPivotMenuItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPivotMenuItemClickEventArgs): void; +} +/** + * Provides data for the PopupMenuItemClick event. + */ +interface ASPxClientPivotMenuItemClickEventArgs extends ASPxClientEventArgs { + /** + * Gets the context menu's type. + * Value: A PivotGridPopupMenuType enumeration value that identifies the context menu. + */ + MenuType: string; + /** + * Gets the name of the menu item currently being clicked. + * Value: A String value that identifies the clicked item by its name. + */ + MenuItemName: string; + /** + * Gets the field's unique indentifier. + * Value: A string which specifies the field's unique indentifier. + */ + FieldID: string; + /** + * Gets the index of the field value for which the popup menu has been invoked. + * Value: An integer value that identifies the field value. + */ + FieldValueIndex: number; +} +/** + * A client-side equivalent of the ASPxPivotCustomizationControl control. + */ +interface ASPxClientPivotCustomization extends ASPxClientControl { + /** + * Returns an HTML element that represents the root of the control's hierarchy. + */ + GetMainContainer(): Object; + /** + * Returns a client-side equivalent of the owner Pivot Grid Control. + */ + GetPivotGrid(): ASPxClientPivotGrid; + /** + * Specifies the Customization Control's height. + * @param value An integer value that specifies the Customization Control's height. + */ + SetHeight(value: number): void; + /** + * Specifies the Customization Control's width. + * @param value An integer value that specifies the Customization Control's width. + */ + SetWidth(value: number): void; + /** + * Recalculates the Customization Control height. + */ + UpdateHeight(): void; + /** + * Specifies the Customization Control's layout. + * @param layout A string that specifies the Customization Control's layout. + */ + SetLayout(layout: string): void; +} +/** + * A method that will handle the CustomCommandExecuted event. + */ +interface ASPxClientRichEditCustomCommandExecutedEventHandler { + /** + * A method that will handle the CustomCommandExecuted event. + * @param source An object representing the event source. Identifies the RichEdit that raised the event. + * @param e A ASPxClientRichEditCustomCommandExecutedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditCustomCommandExecutedEventArgs): void; +} +/** + * Provides data for the CustomCommandExecuted event. + */ +interface ASPxClientRichEditCustomCommandExecutedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value representing the processed command's name. + */ + commandName: string; + /** + * Gets an optional parameter that complements the processed command. + * Value: A string value containing additional information about the processed command. + */ + parameter: Object; +} +/** + * A method that will handle the HyperlinkClick event. + */ +interface ASPxClientRichEditHyperlinkClickEventHandler { + /** + * A method that will handle the HyperlinkClick event. + * @param source The event source. + * @param e An ASPxClientRichEditHyperlinkClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditHyperlinkClickEventArgs): void; +} +/** + * Provides data for the HyperlinkClick event. + */ +interface ASPxClientRichEditHyperlinkClickEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether the event is handled manually, so no default processing is required. + * Value: true if the event is handled and no default processing is required; otherwise false. + */ + handled: boolean; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; + /** + * Gets a value identifying the clicked hyperlink type. + * Value: One of the values. + */ + hyperlinkType: ASPxClientOfficeDocumentLinkType; + /** + * Gets the clicked link's URI. + * Value: A sting value specifying the link's URI. + */ + targetUri: string; +} +/** + * A client-side equivalent of the ASPxRichEdit object. + */ +interface ASPxClientRichEdit extends ASPxClientControl { + /** + * Provides access to document structural elements. + * Value: A object that lists RichEdit's document structural elements. + */ + document: RichEditDocument; + /** + * Provides access to RichEdit's client-side commands. + * Value: A object that lists RichEdit's client-side commands. + */ + commands: RichEditCommands; + /** + * Provides access to the client methods that changes the selection. + * Value: A object that lists methods to work with the selection. + */ + selection: RichEditSelection; + /** + * Gets a unit converter. + * Value: A object representing a unit converter. + */ + unitConverter: RichEditUnitConverter; + /** + * Occurs after a custom command has been executed on the client side. + */ + CustomCommandExecuted: ASPxClientEvent>; + /** + * Fires after a client change has been made to the document and the client-server synchronization starts to apply the change on the server. + */ + BeginSynchronization: ASPxClientEvent>; + /** + * Fires after a document change has been applied to the server and server and client document models have been synchronized. + */ + EndSynchronization: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the RichEdit. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires if any change is made to the RichEdit's document on the client. + */ + DocumentChanged: ASPxClientEvent>; + /** + * Occurs when a hyperlink is clicked within the document. + */ + HyperlinkClick: ASPxClientEvent>; + /** + * Occurs when the selection is changed within the document. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Enables you to switch the full-screen mode of the Rich Text Editor. + * @param fullscreen true to activate full-screen mode; false to deactivate full-screen mode. + */ + SetFullscreenMode(fullscreen: boolean): void; + /** + * Provides access to an object implementing the RichEdit's ribbon UI. + */ + GetRibbon(): ASPxClientRibbon; + /** + * Sets input focus to the RichEdit. + */ + Focus(): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Indicates whether any unsaved changes are contained in the current document. + */ + HasUnsavedChanges(): boolean; + /** + * Reconnects the RichEdit to an external ribbon. + */ + ReconnectToExternalRibbon(): void; +} +/** + * Contains a set of the available client commands. + */ +interface RichEditCommands { + /** + * Gets a command to create a new empty document. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileNew: FileNewCommand; + /** + * Gets a command to open the file, specifying its path. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileOpen: FileOpenCommand; + /** + * Gets a command to invoke the File Open dialog allowing one to select and load a document file into RichEdit. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileOpenDialog: FileOpenDialogCommand; + /** + * Gets a command to save the document to a file. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileSave: FileSaveCommand; + /** + * Gets a command to download the document file, specifying its extension. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileDownload: FileDownloadCommand; + /** + * Gets a command to invoke the Save As dialog that prompts for a file name and saves the current document in a file with the specified path. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileSaveAs: FileSaveAsCommand; + /** + * Gets a command to open the file's Save As dialog. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileSaveAsDialog: FileSaveAsDialogCommand; + /** + * Gets a command to invoke a browser-specific Print dialog allowing one to print the current document. + * Value: A object that provides methods for executing the command and checking its state. + */ + filePrint: FilePrintCommand; + /** + * Gets a command to cancel changes caused by the previous command. + * Value: A object that provides methods for executing the command and checking its state. + */ + undo: UndoCommand; + /** + * Gets a command to reverse actions of the previous undo command. + * Value: A object that provides methods for executing the command and checking its state. + */ + redo: RedoCommand; + /** + * Gets a command to copy the selected text and place it to the clipboard. + * Value: A object that provides methods for executing the command and checking its state. + */ + copy: CopyCommand; + /** + * Gets a command to paste the text from the clipboard over the selection. + * Value: A object that provides methods for executing the command and checking its state. + */ + paste: PasteCommand; + /** + * Gets a command to cut the selected text and place it to the clipboard. + * Value: A object that provides methods for executing the command and checking its state. + */ + cut: CutCommand; + /** + * Gets a command to change the font name of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontName: ChangeFontNameCommand; + /** + * Gets a command to change the font size of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontSize: ChangeFontSizeCommand; + /** + * Gets a command to increase the font size of characters in a selected range to the closest larger predefined value. + * Value: A object that provides methods for executing the command and checking its state. + */ + increaseFontSize: IncreaseFontSizeCommand; + /** + * Gets a command to decrease the selected range's font size to the closest smaller predefined value. + * Value: A object that provides methods for executing the command and checking its state. + */ + decreaseFontSize: DecreaseFontSizeCommand; + /** + * Gets a command to convert selected text to upper case. + * Value: A object that provides methods for executing the command and checking its state. + */ + makeTextUpperCase: MakeTextUpperCaseCommand; + /** + * Gets a command to convert selected text to lower case. + * Value: A object that provides methods for executing the command and checking its state. + */ + makeTextLowerCase: MakeTextLowerCaseCommand; + /** + * Gets a command to capitalize each word in the selected sentence. + * Value: A object that provides methods for executing the command and checking its state. + */ + capitalizeEachWordTextCase: CapitalizeEachWordTextCaseCommand; + /** + * Gets a command to toggle case for each character - upper case becomes lower, lower case becomes upper. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTextCase: ToggleTextCaseCommand; + /** + * Gets a command to change the bold formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontBold: ChangeFontBoldCommand; + /** + * Gets a command to change the italic formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontItalic: ChangeFontItalicCommand; + /** + * Gets a command to change the underline formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontUnderline: ChangeFontUnderlineCommand; + /** + * Gets a command to change the strikeout formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontStrikeout: ChangeFontStrikeoutCommand; + /** + * Gets a command to change the superscript formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontSuperscript: ChangeFontSuperscriptCommand; + /** + * Gets a command to change the subscript formatting of characters in the selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontSubscript: ChangeFontSubscriptCommand; + /** + * Gets a command to change the font color of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontForeColor: ChangeFontForeColorCommand; + /** + * Gets a command to change the background color of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontBackColor: ChangeFontBackColorCommand; + /** + * Gets a command to reset text and paragraph formatting in the selected range to default. + * Value: A object that provides methods for executing the command and checking its state. + */ + clearFormatting: ClearFormattingCommand; + /** + * Gets a command to change the selected range's style. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeStyle: ChangeStyleCommand; + /** + * Gets a command to toggle between the bulleted paragraph and normal text. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleBulletedList: ToggleBulletedListCommand; + /** + * Gets a command to toggle between the numbered paragraph and normal text. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleNumberingList: ToggleNumberingListCommand; + /** + * Gets a command to toggle between the multilevel list style and normal text. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleMultilevelList: ToggleMultilevelListCommand; + /** + * Gets a command to increment the indent level of paragraphs in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + increaseIndent: IncreaseIndentCommand; + /** + * Gets a command to decrease the indent level of paragraphs in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + decreaseIndent: DecreaseIndentCommand; + /** + * Gets a command to toggle hidden symbol visibility. + * Value: A object that provides methods for executing the command and checking its state. + */ + showHiddenSymbols: ShowHiddenSymbolsCommand; + /** + * Gets a command to toggle left paragraph alignment on and off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleParagraphAlignmentLeft: ToggleParagraphAlignmentLeftCommand; + /** + * Gets a command to toggle centered paragraph alignment on and off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleParagraphAlignmentCenter: ToggleParagraphAlignmentCenterCommand; + /** + * Gets a command to toggle right paragraph alignment on and off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleParagraphAlignmentRight: ToggleParagraphAlignmentRightCommand; + /** + * Gets a command to toggle justified paragraph alignment on and off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleParagraphAlignmentJustify: ToggleParagraphAlignmentJustifyCommand; + /** + * Gets a command to format a current paragraph with single line spacing. + * Value: A object that provides methods for executing the command and checking its state. + */ + setSingleParagraphSpacing: SetSingleParagraphSpacingCommand; + /** + * Gets a command to format a current paragraph with one and a half line spacing. + * Value: A object that provides methods for executing the command and checking its state. + */ + setSesquialteralParagraphSpacing: SetSesquialteralParagraphSpacingCommand; + /** + * Gets a command to format a selected paragraph with double line spacing. + * Value: A object that provides methods for executing the command and checking its state. + */ + setDoubleParagraphSpacing: SetDoubleParagraphSpacingCommand; + /** + * Gets a command to add spacing before a paragraph. + * Value: A object that provides methods for executing the command and checking its state. + */ + addSpacingBeforeParagraph: AddSpacingBeforeParagraphCommand; + /** + * Gets a command to add spacing after a paragraph. + * Value: A object that provides methods for executing the command and checking its state. + */ + addSpacingAfterParagraph: AddSpacingAfterParagraphCommand; + /** + * Gets a command to remove spacing before the selected paragraph. + * Value: A object that provides methods for executing the command and checking its state. + */ + removeSpacingBeforeParagraph: RemoveSpacingBeforeParagraphCommand; + /** + * Gets a command to remove spacing after the selected paragraph. + * Value: A object that provides methods for executing the command and checking its state. + */ + removeSpacingAfterParagraph: RemoveSpacingAfterParagraphCommand; + /** + * Gets a command to change the background color of paragraphs in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeParagraphBackColor: ChangeParagraphBackColorCommand; + /** + * Gets a command to invoke the Font dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openFontFormattingDialog: OpenFontFormattingDialogCommand; + /** + * Gets a command to change the font formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontFormatting: ChangeFontFormattingCommand; + /** + * Gets a command to invoke the Indents And Spacing tab of the Paragraph dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openParagraphFormattingDialog: OpenParagraphFormattingDialogCommand; + /** + * Gets a command to change the formatting of paragraphs in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeParagraphFormatting: ChangeParagraphFormattingCommand; + /** + * Gets a command to insert a page break at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertPageBreak: InsertPageBreakCommand; + /** + * Gets a command to invoke the Insert Table dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openInsertTableDialog: OpenInsertTableDialogCommand; + /** + * Gets a command to insert a rectangle table of a specified size. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTable: InsertTableCommand; + /** + * Gets a command to invoke the Insert Image dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openInsertPictureDialog: OpenInsertPictureDialogCommand; + /** + * Gets a command to insert an inline picture stored by specifed web address. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertPicture: InsertPictureCommand; + /** + * Gets a command to invoke the Bookmark dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openInsertBookmarkDialog: OpenInsertBookmarkDialogCommand; + /** + * Gets a command to insert a new bookmark that references the current selection. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertBookmark: InsertBookmarkCommand; + /** + * A command to delete a specific bookmark. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteBookmark: DeleteBookmarkCommand; + /** + * Gets a command to navigate to the specified bookmark. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToBookmark: GoToBookmarkCommand; + /** + * Gets a command to invoke the Hyperlink dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openInsertHyperlinkDialog: OpenInsertHyperlinkDialogCommand; + /** + * Gets a command to insert a hyperlink at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertHyperlink: InsertHyperlinkCommand; + /** + * Gets a command to delete the selected hyperlink. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteHyperlink: DeleteHyperlinkCommand; + /** + * Gets a command to delete all hyperlinks in the selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteHyperlinks: DeleteHyperlinksCommand; + /** + * Gets a command to navigate to the document bookmark or URI (uniform resource identifier) specified for the hyperlink. + * Value: A object that provides methods for executing the command and checking its state. + */ + openHyperlink: OpenHyperlinkCommand; + /** + * Gets a command to invoke the Symbols dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openInsertSymbolDialog: OpenInsertSymbolDialogCommand; + /** + * Gets a command to insert a character into a document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertSymbol: InsertSymbolCommand; + /** + * Gets a command to change page margin settings. + * Value: A object that provides methods for executing the command and checking its state. + */ + changePageMargins: ChangePageMarginsCommand; + /** + * Gets a command to invoke the Margins tab of the Page Setup dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openPageMarginsDialog: OpenPageMarginsDialogCommand; + /** + * Gets a command to change the page orientation. + * Value: A object that provides methods for executing the command and checking its state. + */ + changePageOrientation: ChangePageOrientationCommand; + /** + * Gets a command to define the page size dialog's settings. + * Value: A object that provides methods for executing the command and checking its state. + */ + setPageSizeDialog: SetPageSizeDialogCommand; + /** + * Gets a command to invoke the Paper tab of the Page Setup dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openPagePaperSizeDialog: OpenPagePaperSizeDialogCommand; + /** + * Gets a command to change the page size. + * Value: A object that provides methods for executing the command and checking its state. + */ + changePageSize: ChangePageSizeCommand; + /** + * Gets a command to change the number of section columns having the same width. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeSectionEqualColumnCount: ChangeSectionEqualColumnCountCommand; + /** + * Gets a command to invoke the Columns dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openSectionColumnsDialog: OpenSectionColumnsDialogCommand; + /** + * Gets a command to change the settings of individual section columns. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeSectionColumns: ChangeSectionColumnsCommand; + /** + * Gets a command to insert a column break at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertColumnBreak: InsertColumnBreakCommand; + /** + * Gets a command to insert a section break and starts a new section on the next page. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertSectionBreakNextPage: InsertSectionBreakNextPageCommand; + /** + * Gets a command to insert a section break and starts a new section on the next even-numbered page. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertSectionBreakEvenPage: InsertSectionBreakEvenPageCommand; + /** + * Gets a command to insert a section break and starts a new section on the next odd-numbered page. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertSectionBreakOddPage: InsertSectionBreakOddPageCommand; + /** + * Gets a command to set the background color of the page. + * Value: A object that provides methods for executing the command and checking its state. + */ + changePageColor: ChangePageColorCommand; + /** + * Gets a command to toggle the horizontal ruler's visibility. + * Value: A object that provides methods for executing the command and checking its state. + */ + showHorizontalRuler: ShowHorizontalRulerCommand; + /** + * Gets a command to toggle the fullscreen mode. + * Value: A object that provides methods for executing the command and checking its state. + */ + setFullscreen: SetFullscreenCommand; + /** + * Gets a command to invoke the Bulleted and Numbering dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openNumberingListDialog: OpenNumberingListDialogCommand; + /** + * Gets a command to insert a paragraph break at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertParagraph: InsertParagraphCommand; + /** + * Gets a command to insert text at the current position in a document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertText: InsertTextCommand; + /** + * Gets a command to delete the text in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + delete: DeleteCommand; + /** + * Gets a command to remove the previous word. + * Value: A object that provides methods for executing the command and checking its state. + */ + removePrevWord: RemovePrevWordCommand; + /** + * Gets a command to remove the next word. + * Value: A object that provides methods for executing the command and checking its state. + */ + removeNextWord: RemoveNextWordCommand; + /** + * Gets a command to move the cursor backwards and erase the character in that space. + * Value: A object that provides methods for executing the command and checking its state. + */ + backspace: BackspaceCommand; + /** + * Gets a command to insert the line break at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertLineBreak: InsertLineBreakCommand; + /** + * Gets a command to scale pictures in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changePictureScale: ChangePictureScaleCommand; + /** + * Gets a command to increment the left indentation of paragraphs in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + incrementParagraphLeftIndent: IncrementParagraphLeftIndentCommand; + /** + * Gets a command to decrement the paragraph's left indent position. + * Value: A object that provides methods for executing the command and checking its state. + */ + decrementParagraphLeftIndent: DecrementParagraphLeftIndentCommand; + /** + * Gets a command to move the selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + moveContent: MoveContentCommand; + /** + * Gets a command to copy the selected text and place it to the specified position. + * Value: A object that provides methods for executing the command and checking its state. + */ + copyContent: CopyContentCommand; + /** + * Gets a command to insert a tab character at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTab: InsertTabCommand; + /** + * Gets a command to invoke the Tabs dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openTabsDialog: OpenTabsDialogCommand; + /** + * Gets a command to change the tab stop value of a document or selected paragraphs + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTabs: ChangeTabsCommand; + /** + * Gets a command to invoke the Customize Numbered List dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openCustomNumberingListDialog: OpenCustomNumberingListDialogCommand; + /** + * Gets a command to customize the numbered list parameters. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeCustomNumberingList: ChangeCustomNumberingListCommand; + /** + * Gets a command to restart the numbering list. + * Value: A object that provides methods for executing the command and checking its state. + */ + restartNumberingList: RestartNumberingListCommand; + /** + * Gets a command to increment the indent level of paragraphs in a selected numbered list. + * Value: A object that provides methods for executing the command and checking its state. + */ + incrementNumberingIndent: IncrementNumberingIndentCommand; + /** + * Gets a command to decrement the indent level of paragraphs in a selected numbered list. + * Value: A object that provides methods for executing the command and checking its state. + */ + decrementNumberingIndent: DecrementNumberingIndentCommand; + /** + * Gets a command to create a field with an empty code and populate it with the selection (if it is not collapsed). + * Value: A object that provides methods for executing the command and checking its state. + */ + createField: CreateFieldCommand; + /** + * Gets a command to update the field's result. + * Value: A object that provides methods for executing the command and checking its state. + */ + updateField: UpdateFieldCommand; + /** + * Gets a command to display the selected field's codes. + * Value: A object that provides methods for executing the command and checking its state. + */ + showFieldCodes: ShowFieldCodesCommand; + /** + * Get a command to display all field codes in place of the fields in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + showAllFieldCodes: ShowAllFieldCodesCommand; + /** + * Gets a command to continue the list's numbering. + * Value: A object that provides methods for executing the command and checking its state. + */ + continueNumberingList: ContinueNumberingListCommand; + /** + * Gets a command to insert numeration to a paragraph making it a numbering list item. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertNumeration: InsertNumerationCommand; + /** + * Gets a command to remove the selected numeration. + * Value: A object that provides methods for executing the command and checking its state. + */ + removeNumeration: RemoveNumerationCommand; + /** + * Gets a command to update all fields in the selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + updateAllFields: UpdateAllFieldsCommand; + /** + * Gets a command to insert and update a field with a DATE code. + * Value: A object that provides methods for executing the command and checking its state. + */ + createDateField: CreateDateFieldCommand; + /** + * Gets a command to replace the selection with a TIME field displaying the current time. + * Value: A object that provides methods for executing the command and checking its state. + */ + createTimeField: CreateTimeFieldCommand; + /** + * A command to replace the selection with a PAGE field displaying the current page number. + * Value: A object that provides methods for executing the command and checking its state. + */ + createPageField: CreatePageFieldCommand; + /** + * Gets a command to convert the text of all selected sentences to sentence case. + * Value: A object that provides methods for executing the command and checking its state. + */ + makeTextSentenceCase: MakeTextSentenceCaseCommand; + /** + * Gets a command to switch the text case at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + switchTextCase: SwitchTextCaseCommand; + /** + * Gets a command to navigate to the first data record. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToFirstDataRecord: GoToFirstDataRecordCommand; + /** + * Gets a command to navigate to the previous data record of the bound data source. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToPreviousDataRecord: GoToPreviousDataRecordCommand; + /** + * Gets a command to navigate to the next data record of the bound data source. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToNextDataRecord: GoToNextDataRecordCommand; + /** + * Gets a command to navigate to the next data record. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToDataRecord: GoToDataRecordCommand; + /** + * Gets a command to navigate to the last data record of the bound data source. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToLastDataRecord: GoToLastDataRecordCommand; + /** + * Gets a command to display or hide actual data in MERGEFIELD fields. + * Value: A object that provides methods for executing the command and checking its state. + */ + showMergedData: ShowMergedDataCommand; + /** + * Gets a command to invoke the Insert Merge Field dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + mergeFieldDialog: MergeFieldDialogCommand; + /** + * Gets a command to replace the selection with a MERGEFIELD (a data source column name is passed with a parameter). + * Value: A object that provides methods for executing the command and checking its state. + */ + createMergeField: CreateMergeFieldCommand; + /** + * Gets a command to invoke the Export Range dialog window to start a mail merge. + * Value: A object that provides methods for executing the command and checking its state. + */ + mailMergeDialog: MailMergeDialogCommand; + /** + * Gets a command to perform a mail merge and download the merged document. + * Value: A object that provides methods for executing the command and checking its state. + */ + mailMergeAndDownload: MailMergeAndDownloadCommand; + /** + * Gets a command to perform a mail merge and save the merged document to the server. + * Value: A object that provides methods for executing the command and checking its state. + */ + mailMergeAndSaveAs: MailMergeAndSaveAsCommand; + /** + * Gets a command to activate the page header and begin editing. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertHeader: InsertHeaderCommand; + /** + * Gets a command to activate the page footer and begin editing. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertFooter: InsertFooterCommand; + /** + * Gets a command to link a header/footer to the previous section, so it has the same content. + * Value: A object that provides methods for executing the command and checking its state. + */ + linkHeaderFooterToPrevious: LinkHeaderFooterToPreviousCommand; + /** + * Gets a command to navigate to the page footer from the page header in the header/footer editing mode. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToFooter: GoToFooterCommand; + /** + * Gets a command to navigate to the page header from the page footer in the header/footer editing mode. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToHeader: GoToHeaderCommand; + /** + * Gets a command to navigate to the next page header or footer in the header/footer editing mode. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToNextHeaderFooter: GoToNextHeaderFooterCommand; + /** + * Gets a command to navigate to the previous page header or footer in the header/footer editing mode. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToPreviousHeaderFooter: GoToPreviousHeaderFooterCommand; + /** + * Gets a command to change the header/footer edit mode, so it allows creation of a different header or footer for the first page of a document or section. + * Value: A object that provides methods for executing the command and checking its state. + */ + setDifferentFirstPageHeaderFooter: SetDifferentFirstPageHeaderFooterCommand; + /** + * Gets a command to change the header/footer edit mode so it allows creation of a different header or footer for odd and even pages of a document or section. + * Value: A object that provides methods for executing the command and checking its state. + */ + setDifferentOddAndEvenPagesHeaderFooter: SetDifferentOddAndEvenPagesHeaderFooterCommand; + /** + * Gets a command to finish header/footer editing. + * Value: A object that provides methods for executing the command and checking its state. + */ + closeHeaderFooter: CloseHeaderFooterCommand; + /** + * Gets a command to replace the selection with a NUMPAGES field displaying the total number of pages. + * Value: A object that provides methods for executing the command and checking its state. + */ + createPageCountField: CreatePageCountFieldCommand; + /** + * Gets a command to invoke the Table tab of the Table Properties dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openTableFormattingDialog: OpenTableFormattingDialogCommand; + /** + * Gets a command to change the selected table's formatting. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableFormatting: ChangeTableFormattingCommand; + /** + * Gets a command to change the selected table rows' preferred height. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableRowPreferredHeight: ChangeTableRowPreferredHeightCommand; + /** + * Gets a command to change the preferred cell width of the selected table rows. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableCellPreferredWidth: ChangeTableCellPreferredWidthCommand; + /** + * Gets a command to toggle inside borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellInsideBorders: ToggleTableCellInsideBordersCommand; + /** + * Gets a command to change the selected table columns' preferred width. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableColumnPreferredWidth: ChangeTableColumnPreferredWidthCommand; + /** + * Gets a command to change the cell formatting of the selected table elements. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableCellFormatting: ChangeTableCellFormattingCommand; + /** + * Gets a command to insert a table column to the left of the current position in the table. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableColumnToTheLeft: InsertTableColumnToTheLeftCommand; + /** + * Gets a command to insert a table column to the right of the current position in the table. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableColumnToTheRight: InsertTableColumnToTheRightCommand; + /** + * Gets a command to insert a row in the table below the selected row. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableRowBelow: InsertTableRowBelowCommand; + /** + * Gets a command to insert a row in the table above the selected row. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableRowAbove: InsertTableRowAboveCommand; + /** + * Gets a command to delete the selected rows in the table. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTableRows: DeleteTableRowsCommand; + /** + * Gets a command to delete the selected columns in the table. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTableColumns: DeleteTableColumnsCommand; + /** + * Gets a command to insert table cells with a horizontal shift into the selected table. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableCellWithShiftToTheLeft: InsertTableCellWithShiftToTheLeftCommand; + /** + * Gets a command to delete the selected table cells with a horizontal shift. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTableCellsWithShiftHorizontally: DeleteTableCellsWithShiftHorizontallyCommand; + /** + * Gets a command to delete the selected table cells with a vertical shift. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTableCellsWithShiftVertically: DeleteTableCellsWithShiftVerticallyCommand; + /** + * Gets a command to delete the selected table. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTable: DeleteTableCommand; + /** + * Gets a command to invoke the Insert Cells dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableCellsDialog: InsertTableCellsDialogCommand; + /** + * Gets a command to invoke the Delete Cells dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTableCellsDialog: DeleteTableCellsDialogCommand; + /** + * Gets a command to merge the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + mergeTableCells: MergeTableCellsCommand; + /** + * Gets a command to invoke the Split Cells dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + splitTableCellsDialog: SplitTableCellsDialogCommand; + /** + * Gets a command to split the selected table cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + splitTableCells: SplitTableCellsCommand; + /** + * Gets a command to insert table cells with a vertical shift into the selected table. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableCellsWithShiftToTheVertically: InsertTableCellsWithShiftToTheVerticallyCommand; + /** + * Gets a command to invoke the Borders tab of the Borders and Shading dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openTableBordersAndShadingDialog: OpenTableBordersAndShadingDialogCommand; + /** + * Gets a command to change the selected table's borders and shading. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableBordersAndShading: ChangeTableBordersAndShadingCommand; + /** + * Gets a command to apply top-left alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignTopLeft: ToggleTableCellAlignTopLeftCommand; + /** + * Gets a command to apply top-center alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignTopCenter: ToggleTableCellAlignTopCenterCommand; + /** + * Gets a command to apply top-right alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignTopRight: ToggleTableCellAlignTopRightCommand; + /** + * Gets a command to apply middle-left alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignMiddleLeft: ToggleTableCellAlignMiddleLeftCommand; + /** + * Gets a command to apply middle-center alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignMiddleCenter: ToggleTableCellAlignMiddleCenterCommand; + /** + * Gets a command to apply middle-right alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignMiddleRight: ToggleTableCellAlignMiddleRightCommand; + /** + * Gets a command to apply bottom-left alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignBottomLeft: ToggleTableCellAlignBottomLeftCommand; + /** + * Gets a command to apply bottom-center alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignBottomCenter: ToggleTableCellAlignBottomCenterCommand; + /** + * Gets a command to apply bottom-right alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignBottomRight: ToggleTableCellAlignBottomRightCommand; + /** + * Gets a command to change the selected table's style. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableStyle: ChangeTableStyleCommand; + /** + * Gets a command to toggle top borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellTopBorder: ToggleTableCellTopBorderCommand; + /** + * Gets a command to toggle right borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellRightBorder: ToggleTableCellRightBorderCommand; + /** + * Gets a command to toggle bottom borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellBottomBorder: ToggleTableCellBottomBorderCommand; + /** + * Gets a command to toggle left borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellLeftBorder: ToggleTableCellLeftBorderCommand; + /** + * Gets a command to remove the borders of the selected table cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + removeTableCellBorders: RemoveTableCellBordersCommand; + /** + * Gets a command to toggle all borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAllBorders: ToggleTableCellAllBordersCommand; + /** + * Gets a command to toggle inner horizontal borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellInsideHorizontalBorders: ToggleTableCellInsideHorizontalBordersCommand; + /** + * Gets a command to toggle inner vertical borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellInsideVerticalBorders: ToggleTableCellInsideVerticalBordersCommand; + /** + * Gets a command to toggle outer borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellOutsideBorders: ToggleTableCellOutsideBordersCommand; + /** + * Gets a command to change the selected table's style options. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableLook: ChangeTableLookCommand; + /** + * Gets a command to change the repository item's table border style. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableBorderRepositoryItem: ChangeTableBorderRepositoryItemCommand; + /** + * Gets a command to change cell shading in the selected table elements. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableCellShading: ChangeTableCellShadingCommand; + /** + * Gets a command to toggle the display of grid lines for a table with no borders applied - on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + showTableGridLines: ShowTableGridLinesCommand; + /** + * Gets a command to invoke the Search Panel allowing end-users to search text and navigate through search results. + * Value: A object that provides methods for executing the command and checking its state. + */ + openFindPanel: OpenFindPanelCommand; + /** + * Gets a command to invoke the Find and Replace dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openFindAndReplaceDialog: OpenFindAndReplaceDialogCommand; + /** + * Gets a command to find all matches of the specified text in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + findAll: FindAllCommand; + /** + * Gets a command to hide the results of the search. + * Value: A object that provides methods for executing the command and checking its state. + */ + hideFindResults: HideFindResultsCommand; + /** + * Gets a command to search for a specific text and replace all matches in the document with the specified string. + * Value: A object that provides methods for executing the command and checking its state. + */ + replaceAll: ReplaceAllCommand; + /** + * Gets a command to search for a specific text and replace the next match in the document with the specified string. + * Value: A object that provides methods for executing the command and checking its state. + */ + replaceNext: ReplaceNextCommand; + /** + * Gets a command to invoke the Spelling dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openSpellingDialog: OpenSpellingDialogCommand; + /** + * Gets a command to assign a shortcut to the specified client command. + * Value: A object that provides methods for executing the command and checking its state. + */ + assignShortcut: AssignShortcutCommand; + /** + * Gets a command to invoke the Layout dialog window to customize the settings of a floating object. + * Value: A object that provides methods for executing the command and checking its state. + */ + openLayoutOptionsDialog: OpenLayoutOptionsDialogCommand; + /** + * Gets a command to insert a floating text box. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertFloatingTextBox: InsertFloatingTextBoxCommand; + /** + * Gets a command to modify a floating object's alignment position. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectAlignmentPosition: ChangeFloatingObjectAlignmentPositionCommand; + /** + * Gets a command to change a floating object's absolute position. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectAbsolutePosition: ChangeFloatingObjectAbsolutePositionCommand; + /** + * Gets a command to modify a floating object's relative position. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectRelativePosition: ChangeFloatingObjectRelativePositionCommand; + /** + * Gets a command to lock a floating object's anchor. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectLockAnchor: ChangeFloatingObjectLockAnchorCommand; + /** + * Gets a command to modify a floating object's text wrapping settings. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectTextWrapping: ChangeFloatingObjectTextWrappingCommand; + /** + * Gets a command to change a floating object's absolute size. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectAbsoluteSize: ChangeFloatingObjectAbsoluteSizeCommand; + /** + * Gets a command to modify a text box' relative size settings. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTextBoxRelativeSize: ChangeTextBoxRelativeSizeCommand; + /** + * Gets a command to rotate a floating object. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectRotation: ChangeFloatingObjectRotationCommand; + /** + * Gets a command to lock a floating object's aspect ratio. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectLockAspectRatio: ChangeFloatingObjectLockAspectRatioCommand; + /** + * Gets a command to modify a floating object's background fill color. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectFillColor: ChangeFloatingObjectFillColorCommand; + /** + * Gets a command to modify a floating object's outline color. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectOutlineColor: ChangeFloatingObjectOutlineColorCommand; + /** + * Gets a command to modify a floating object's outline width. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectOutlineWidth: ChangeFloatingObjectOutlineWidthCommand; + /** + * Gets a command to modify a text box' content margins. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTextBoxContentMargins: ChangeTextBoxContentMarginsCommand; + changeTextBoxResizeShapeToFitText: ChangeTextBoxResizeShapeToFitTextCommand; +} +/** + * Serves as a base for objects that implement different client command functionalities. + */ +interface CommandBase { +} +/** + * Serves as a base for commands with a simple common command state. + */ +interface CommandWithSimpleStateBase extends CommandBase { + /** + * Gets information about the command state. + */ + getState(): SimpleCommandState; +} +/** + * Serves as a base for commands with the Boolean state. + */ +interface CommandWithBooleanStateBase extends CommandBase { + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * Defines a simple state common to most of the client commands. + */ +interface SimpleCommandState { + /** + * Gets a value indicating whether the command's UI element is enabled (within the ribbon and context menu). + * Value: true, if the command's related UI element is enabled; otherwise, false. + */ + enabled: boolean; + /** + * Gets a value indicating whether the command's UI element is visible. + * Value: true, if the command's related UI element is visible; otherwise, false. + */ + visible: boolean; +} +/** + * Defines the state of a command. + */ +interface CommandState extends SimpleCommandState { + /** + * Gets the command state value. + * Value: A T object specifying the command state value. + */ + value: T; +} +/** + * Contains a set properties providing the current information about certain document structural elements. + */ +interface RichEditDocument { + /** + * Provides the information about the active sub-document. + * Value: A object storing information about the essential document functionality. + */ + activeSubDocument: SubDocument; + /** + * Provides information about sections in the current document. + * Value: An array of Section objects storing information about sections. + */ + sectionsInfo: Section[]; + /** + * Provides information about paragraph styles in the current document. + * Value: An array of ParagraphStyle objects storing information about paragraph styles. + */ + paragraphStylesInfo: ParagraphStyle[]; + /** + * Provides information about character styles in the current document. + * Value: An array of CharacterStyle objects storing information about character styles. + */ + characterStylesInfo: CharacterStyle[]; + /** + * Provides information about numbered paragraphs in the document. + * Value: An array of AbstractNumberingList objects storing the information about numbered paragraphs. + */ + abstractNumberingListsInfo: AbstractNumberingList[]; + /** + * Provides information about table styles in the current document. + * Value: An array of TableStyle objects storing information about table styles. + */ + tableStylesInfo: TableStyle[]; + /** + * Provides information about spell checking in the current document. + * Value: A object. + */ + spellingInfo: SpellingInfo; +} +/** + * An abstract numbering list definition that defines the appearance and behavior of numbered paragraphs in a document. + */ +interface AbstractNumberingList { + deleted: boolean; +} +/** + * Defines a paragraph in the document. + */ +interface Paragraph { + /** + * Gets the paragraph's character length. + * Value: An integer value specifying the element length in characters. + */ + length: number; + /** + * Gets the paragraph's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the text buffer interval occupied by the current paragraph element. + * Value: An object specifying the interval settings. + */ + interval: Interval; + /** + * Gets the name of the paragraph style applied to the current paragraph (see name). + * Value: A string value specifying the style name. + */ + styleName: string; + /** + * Gets the index of a list applied to the paragraph. + * Value: An integer that is the index of a list to which the paragraph belongs. + */ + listIndex: number; + /** + * Gets the index of the list level applied to the current paragraph in the numbering list. + * Value: An integer that is the index of the list level of the current paragraph. + */ + listLevelIndex: number; +} +/** + * Defines a field in the document. + */ +interface Field { + /** + * Gets the field's start position in a document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the field length in a document. + * Value: An integer value specifying the field length. + */ + length: number; + /** + * Gets the text buffer interval occupied by the field code element. + * Value: An object specifying the interval settings. + */ + codeInterval: Interval; + /** + * Gets the text buffer interval occupied by the field result element. + * Value: An object specifying the interval settings. + */ + resultInterval: Interval; + /** + * Gets the text buffer interval occupied by the current field element. + * Value: An object specifying the interval settings. + */ + interval: Interval; + /** + * Gets or sets a URI to navigate to when the hyperlink (represented by the current field) is activated. + * Value: A string representing an URI. + */ + hyperlinkUri: string; + /** + * Gets or sets the text for the tooltip displayed when the mouse hovers over a hyperlink field. + * Value: A string containing the tooltip text. + */ + hyperlinkTip: string; + /** + * Gets or sets the name of a bookmark (or a hyperlink) in the current document which shall be the target of the hyperlink field. + * Value: A string representing the bookmark's name. + */ + hyperlinkAnchor: string; + /** + * Gets a value specifying whether a field's code or result is dispalyed. + * Value: true, if the field code is displayed; false, if the field result is displayed. + */ + showCode: boolean; +} +/** + * Defines a bookmark in the document. + */ +interface Bookmark { + /** + * Gets the bookmark's start position in a document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the bookmark's length. + * Value: An integer value specifying the length of the bookmark. + */ + length: number; + /** + * Gets the text buffer interval occupied by the current bookmark element. + * Value: An object specifying the interval settings. + */ + interval: Interval; + /** + * Gets the name of a bookmark in the document. + * Value: A string that is the unique bookmark's name. + */ + name: string; +} +/** + * Defines a section in the document. + */ +interface Section { + /** + * Gets the section's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the section's character length. + * Value: An integer value specifying the element length in characters. + */ + length: number; + /** + * Gets the text buffer interval occupied by the current section element. + * Value: An object specifying the interval settings. + */ + interval: Interval; + /** + * Provides access to the section's headers. + * Value: An array of HeaderFooter objects storing information about the section's headers. + */ + headers: HeaderFooter[]; + /** + * Provides access to the section's footers. + * Value: An array of HeaderFooter objects storing information about the section's footers. + */ + footers: HeaderFooter[]; +} +/** + * Contains settings defining a header or footer in a document. + */ +interface HeaderFooter { + /** + * Gets the type of the header (footer). + * Value: One of the values. + */ + type: any; + /** + * Provides access to an object implementing the basic document functionality that is common to the header, footer and the main document body. + * Value: A object exposing the basic document functionality. + */ + subDocument: SubDocument; +} +/** + * Contains in-line picture settings. + */ +interface InlinePictureInfo { + /** + * Gets the image identifier. + * Value: An integer value specifying the image identifier. + */ + id: number; + /** + * Gets the image position. + * Value: An integer value specifying the image position. + */ + position: number; + /** + * Gets the initial image width. + * Value: An integer value specifying the image width. + */ + initialWidth: number; + /** + * Gets the initial image height. + * Value: An integer value specifying the image height. + */ + initialHeight: number; + /** + * Gets the X-scaling factor of the inline image. + * Value: An integer value specifying the scaling factor for the X-axis. + */ + scaleX: number; + /** + * Gets the Y-scaling factor of the inline image. + * Value: An integer value specifying the scaling factor for the Y-axis. + */ + scaleY: number; + /** + * Gets the actual image width. + * Value: An integer value specifying the image width. + */ + actualWidth: number; + /** + * Gets the actual image height. + * Value: An integer value specifying the image height. + */ + actualHeight: number; +} +declare enum HeaderFooterType { + First=0, + Odd=1, + Primary=1, + Even=2 +} +/** + * Contains the settings defining a file to save to. + */ +interface RichEditFileInfo { + /** + * Gets or sets the file's folder name. + * Value: A string value specifying the folder name. + */ + folderPath: string; + /** + * Gets or sets the file name. + * Value: A string value specifying the file name. + */ + fileName: string; + /** + * Gets or sets the file's document format. + * Value: A DocumentFormat enumeration value. + */ + documentFormat: any; +} +declare enum DocumentFormat { + Undefined=0, + PlainText=1, + Rtf=2, + Html=3, + OpenXml=4, + Mht=5, + WordML=6, + OpenDocument=7, + ePub=9, + Doc=10 +} +/** + * Contains a set of methods and properties to work with the document selection. + */ +interface RichEditSelection { + /** + * Gets or sets an array of document intervals in the selection. + * Value: An array of Interval objects. + */ + intervals: Interval[]; + /** + * Gets or sets a value specifying whether the current selection is collapsed (and represents the cursor position). + * Value: true, if the selection is collapsed; otherwise, false. + */ + collapsed: boolean; + /** + * Gets the maximum position of a document interval in the selection. + */ + getIntervalMaxPosition(): number; + /** + * Moves the cursor to the next line. + */ + goToNextLine(): void; + /** + * Moves the cursor to the next line and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToNextLine(extendSelection: boolean): void; + /** + * Moves the cursor to the end of the line in which the cursor is located. + */ + goToLineEnd(): void; + /** + * Moves the cursor to the end of the line in which the cursor is located and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToLineEnd(extendSelection: boolean): void; + /** + * Moves the cursor to the start of the line in which the cursor is located. + */ + goToLineStart(): void; + /** + * Moves the cursor to the start of the line in which the cursor is located and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToLineStart(extendSelection: boolean): void; + /** + * Moves the cursor to the previous line. + */ + goToPreviousLine(): void; + /** + * Moves the cursor to the previous line and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToPreviousLine(extendSelection: boolean): void; + /** + * Moves the cursor to the next character. + */ + goToNextCharacter(): void; + /** + * Moves the cursor to the next character and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToNextCharacter(extendSelection: boolean): void; + /** + * Moves the cursor to the previous character. + */ + goToPreviousCharacter(): void; + /** + * Moves the cursor to the previous character and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToPreviousCharacter(extendSelection: boolean): void; + /** + * Selects the line in which the cursor is located. + */ + selectLine(): void; + /** + * Selects the line in which the cursor is located and allows you to extend the entire selection with the currently existing selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + selectLine(extendSelection: boolean): void; + /** + * Moves the cursor to the beginning of the next page. + */ + goToNextPage(): void; + /** + * Moves the cursor to the beginning of the next page and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToNextPage(extendSelection: boolean): void; + /** + * Moves the cursor to the beginning of the previous page. + */ + goToPreviousPage(): void; + /** + * Moves the cursor to the beginning of the previous page and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToPreviousPage(extendSelection: boolean): void; + /** + * Moves the cursor to the start of the document. + */ + goToDocumentStart(): void; + /** + * Moves the cursor to the start of the document and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToDocumentStart(extendSelection: boolean): void; + /** + * Moves the cursor to the end of the document. + */ + goToDocumentEnd(): void; + /** + * Moves the cursor to the end of the document and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToDocumentEnd(extendSelection: boolean): void; + /** + * Moves the cursor to the next word. + */ + goToNextWord(): void; + /** + * Moves the cursor to the next word and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToNextWord(extendSelection: boolean): void; + /** + * Moves the cursor to the previous word. + */ + goToPrevWord(): void; + /** + * Moves the cursor to the previous word and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToPrevWord(extendSelection: boolean): void; + /** + * Moves the cursor to the start of the paragraph in which the cursor is located. + */ + goToParagraphStart(): void; + /** + * Moves the cursor to the start of the paragraph in which the cursor is located and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToParagraphStart(extendSelection: boolean): void; + /** + * Moves the cursor to the end of the paragraph in which the cursor is located. + */ + goToParagraphEnd(): void; + /** + * Moves the cursor to the end of the paragraph in which the cursor is located and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToParagraphEnd(extendSelection: boolean): void; + /** + * Selects the paragraph in which the cursor is located. + */ + selectParagraph(): void; + /** + * Moves the cursor to the next page break mark. + */ + goToStartNextPageCommand(): void; + /** + * Moves the cursor to the next page break mark and extends the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToStartNextPageCommand(extendSelection: boolean): void; + /** + * Moves the cursor to the previous page break mark. + */ + goToStartPrevPageCommand(): void; + /** + * Moves the cursor to the previous page break mark and extends the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToStartPrevPageCommand(extendSelection: boolean): void; + /** + * Selects the table cell in which the cursor is located. + */ + selectTableCell(): void; + /** + * Selects the table cell in which the cursor is located and allows you to extend the entire selection with the currently existing selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + selectTableCell(extendSelection: boolean): void; + /** + * Selects the table row in which the cursor is located. + */ + selectTableRow(): void; + /** + * Selects the table row in which the cursor is located and allows you to extend the entire selection with the currently existing selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + selectTableRow(extendSelection: boolean): void; + /** + * Selects the entire table in which the cursor is located. + */ + selectTable(): void; + /** + * Selects the entire table in which the cursor is located and allows you to extend the entire selection with the currently existing selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + selectTable(extendSelection: boolean): void; + /** + * Selects the editor's entire content. + */ + selectAll(): void; + /** + * Makes the main sub-document active and moves the cursor to its beginning. + */ + setMainSubDocumentAsActive(): void; + /** + * Creates a footer sub-document (if it was not created before) and sets the footer as the active sub-document. Moves the cursor to the footer's start position. + * @param pageIndex An integer value specifying the active page's index. + */ + setFooterSubDocumentAsActiveByPageIndex(pageIndex: number): void; + /** + * Creates a header sub-document (if it was not created before) and sets the header as the active sub-document. Moves the cursor to the header's start position. + * @param pageIndex An integer value specifying the active page's index. + */ + setHeaderSubDocumentAsActiveByPageIndex(pageIndex: number): void; +} +/** + * Defines a document's interval. + */ +interface Interval { + /** + * Gets the interval's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the interval's character length. + * Value: An integer value specifying the element length in characters. + */ + length: number; +} +/** + * Contains spell checking related settings. + */ +interface SpellingInfo { + /** + * Gets a value specifying the spell checking state. + * Value: One of the enumeration values. + */ + spellCheckerState: any; + /** + * Provides access to an array containing misspelled intervals. + * Value: An array of objects. + */ + misspelledIntervals: MisspelledInterval[]; +} +declare enum SpellCheckerState { + Disabled=0, + InProgress=1, + Done=2 +} +/** + * Contains the settings defining a misspelled interval. + */ +interface MisspelledInterval { + /** + * Gets the start position of the misspelled word in the interval. + * Value: An integer value specifying the misspelled word's start position. + */ + start: number; + /** + * Gets the length of the misspelled interval. + * Value: An integer value specifying the misspelled interval's length. + */ + length: number; + /** + * Gets the text buffer interval occupied by the current element. + * Value: An object specifying the interval settings. + */ + interval: Interval; + /** + * Gets the spelling error type. + * Value: One of the enumeration values. + */ + errorType: any; + /** + * Gets an erroneous word found during spell check. + * Value: A string that is the erroneous or misspelled word. + */ + word: string; + /** + * Gets a list of suggested words to replace the misspelled word. + * Value: A string array containing suggested words. + */ + suggestions: string[]; +} +declare enum SpellingErrorType { + Misspelling=0, + Repeating=1 +} +/** + * Serves as a base for objects implementing different element styles. + */ +interface StyleBase { + /** + * Gets or sets the name of the style. + * Value: A string specifying the style name. + */ + name: string; + /** + * Gets whether the specified style is marked as deleted. + * Value: true, if the style is deleted; otherwise, false. + */ + isDeleted: boolean; +} +/** + * Defines the paragraph style settings. + */ +interface ParagraphStyle extends StyleBase { + /** + * Gets or sets the linked style for the current style. + * Value: A object representing a character style linked to a current style. + */ + linkedStyle: CharacterStyle; + /** + * Gets or sets the default style for a paragraph that immediately follows the current paragraph. + * Value: A object specifying the style for the next paragraph. + */ + nextStyle: ParagraphStyle; + /** + * Gets the index of the list item associated with the paragraph formatted with the current style. + * Value: An integer value specifying the list item index. + */ + listIndex: number; + /** + * Gets the index of the list level applied to the paragraph formatted with the current style. + * Value: An integer that is the list level index. + */ + listLevelIndex: number; + /** + * Gets or sets the style from which the current style inherits. + * Value: A object representing the parent style. + */ + parent: ParagraphStyle; +} +/** + * Contains characteristics of a character style in a document. + */ +interface CharacterStyle extends StyleBase { + /** + * Gets or sets the linked style for the current style. + * Value: A object representing a paragraph style linked to a current style. + */ + linkedStyle: ParagraphStyle; + /** + * Gets the style form which the current style inherits. + * Value: A object representing the parent style. + */ + parent: CharacterStyle; +} +/** + * Defines the table style settings. + */ +interface TableStyle extends StyleBase { + /** + * Gets or sets the style from which the current style inherits. + * Value: A object that is the parent style. + */ + parent: TableStyle; +} +/** + * Exposes the settings providing the information about the essential document functionality. + */ +interface SubDocument { + /** + * Gets the sub-document identifier. + * Value: An integer value specifying the sub-document identifier. + */ + id: number; + /** + * Gets a value specifying the sub-document type. + * Value: One of the enumeration values. + */ + type: any; + /** + * Provides information about paragraphs contained in the document. + * Value: An array of Paragraph objects storing information about document paragraphs. + */ + paragraphsInfo: Paragraph[]; + /** + * Provides information about fields in the current document. + * Value: An array of Field objects storing information about document fields. + */ + fieldsInfo: Field[]; + /** + * Provides information about tables contained in the document. + * Value: An array of Table objects storing information about document tables. + */ + tablesInfo: Table[]; + /** + * Provides information about document bookmarks. + * Value: An array of Bookmark objects storing information about document bookmarks. + */ + bookmarksInfo: Bookmark[]; + /** + * Provides access to an array of objects containing in-line picture settings. + * Value: An array of objects. + */ + inlinePicturesInfo: InlinePictureInfo[]; + /** + * Gets the document's textual representation. + * Value: A string value specifying the document's text. + */ + text: string; + /** + * Gets the character length of the document. + * Value: An integer that is the number of character positions in the document. + */ + length: number; +} +declare enum SubDocumentType { + Main=0, + Header=1, + Footer=2, + TextBox=3 +} +/** + * Defines a table in the document. + */ +interface Table { + /** + * Gets the table's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the table length in characters. + * Value: A integer value specifying the character length of the table. + */ + length: number; + /** + * Gets the text buffer interval occupied by the current table element. + * Value: An object specifying the interval settings. + */ + interval: Interval; + /** + * Provides access to a collection of table rows. + * Value: An array of TableRow objects storing information about individual table rows. + */ + rows: TableRow[]; + /** + * Gets the name of the style applied to the table (see name). + * Value: A string value specifying the style name. + */ + styleName: string; +} +/** + * Defines a table row in the document. + */ +interface TableRow { + /** + * Gets the table row's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the table row's character length. + * Value: An integer value specifying the element length in characters. + */ + length: number; + /** + * Gets the text buffer interval occupied by the current table row element. + * Value: An object specifying the interval settings. + */ + interval: Interval; + /** + * Provides information about the table row's cells. + * Value: An array of TableCell objects storing information about cells. + */ + cells: TableCell[]; +} +/** + * Defines a table cell in the document. + */ +interface TableCell { + /** + * Gets the table cell's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the table cell's character length. + * Value: An integer value specifying the element length in characters. + */ + length: number; + /** + * Gets the text buffer interval occupied by the current table cell element. + * Value: An object specifying the interval settings. + */ + interval: Interval; +} +/** + * Contains the method to convert different units of measurement. + */ +interface RichEditUnitConverter { + /** + * Converts a measurement from pixels to twips. + * @param value The pixels value to be converted. + */ + pixelsToTwips(value: number): number; + /** + * Converts a measurement from inches to twips. + * @param value The inches value (floating) to be converted. + */ + inchesToTwips(value: number): number; + /** + * Converts a measurement from points to twips. + * @param value The points value to be converted. + */ + pointsToTwips(value: number): number; + /** + * Converts a value in centimeters to twips. + * @param value A floating value specifying the value in centimeters to convert. + */ + centimetersToTwips(value: number): number; + /** + * Converts a measurement from twips to centimeters. + * @param value The twips value to be converted. + */ + twipsToCentimeters(value: number): number; + /** + * Converts a measurement from pixels to centimeters. + * @param value The pixels value to be converted. + */ + pixelsToCentimeters(value: number): number; + /** + * Converts a measurement from twips to inches. + * @param value The twips value to be converted. + */ + twipsToInches(value: number): number; + /** + * Converts a measurement from pixels to inches. + * @param value The pixels value to be converted. + */ + pixelsToInches(value: number): number; + /** + * Converts a measurement from pixels to points. + * @param value The pixels value to be converted. + */ + pixelsToPoints(value: number): number; + /** + * Converts a measurement from twips to points. + * @param value The twips value to be converted. + */ + twipsToPoints(value: number): number; +} +/** + * A command to invoke the Bookmark dialog. + */ +interface OpenInsertBookmarkDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenInsertBookmarkDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a new bookmark that references the current selection. + */ +interface InsertBookmarkCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertBookmarkCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param name A string value specifying a name of the created bookmark. + * @param start An integer value specifying the start position of the bookmark's range. + * @param length An integer value specifying the length of the bookmark's range. + */ + execute(name: string, start: number, length: number): boolean; +} +/** + * A command to delete a specific bookmark. + */ +interface DeleteBookmarkCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteBookmarkCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param name A string value specifying a name of the deleted bookmark. + */ + execute(name: string): boolean; +} +/** + * Gets a command to navigate to the specified bookmark in the document. + */ +interface GoToBookmarkCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToBookmarkCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param name + */ + execute(name: string): boolean; +} +/** + * A command to paste the text from the clipboard over the selection. + */ +interface PasteCommand extends CommandWithSimpleStateBase { + /** + * Executes the PasteCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to copy the selected text and place it to the clipboard. + */ +interface CopyCommand extends CommandWithSimpleStateBase { + /** + * Executes the CopyCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to cut the selected text and place it to the clipboard. + */ +interface CutCommand extends CommandWithSimpleStateBase { + /** + * Executes the CutCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert an empty document field at the current position in the document. + */ +interface CreateFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreateFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to update the field's result. + */ +interface UpdateFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the UpdateFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to display the selected field's field codes. + */ +interface ShowFieldCodesCommand extends CommandWithSimpleStateBase { + /** + * Executes the ShowFieldCodesCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param showFieldCodes true to display field codes, false to hide field codes. + */ + execute(showFieldCodes: boolean): boolean; + /** + * Executes the ShowFieldCodesCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to display all field codes in place of the fields in the document. + */ +interface ShowAllFieldCodesCommand extends CommandWithSimpleStateBase { + /** + * Executes the ShowAllFieldCodesCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param showFieldCodes true to display field codes, false to hide field codes. + */ + execute(showFieldCodes: boolean): boolean; + /** + * Executes the ShowAllFieldCodesCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to update all fields in the selected range. + */ +interface UpdateAllFieldsCommand extends CommandWithSimpleStateBase { + /** + * Executes the UpdateAllFieldsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a DATE field displaying the current date. + */ +interface CreateDateFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreateDateFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a TIME field displaying the current time. + */ +interface CreateTimeFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreateTimeFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a PAGE field displaying the current page number. + */ +interface CreatePageFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreatePageFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the next data record of the bound data source. + */ +interface GoToDataRecordCommand extends CommandBase { + /** + * Executes the GoToDataRecordCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param activeRecordIndex An integer value specifying index of the next data record. + */ + execute(activeRecordIndex: number): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * Contains the settings defining a data record. + */ +interface DataRecordOptions { + /** + * Gets or sets the index of the active data record. + * Value: An integer value specifying the data record index. + */ + activeRecordIndex: number; + recordCount: number; +} +/** + * A command to navigate to the first data record of the bound data source. + */ +interface GoToFirstDataRecordCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToFirstDataRecordCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the previous data record of the bound data source. + */ +interface GoToPreviousDataRecordCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToPreviousDataRecordCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the next data record of the bound data source. + */ +interface GoToNextDataRecordCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToNextDataRecordCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the last data record of the bound data source. + */ +interface GoToLastDataRecordCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToLastDataRecordCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to display or hide actual data in MERGEFIELD fields. + */ +interface ShowMergedDataCommand extends CommandWithBooleanStateBase { + /** + * Executes the ShowMergedDataCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ShowMergedDataCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param showMergedData true to display merged data, false to hide merged data. + */ + execute(showMergedData: boolean): boolean; +} +/** + * A command to invoke the Insert Merge Field dialog. + */ +interface MergeFieldDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the MergeFieldDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a MERGEFIELD field (with a data source column name) at the current position in the document. + */ +interface CreateMergeFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreateMergeFieldCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fieldName A string value specifying the name of the merge field. + */ + execute(fieldName: string): boolean; +} +/** + * Gets a command to invoke the Export Range dialog to start a mail merge. + */ +interface MailMergeDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the MailMergeDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to start the mail merge process and download the resulting document containing the merged information. + */ +interface MailMergeAndDownloadCommand extends CommandBase { + /** + * Executes the MailMergeAndDownloadCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fileExtension A string value specifying the file extension of the resulting document. + */ + execute(fileExtension: string): boolean; + /** + * Executes the MailMergeAndDownloadCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param documentFormat One of the DocumentFormat enumeration values. + */ + execute(documentFormat: any): boolean; + /** + * Executes the MailMergeAndDownloadCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fileExtension A string value specifying the file extension of the resulting document. + * @param settings A MailMergeSettings object containing settings to set up mail merge operations. + */ + execute(fileExtension: string, settings: MailMergeSettings): boolean; + /** + * Executes the MailMergeAndDownloadCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param documentFormat One of the DocumentFormat enumeration values. + * @param settings A MailMergeSettings object specifying the mail merge settings. + */ + execute(documentFormat: any, settings: MailMergeSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to start the mail merge process and save the resulting merged document to the server. + */ +interface MailMergeAndSaveAsCommand extends CommandBase { + /** + * Executes the MailMergeAndSaveAsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param filePath A string value specifying path to the saving file on the server. + */ + execute(filePath: string): boolean; + /** + * Executes the MailMergeAndSaveAsCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fileInfo A RichEditFileInfo object specifying a file to save to. + * @param settings A MailMergeSettings object specifying the mail merge settings. + */ + execute(fileInfo: RichEditFileInfo, settings: MailMergeSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to insert a NUMPAGES field displaying the total number of pages. + */ +interface CreatePageCountFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreatePageCountFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * Contains settings to set up mail merge operations. + */ +interface MailMergeSettings { + /** + * Gets or sets a value specifying which data rows should be exported into a merged document. + * Value: One of the values. + */ + range: any; + /** + * Gets or sets the index of the row from which the exported range starts. + * Value: An integer value specifying the row index. + */ + exportFrom: number; + /** + * Gets or sets the number of data rows in the exported mail-merge range. + * Value: An integer value specifying the row count. + */ + exportRecordsCount: number; + /** + * Gets or sets the merge mode. + * Value: One of the values. + */ + mergeMode: any; +} +declare enum MergeMode { + NewParagraph=0, + NewSection=1, + JoinTables=2 +} +declare enum MailMergeExportRange { + AllRecords=0, + CurrentRecord=1, + Range=2 +} +/** + * A command to create a new empty document. + */ +interface FileNewCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileNewCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to open the file, specifying its path. + */ +interface FileOpenCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileOpenCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param path A string value specifying path to the opening file. + */ + execute(path: string): boolean; +} +/** + * A command to invoke the File Open dialog allowing one to select and load a document file into RichEdit. + */ +interface FileOpenDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileOpenDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to save the document to a file. + */ +interface FileSaveCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileSaveCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Save As dialog that prompts for a file name and saves the current document in a file with the specified path. + */ +interface FileSaveAsCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileSaveAsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param path A string value specifying path to the saving file. + */ + execute(path: string): boolean; + /** + * Executes the FileSaveAsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fileInfo A object specifying a file to save to. + */ + execute(fileInfo: RichEditFileInfo): boolean; +} +/** + * A command to download the document file, specifying its extension. + */ +interface FileDownloadCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileDownloadCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fileExtension A string value specifying the extension of the downloading file. + */ + execute(fileExtension: string): boolean; + /** + * Executes the FileDownloadCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param documentFormat A DocumentFormat enumeration value. + */ + execute(documentFormat: any): boolean; +} +/** + * A command to open the file's Save As dialog. + */ +interface FileSaveAsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileSaveAsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke a browser-specific Print dialog allowing one to print the current document. + */ +interface FilePrintCommand extends CommandWithSimpleStateBase { + /** + * Executes the FilePrintCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Search Panel allowing end-users to search text and navigate through search results. + */ +interface OpenFindPanelCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenFindPanelCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Find and Replace dialog. + */ +interface OpenFindAndReplaceDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenFindAndReplaceDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to find all matches of the specified text in the document. + */ +interface FindAllCommand extends CommandWithSimpleStateBase { + /** + * Executes the FindAllCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param text A string value specifying finding text. + * @param matchCase true, to perform a case-sensitive search; otherwise, false. + * @param highlightResults true, to highlight result of search; otherwise, false. + */ + execute(text: string, matchCase: boolean, highlightResults: boolean): boolean; + /** + * Executes the FindAllCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param text A string value specifying text to find. + * @param matchCase true, to perform a case-sensitive search; otherwise, false. + * @param highlightResults true, to highlight result of search; otherwise, false. + * @param results An array of Interval objects containing the results of search. + */ + execute(text: string, matchCase: boolean, highlightResults: boolean, results: Interval[]): boolean; +} +/** + * A command to hide the search results. + */ +interface HideFindResultsCommand extends CommandWithSimpleStateBase { + /** + * Executes the HideFindResultsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to search for a specific text and replace all matches in the document with the specified string. + */ +interface ReplaceAllCommand extends CommandWithSimpleStateBase { + /** + * Executes the ReplaceAllCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param text A string value specifying a text to replace. + * @param replaceText A string value specifying the replacing text. + * @param matchCase true, to perform a case-sensitive search; otherwise, false. + */ + execute(text: string, replaceText: string, matchCase: boolean): boolean; +} +/** + * A command to search for a specific text and replace the next match in the document with the specified string. + */ +interface ReplaceNextCommand extends CommandWithSimpleStateBase { + /** + * Executes the ReplaceNextCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param text A string value specifying text to replace. + * @param replaceText A string value specifying replacing text. + * @param matchCase true, to perform a case-sensitive search; otherwise, false. + */ + execute(text: string, replaceText: string, matchCase: boolean): boolean; +} +interface OpenLayoutOptionsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenLayoutOptionsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a floating text box. + */ +interface InsertFloatingTextBoxCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertFloatingTextBoxCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to lock a floating object's anchor. + */ +interface ChangeFloatingObjectLockAnchorCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectLockAnchorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param lockAnchor true to lock the anchor; false, otherwise. + */ + execute(lockAnchor: boolean): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's alignment position. + */ +interface ChangeFloatingObjectAlignmentPositionCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectAlignmentPositionCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A FloatingObjectAlignmentPositionSettings object specifying alignment position settings. + */ + execute(settings: FloatingObjectAlignmentPositionSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change a floating object's absolute position. + */ +interface ChangeFloatingObjectAbsolutePositionCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectAbsolutePositionCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A FloatingObjectAbsolutePositionSettings object specifying page margin settings. + */ + execute(settings: FloatingObjectAbsolutePositionSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's relative position. + */ +interface ChangeFloatingObjectRelativePositionCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectRelativePositionCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A FloatingObjectRelativePositionSettings object specifying relative positioin settings. + */ + execute(settings: FloatingObjectRelativePositionSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's text wrapping settings. + */ +interface ChangeFloatingObjectTextWrappingCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectTextWrappingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A FloatingObjectTextWrappingSettings object specifying text wrapping settings. + */ + execute(settings: FloatingObjectTextWrappingSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change a floating object's absolute size. + */ +interface ChangeFloatingObjectAbsoluteSizeCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectAbsoluteSizeCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A FloatingObjectAbsoluteSizeSettings object specifying absolute size settings. + */ + execute(settings: FloatingObjectAbsoluteSizeSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a text box' relative size settings. + */ +interface ChangeTextBoxRelativeSizeCommand extends CommandBase { + /** + * Executes the ChangeTextBoxRelativeSizeCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TextBoxRelativeSizeSettings object specifying relative size settings. + */ + execute(settings: TextBoxRelativeSizeSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to rotate a floating object. + */ +interface ChangeFloatingObjectRotationCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectRotationCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param rotation An integer value specifying the angle of rotation. + */ + execute(rotation: number): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to lock a floating object's aspect ratio. + */ +interface ChangeFloatingObjectLockAspectRatioCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectLockAspectRatioCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param lockAspectRatio true to lock the aspect ratio and maintain the proportions; otherwise, false. + */ + execute(lockAspectRatio: boolean): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's background fill color. + */ +interface ChangeFloatingObjectFillColorCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectFillColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string value specifying the color. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's outline color. + */ +interface ChangeFloatingObjectOutlineColorCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectOutlineColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string value specifying the color. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's outline width. + */ +interface ChangeFloatingObjectOutlineWidthCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectOutlineWidthCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param width An integer value specifying the outline width. + */ + execute(width: number): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a text box' content margins. + */ +interface ChangeTextBoxContentMarginsCommand extends CommandBase { + /** + * Executes the ChangeTextBoxContentMarginsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A Margins object specifying margin settings. + */ + execute(settings: Margins): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +interface ChangeTextBoxResizeShapeToFitTextCommand extends CommandBase { + execute(resizeShapeToFitText: boolean): boolean; + getState(): any; +} +/** + * Contains alignment position settings for floating objects. + */ +interface FloatingObjectAlignmentPositionSettings { + /** + * Gets or sets a value specifying how a floating object is horizontally aligned relative to an element specified by the horizontalPositionAlignment property. + * Value: One of the enumeration values. + */ + horizontalPositionAlignment: any; + /** + * Gets or sets a value specifying to what element the horizontal alignment of a floating object is relative. + * Value: One of the enumeration values. + */ + horizontalPositionType: any; + /** + * Gets or sets a value specifying how a floating object is vertically aligned relative to an element specified by the verticalPositionAlignment property. + * Value: One of the enumeration values. + */ + verticalPositionAlignment: any; + /** + * Gets or sets a value specifying to what element the vertical alignment of a floating object is relative. + * Value: One of the enumeration values. + */ + verticalPositionType: any; +} +/** + * Contains page margin settings. + */ +interface FloatingObjectAbsolutePositionSettings { + /** + * Gets or sets a floating object's horizontal position relative to an element specified by the horizontalPositionType property. + * Value: An integer value specifying the position. + */ + horizontalAbsolutePosition: number; + /** + * Gets or sets a value specifying to what element the horizontal position of a floating object is relative. + * Value: One of the enumeration values. + */ + horizontalPositionType: any; + /** + * Gets or sets a floating object's vertical position relative to an element specified by the verticalPositionType property. + * Value: An integer value specifying the position. + */ + verticalAbsolutePosition: number; + /** + * Gets or sets a value specifying to what element the vertical position of a floating object is relative. + * Value: One of the enumeration values. + */ + verticalPositionType: any; +} +/** + * Contains relative position settings for floating objects. + */ +interface FloatingObjectRelativePositionSettings { + /** + * Gets or sets the horizontal distance between the edge of a floating object and the element specified by the horizontalRelativePosition property + * Value: An integer value specifying the horizontal position. + */ + horizontalRelativePosition: number; + /** + * Gets or sets a value specifying to what element the horizontal position of a floating object is relative. + * Value: One of the enumeration values. + */ + horizontalPositionType: any; + /** + * Gets or sets the horizontal distance between the edge of a floating object and the element specified by the verticalRelativePosition property + * Value: An integer value specifying the vertical position. + */ + verticalRelativePosition: number; + /** + * Gets or sets a value specifying to what element the vertical position of a floating object is relative. + * Value: One of the enumeration values. + */ + verticalPositionType: any; +} +/** + * Contains text wrapping settings for floating objects. + */ +interface FloatingObjectTextWrappingSettings { + /** + * Gets or sets a value specifying how text is wrapped around a floating object. + * Value: One of the enumeration values. + */ + floatingObjectTextWrapType: any; + /** + * Gets or sets a value specifying how text can wrap around a floating object's left and right sides. + * Value: One of the enumeration values. + */ + floatingObjectTextWrapSide: any; + /** + * Gets or sets the left offset of text wrapping. + * Value: An integer value specifying the left offset. + */ + leftDistance: number; + /** + * Gets or sets the right offset of text wrapping. + * Value: An integer value specifying the right offset. + */ + rightDistance: number; + /** + * Gets or sets the top offset of text wrapping. + * Value: An integer value specifying the top offset. + */ + topDistance: number; + /** + * Gets or sets the bottom offset of text wrapping. + * Value: An integer value specifying the bottom offset. + */ + bottomDistance: number; +} +/** + * Contains absolute size settings for floating objects. + */ +interface FloatingObjectAbsoluteSizeSettings { + /** + * Gets or sets a floating object's absolute width. + * Value: An integer value specifying the width. + */ + absoluteWidth: number; + /** + * Gets or sets a floating object's absolute height. + * Value: An integer value specifying the height. + */ + absoluteHeight: number; +} +/** + * Contains relative size settings for floating objects. + */ +interface TextBoxRelativeSizeSettings { + /** + * Gets or sets the percentage specifying a floating object's width relative to the element defined by the relativeWidthType property. + * Value: An integer value specifying the relative width, as a percentage. + */ + relativeWidth: number; + /** + * Gets or sets a value specifying to what element the floating object width is relative. + * Value: One of the enumeration values. + */ + relativeWidthType: any; + /** + * Gets or sets the percentage specifying a floating object's height relative to the element defined by the relativeHeightType property. + * Value: An integer value specifying the relative height, as a percentage. + */ + relativeHeight: number; + /** + * Gets or sets a value specifying to what element the floating object height is relative. + * Value: One of the enumeration values. + */ + relativeHeightType: any; +} +declare enum FloatingObjectRelativeWidthType { + Margin=0, + Page=1, + LeftMargin=2, + RightMargin=3, + InsideMargin=4, + OutsideMargin=5 +} +declare enum FloatingObjectRelativeHeightType { + Margin=0, + Page=1, + TopMargin=2, + BottomMargin=3, + InsideMargin=4, + OutsideMargin=5 +} +declare enum FloatingObjectTextWrapType { + None=0, + TopAndBottom=1, + Tight=2, + Through=3, + Square=4 +} +declare enum FloatingObjectTextWrapSide { + Both=0, + Left=1, + Right=2, + Largest=3 +} +declare enum FloatingObjectHorizontalPositionType { + Page=0, + Character=1, + Column=2, + Margin=3, + LeftMargin=4, + RightMargin=5, + InsideMargin=6, + OutsideMargin=7 +} +declare enum FloatingObjectHorizontalPositionAlignment { + None=0, + Left=1, + Center=2, + Right=3, + Inside=4, + Outside=5 +} +declare enum FloatingObjectVerticalPositionType { + Page=0, + Line=1, + Paragraph=2, + Margin=3, + TopMargin=4, + BottomMargin=5, + InsideMargin=6, + OutsideMargin=7 +} +declare enum FloatingObjectVerticalPositionAlignment { + None=0, + Top=1, + Center=2, + Bottom=3, + Inside=4, + Outside=5 +} +/** + * A command to cancel changes caused by the previous command. + */ +interface UndoCommand extends CommandWithSimpleStateBase { + /** + * Executes the UndoCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to reverse actions of the previous undo command. + */ +interface RedoCommand extends CommandWithSimpleStateBase { + /** + * Executes the RedoCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Hyperlink dialog. + */ +interface OpenInsertHyperlinkDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenInsertHyperlinkDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a hyperlink at the current position in the document. + */ +interface InsertHyperlinkCommand extends CommandBase { + /** + * Executes the InsertHyperlinkCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A HyperLinkSettings object specifying hyperlink settings. + */ + execute(settings: HyperlinkSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to delete the selected hyperlink. + */ +interface DeleteHyperlinkCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteHyperlinkCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete all hyperlinks in a selected range. + */ +interface DeleteHyperlinksCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteHyperlinksCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the document bookmark or URI (uniform resource identifier) specified for the hyperlink. + */ +interface OpenHyperlinkCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenHyperlinkCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * Contains settings to define hyperlinks. + */ +interface HyperlinkSettings { + /** + * Gets or sets a text displayed for a hyperlink. + * Value: A string value specifying the hyperlink display text. + */ + text: string; + /** + * Gets or sets a text for the tooltip displayed when the mouse hovers over a hyperlink. + * Value: A string containing the tooltip text. + */ + tooltip: string; + /** + * Gets or sets the hyperlink destination. + * Value: A string value that specifies the destination to which a hyperlink refers. + */ + url: string; + /** + * Gets or sets the associated bookmak. + * Value: A string value specifying the bookmark name. + */ + bookmark: string; +} +/** + * A command to insert a page break at the current position in the document. + */ +interface InsertPageBreakCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertPageBreakCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a column break at the current position in the document. + */ +interface InsertColumnBreakCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertColumnBreakCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a section break and start a new section on the next page. + */ +interface InsertSectionBreakNextPageCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertSectionBreakNextPageCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a section break and start a new section on the next even-numbered page. + */ +interface InsertSectionBreakEvenPageCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertSectionBreakEvenPageCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a section break and start a new section on the next odd-numbered page. + */ +interface InsertSectionBreakOddPageCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertSectionBreakOddPageCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert the line break at the current position in the document. + */ +interface InsertLineBreakCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertLineBreakCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle between the bulleted paragraph and normal text. + */ +interface ToggleBulletedListCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleBulletedListCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle between the numbered paragraph and normal text. + */ +interface ToggleNumberingListCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleNumberingListCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle between the multilevel list style and normal text. + */ +interface ToggleMultilevelListCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleMultilevelListCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Bulleted and Numbering dialog. + */ +interface OpenNumberingListDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenNumberingListDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Customize Numbered List dialog. + */ +interface OpenCustomNumberingListDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenCustomNumberingListDialogCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param abstractNumberingListIndex An integer value specifying index of abstract numbering list. + */ + execute(abstractNumberingListIndex: number): boolean; +} +/** + * A command to customize the numbered list parameters. + */ +interface ChangeCustomNumberingListCommand extends CommandBase { + /** + * Executes the ChangeCustomNumberingListCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param abstractNumberingListIndex An integer value specifying the numbering list index. + * @param listLevelSettings An array of ListLevelSettings objects defining settings for list levels. + */ + execute(abstractNumberingListIndex: number, listLevelSettings: ListLevelSettings[]): boolean; + /** + * Gets information about the command state. + * @param abstractNumberingListIndex An integer value specifying the index of the abstract numbering list item whose state to return. + */ + getState(abstractNumberingListIndex: number): any; +} +/** + * A command to restart the numbering list. + */ +interface RestartNumberingListCommand extends CommandWithSimpleStateBase { + /** + * Executes the RestartNumberingListCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to increment the indent level of paragraphs in a selected numbered list. + */ +interface IncrementNumberingIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the IncrementNumberingIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to decrement the indent level of paragraphs in a selected numbered list. + */ +interface DecrementNumberingIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the DecrementNumberingIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to continue the list's numbering. + */ +interface ContinueNumberingListCommand extends CommandWithSimpleStateBase { + /** + * Executes the ContinueNumberingListCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert numeration to a paragraph making it a numbering list item. + */ +interface InsertNumerationCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertNumerationCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param abstractNumberingListIndex An integer value specifying index of abstract numbering list. + */ + execute(abstractNumberingListIndex: number): boolean; + /** + * Executes the InsertNumerationCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param numberingListIndex An integer value specifying an index of the numbering list. + * @param isAbstractNumberingList true, to insert an abstract numbering list; otherwise, false. + */ + execute(numberingListIndex: number, isAbstractNumberingList: boolean): boolean; +} +/** + * A command to remove the selected numeration. + */ +interface RemoveNumerationCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemoveNumerationCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * Contains settings to define individual bulleted or numbered list levels. + */ +interface ListLevelSettings { + /** + * Gets or sets the pattern used to format the list level for display purposes. + * Value: A string value specifying the format pattern. + */ + displayFormatString: string; + /** + * Gets or sets the numbering format used for the current list level's paragraph. + * Value: One of the values. + */ + format: any; + /** + * Gets the list level item's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets or sets the paragraph text alignment within numbered list levels. + * Value: One of the values. + */ + alignment: any; + /** + * Gets or sets the character inserted after the number for a numbered list item. + * Value: A string value that is the trailing character for the list level. + */ + separator: string; + /** + * Gets or sets the left indent for text within the current list level's paragraph. + * Value: An integer value specifying the left indent. + */ + leftIndent: number; + /** + * Gets or sets a value specifying the indent of the first line of the current list level's paragraph. + * Value: An integer value specifying the indent. + */ + firstLineIndent: number; + /** + * Gets or sets a value specifying whether and how the first line of the current list level's paragraph is indented. + * Value: One of the values. + */ + firstLineIndentType: any; + /** + * Gets or sets the font name of the current list level's paragraph. + * Value: A string value specifying the font name. + */ + fontName: string; + /** + * Gets or sets the font color of the current list level's paragraph. + * Value: A string value specifying the font color. + */ + fontColor: string; + /** + * Gets or sets the font size of the current list level's paragraph. + * Value: An integer value specifying the font size. + */ + fontSize: number; + /** + * Gets or sets whether the font formatting of the current list level's paragraph is bold. + * Value: true, if the font formatting is bold; otherwise, false. + */ + fontBold: boolean; + /** + * Gets or sets whether the font formatting of the current list level's paragraph is italic. + * Value: true, if the font formatting is italic; otherwise, false. + */ + fontItalic: boolean; +} +declare enum ListLevelFormat { + Decimal=0, + AIUEOHiragana=1, + AIUEOFullWidthHiragana=2, + ArabicAbjad=3, + ArabicAlpha=4, + Bullet=5, + CardinalText=6, + Chicago=7, + ChineseCounting=8, + ChineseCountingThousand=9, + ChineseLegalSimplified=10, + Chosung=11, + DecimalEnclosedCircle=12, + DecimalEnclosedCircleChinese=13, + DecimalEnclosedFullstop=14, + DecimalEnclosedParentheses=15, + DecimalFullWidth=16, + DecimalFullWidth2=17, + DecimalHalfWidth=18, + DecimalZero=19, + Ganada=20, + Hebrew1=21, + Hebrew2=22, + Hex=23, + HindiConsonants=24, + HindiDescriptive=25, + HindiNumbers=26, + HindiVowels=27, + IdeographDigital=28, + IdeographEnclosedCircle=29, + IdeographLegalTraditional=30, + IdeographTraditional=31, + IdeographZodiac=32, + IdeographZodiacTraditional=33, + Iroha=34, + IrohaFullWidth=35, + JapaneseCounting=36, + JapaneseDigitalTenThousand=37, + JapaneseLegal=38, + KoreanCounting=39, + KoreanDigital=40, + KoreanDigital2=41, + KoreanLegal=42, + LowerLetter=43, + LowerRoman=44, + None=45, + NumberInDash=46, + Ordinal=47, + OrdinalText=48, + RussianLower=49, + RussianUpper=50, + TaiwaneseCounting=51, + TaiwaneseCountingThousand=52, + TaiwaneseDigital=53, + ThaiDescriptive=54, + ThaiLetters=55, + ThaiNumbers=56, + UpperLetter=57, + UpperRoman=58, + VietnameseDescriptive=59 +} +declare enum ListLevelNumberAlignment { + Left=0, + Center=1, + Right=2 +} +/** + * A command to invoke the Insert Image dialog. + */ +interface OpenInsertPictureDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenInsertPictureDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a picture from a file. + */ +interface InsertPictureCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertPictureCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param imageUrl A string value specifying picture's Url. + */ + execute(imageUrl: string): boolean; +} +/** + * A command to invoke the Symbols dialog. + */ +interface OpenInsertSymbolDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenInsertSymbolDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a character into the document. + */ +interface InsertSymbolCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertSymbolCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param symbol A string value specifying symbols to insert. + * @param fontName A string value specifying the font of symbols to insert. + */ + execute(symbol: string, fontName: string): boolean; +} +/** + * A command to insert a paragraph break at the current position in the document. + */ +interface InsertParagraphCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertParagraphCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert text at the current position in the document. + */ +interface InsertTextCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTextCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param text A string value specifying a text to insert. + */ + execute(text: string): boolean; +} +/** + * A command to delete the text in a selected range. + */ +interface DeleteCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to remove the previous word. + */ +interface RemovePrevWordCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemovePrevWordCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to remove the next word. + */ +interface RemoveNextWordCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemoveNextWordCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to move the cursor backwards and erase the character in that space. + */ +interface BackspaceCommand extends CommandWithSimpleStateBase { + /** + * Executes the BackspaceCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to scale pictures in a selected range. + */ +interface ChangePictureScaleCommand extends CommandBase { + /** + * Executes the ChangePictureScaleCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param scale A Scale object specifying scaling of the picture. + */ + execute(scale: Scale): boolean; + /** + * Executes the ChangePictureScaleCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param x An interger number specifying width of the picture + * @param y An interger number specifying height of the picture + */ + execute(x: number, y: number): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to move the selected range to a specific position in the document. + */ +interface MoveContentCommand extends CommandWithSimpleStateBase { + /** + * Executes the MoveContentCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param position An integer value specifying position to insert selected text. + */ + execute(position: number): boolean; +} +/** + * A command to copy the selected text and place it to the specified position. + */ +interface CopyContentCommand extends CommandWithSimpleStateBase { + /** + * Executes the CopyContentCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param position An integer number value specifying position for pasting selected text. + */ + execute(position: number): boolean; +} +/** + * A command to insert a tab character at the current position in the document. + */ +interface InsertTabCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTabCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * Defines the scaling settings. + */ +interface Scale { + /** + * Gets or sets the image's y-scale factor as a percent. + * Value: An integer value that is the y-scale factor as a percent. + */ + x: number; + /** + * Gets or sets the image's x-scale factor as a percent. + * Value: An integer value that is the x-scale factor as a percent. + */ + y: number; +} +/** + * A command to change page margin settings. + */ +interface ChangePageMarginsCommand extends CommandBase { + /** + * Executes the ChangePageMarginsCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param left An integer number specifying left margin of the page. + * @param top An integer number specifying top margin of the page. + * @param right An integer number specifying right margin of the page. + * @param bottom An integer number specifying bottom margin of the page. + */ + execute(left: number, top: number, right: number, bottom: number): boolean; + /** + * Executes the ChangePageMarginsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param margins A Margins object specifying page margin settings. + */ + execute(margins: Margins): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to invoke the Margins tab of the Page Setup dialog. + */ +interface OpenPageMarginsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenPageMarginsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the page orientation. + */ +interface ChangePageOrientationCommand extends CommandBase { + /** + * Executes the ChangePageOrientationCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param isPortrait One of the Orientation enumeration values. + */ + execute(isPortrait: any): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to invoke the Paper tab of the Page Setup dialog. + */ +interface OpenPagePaperSizeDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenPagePaperSizeDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to set the page size. + */ +interface SetPageSizeDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the SetPageSizeDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the page size. + */ +interface ChangePageSizeCommand extends CommandBase { + /** + * Executes the ChangePageSizeCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param width An integer number specifying width of the page. + * @param height An integer number specifying height of the page. + */ + execute(width: number, height: number): boolean; + /** + * Executes the ChangePageSizeCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param size A Size object specifying the page size settings. + */ + execute(size: Size): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the number of section columns having the same width. + */ +interface ChangeSectionEqualColumnCountCommand extends CommandBase { + /** + * Executes the ChangeSectionEqualColumnCountCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param columnCount An interger number specifying the number of section columns having the same width. + */ + execute(columnCount: number): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to invoke the Columns dialog. + */ +interface OpenSectionColumnsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenSectionColumnsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the settings of individual section columns. + */ +interface ChangeSectionColumnsCommand extends CommandBase { + /** + * Executes the ChangeSectionColumnsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param columns An array of SectionColumn objects. + */ + execute(columns: SectionColumn[]): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the background color of the page. + */ +interface ChangePageColorCommand extends CommandBase { + /** + * Executes the ChangePageColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string specifying a background color the page. May be specified as a color name or a hex color value. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to activate the page header and begin editing. + */ +interface InsertHeaderCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertHeaderCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to activate the page footer and begin editing. + */ +interface InsertFooterCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to link a header/footer to the previous section, so it has the same content. + */ +interface LinkHeaderFooterToPreviousCommand extends CommandWithSimpleStateBase { + /** + * Executes the LinkHeaderFooterToPreviousCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the page footer from the page header in the header/footer editing mode. + */ +interface GoToFooterCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the page header from the page footer in the header/footer editing mode. + */ +interface GoToHeaderCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToHeaderCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the next page header or footer in the header/footer editing mode. + */ +interface GoToNextHeaderFooterCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToNextHeaderFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the previous page header or footer in the header/footer editing mode. + */ +interface GoToPreviousHeaderFooterCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToPreviousHeaderFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the header/footer edit mode, so it allows creation of a different header or footer for the first page of a document or section. + */ +interface SetDifferentFirstPageHeaderFooterCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetDifferentFirstPageHeaderFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the SetDifferentFirstPageHeaderFooterCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param differentFirstPage true to apply a different text for the first page's header and footer, false to remove the difference. + */ + execute(differentFirstPage: boolean): boolean; +} +/** + * A command to change the header/footer edit mode so it allows creation of a different header or footer for odd and even pages of a document or section. + */ +interface SetDifferentOddAndEvenPagesHeaderFooterCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetDifferentOddAndEvenPagesHeaderFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the SetDifferentOddAndEvenPagesHeaderFooterCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param differentOddAndEvenPages true to apply a different text for the header and footer of the odd and even pages , false to remove the difference. + */ + execute(differentOddAndEvenPages: boolean): boolean; +} +/** + * A command to finish header/footer editing. + */ +interface CloseHeaderFooterCommand extends CommandWithSimpleStateBase { + /** + * Executes the CloseHeaderFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * Defines a section column in the document. + */ +interface SectionColumn { + /** + * Gets or sets the width of the section column. + * Value: An integer value specifying the section column width. + */ + width: number; + /** + * Gets or sets the amount of space between adjacent section columns. + * Value: An integer value specifying the spacing between section columns. + */ + spacing: number; +} +/** + * Defines the size settings. + */ +interface Size { + /** + * Gets or sets the width value. + * Value: An integer value specifying the width. + */ + width: number; + /** + * Gets or sets the height value. + * Value: An integer value specifying the height. + */ + height: number; +} +/** + * Defines the margin settings. + */ +interface Margins { + /** + * Gets or sets the left margin. + * Value: An integer value specifying the left margin. + */ + left: number; + /** + * Gets or sets the top margin. + * Value: An integer value specifying the top margin. + */ + top: number; + /** + * Gets or sets the right margin. + * Value: An integer value specifying the right margin. + */ + right: number; + /** + * Gets or sets the bottom margin. + * Value: An integer value specifying the bottom margin. + */ + bottom: number; +} +declare enum Orientation { + Landscape=0, + Portrait=1 +} +/** + * A command to increment the indent level of paragraphs in a selected range. + */ +interface IncreaseIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the IncreaseIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to decrement the indent level of paragraphs in a selected range. + */ +interface DecreaseIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the DecreaseIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle the visibility of hidden symbols. + */ +interface ShowHiddenSymbolsCommand extends CommandWithBooleanStateBase { + /** + * Executes the ShowHiddenSymbolsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ShowHiddenSymbolsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param show true to display hidden symbols; otherwise, false. + */ + execute(show: boolean): boolean; +} +/** + * A command to toggle left paragraph alignment on and off. + */ +interface ToggleParagraphAlignmentLeftCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleParagraphAlignmentLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle centered paragraph alignment on and off. + */ +interface ToggleParagraphAlignmentCenterCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleParagraphAlignmentCenterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle right paragraph alignment on and off. + */ +interface ToggleParagraphAlignmentRightCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleParagraphAlignmentRightCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle justified paragraph alignment on and off. + */ +interface ToggleParagraphAlignmentJustifyCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleParagraphAlignmentJustifyCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to format a current paragraph with single line spacing. + */ +interface SetSingleParagraphSpacingCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetSingleParagraphSpacingCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to format a current paragraph with one and a half line spacing. + */ +interface SetSesquialteralParagraphSpacingCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetSesquialteralParagraphSpacingCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to format a current paragraph with double line spacing. + */ +interface SetDoubleParagraphSpacingCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetDoubleParagraphSpacingCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to add spacing before a paragraph. + */ +interface AddSpacingBeforeParagraphCommand extends CommandWithSimpleStateBase { + /** + * Executes the AddSpacingBeforeParagraphCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to add spacing after a paragraph. + */ +interface AddSpacingAfterParagraphCommand extends CommandWithSimpleStateBase { + /** + * Executes the AddSpacingAfterParagraphCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to remove spacing before the selected paragraph. + */ +interface RemoveSpacingBeforeParagraphCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemoveSpacingBeforeParagraphCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to remove spacing after the selected paragraph. + */ +interface RemoveSpacingAfterParagraphCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemoveSpacingAfterParagraphCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the background color of paragraphs in a selected range. + */ +interface ChangeParagraphBackColorCommand extends CommandBase { + /** + * Executes the ChangeParagraphBackColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string specifying a background color of the paragraphs in a selected range. May be specified as a color name or a hex color value. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to invoke the Paragraph dialog allowing end-users to set paragraph formatting. + */ +interface OpenParagraphFormattingDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenParagraphFormattingDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the formatting of paragraphs in a selected range. + */ +interface ChangeParagraphFormattingCommand extends CommandBase { + /** + * Executes the ChangeParagraphFormattingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A ParagraphFormattingSettings object specifying paragraph formatting settings. + */ + execute(settings: ParagraphFormattingSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to increment the left indentation of paragraphs in a selected range. + */ +interface IncrementParagraphLeftIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the IncrementParagraphLeftIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to decrement the left indentation of paragraphs in a selected range. + */ +interface DecrementParagraphLeftIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the DecrementParagraphLeftIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Tabs paragraph dialog. + */ +interface OpenTabsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenTabsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change paragraph tab stops. + */ +interface ChangeTabsCommand extends CommandBase { + /** + * Executes the ChangeTabsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TabsSettings object maintaining the information about tab stops. + */ + execute(settings: TabsSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * Contains the information about tab stops. + */ +interface TabsSettings { + /** + * Gets or sets the default tab stop value. + * Value: An integer value specifying the default tab stop. + */ + defaultTabStop: number; + /** + * Gets or sets a list of tab stops. + * Value: An array of TabSettings objects containing individual tab stop settings. + */ + tabs: TabSettings[]; +} +/** + * Contains settings of a tab stop. + */ +interface TabSettings { + /** + * Gets or sets the alignment type, specifying how any text after the tab will be lined up. + * Value: One of the values. + */ + alignment: any; + /** + * Gets or sets the tab leader style, i.e., the symbol used as a tab leader. + * Value: One of the values. + */ + leader: any; + /** + * Gets or sets the position of the tab stop. + * Value: A number representing the distance from the left edge of the text area. + */ + position: number; + /** + * Gets or sets whether the individual tab stop is in effect. + * Value: true to switch off this tab stop; otherwise, false. + */ + deleted: boolean; +} +declare enum TabAlign { + Left=0, + Center=1, + Right=2, + Decimal=3 +} +declare enum TabLeaderType { + None=0, + Dots=1, + MiddleDots=2, + Hyphens=3, + Underline=4, + ThickLine=5, + EqualSign=6 +} +/** + * Contains settings to define the paragraph formatting. + */ +interface ParagraphFormattingSettings { + /** + * Gets or sets the paragraph alignment. + * Value: One of the values. + */ + alignment: any; + /** + * Gets or sets the outline level of a paragraph. + * Value: An integer specifying the level number. + */ + outlineLevel: number; + /** + * Gets or sets the right indent value for the specified paragraph. + * Value: An integer value specifying the right indent. + */ + rightIndent: number; + /** + * Gets or sets the spacing before the current paragraph. + * Value: An integer value specifying the spacing before the paragraph. + */ + spacingBefore: number; + /** + * Gets or sets the spacing after the current paragraph. + * Value: An integer value specifying the spacing after the paragraph. + */ + spacingAfter: number; + /** + * Gets or sets a value which determines the spacing between lines in a paragraph. + * Value: One of the values. + */ + lineSpacingType: any; + /** + * Gets or sets a value specifying whether and how the first line of a paragraph is indented. + * Value: One of the values. + */ + firstLineIndentType: any; + /** + * Gets or sets a value specifying the indent of the first line of a paragraph. + * Value: An integer value specifying the indent of the first line. + */ + firstLineIndent: number; + /** + * Gets or sets whether to suppress addition of additional space (contextual spacing) between paragraphs of the same style. + * Value: true to remove extra spacing between paragraphs, false to add extra space. + */ + contextualSpacing: boolean; + /** + * Gets or sets whether to prevent all page breaks that interrupt a paragraph. + * Value: true, to keep paragraph lines together; otherwise, false. + */ + keepLinesTogether: boolean; + /** + * Gets or sets whether a page break is inserted automatically before a specified paragraph(s). + * Value: true, if a page break is inserted automatically before a paragraph(s); otherwise, false. + */ + pageBreakBefore: boolean; + /** + * Gets or sets the left indent for text within a paragraph. + * Value: An integer value specifying the left indent. + */ + leftIndent: number; + /** + * Gets or sets a line spacing value. + * Value: An integer value specifying the line spacing. + */ + lineSpacing: number; + /** + * Gets or sets the paragraph background color. + * Value: A string value specifying the background color. + */ + backColor: string; +} +declare enum ParagraphAlignment { + Left=0, + Right=1, + Center=2, + Justify=3 +} +declare enum ParagraphLineSpacingType { + Single=0, + Sesquialteral=1, + Double=2, + Multiple=3, + Exactly=4, + AtLeast=5 +} +declare enum ParagraphFirstLineIndent { + None=0, + Indented=1, + Hanging=2 +} +/** + * A command to assign a shortcut to the specified client command. + */ +interface AssignShortcutCommand extends CommandWithSimpleStateBase { + /** + * Executes the AssignShortcutCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param keyCode An integer value specifying the code uniquely identifying the key combination. + * @param callback A callback function to execute on pressing the shortcut. + */ + execute(keyCode: number, callback: (arg1: string) => void): boolean; +} +/** + * A command to invoke the Spelling dialog window. + */ +interface OpenSpellingDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenSpellingDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Insert Table dialog. + */ +interface OpenInsertTableDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenInsertTableDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Insert Table dialog. + */ +interface InsertTableCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param columnCount An integer value specifying a number of columns in a generated table. + * @param rowCount An integer value specifying a number of rows in a generated table. + */ + execute(columnCount: number, rowCount: number): boolean; +} +/** + * A command to invoke the Table Properties dialog. + */ +interface OpenTableFormattingDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenTableFormattingDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the selected table's formatting. + */ +interface ChangeTableFormattingCommand extends CommandBase { + /** + * Executes the ChangeTableFormattingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TableFormattingSettings object containing the settings to format a table. + */ + execute(settings: TableFormattingSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the selected table's preferred row height. + */ +interface ChangeTableRowPreferredHeightCommand extends CommandBase { + /** + * Executes the ChangeTableRowPreferredHeightCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param preferredHeight A TableHeightUnit object specifying preferred height of the selected table rows. + */ + execute(preferredHeight: TableHeightUnit): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the preferred cell width of the selected table rows. + */ +interface ChangeTableCellPreferredWidthCommand extends CommandBase { + /** + * Executes the ChangeTableCellPreferredWidthCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param preferredWidth A TableWidthUnit object specifying preferred width of the selected table rows. + */ + execute(preferredWidth: TableWidthUnit): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the selected table's preferred column width. + */ +interface ChangeTableColumnPreferredWidthCommand extends CommandBase { + /** + * Executes the ChangeTableColumnPreferredWidthCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param preferredWidth A TableWidthUnit object specifying preferred width of the selected table columns. + */ + execute(preferredWidth: TableWidthUnit): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the cell formatting of the selected table elements. + */ +interface ChangeTableCellFormattingCommand extends CommandBase { + /** + * Executes the ChangeTableCellFormattingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TableFormattingSettings object specifying cell formatting of the selected table elements. + */ + execute(settings: TableCellFormattingSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to insert a table column to the left of the current position in the table. + */ +interface InsertTableColumnToTheLeftCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableColumnToTheLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a table column to the right of the current position in the table. + */ +interface InsertTableColumnToTheRightCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableColumnToTheRightCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a row in a table below the selected row. + */ +interface InsertTableRowBelowCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableRowBelowCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a row in a table above the selected row. + */ +interface InsertTableRowAboveCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableRowAboveCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete the selected table rows. + */ +interface DeleteTableRowsCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableRowsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete the selected table columns. + */ +interface DeleteTableColumnsCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableColumnsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert table cells with a horizontal shift into the selected table. + */ +interface InsertTableCellWithShiftToTheLeftCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableCellWithShiftToTheLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete the selected table cells with a horizontal shift. + */ +interface DeleteTableCellsWithShiftHorizontallyCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableCellsWithShiftHorizontallyCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete the selected table cells with a vertical shift. + */ +interface DeleteTableCellsWithShiftVerticallyCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableCellsWithShiftVerticallyCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete the selected table. + */ +interface DeleteTableCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Insert Cells dialog. + */ +interface InsertTableCellsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableCellsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Delete Cells dialog. + */ +interface DeleteTableCellsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableCellsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to merge the selected table cells. + */ +interface MergeTableCellsCommand extends CommandWithSimpleStateBase { + /** + * Executes the MergeTableCellsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Split Cells dialog. + */ +interface SplitTableCellsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the SplitTableCellsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to split the selected table cells based on the specified options. + */ +interface SplitTableCellsCommand extends CommandWithSimpleStateBase { + /** + * Executes the SplitTableCellsCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param rowCount An integer value specifying a number of rows in the split table cells. + * @param columnCount An integer value specifying a number of columns in the split table cells. + * @param mergeBeforeSplit true to merge the selected cells before the splitting; otherwise, false. + */ + execute(rowCount: number, columnCount: number, mergeBeforeSplit: boolean): boolean; +} +/** + * A command to insert table cells with a vertical shift into the selected table. + */ +interface InsertTableCellsWithShiftToTheVerticallyCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableCellsWithShiftToTheVerticallyCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Borders and Shading table dialog. + */ +interface OpenTableBordersAndShadingDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenTableBordersAndShadingDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change borders and shading of the selected table elements. + */ +interface ChangeTableBordersAndShadingCommand extends CommandBase { + /** + * Executes the ChangeTableBordersAndShadingCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TableBorderSettings object with settings specifying table borders. + * @param applyToWholeTable true to apply the border settings to the whole table, false to apply the border settings to the selected cells. + */ + execute(settings: TableBordersSettings, applyToWholeTable: boolean): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to apply top-left alignment for the selected table cells. + */ +interface ToggleTableCellAlignTopLeftCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignTopLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply top-center alignment for the selected table cells. + */ +interface ToggleTableCellAlignTopCenterCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignTopCenterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply top-right alignment for the selected table cells. + */ +interface ToggleTableCellAlignTopRightCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignTopRightCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply middle-left alignment for the selected table cells. + */ +interface ToggleTableCellAlignMiddleLeftCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignMiddleLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply middle-center alignment for the selected table cells. + */ +interface ToggleTableCellAlignMiddleCenterCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignMiddleCenterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply middle-right alignment for the selected table cells. + */ +interface ToggleTableCellAlignMiddleRightCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignMiddleRightCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply bottom-left alignment for the selected table cells. + */ +interface ToggleTableCellAlignBottomLeftCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignBottomLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply bottom-center alignment for the selected table cells. + */ +interface ToggleTableCellAlignBottomCenterCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignBottomCenterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply bottom-right alignment for the selected table cells. + */ +interface ToggleTableCellAlignBottomRightCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignBottomRightCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the selected table's style. + */ +interface ChangeTableStyleCommand extends CommandBase { + /** + * Executes the ChangeTableStyleCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param style A TableStyle object specifying the style applying to the table. + */ + execute(style: TableStyle): boolean; + /** + * Executes the ChangeTableStyleCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param styleName A string specifying the name of style applying to the table. + */ + execute(styleName: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to toggle top borders for selected cells on/off. + */ +interface ToggleTableCellTopBorderCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellTopBorderCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle right borders for selected cells on/off. + */ +interface ToggleTableCellRightBorderCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellRightBorderCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle bottom borders for selected cells on/off. + */ +interface ToggleTableCellBottomBorderCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellBottomBorderCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle left borders for selected cells on/off. + */ +interface ToggleTableCellLeftBorderCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellLeftBorderCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to remove the borders of the selected table cells. + */ +interface RemoveTableCellBordersCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemoveTableCellBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle all borders for selected cells on/off. + */ +interface ToggleTableCellAllBordersCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAllBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle inner borders for selected cells on/off. + */ +interface ToggleTableCellInsideBordersCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellInsideBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle inner horizontal borders for selected cells on/off. + */ +interface ToggleTableCellInsideHorizontalBordersCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellInsideHorizontalBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle inner vertical borders for selected cells on/off. + */ +interface ToggleTableCellInsideVerticalBordersCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellInsideVerticalBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle outer borders for selected cells on/off. + */ +interface ToggleTableCellOutsideBordersCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellOutsideBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the selected table's style options. + */ +interface ChangeTableLookCommand extends CommandBase { + /** + * Executes the ChangeTableLookCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TableLookSettings object containing the settings that modify the table appearance. + */ + execute(settings: TableLookSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the repository item's table border style. + */ +interface ChangeTableBorderRepositoryItemCommand extends CommandBase { + /** + * Executes the ChangeTableBorderRepositoryItemCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TableBorderSettings object specifying the repository item's table border style. + */ + execute(settings: TableBorderSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change cell shading in the selected table elements. + */ +interface ChangeTableCellShadingCommand extends CommandBase { + /** + * Executes the ChangeTableCellShadingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string specifying the color of the selected cells' shading. May be specified as a color name or a hex color value. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to toggle the display of grid lines for a table with no borders applied - on/off. + */ +interface ShowTableGridLinesCommand extends CommandWithBooleanStateBase { + /** + * Executes the ShowTableGridLinesCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ShowTableGridLinesCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param showTableGridLines true to display grid lines of the table, false to hide grid lines of the table. + */ + execute(showTableGridLines: boolean): boolean; +} +/** + * Contains the table style settings that modify the table appearance. + */ +interface TableLookSettings { + /** + * Gets or sets a value specifying whether special formatting is applied to the first row of the table. + * Value: true, to apply the formatting; otherwise, false. + */ + applyFirstRow: boolean; + /** + * Gets or sets a value specifying whether special formatting is applied to the last row of the table. + * Value: true, to apply the formatting; otherwise, false. + */ + applyLastRow: boolean; + /** + * Gets or sets a value specifying whether special formatting is applied to the first column of the table. + * Value: true, to apply the formatting; otherwise, false. + */ + applyFirstColumn: boolean; + /** + * Gets or sets a value specifying whether special formatting is applied to the last column of the table. + * Value: true, to apply the formatting; otherwise, false. + */ + applyLastColumn: boolean; + /** + * Gets or sets a value specifying whether row banding formatting is not applied to the table. + * Value: true, to apply the formatting; otherwise, false. + */ + doNotApplyRowBanding: boolean; + /** + * Gets or sets a value specifying whether column banding formatting is not applied to the table. + * Value: true, to apply the formatting; otherwise, false. + */ + doNotApplyColumnBanding: boolean; +} +/** + * Contains settings to define table borders. + */ +interface TableBordersSettings { + /** + * Gets or sets the top border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + top: TableBorderSettings; + /** + * Gets or sets the right border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + right: TableBorderSettings; + /** + * Gets or sets the bottom border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + bottom: TableBorderSettings; + /** + * Gets or sets the left border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + left: TableBorderSettings; + /** + * Gets or sets the inside horizontal border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + insideHorizontal: TableBorderSettings; + /** + * Gets or sets the inside vertical border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + insideVertical: TableBorderSettings; + /** + * Gets or sets the background color of table borders. + * Value: A string value specifying the background color. + */ + backgroundColor: string; +} +/** + * Contains settings to define a table border. + */ +interface TableBorderSettings { + /** + * Gets or sets the border color. + * Value: A string value specifying the border color. + */ + color: string; + /** + * Gets or sets the border line width. + * Value: An integer value defining the border line width. + */ + width: number; + /** + * Gets or sets the border line style. + * Value: A object defining the border line style. + */ + style: any; +} +declare enum BorderLineStyle { + None=0, + Single=1, + Thick=2, + Double=3, + Dotted=4, + Dashed=5, + DotDash=6, + DotDotDash=7, + Triple=8, + ThinThickSmallGap=9, + ThickThinSmallGap=10, + ThinThickThinSmallGap=11, + ThinThickMediumGap=12, + ThickThinMediumGap=13, + ThinThickThinMediumGap=14, + ThinThickLargeGap=15, + ThickThinLargeGap=16, + ThinThickThinLargeGap=17, + Wave=18, + DoubleWave=19, + DashSmallGap=20, + DashDotStroked=21, + ThreeDEmboss=22, + ThreeDEngrave=23, + Outset=24, + Inset=25, + Apples=26, + ArchedScallops=27, + BabyPacifier=28, + BabyRattle=29, + Balloons3Colors=30, + BalloonsHotAir=31, + BasicBlackDashes=32, + BasicBlackDots=33, + BasicBlackSquares=34, + BasicThinLines=35, + BasicWhiteDashes=36, + BasicWhiteDots=37, + BasicWhiteSquares=38, + BasicWideInline=39, + BasicWideMidline=40, + BasicWideOutline=41, + Bats=42, + Birds=43, + BirdsFlight=44, + Cabins=45, + CakeSlice=46, + CandyCorn=47, + CelticKnotwork=48, + CertificateBanner=49, + ChainLink=50, + ChampagneBottle=51, + CheckedBarBlack=52, + CheckedBarColor=53, + Checkered=54, + ChristmasTree=55, + CirclesLines=56, + CirclesRectangles=57, + ClassicalWave=58, + Clocks=59, + Compass=60, + Confetti=61, + ConfettiGrays=62, + ConfettiOutline=63, + ConfettiStreamers=64, + ConfettiWhite=65, + CornerTriangles=66, + CouponCutoutDashes=67, + CouponCutoutDots=68, + CrazyMaze=69, + CreaturesButterfly=70, + CreaturesFish=71, + CreaturesInsects=72, + CreaturesLadyBug=73, + CrossStitch=74, + Cup=75, + DecoArch=76, + DecoArchColor=77, + DecoBlocks=78, + DiamondsGray=79, + DoubleD=80, + DoubleDiamonds=81, + Earth1=82, + Earth2=83, + EclipsingSquares1=84, + EclipsingSquares2=85, + EggsBlack=86, + Fans=87, + Film=88, + Firecrackers=89, + FlowersBlockPrint=90, + FlowersDaisies=91, + FlowersModern1=92, + FlowersModern2=93, + FlowersPansy=94, + FlowersRedRose=95, + FlowersRoses=96, + FlowersTeacup=97, + FlowersTiny=98, + Gems=99, + GingerbreadMan=100, + Gradient=101, + Handmade1=102, + Handmade2=103, + HeartBalloon=104, + HeartGray=105, + Hearts=106, + HeebieJeebies=107, + Holly=108, + HouseFunky=109, + Hypnotic=110, + IceCreamCones=111, + LightBulb=112, + Lightning1=113, + Lightning2=114, + MapleLeaf=115, + MapleMuffins=116, + MapPins=117, + Marquee=118, + MarqueeToothed=119, + Moons=120, + Mosaic=121, + MusicNotes=122, + Northwest=123, + Ovals=124, + Packages=125, + PalmsBlack=126, + PalmsColor=127, + PaperClips=128, + Papyrus=129, + PartyFavor=130, + PartyGlass=131, + Pencils=132, + People=133, + PeopleHats=134, + PeopleWaving=135, + Poinsettias=136, + PostageStamp=137, + Pumpkin1=138, + PushPinNote1=139, + PushPinNote2=140, + Pyramids=141, + PyramidsAbove=142, + Quadrants=143, + Rings=144, + Safari=145, + Sawtooth=146, + SawtoothGray=147, + ScaredCat=148, + Seattle=149, + ShadowedSquares=150, + SharksTeeth=151, + ShorebirdTracks=152, + Skyrocket=153, + SnowflakeFancy=154, + Snowflakes=155, + Sombrero=156, + Southwest=157, + Stars=158, + Stars3d=159, + StarsBlack=160, + StarsShadowed=161, + StarsTop=162, + Sun=163, + Swirligig=164, + TornPaper=165, + TornPaperBlack=166, + Trees=167, + TriangleParty=168, + Triangles=169, + Tribal1=170, + Tribal2=171, + Tribal3=172, + Tribal4=173, + Tribal5=174, + Tribal6=175, + TwistedLines1=176, + TwistedLines2=177, + Vine=178, + Waveline=179, + WeavingAngles=180, + WeavingBraid=181, + WeavingRibbon=182, + WeavingStrips=183, + WhiteFlowers=184, + Woodwork=185, + XIllusions=186, + ZanyTriangles=187, + ZigZag=188, + ZigZagStitch=189, + Nil=-1 +} +/** + * Contains the settings to define the table cell formatting. + */ +interface TableCellFormattingSettings { + /** + * Gets or sets a table cell's preferred width. + * Value: A object specifying the preferred cell width. + */ + preferredWidth: TableWidthUnit; + /** + * Gets or sets the vertical alignment of a table cell's content. + * Value: One the values. + */ + verticalAlignment: any; + /** + * Gets or sets a value specifying whether text is wrapped in a table cell. + * Value: true if text is wrapped; false if text is not wrapped. + */ + noWrap: boolean; + /** + * Gets or sets a table cell's left margin. + * Value: An integer value specifying the left margin. + */ + marginLeft: number; + /** + * Gets or sets a table cell's right margin. + * Value: An integer value specifying the right margin. + */ + marginRight: number; + /** + * Gets or sets a table cell's top margin. + * Value: An integer value specifying the top margin. + */ + marginTop: number; + /** + * Gets or sets a table cell's bottom margin. + * Value: An integer value specifying the bottom margin. + */ + marginBottom: number; + /** + * Gets or sets a value specifying whether a table cell's margins are inherited from the table level settings. + * Value: true to inherit table level margins; false to use a table cell's own margin settings. + */ + marginsSameAsTable: boolean; +} +declare enum TableCellVerticalAlignment { + Top=0, + Both=1, + Center=2, + Bottom=3 +} +/** + * Contains the settings to format a table. + */ +interface TableFormattingSettings { + /** + * Gets or sets the preferred width of cells in the table. + * Value: A object specifying the width. + */ + preferredWidth: TableWidthUnit; + /** + * Gets or sets the alignment of table rows. + * Value: One of the values. + */ + alignment: any; + /** + * Gets or sets the table's left indent. + * Value: An integer value specifying the indent. + */ + indent: number; + /** + * Gets or sets the spacing between table cells. + * Value: An integer value specifying the spacing. + */ + spacingBetweenCells: number; + /** + * Gets or sets a value specifying whether spacing is allowed between table cells. + * Value: true, to allow spacing; otherwise, false. + */ + allowSpacingBetweenCells: boolean; + /** + * Gets or sets a value that specifying whether to allow automatic resizing of table cells to fit their contents. + * Value: true, to allow automatic resizing; otherwise, false. + */ + resizeToFitContent: boolean; + /** + * Gets or sets the default left margin for cells in the table. + * Value: An integer value specifying the margin value. + */ + defaultCellMarginLeft: number; + /** + * Gets or sets the default right margin for cells in the table. + * Value: An integer value specifying the margin value. + */ + defaultCellMarginRight: number; + /** + * Gets or sets the default top margin for cells in the table. + * Value: An integer value specifying the margin value. + */ + defaultCellMarginTop: number; + /** + * Gets or sets the default bottom margin for cells in the table. + * Value: An integer value specifying the margin value. + */ + defaultCellMarginBottom: number; +} +/** + * Contains settings defining the table width's measurement units and value. + */ +interface TableWidthUnit { + /** + * Gets or sets the table width value. + * Value: An integer value specifying the table width. + */ + value: number; + /** + * Gets or sets the unit type for the table width. + * Value: One of the values. + */ + type: any; +} +/** + * Contains settings defining the table height's measurement units and value. + */ +interface TableHeightUnit { + /** + * Gets or sets the table height value. + * Value: An integer value specifying the table height. + */ + value: number; + /** + * Gets or sets the unit type for the table height. + * Value: One of the enumeration values. + */ + type: any; +} +declare enum TableHeightUnitType { + Minimum=0, + Auto=1, + Exact=2 +} +declare enum TableRowAlignment { + Both=0, + Center=1, + Distribute=2, + Left=3, + NumTab=4, + Right=5 +} +declare enum TableWidthUnitType { + Nil=0, + Auto=1, + FiftiethsOfPercent=2, + ModelUnits=3 +} +/** + * A command to change the font name of characters in a selected range. + */ +interface ChangeFontNameCommand extends CommandBase { + /** + * Executes the ChangeFontNameCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontName A string specifying the font name. + */ + execute(fontName: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the font size of characters in a selected range. + */ +interface ChangeFontSizeCommand extends CommandBase { + /** + * Executes the ChangeFontSizeCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontSize An integer number specifying the font size. + */ + execute(fontSize: number): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to increase the font size of characters in a selected range to the closest larger predefined value. + */ +interface IncreaseFontSizeCommand extends CommandWithSimpleStateBase { + /** + * Executes the IncreaseFontSizeCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to decrease the font size of characters in a selected range to the closest smaller predefined value. + */ +interface DecreaseFontSizeCommand extends CommandWithSimpleStateBase { + /** + * Executes the DecreaseFontSizeCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to convert the selected text to upper case. + */ +interface MakeTextUpperCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the MakeTextUpperCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to convert the selected text to lower case. + */ +interface MakeTextLowerCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the MakeTextLowerCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to capitalize each word in the selected sentence. + */ +interface CapitalizeEachWordTextCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the CapitalizeEachWordTextCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle the case for each character - upper case becomes lower, lower case becomes upper. + */ +interface ToggleTextCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the ToggleTextCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the bold formatting of characters in a selected range. + */ +interface ChangeFontBoldCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontBoldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontBoldCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontBold true to apply bold formatting to the text, false to remove bold formatting. + */ + execute(fontBold: boolean): boolean; +} +/** + * A command to change the italic formatting of characters in a selected range. + */ +interface ChangeFontItalicCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontItalicCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontItalicCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontItalic true to apply italic formatting to the text, false to remove italic formatting. + */ + execute(fontItalic: boolean): boolean; +} +/** + * A command to change the underline formatting of characters in a selected range. + */ +interface ChangeFontUnderlineCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontUnderlineCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontUnderlineCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontUnderline true to apply underline formatting to the text, false to remove underline formatting. + */ + execute(fontUnderline: boolean): boolean; +} +/** + * A command to change the strikeout formatting of characters in a selected range. + */ +interface ChangeFontStrikeoutCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontStrikeoutCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontStrikeoutCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontStrikeout true to apply strikeout formatting to the text, false to remove strikeout formatting. + */ + execute(fontStrikeout: boolean): boolean; +} +/** + * A command to change the superscript formatting of characters in a selected range. + */ +interface ChangeFontSuperscriptCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontSuperscriptCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontSuperscriptCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontSuperscript true to apply superscript formatting to the text, false to remove superscript formatting. + */ + execute(fontSuperscript: boolean): boolean; +} +/** + * A command to change the subscript formatting of characters in the selected range. + */ +interface ChangeFontSubscriptCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontSubscriptCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontSubscriptCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontSubscript true to apply subscript formatting to the text, false to remove subscript formatting. + */ + execute(fontSubscript: boolean): boolean; +} +/** + * A command to change the font color of characters in a selected range. + */ +interface ChangeFontForeColorCommand extends CommandBase { + /** + * Executes the ChangeFontForeColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string specifying the font color. May be specified as a color name or a hex color value. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the background color of characters in a selected range. + */ +interface ChangeFontBackColorCommand extends CommandBase { + /** + * Executes the ChangeFontBackColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string specifying the background font color. May be specified as a color name or a hex color value. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to reset the selected text's formatting to default. + */ +interface ClearFormattingCommand extends CommandWithSimpleStateBase { + /** + * Executes the ClearFormattingCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the selected range's style. + */ +interface ChangeStyleCommand extends CommandBase { + /** + * Executes the ChangeStyleCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param style A StyleBase object specifying the selected range's style. + */ + execute(style: StyleBase): boolean; + /** + * Executes the ChangeStyleCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param styleName A string specifying the applying style's name. + * @param isParagraphStyle true to apply the style to a paragraph, false to apply the style to a character. + */ + execute(styleName: string, isParagraphStyle: boolean): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to invoke the Font dialog allowing end-users to change the font, size and style of the selected text. + */ +interface OpenFontFormattingDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenFontFormattingDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to convert the text of all selected sentences to sentence case. + */ +interface MakeTextSentenceCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the MakeTextSentenceCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to switch the text case at the current position in the document. + */ +interface SwitchTextCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the SwitchTextCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the font formatting of characters in a selected range. + */ +interface ChangeFontFormattingCommand extends CommandBase { + /** + * Executes the ChangeFontFormattingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A FontFormattingSettings object specifying font formatting settings. + */ + execute(settings: FontFormattingSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * Contains settings to define the font formatting. + */ +interface FontFormattingSettings { + /** + * Gets or sets the character(s) font name. + * Value: A string value specifying the font name. + */ + fontName: string; + /** + * Gets or sets the character(s) font size. + * Value: An integer value specifying the font size. + */ + size: number; + /** + * Gets or sets the foreground color of characters. + * Value: A string value specifying the foreground color. + */ + foreColor: string; + /** + * Gets or sets the character background color. + * Value: A string value specifying the background color. + */ + backColor: string; + /** + * Gets or sets the type of underline applied to the character(s). + * Value: true, if characters are underlined; otherwise, false. + */ + underline: boolean; + /** + * Gets or sets the color of the underline for the specified characters. + * Value: A string value specifying the underline color. + */ + underlineColor: string; + /** + * Gets or sets whether the character formatting is bold. + * Value: true, if characters are bold; otherwise, false. + */ + bold: boolean; + /** + * Gets or sets a value indicating whether a character(s) is italicized. + * Value: true, if characters are italicized; otherwise, false. + */ + italic: boolean; + /** + * Gets or sets a value specifying whether the strikeout formatting is applied to a character(s). + * Value: true if the strikeout formatting is applied; otherwise, false. + */ + strikeout: boolean; + /** + * Gets or sets whether only word characters are underlined. + * Value: true to underline only characters in words; false to underline all characters. + */ + underlineWordsOnly: boolean; + /** + * Gets or sets a value specifying character script formatting. + * Value: One of the values. + */ + script: any; + /** + * Gets or sets a value indicating whether all characters are capital letters. + * Value: true, if all characters are capitalized; otherwise, false. + */ + allCaps: boolean; + /** + * Gets or sets a value indicating whether a character(s) is hidden. + * Value: true, if characters are hidden; otherwise, false. + */ + hidden: boolean; +} +declare enum CharacterFormattingScript { + Normal=0, + Subscript=1, + Superscript=2 +} +/** + * A command to toggle the horizontal ruler's visibility. + */ +interface ShowHorizontalRulerCommand extends CommandWithBooleanStateBase { + /** + * Executes the ShowHorizontalRulerCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ShowHorizontalRulerCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param show true to display the horizontal ruler, false to hide the horizontal ruler. + */ + execute(show: boolean): boolean; +} +/** + * A command to toggle the fullscreen mode. + */ +interface SetFullscreenCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetFullscreenCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the SetFullscreenCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fullscreen true to apply the fullscreen mode, false to disable the fullscreen mode. + */ + execute(fullscreen: boolean): boolean; +} +/** + * Holds the information that determines what action types can be performed for appointments. + */ +interface ASPxClientAppointmentFlags { + /** + * Gets a value that specifies whether an end-user is allowed to delete appointments. + * Value: true if an end-user can delete appointments; otherwise, false. Default is true. + */ + allowDelete: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to edit appointments. + * Value: true if the end-user can edit appointments; otherwise, false. + */ + allowEdit: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to change the time boundaries of appointments. + * Value: true if appointment resizing is allowed; otherwise, false. Default is true. + */ + allowResize: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to copy appointments. + * Value: true if a user can copy appointments; otherwise, false. Default is true. + */ + allowCopy: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to drag and drop appointments to another time slot or date. + * Value: true if the user can drag and drop appointments; otherwise, false. + */ + allowDrag: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to drag and drop appointments between resources. + * Value: true if the end-user can drag appointment from one resource to another; otherwise, false. + */ + allowDragBetweenResources: boolean; + /** + * Gets a value that specifies whether an inplace editor can be activated for an appointment. + * Value: true if an inplace editor is activated; otherwise, false. Default is true. + */ + allowInplaceEditor: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to share the schedule time between two or more appointments. + * Value: true if appointments with the same schedule time are allowed; otherwise, false. Default is true. + */ + allowConflicts: boolean; +} +/** + * Represents a client-side equivalent of the Appointment class. + */ +interface ASPxClientAppointment { + /** + * Gets the time interval of the appointment for client-side scripting. + * Value: An ASPxClientTimeInterval object, representing the interval assigned to an appointment. + */ + interval: ASPxClientTimeInterval; + /** + * Gets the identifiers of resources associated with the appointment for client-side scripting. + * Value: An array of string representations for resource identifiers. + */ + resources: string[]; + /** + * Gets the ID of an appointment for use in client-side scripts. + * Value: A string representation of the appointment ID. + */ + appointmentId: string; + /** + * Gets the type of appointment for use in client-side scripts. + * Value: An ASPxAppointmentType enumeration member, representing the appointment's type. + */ + appointmentType: ASPxAppointmentType; + /** + * Gets the index of the availability status object associated with the appointment. + * Value: An integer value that specifies the index of the corresponding Statuses collection. + */ + statusIndex: number; + /** + * Gets the index of the label object associated with the appointment for client-side scripting. + * Value: An integer value that specifies the index of the corresponding Labels collection. + */ + labelIndex: number; + /** + * Gets the client appointment value that is equivalent in meaning to the Subject property. + * Value: A string representing the appointment subject. + */ + subject: string; + /** + * Gets the client appointment value that is equivalent in meaning to the Description property. + * Value: A string, representing the description for an appointment. + */ + description: string; + /** + * Gets the client appointment value that is equivalent in meaning to the Location property. + * Value: A string representing the appointment location. + */ + location: string; + /** + * Gets the client appointment value that is equivalent in meaning to the AllDay property. + * Value: true indicates the all-day appointment; otherwise, false. + */ + allDay: boolean; + /** + * Adds a resource to the collection of resources associated with the client appointment. + * @param resourceId An object, representing the resource id. + */ + AddResource(resourceId: Object): void; + /** + * Gets the resource associated with the client-side appointment by its index. + * @param index An integer, representing an index of a resource in a resource collection associated with the current appointment. + */ + GetResource(index: number): Object; + /** + * Sets the property value of the client appointment, corresponding to the Start appointment property. + * @param start A JavaScript Date object representing the appointment start. + */ + SetStart(start: Date): void; + /** + * Gets the property value of the client appointment corresponding to the Start appointment property. + */ + GetStart(): Date; + /** + * Sets the property value of the client appointment, corresponding to the End appointment property. + * @param end A JavaScript Date object representing the end of the appointment. + */ + SetEnd(end: Date): void; + /** + * Gets the property value of the client appointment corresponding to the End appointment property. + */ + GetEnd(): Date; + /** + * Sets the property value of the client appointment, corresponding to the Duration appointment property. + * @param duration A TimeSpan object representing the appointment duration. + */ + SetDuration(duration: any): void; + /** + * Gets the property value of the client appointment corresponding to the Duration appointment property. + */ + GetDuration(): number; + /** + * Sets the ID of the client appointment. + * @param id An object representing the appointment identifier. + */ + SetId(id: Object): void; + /** + * Gets the ID of the client appointment. + */ + GetId(): Object; + /** + * Specifies the type of the current client appointment. + * @param type An ASPxAppointmentType enumeration value indicating the appointment type. + */ + SetAppointmentType(type: ASPxAppointmentType): void; + /** + * Gets the type of the client appointment. + */ + GetAppointmentType(): ASPxAppointmentType; + /** + * Sets the property value of the client appointment, corresponding to the StatusId appointment property. + * @param statusId An integer representing the index in the AppointmentStatusCollection. + */ + SetStatusId(statusId: number): void; + /** + * Gets the property value of the client appointment corresponding to the StatusId appointment property. + */ + GetStatusId(): number; + /** + * Sets the property value of the client appointment, corresponding to the LabelId appointment property. + * @param statusId An integer representing the index of the label in the Labels label collection. + */ + SetLabelId(statusId: number): void; + /** + * Gets the property value of the client appointment corresponding to the LabelId appointment property. + */ + GetLabelId(): number; + /** + * Sets the property value of the client appointment, corresponding to the Subject appointment property. + * @param subject A string containing the appointment subject. + */ + SetSubject(subject: string): void; + /** + * Gets the property value of the client appointment corresponding to the Subject appointment property. + */ + GetSubject(): string; + /** + * Sets the property value of the client appointment, corresponding to the Description appointment property. + * @param description A string representing the appointment description. + */ + SetDescription(description: string): void; + /** + * Gets the property value of the client appointment corresponding to the Description appointment property. + */ + GetDescription(): string; + /** + * Sets the property value of the client appointment, corresponding to the Location appointment property. + * @param location A string representing the appointment location. + */ + SetLocation(location: string): void; + /** + * Gets the property value of the client appointment corresponding to the Location appointment property. + */ + GetLocation(): string; + /** + * Specifies the property value of the client appointment corresponding to the AllDay appointment property. + * @param allDay true to indicate the all-day appointment; otherwise, false. + */ + SetAllDay(allDay: boolean): void; + /** + * Gets the property value of the client appointment corresponding to the AllDay appointment property. + */ + GetAllDay(): boolean; + /** + * Gets the appointment that is the RecurrencePattern for the current appointment. + */ + GetRecurrencePattern(): ASPxClientAppointment; + /** + * Sets the property value of the client appointment, corresponding to the RecurrenceInfo appointment property. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object representing the recurrence information. + */ + SetRecurrenceInfo(recurrenceInfo: ASPxClientRecurrenceInfo): void; + /** + * Gets the property value of the client appointment corresponding to the RecurrenceInfo appointment property. + */ + GetRecurrenceInfo(): ASPxClientRecurrenceInfo; +} +/** + * A client point object. + */ +interface ASPxClientPoint { + /** + * Gets the point's X-coordinate. + */ + GetX(): number; + /** + * Gets the point's Y-coordinate. + */ + GetY(): number; +} +/** + * A client rectangle object. + */ +interface ASPxClientRect { + /** + * Gets the X-coordinate of the rectangle's left edge. + */ + GetLeft(): number; + /** + * Gets the X-coordinate of the rectangle's right edge. + */ + GetRight(): number; + /** + * Gets the Y-coordinate of the rectangle's top edge. + */ + GetTop(): number; + /** + * Gets the Y-coordinate of the rectangle's bottom edge. + */ + GetBottom(): number; + /** + * Gets the rectangle's width. + */ + GetWidth(): number; + /** + * Gets the rectangle's height. + */ + GetHeight(): number; +} +/** + * Contains information defining the occurrences of a recurring client appointment. + */ +interface ASPxClientRecurrenceInfo { + /** + * Sets the recurrence start date. + * @param start A JavaScript date object value that specifies the start date for the recurrence. + */ + SetStart(start: Date): void; + /** + * Gets the recurrence start date. + */ + GetStart(): Date; + /** + * Sets the recurrence end date. + * @param end A JavaScript Date object that specifies the end date for the recurrence. + */ + SetEnd(end: Date): void; + /** + * Gets the recurrence end date. + */ + GetEnd(): Date; + /** + * Sets the duration of the recurrence. + * @param duration A TimeSpan object representing the duration. + */ + SetDuration(duration: any): void; + /** + * Gets the duration of the recurrence. + */ + GetDuration(): number; + /** + * Sets the time base for the frequency of the corresponding appointment occurrences. + * @param type An ASPxClientRecurrenceType enumeration value that specifies the recurrence's frequency type. + */ + SetRecurrenceType(type: ASPxClientRecurrenceType): void; + /** + * Gets the time base for the frequency of the corresponding appointment reoccurrence. + */ + GetRecurrenceType(): ASPxClientRecurrenceType; + /** + * Sets the day/days in a week that the corresponding appointment recurs on. + * @param weekDays The ASPxClientWeekDays enumeration value specifying the day/days in a week. + */ + SetWeekDays(weekDays: ASPxClientWeekDays): void; + /** + * Gets the day/days in a week on which the corresponding appointment occurs. + */ + GetWeekDays(): ASPxClientWeekDays; + /** + * Sets how many times the appointment occurs. + * @param occurrenceCount An integer value that specifies how many times the appointment occurs. + */ + SetOccurrenceCount(occurrenceCount: number): void; + /** + * Gets how many times the appointment occurs. + */ + GetOccurrenceCount(): number; + /** + * Sets the frequency with which the corresponding appointment occurs (dependent on the recurrence Type). + * @param periodicity An integer value that specifies the frequency with which the corresponding appointment occurs. + */ + SetPeriodicity(periodicity: number): void; + /** + * Gets the frequency with which the corresponding appointment reoccurs (dependent on the recurrence Type). + */ + GetPeriodicity(): number; + /** + * Sets the ordinal number of a day within a defined month. + * @param dayNumber A positive integer value that specifies the day number within a month. + */ + SetDayNumber(dayNumber: number): void; + /** + * Gets the ordinal number of a day within a defined month. + */ + GetDayNumber(): number; + /** + * Sets the occurrence number of the week in a month for the recurrence pattern. + * @param weekOfMonth A ASPxClientWeekOfMonth enumeration value that specifies a particular week in every month. + */ + SetWeekOfMonth(weekOfMonth: ASPxClientWeekOfMonth): void; + /** + * Gets the occurrence number of the week in a month for the recurrence pattern. + */ + GetWeekOfMonth(): ASPxClientWeekOfMonth; + /** + * Sets the month (as a number) on which the corresponding appointment occurs. + * @param month A positive integer value that specifies the month's number. + */ + SetMonth(month: number): void; + /** + * Gets the month (as a number) on which the corresponding appointment recurs. + */ + GetMonth(): number; + /** + * Gets the type of the recurrence range. + */ + GetRange(): ASPxClientRecurrenceRange; + /** + * Sets the type of the recurrence range. + * @param range An ASPxClientRecurrenceRangeenumeration value that specifies the recurrence range type. + */ + SetRange(range: ASPxClientRecurrenceRange): void; +} +/** + * Contains types of the recurrence range. + */ +interface ASPxClientRecurrenceRange { + /** + * A recurring appointment will not have an end date, i.e. infinite recurrence + * Value: The "NoEndDate" string. + */ + NoEndDate: string; + /** + * A recurring appointment will end after its recurrence count exceeds the value specified by the SetOccurrenceCount method. + * Value: The "OccurrenceCount" string. + */ + OccurrenceCount: string; + /** + * A recurring appointment will end after the date specified by the SetEnd method. + * Value: The "EndByDate" string. + */ + EndByDate: string; +} +/** + * Contains recurrence types. + */ +interface ASPxClientRecurrenceType { + /** + * The recurring appointment occurs on a daily basis. + * Value: The "Daily" string. + */ + Daily: string; + /** + * The recurring appointment reoccurs on a weekly basis. + * Value: The "Weekly" string. + */ + Weekly: string; + /** + * The recurring appointment reoccurs on a monthly basis. + * Value: The "Monthly" string. + */ + Monthly: string; + /** + * The recurring appointment reoccurs on an yearly basis. + * Value: The "Yearly" string. + */ + Yearly: string; + /** + * The recurring appointment occurs on an hourly base. + * Value: The "Hourly" string. + */ + Hourly: string; +} +/** + * Contains days and groups of days for use in recurrence patterns. + */ +interface ASPxClientWeekDays { + /** + * Specifies Sunday. + * Value: The integer 1 value. + */ + Sunday: number; + /** + * Specifies Monday. + * Value: The integer 2 value. + */ + Monday: number; + /** + * Specifies Tuesday. + * Value: The integer 4 value. + */ + Tuesday: number; + /** + * Specifies Wednesday. + * Value: The integer 8 value. + */ + Wednesday: number; + /** + * Specifies Thursday. + * Value: The integer 16 value. + */ + Thursday: number; + /** + * Specifies Friday. + * Value: The integer 32 value. + */ + Friday: number; + /** + * Specifies Saturday. + * Value: The integer 64 value. + */ + Saturday: number; + /** + * Specifies Saturday and Sunday. + * Value: The integer 65 value. + */ + WeekendDays: number; + /** + * Specifies work days (Monday, Tuesday, Wednesday, Thursday and Friday). + * Value: The integer 62 value. + */ + WorkDays: number; + /** + * Specifies every day of the week. + * Value: The integer 127 value. + */ + EveryDay: number; +} +/** + * Contains number of weeks in a month in which the event occurs. + */ +interface ASPxClientWeekOfMonth { + /** + * There isn't any recurrence rule based on the weeks in a month. + * Value: The integer 0 value. + */ + None: number; + /** + * The recurring event will occur once a month, on the specified day or days of the first week in the month. + * Value: The integer 1 value. + */ + First: number; + /** + * The recurring event will occur once a month, on the specified day or days of the second week in the month. + * Value: The integer 2 value. + */ + Second: number; + /** + * The recurring event will occur once a month, on the specified day or days of the third week in the month. + * Value: The integer 3 value. + */ + Third: number; + /** + * The recurring event will occur once a month, on the specified day or days of the fourth week in the month. + * Value: The integer 4 value; + */ + Fourth: number; + /** + * The recurring event will occur once a month, on the specified day or days of the last week in the month. + * Value: The integer 5 value; + */ + Last: number; +} +/** + * Represents a client-side equivalent of the WeekDaysCheckEdit control. + */ +interface ASPxClientWeekDaysCheckEdit extends ASPxClientControl { + /** + * Gets the selection state of the week day check boxes. + */ + GetValue(): ASPxClientWeekDays; + /** + * Gets the selection state of the week day check boxes. + * @param value An ASPxClientWeekDays object specifying the selection state of the week day check boxes. + */ + SetValue(value: ASPxClientWeekDays): void; +} +/** + * Represents a client-side equivalent of the RecurrenceRangeControl. + */ +interface ASPxClientRecurrenceRangeControl extends ASPxClientControl { + /** + * Gets the type of the recurrence range. + */ + GetRange(): ASPxClientRecurrenceRange; + /** + * Gets how many times the appointment occurs. + */ + GetOccurrenceCount(): number; + /** + * Gets the recurrence end date. + */ + GetEndDate(): Date; + /** + * Sets the type of the recurrence range. + * @param range An ASPxClientRecurrenceRangeenumeration value that specifies the recurrence range type. + */ + SetRange(range: ASPxClientRecurrenceRange): void; + /** + * Sets how many times the appointment occurs. + * @param occurrenceCount An integer value that specifies how many times the appointment occurs. + */ + SetOccurrenceCount(occurrenceCount: number): void; + /** + * Sets the recurrence end date. + * @param date A JavaScript Date object that specifies the end date for the recurrence. + */ + SetEndDate(date: Date): void; +} +/** + * A base for client equivalents of recurrence controls available in the XtraScheduler library. + */ +interface ASPxClientRecurrenceControlBase extends ASPxClientControl { + /** + * Returns an object providing access to the ASPxClientRecurrenceControlBase control's editor values. + */ + CreateValueAccessor(): DefaultRecurrenceRuleValuesAccessor; + /** + * Updates values of editors displayed by the ASPxClientRecurrenceControlBase control. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object containing new editor values. + */ + Update(recurrenceInfo: ASPxClientRecurrenceInfo): void; +} +/** + * Represents a client-side equivalent of the DailyRecurrenceControl - a control for specifying the daily recurrence. + */ +interface ASPxClientDailyRecurrenceControl extends ASPxClientRecurrenceControlBase { + /** + * Returns an object providing access to the ASPxClientDailyRecurrenceControl's editor values. + */ + CreateValueAccessor(): DefaultRecurrenceRuleValuesAccessor; + /** + * Updates values of editors displayed by the ASPxClientDailyRecurrenceControl. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object containing new editor values. + */ + Update(recurrenceInfo: ASPxClientRecurrenceInfo): void; +} +/** + * Represents a client-side equivalent of the WeeklyRecurrenceControl. + */ +interface ASPxClientWeeklyRecurrenceControl extends ASPxClientRecurrenceControlBase { + /** + * Returns an object providing access to the ASPxClientWeeklyRecurrenceControl's editor values. + */ + CreateValueAccessor(): DefaultRecurrenceRuleValuesAccessor; + /** + * Updates values of editors displayed by the ASPxClientWeeklyRecurrenceControl. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object containing new editor values. + */ + Update(recurrenceInfo: ASPxClientRecurrenceInfo): void; +} +/** + * Represents a client-side equivalent of the MonthlyRecurrenceControl. + */ +interface ASPxClientMonthlyRecurrenceControl extends ASPxClientRecurrenceControlBase { + /** + * Returns an object providing access to the ASPxClientMonthlyRecurrenceControl's editor values. + */ + CreateValueAccessor(): DefaultRecurrenceRuleValuesAccessor; + /** + * Updates values of editors displayed by the ASPxClientMonthlyRecurrenceControll. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object containing new editor values. + */ + Update(recurrenceInfo: ASPxClientRecurrenceInfo): void; +} +/** + * Represents a client-side equivalent of the YearlyRecurrenceControl. + */ +interface ASPxClientYearlyRecurrenceControl extends ASPxClientRecurrenceControlBase { + /** + * Returns an object providing access to the ASPxClientYearlyRecurrenceControl's editor values. + */ + CreateValueAccessor(): DefaultRecurrenceRuleValuesAccessor; + /** + * Updates values of editors displayed by the ASPxClientYearlyRecurrenceControl. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object containing new editor values. + */ + Update(recurrenceInfo: ASPxClientRecurrenceInfo): void; +} +/** + * An object providing access to an ASPxClientRecurrenceControlBase control's editor values. + */ +interface DefaultRecurrenceRuleValuesAccessor { + /** + * Get the frequency with which the appointment occurs with respect to the appointment's recurrence type. + */ + GetPeriodicity(): number; + /** + * Gets the number of the month's day in which the appointment is scheduled. + */ + GetDayNumber(): number; + /** + * Gets or sets the month's number. + */ + GetMonth(): number; + /** + * Gets the days of the week on which a weekly recurrent appointment is scheduled. + */ + GetWeekDays(): ASPxClientWeekDays; + /** + * Gets the number of the week in a month when an appointment is scheduled. + */ + GetWeekOfMonth(): ASPxClientWeekOfMonth; +} +/** + * An object providing access to an ASPxClientDailyRecurrenceControl's editor values. + */ +interface DailyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAccessor { + /** + * Gets the number of days between appointment occurrences. + */ + GetPeriodicity(): number; + /** + * Gets the days of the week to which a daily recurrent appointment is scheduled. + */ + GetWeekDays(): ASPxClientWeekDays; +} +/** + * An object providing access to an ASPxClientWeeklyRecurrenceControl's editor values. + */ +interface WeeklyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAccessor { + /** + * Gets the number of weeks between appointment occurrences. + */ + GetPeriodicity(): number; + /** + * Gets the days of the week on which a weekly recurrent appointment is scheduled. + */ + GetWeekDays(): ASPxClientWeekDays; +} +/** + * An object providing access to an ASPxClientMonthlyRecurrenceControl's editor values. + */ +interface MonthlyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAccessor { + /** + * Gets the day of the month on which the appointment is scheduled. + */ + GetDayNumber(): number; + /** + * Gets the number of months between appointment occurrences. + */ + GetPeriodicity(): number; + /** + * Gets the days of the week on which a monthly recurrent appointment is scheduled. + */ + GetWeekDays(): ASPxClientWeekDays; + /** + * Gets the number of the week in a month when an appointment is scheduled. + */ + GetWeekOfMonth(): ASPxClientWeekOfMonth; +} +/** + * An object providing access to an ASPxClientYearlyRecurrenceControl's editor values. + */ +interface YearlyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAccessor { + /** + * Gets the day of the month on which the appointment is scheduled. + */ + GetDayNumber(): number; + /** + * Gets or sets the month's number. + */ + GetMonth(): number; + /** + * Gets the days of the week on which a yearly recurrent appointment is scheduled. + */ + GetWeekDays(): ASPxClientWeekDays; + /** + * Gets or sets the number of a week in a month when an appointment is scheduled. + */ + GetWeekOfMonth(): ASPxClientWeekOfMonth; +} +/** + * Provides base functionality for ASPxClientScheduler's forms. + */ +interface ASPxClientFormBase { + /** + * Occurs when the form has been closed. + */ + FormClosed: ASPxClientEvent>; + /** + * Closes the form. + */ + Close(): void; + /** + * Sets the visibility state of the specified form element. + * @param element An object specifying the element whose visibility state should be changed. + * @param isVisible true to display the element; false to hide the element. + */ + SetVisibleCore(element: Object, isVisible: boolean): void; +} +/** + * Represents a client-side equivalent of the RecurrenceTypeEdit. + */ +interface ASPxClientRecurrenceTypeEdit extends ASPxClientRadioButtonList { + /** + * Gets the selected recurrence type. + */ + GetRecurrenceType(): ASPxClientRecurrenceType; + /** + * Sets the selected recurrence type. + * @param recurrenceType An ASPxClientRecurrenceType enumeration value. + */ + SetRecurrenceType(recurrenceType: ASPxClientRecurrenceType): void; +} +/** + * Contains lists of property names for different appointment types. + */ +interface AppointmentPropertyNames { + /** + * Gets the list of properties characteristic for appointments of the Normal type. + * Value: A string array which is composed of the appointment property names. + */ + Normal: string; + /** + * Gets the list of properties characteristic for appointments of the Pattern type. + * Value: A string array which is composed of the appointment property names. + */ + Pattern: string; +} +/** + * Represents the client-side equivalent of the TimeInterval class. + */ +interface ASPxClientTimeInterval { + /** + * Gets a value indicating if the time interval is All-Day. + */ + GetAllDay(): boolean; + /** + * Sets a value specifying if the time interval is All-Day. + * @param allDayValue true, if this is an all-day time interval; otherwise, false. + */ + SetAllDay(allDayValue: boolean): void; + /** + * Client-side function that returns the start time of the interval. + */ + GetStart(): Date; + /** + * Client-side function that returns the duration of the specified time interval. + */ + GetDuration(): number; + /** + * Client-side function that returns the end time of the interval. + */ + GetEnd(): Date; + /** + * Client-side function that sets the start time of the interval. + * @param value A DateTime value, representing the beginning of the interval. + */ + SetStart(value: Date): void; + /** + * Client-side function that returns the duration of the specified time interval. + * @param value A TimeSpan object, representing the duration of the time period. + */ + SetDuration(value: any): void; + /** + * Client-side function that sets the end time of the interval. + * @param value A DateTime value, representing the end of the interval. + */ + SetEnd(value: Date): void; + /** + * Determines whether the specified object is equal to the current ASPxClientTimeInterval instance. + * @param interval The object to compare with the current object. + */ + Equals(interval: ASPxClientTimeInterval): boolean; + /** + * Checks if the current time interval intersects with the specified time interval. + * @param interval A ASPxClientTimeInterval object which represents the time interval to be checked. + */ + IntersectsWith(interval: ASPxClientTimeInterval): boolean; + /** + * Checks if the current time interval intersects with the specified time interval. The boundaries of the time intervals are excluded from the check. + * @param interval A ASPxClientTimeInterval object which represents the time interval to be checked. + */ + IntersectsWithExcludingBounds(interval: ASPxClientTimeInterval): boolean; + /** + * Client-side function that determines whether the specified interval is contained within the current one. + * @param interval An ASPxClientTimeInterval object, representing the time interval to check. + */ + Contains(interval: ASPxClientTimeInterval): boolean; +} +/** + * Holds action types for the client-side Refresh method. + */ +interface ASPxClientSchedulerRefreshAction { + /** + * Gets the value of the action parameter which initiates a simple reload of the control. + * Value: An integer representing the action parameter value. + */ + None: number; + /** + * Gets the value of the action parameter which initiates reloading of the main ASPxScheduler control and its data-dependent satellites. + * Value: An integer representing the action parameter value. + */ + VisibleIntervalChanged: number; + /** + * Gets the value of the action parameter which initiates reloading of the main ASPxScheduler control and its satellite View controls. + * Value: An integer representing the action parameter value. + */ + ActiveViewTypeChanged: number; +} +/** + * Contains methods allowing you to perform or cancel an operation. + */ +interface ASPxClientAppointmentOperation { + /** + * Passes parameters to the corresponding callback function to accomplish the operation. + */ + Apply(): void; + /** + * Cancels the operation. + */ + Cancel(): void; +} +/** + * Represents the client-side equivalent of the ASPxScheduler control. + */ +interface ASPxClientScheduler extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientScheduler. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side when the Scheduler control is about to change its active view. + */ + ActiveViewChanging: ASPxClientEvent>; + /** + * Client-side event. Occurs after the active view of the ASPxScheduler has been changed. + */ + ActiveViewChanged: ASPxClientEvent>; + /** + * Occurs when an end-user presses a keyboard shortcut. + */ + Shortcut: ASPxClientEvent>; + /** + * Occurs when the end-user clicks an appointment. + */ + AppointmentClick: ASPxClientEvent>; + /** + * Occurs when the end-user double clicks on an appointment. + */ + AppointmentDoubleClick: ASPxClientEvent>; + /** + * Occurs when an end-user clicks a time cell. + */ + CellClick: ASPxClientEvent>; + /** + * Occurs when and end-user double-clicks a time cell. + */ + CellDoubleClick: ASPxClientEvent>; + /** + * Occurs on the client side when the user selects an appointment. + */ + AppointmentsSelectionChanged: ASPxClientEvent>; + /** + * Fires on the client side when the time cell selection is changed. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the time cell selection is about to change. + */ + SelectionChanging: ASPxClientEvent>; + /** + * Fires on the client side when the time interval of the scheduling area is changed. + */ + VisibleIntervalChanged: ASPxClientEvent>; + /** + * Occurs when one of More Buttons is clicked. + */ + MoreButtonClicked: ASPxClientEvent>; + /** + * Client-side event that occurs when a popup menu item is clicked. + */ + MenuItemClicked: ASPxClientEvent>; + /** + * Client-side event that occurs after an appointment has been dragged and dropped. + */ + AppointmentDrop: ASPxClientEvent>; + /** + * A client-side event that occurs when an appointment is being dragged. + */ + AppointmentDrag: ASPxClientEvent>; + /** + * A client-side event that occurs when an appointment is being resized. + */ + AppointmentResizing: ASPxClientEvent>; + /** + * Client-side event that occurs when an appointment is resized. + */ + AppointmentResize: ASPxClientEvent>; + /** + * Client-side event that fires before an appointment is deleted. + */ + AppointmentDeleting: ASPxClientEvent>; + /** + * Client-side scripting method that gets the active View. + */ + GetActiveViewType(): ASPxSchedulerViewType; + /** + * Client-side scripting method to change the ASPxScheduler's active View. + * @param value A ASPxSchedulerViewType enumeration value, representing a view type to set. + */ + SetActiveViewType(value: ASPxSchedulerViewType): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Client-side scripting method which initiates a round trip to the server so that the current page will be reloaded. + */ + Refresh(): void; + /** + * Client-side scripting method which initiates a round trip to the server, so that the control will be reloaded using the specified refresh action. + * @param refreshAction An ASPxClientSchedulerRefreshAction enumeration value, specifying the refresh action. + */ + Refresh(refreshAction: ASPxClientSchedulerRefreshAction): void; + /** + * Client-side function that returns the type of grouping applied to the appointments displayed in the scheduler. + */ + GetGroupType(): ASPxSchedulerGroupType; + /** + * Client-side scripting method which raises the callback command to set the GroupType. + * @param value An ASPxSchedulerGroupType enumeration value, which specifies how appointments are grouped. + */ + SetGroupType(value: ASPxSchedulerGroupType): void; + /** + * Client-side method that navigates the scheduler to the current system date. + */ + GotoToday(): void; + /** + * Client-side scripting method which raises the GotoDate callback command. + * @param date A DateTime value specifying the destination time. + */ + GotoDate(date: Date): void; + /** + * Client-side function which slides the visible interval one time span back. + */ + NavigateBackward(): void; + /** + * Client-side function which slides the visible interval one time span forward. + */ + NavigateForward(): void; + /** + * Client-side method which raises the callback command to change the ClientTimeZoneId of the scheduler. + * @param timeZoneId A string, a time zone identifier which is valid for the System.TimeZoneInfo.Id property. + */ + ChangeTimeZoneId(timeZoneId: string): void; + /** + * Displays a Selection ToolTip on a position given by the specified coordinates. + * @param x An integer representing the X-coordinate. + * @param y An integer representing the Y-coordinate. + */ + ShowSelectionToolTip(x: number, y: number): void; + /** + * Client-side function that returns the time interval, selected in the scheduler. + */ + GetSelectedInterval(): ASPxClientTimeInterval; + /** + * Client-side function that returns the ResourceId of selected time cell's resource. + */ + GetSelectedResource(): string; + /** + * Gets a collection of visible appointments. + */ + GetVisibleAppointments(): ASPxClientAppointment[]; + /** + * Client-side function that returns an appointment with the specified ID. + * @param id An appointment's identifier. + */ + GetAppointmentById(id: Object): ASPxClientAppointment; + /** + * Client-side function that returns the id's of selected appointments. + */ + GetSelectedAppointmentIds(): string[]; + /** + * Client-side function that removes the appointment specified by its client ID from a collection of selected appointments. + * @param aptId An appointment's identifier. + */ + DeselectAppointmentById(aptId: Object): void; + /** + * Client-side function that selects an appointment with the specified ID. + * @param aptId An appointment's identifier. + */ + SelectAppointmentById(aptId: Object): void; + /** + * Enables obtaining appointment property values in a client-side script. Executes the callback command with the AppointmentData identifier. + * @param aptId An integer, representing the appointment ID. + * @param propertyNames An array of strings, representing the appointment properties to query. + * @param onCallBack A handler of a function which will receive and process the properties' values. + */ + GetAppointmentProperties(aptId: number, propertyNames: string[], onCallBack: Object): string[]; + /** + * Initiates a callback to retrieve and apply the values for the specified list of properties to the specified appointment, and transfer control to the specified function. + * @param clientAppointment An ASPxClientAppointment object that is the client appointment for which the data is retrieved. + * @param propertyNames An array of strings, that are the names of appointment properties to query. + * @param onCallBack A handler of a function executed after a callback. + */ + RefreshClientAppointmentProperties(clientAppointment: ASPxClientAppointment, propertyNames: string[], onCallBack: Object): void; + /** + * Client-side function that invokes the editing form for the appointment specified by its client ID. + * @param aptClientId A string, representing the appointment client identifier. + */ + ShowAppointmentFormByClientId(aptClientId: string): void; + /** + * Client-side function that invokes the editing form for the appointment specified by its storage identifier. + * @param aptServerId A string, representing the appointment identifier. + */ + ShowAppointmentFormByServerId(aptServerId: string): void; + /** + * Sets the time of the day corresponding to the start of the topmost displayed time cell row. + * @param duration An integer, representing the number of milliseconds passed since the start of the day. + * @param viewType An ASPxSchedulerViewType enumeration member, representing the scheduler's View. It can be either 'Day' or 'WorkWeek'. + */ + SetTopRowTime(duration: number, viewType: ASPxSchedulerViewType): void; + /** + * Sets the time of the day corresponding to the start of the topmost displayed time cell row. + * @param duration An integer, representing the number of milliseconds passed since the start of the day. + */ + SetTopRowTime(duration: number): void; + /** + * Gets the time of the day corresponding to the start of the topmost displayed time cell row. + * @param viewType An ASPxSchedulerViewType enumeration member, representing the scheduler's View. It can be either "Day" or "WorkWeek", otherwise the result is undefined. + */ + GetTopRowTime(viewType: ASPxSchedulerViewType): number; + /** + * Gets the time of day corresponding to the start of the topmost displayed time cell row. + */ + GetTopRowTime(): number; + /** + * Client-side scripting method which displays the Loading Panel. + */ + ShowLoadingPanel(): void; + /** + * Client-side scripting method which hides the Loading Panel from view. + */ + HideLoadingPanel(): void; + /** + * Client-side method that invokes the inplace editor form to create a new appointment. + * @param start A date object, representing the start of the new appointment. + * @param end A date object, representing the end of the new appointment. + */ + ShowInplaceEditor(start: Date, end: Date): void; + /** + * Client-side method that invokes the inplace editor form to create a new appointment. + * @param start A date object, representing the start of the new appointment. + * @param end A date object, representing the end of the new appointment. + * @param resourceId An object representing the identifier of a resource associated with the new appointment. + */ + ShowInplaceEditor(start: Date, end: Date, resourceId: string): void; + /** + * Client-side scripting method to insert the specified appointment. + * @param apt An ASPxClientAppointment object representing the client-side appointment. + */ + InsertAppointment(apt: ASPxClientAppointment): void; + /** + * Client-side scripting method to update the specified appointment. + * @param apt An ASPxClientAppointment object representing the client-side appointment. + */ + UpdateAppointment(apt: ASPxClientAppointment): void; + /** + * Client-side scripting method to delete the specified appointment. + * @param apt An ASPxClientAppointment object representing the client-side appointment. + */ + DeleteAppointment(apt: ASPxClientAppointment): void; + /** + * Client-side method that allows retrieving a collection of time intervals displayed by the ASPxScheduler. + */ + GetVisibleIntervals(): ASPxClientTimeInterval[]; + /** + * Changes the container that the ASPxScheduler tooltip belongs to. + * @param container An object that serves as the new container for the pop-up menu. + */ + ChangeToolTipContainer(container: Object): void; + /** + * Changes the container that the ASPxScheduler pop-up menu belongs to. + * @param container An object that serves as the new container for the pop-up menu. + */ + ChangePopupMenuContainer(container: Object): void; + /** + * Returns focus to the form if the ASPxScheduler control is not visible when the reminder fires. + * @param container A DIV object that is located in such a way that it is visible on the page in situations when the ASPxScheduler control is hidden. + */ + ChangeFormContainer(container: Object): void; + /** + * Client-side scripting method that saves appointment modifications and closes the form. + */ + AppointmentFormSave(): void; + /** + * Client-side scripting method that deletes the appointment being edited. + */ + AppointmentFormDelete(): void; + /** + * Client-side scripting method that cancels changes and closes the appointment editing form. + */ + AppointmentFormCancel(): void; + /** + * Client-side scripting method that navigates the scheduler to the date selected in the GotoDate form and closes the form. + */ + GoToDateFormApply(): void; + /** + * Client-side scripting method that cancels changes and closes the GotoDate form. + */ + GoToDateFormCancel(): void; + /** + * Client-side scripting method that cancels changes and closes the form. + */ + InplaceEditFormSave(): void; + /** + * Client-side scripting method that cancels changes and closes the form. + */ + InplaceEditFormCancel(): void; + /** + * Client-side scripting method that invokes the appointment editing form for the appointment being edited in the inplace editor. + */ + InplaceEditFormShowMore(): void; + /** + * Client-side scripting method that closes the Reminder form. + */ + ReminderFormCancel(): void; + /** + * Client-side scripting method that calls the Dismiss method for the selected reminder. + */ + ReminderFormDismiss(): void; + /** + * Client-side scripting method that dismisses all reminders shown in the Reminder form. + */ + ReminderFormDismissAll(): void; + /** + * Client-side scripting method that changes the alert time for the selected reminder to the specified interval. + */ + ReminderFormSnooze(): void; +} +/** + * Represents a client-side equivalent of the SchedulerViewType object. + */ +interface ASPxSchedulerViewType { + /** + * Gets a string representation equivalent of Day enumeration for use in client scripts. + * Value: A string "Day", indicating the DayView. + */ + Day: string; + /** + * Gets a string representation equivalent of WorkWeek enumeration for use in client scripts. + * Value: A string "WorkWeek", indicating the WorkWeekView. + */ + WorkWeek: string; + /** + * Gets a string representation equivalent of Week enumeration for use in client scripts. + * Value: A string "Week", indicating the WeekView. + */ + Week: string; + /** + * Gets a string representation equivalent of Month enumeration for use in client scripts. + * Value: A string "Month", indicating the MonthView. + */ + Month: string; + /** + * Gets a string representation equivalent of Timeline enumeration for use in client scripts. + * Value: A string "Timeline", indicating the TimelineView. + */ + Timeline: string; + /** + * Gets a string representation equivalent of FullWeek enumeration for use in client scripts. + * Value: A string "FullWeek", indicating the FullWeekView. + */ + FullWeek: string; + /** + * Gets a string representation equivalent to the Agenda enumeration for use in client scripts. + * Value: A string "Agenda", indicating the AgendaView. + */ + Agenda: string; +} +/** + * Represents a client-side equivalent of the SchedulerGroupType enumeration. + */ +interface ASPxSchedulerGroupType { + /** + * Gets a string representation equivalent of None enumeration for use in client scripts. + * Value: A "None" string value. + */ + None: string; + /** + * Gets a string representation equivalent of Date enumeration for use in client scripts. + * Value: A "Date" string value. + */ + Date: string; + /** + * Gets a string representation equivalent of Resource enumeration for use in client scripts. + * Value: A "Resource" string value. + */ + Resource: string; +} +/** + * Represents a client-side equivalent of the AppointmentType enumeration. + */ +interface ASPxAppointmentType { + /** + * Gets a string representation equivalent of Normal enumeration for use in client scripts. + * Value: A "Normal" string value. + */ + Normal: string; + /** + * Gets a string representation equivalent of Pattern enumeration for use in client scripts. + * Value: A "Pattern" string value. + */ + Pattern: string; + /** + * Gets a string representation equivalent of Occurrence enumeration for use in client scripts. + * Value: An "Occurrence" string value. + */ + Occurrence: string; + /** + * Gets a string representation equivalent of ChangedOccurrence enumeration for use in client scripts. + * Value: A "ChangedOccurrence" string value. + */ + ChangedOccurrence: string; + /** + * Gets a string representation equivalent of DeletedOccurrence enumeration for use in client scripts. + * Value: A "DeletedOccurrence" string value. + */ + DeletedOccurrence: string; +} +interface ASPxClientAppointmentDeletingEventHandler { + /** + * A method that will handle the AppointmentDeleting event. + * @param source The event sender (typically an ASPxClientScheduler control). + * @param e A ASPxClientAppointmentDeletingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientAppointmentDeletingEventArgs): void; +} +/** + * Provides data for the AppointmentDeleting event. + */ +interface ASPxClientAppointmentDeletingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets client IDs of the appointments that are intended to be removed. + * Value: An array of client appointment identifiers, representing appointments passed for deletion. + */ + appointmentIds: Object[]; +} +interface AppointmentClickEventHandler { + /** + * A method that will handle the AppointmentClick event. + * @param source The event sender (typically an ASPxClientScheduler control). + * @param e A AppointmentClickEventArgs object that contains event data. + */ + (source: S, e: AppointmentClickEventArgs): void; +} +/** + * Provides data for the AppointmentDoubleClick events. + */ +interface AppointmentClickEventArgs extends ASPxClientEventArgs { + /** + * Gets the client appointment ID for the appointment being clicked. + * Value: A string, representing the client ID of the appointment. + */ + appointmentId: string; + /** + * Gets the HTML element that the event was triggered on. + * Value: An object containing event data. + */ + htmlElement: Object; + /** + * Gets or sets whether an event is handled, and that default actions are not required. + * Value: true if no default processing is required; otherwise, false. + */ + handled: boolean; +} +/** + * A method that will handle the AppointmentsSelectionChanged event. + */ +interface AppointmentsSelectionEventHandler { + /** + * A method that will handle the AppointmentsSelectionChanged event. + * @param source The ASPxScheduler control which fires the event. + * @param e A AppointmentsSelectionEventArgs object that contains event data. + */ + (source: S, e: AppointmentsSelectionEventArgs): void; +} +/** + * Provides data for the AppointmentsSelectionChanged event. + */ +interface AppointmentsSelectionEventArgs extends ASPxClientEventArgs { + /** + * Gets identifiers of the selected appointments. + * Value: A comma separated list of string values, representing appointment IDs. + */ + appointmentIds: string[]; +} +/** + * A method that will handle the Shortcut event. + */ +interface ShortcutEventHandler { + /** + * A method that will handle the Shortcut event. + * @param source The event sender (typically an ASPxClientScheduler control). + * @param e A ShortcutEventArgs object that contains event data. + */ + (source: S, e: ShortcutEventArgs): void; +} +/** + * Provides data for the client-side Shortcut event. + */ +interface ShortcutEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of a command associated with the keyboard shortcut. + * Value: A string containing a command name. + */ + commandName: string; + /** + * Gets an object containing information about a keyboard shortcut event. + * Value: An object containing event data. + */ + htmlEvent: Object; + /** + * Gets or sets whether an event is handled, and that default actions are not required. + * Value: true, if no default processing is required; otherwise, false. + */ + handled: boolean; +} +/** + * A method that will handle the ActiveViewChanging event. + */ +interface ActiveViewChangingEventHandler { + /** + * A method that will handle the ActiveViewChanging event. + * @param source The ASPxClientScheduler control which fires the event. + * @param e An ActiveViewChangingEventArgs object that contains event data + */ + (source: S, e: ActiveViewChangingEventArgs): void; +} +/** + * Provides data for the client-side ActiveViewChanging event. + */ +interface ActiveViewChangingEventArgs extends ASPxClientEventArgs { + /** + * Gets the value of the ActiveView property before modification. + * Value: A SchedulerViewType enumeration. + */ + oldView: ASPxSchedulerViewType; + /** + * Gets the new value of the ActiveView property. + * Value: A string, which is the SchedulerViewType enumeration value. + */ + newView: ASPxSchedulerViewType; + /** + * Gets or sets whether the change of active view should be canceled. + * Value: true to cancel the operation; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the MoreButtonClicked event. + */ +interface MoreButtonClickedEventHandler { + /** + * A method that will handle MoreButtonClicked event. + * @param source The ASPxClientScheduler control which fires the event. + * @param e A MoreButtonClickedEventArgs object that contains event data. + */ + (source: S, e: MoreButtonClickedEventArgs): void; +} +/** + * Provides data for the MoreButtonClicked client-side event. + */ +interface MoreButtonClickedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the Start or End values of the target appointment. + * Value: A DateTime value representing the target appointment's boundary. + */ + targetDateTime: Date; + /** + * Gets the time interval of the cell where the button is located. + * Value: An ASPxClientTimeInterval object representing the time interval of the cell which holds the button. + */ + interval: ASPxClientTimeInterval; + /** + * Gets the resource identifier associated with the cell where the button is located. + * Value: A string, corresponding to ResourceId. + */ + resource: string; + /** + * Gets or sets whether an event is handled. If it is handled, default actions are not required. + * Value: true if no default processing is required; otherwise, false. + */ + handled: boolean; +} +/** + * A method that will handle the MenuItemClicked event. + */ +interface MenuItemClickedEventHandler { + /** + * A method that will handle the MenuItemClicked event. + * @param source The ASPxClientScheduler control which fires the event. + * @param e A MenuItemClickedEventArgs object that contains event data. + */ + (source: S, e: MenuItemClickedEventArgs): void; +} +/** + * Provides data for the MenuItemClicked event. + */ +interface MenuItemClickedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the menu item which is clicked. + * Value: A string, containing the menu item name. + */ + itemName: string; + /** + * Gets or sets whether an event is handled, and that default actions are not required. + * Value: true if no default processing is required; otherwise, false. + */ + handled: boolean; +} +/** + * A method that will handle the AppointmentDrag event. + */ +interface AppointmentDragEventHandler { + /** + * A method that will handle the AppointmentDrag event. + * @param source The event sender (typically an ASPxClientScheduler object). + * @param e A ASPxClientAppointmentDragEventArgs object that contains event data. + */ + (source: S, e: ASPxClientAppointmentDragEventArgs): void; +} +/** + * Provides data for the AppointmentDrag event. + */ +interface ASPxClientAppointmentDragEventArgs extends ASPxClientEventArgs { + /** + * Specifies whether or not appointments can be dropped into the intervals over which they are currently dragged. + * Value: true to allow dropping appointments; otherwise, false. + */ + allow: boolean; + /** + * Gets a mouse event object related to the current drag operation. + * Value: An object providing event properties specific to mouse events. + */ + mouseEvent: Object; + /** + * Provides information about dragged appointments. + * Value: An array of ASPxClientAppointmentDragInfo objects storing information about dragged appointments. + */ + dragInformation: ASPxClientAppointmentDragInfo[]; +} +/** + * A method that will handle the AppointmentDrop event. + */ +interface AppointmentDropEventHandler { + /** + * A method that will handle the AppointmentDrop event. + * @param source The event sender (typically an ASPxClientScheduler object). + * @param e A ASPxClientAppointmentDropEventArgs object that contains event data. + */ + (source: S, e: ASPxClientAppointmentDropEventArgs): void; +} +/** + * Provides data for the AppointmentDrop event. + */ +interface ASPxClientAppointmentDropEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets a value that specifies whether the event is handled, and the default processing is not required. + * Value: true, if if the event is completely handled by custom code and no default processing is required; otherwise, false. + */ + handled: boolean; + /** + * Provides access to an object that enables you to choose an operation to perform. + * Value: An ASPxClientAppointmentOperation object providing methods to perform the required operation. + */ + operation: ASPxClientAppointmentOperation; + /** + * Provides information about dropped appointments. + * Value: An array of ASPxClientAppointmentDragInfo objects storing information about dropped appointments. + */ + dragInformation: ASPxClientAppointmentDragInfo[]; +} +interface AppointmentResizeEventHandler { + /** + * A method that will handle the AppointmentResize event. + * @param source The event sender (typically an ASPxClientScheduler control). + * @param e A ASPxClientAppointmentResizeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientAppointmentResizeEventArgs): void; +} +/** + * Provides data for the AppointmentResize event. + */ +interface ASPxClientAppointmentResizeEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether default event processing is required. + * Value: true to process an event using only custom code; otherwise, false. + */ + handled: boolean; + /** + * Provides access to an object that enables you to choose an operation to perform. + * Value: An ASPxClientAppointmentOperation object providing methods to perform the required operation. + */ + operation: ASPxClientAppointmentOperation; + /** + * Gets the resized appointment's identifier. + * Value: A string containing an appointment identifier. + */ + appointmentId: string; + /** + * Gets the appointment's interval before resizing. + * Value: An object representing the interval assigned to the appointment. + */ + oldInterval: ASPxClientTimeInterval; + /** + * Gets the appointment's interval after resizing. + * Value: An object representing the interval assigned to the appointment. + */ + newInterval: ASPxClientTimeInterval; +} +/** + * A method that will handle the AppointmentResizing event. + */ +interface AppointmentResizingEventHandler { + /** + * A method that will handle the AppointmentResizing event. + * @param source The event sender (typically an ASPxClientScheduler object). + * @param e A ASPxClientAppointmentResizingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientAppointmentResizingEventArgs): void; +} +/** + * Provides data for the AppointmentResizing event. + */ +interface ASPxClientAppointmentResizingEventArgs extends ASPxClientEventArgs { + /** + * Specifies whether or not an appointment can be resized to the new time interval. + * Value: true to allow resizing the appointment; otherwise, false. + */ + allow: boolean; + /** + * Gets a mouse event object related to the current appointment resizing operation. + * Value: An object providing event properties specific to mouse events. + */ + mouseEvent: Object; + /** + * Gets the resized appointment's identifier. + * Value: A string containing an appointment identifier. + */ + appointmentId: string; + /** + * Gets the appointment's interval before resizing. + * Value: An object representing the interval assigned to the appointment. + */ + oldInterval: ASPxClientTimeInterval; + /** + * Gets the appointment's interval after resizing. + * Value: An object representing the interval assigned to the appointment. + */ + newInterval: ASPxClientTimeInterval; +} +/** + * Stores information about an appointment drag operation. + */ +interface ASPxClientAppointmentDragInfo { + /** + * Gets the dragged appointment's identifier. + * Value: A string containing an appointment identifier. + */ + appointmentId: string; + /** + * Gets the appointment's interval before the drag operation. + * Value: An object representing the interval assigned to the appointment. + */ + oldInterval: ASPxClientTimeInterval; + /** + * Gets resources that were associated with the appointment before the drag operation. + * Value: A array of strings containing resource identifiers. + */ + oldResources: string[]; + /** + * Gets the appointment's interval after the drag operation. + * Value: An object representing the interval assigned to the appointment. + */ + newInterval: ASPxClientTimeInterval; + /** + * Gets resources associated with the appointment after the drag operation. + * Value: An array of strings containing resource identifiers. + */ + newResources: string[]; +} +/** + * A method that will handle the CellDoubleClick events. + */ +interface CellClickEventHandler { + /** + * A method that will handle the CellClick event. + * @param source The event sender (typically an ASPxClientScheduler control). + * @param e A CellClickEventArgs object that contains event data. + */ + (source: S, e: CellClickEventArgs): void; +} +/** + * Provides data for the CellDoubleClick events. + */ +interface CellClickEventArgs extends ASPxClientEventArgs { + /** + * Provides access to an object containing information about an HTML element representing the clicked time cell. + * Value: An object containing information about an HTML element. + */ + htmlElement: Object; + /** + * Provides access to a time interval occupied by the clicked time cell. + * Value: An object. + */ + interval: ASPxClientTimeInterval; + /** + * Gets the name of a resource to which the clicked time cell belongs. + * Value: A string containing the name of a resource. + */ + resource: string; +} +/** + * Contains information about a client tooltip. + */ +interface ASPxClientSchedulerToolTipData { + /** + * Returns the client appointment for which the tooltip is displayed. + */ + GetAppointment(): ASPxClientAppointment; + /** + * Returns the client time interval for which the tooltip is displayed. + */ + GetInterval(): ASPxClientTimeInterval; + /** + * Returns the resources associated with the appointment for which the tooltip is displayed. + */ + GetResources(): Object[]; +} +/** + * A client-side equivalent of the ASPxSchedulerToolTipBase control. + */ +interface ASPxClientToolTipBase { + /** + * Returns the value that indicates whether or not the tooltip can be displayed. + */ + CanShowToolTip(): boolean; + /** + * Ends updating the tooltip content. + * @param toolTipData An ASPxClientSchedulerToolTipData object providing data required to update the tooltip content. + */ + FinalizeUpdate(toolTipData: ASPxClientSchedulerToolTipData): void; + /** + * Updates the tooltip content. + * @param toolTipData An ASPxClientSchedulerToolTipData object providing data required to update the tooltip content. + */ + Update(toolTipData: ASPxClientSchedulerToolTipData): void; + /** + * Closes the tooltip. + */ + Close(): void; + /** + * Gets the tooltip position. + * @param bounds An object that represents the tooltip bounds. + */ + CalculatePosition(bounds: Object): ASPxClientPoint; + /** + * Displays the Appointment Menu in the position of the tooltip. + * @param eventObject An object containing information about the event on which the menu is displayed. + */ + ShowAppointmentMenu(eventObject: Object): void; + /** + * Displays the View Menu in the position of the tooltip. + * @param eventObject An object containing information about the event on which the menu is displayed. + */ + ShowViewMenu(eventObject: Object): void; + /** + * Returns the string representation of the specified interval. + * @param interval An ASPxClientTimeInterval object to convert. + */ + ConvertIntervalToString(interval: ASPxClientTimeInterval): string; +} +/** + * Represents the client-side equivalent of the ASPxSpellChecker class. + */ +interface ASPxClientSpellChecker extends ASPxClientControl { + /** + * Client-side event that occurs before the spell check starts. + */ + BeforeCheck: ASPxClientEvent>; + /** + * Client-side event that occurs before a message box informing about process completion is shown. + */ + CheckCompleteFormShowing: ASPxClientEvent>; + /** + * Client-side event that occurs when a spell check is finished. + */ + AfterCheck: ASPxClientEvent>; + /** + * Occurs after a word is changed in a checked text. + */ + WordChanged: ASPxClientEvent>; + /** + * Starts the spelling check of the text contained within the element specified by the CheckedElementID value. + */ + Check(): void; + /** + * Starts checking contents of the specified element. + * @param element An object representing the element being checked. + */ + CheckElement(element: Object): void; + /** + * Starts checking contents of the specified element. + * @param id A string representing the identifier of the element being checked. + */ + CheckElementById(id: string): void; + /** + * Starts checking the contents of controls in the specified container. + * @param containerElement An object representing a control which contains elements being checked. + */ + CheckElementsInContainer(containerElement: Object): void; + /** + * Starts checking the contents of controls in the specified container. + * @param containerId A string, specifying the control's identifier. + */ + CheckElementsInContainerById(containerId: string): void; +} +/** + * Represents an object that will handle the client-side BeforeCheck event. + */ +interface ASPxClientBeforeCheckEventHandler { + /** + * A method that will handle the BeforeCheck event. + * @param source The ASPxClientSpellChecker control which fires the event. + * @param e A ASPxClientSpellCheckerBeforeCheckEventArgs object that contains event data + */ + (source: S, e: ASPxClientSpellCheckerBeforeCheckEventArgs): void; +} +/** + * Provides data for an event that occurs before a spelling check is started. Represents the client-side equivalent of the BeforeCheckEventArgs class. + */ +interface ASPxClientSpellCheckerBeforeCheckEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the programmatic identifier assigned to the control which is going to be checked. + * Value: A string, containing the control's identifier. + */ + controlId: string; +} +/** + * Represents an object that will handle the client-side AfterCheck event. + */ +interface ASPxClientAfterCheckEventHandler { + /** + * A method that will handle the AfterCheck event. + * @param source The ASPxClientSpellChecker control which fires the event. + * @param e A ASPxClientSpellCheckerAfterCheckEventArgs object that contains event data + */ + (source: S, e: ASPxClientSpellCheckerAfterCheckEventArgs): void; +} +/** + * Provides data for the client event that occurs after a spelling check is complete. + */ +interface ASPxClientSpellCheckerAfterCheckEventArgs extends ASPxClientEventArgs { + /** + * Gets the programmatic identifier assigned to the control which has been checked. + * Value: A string, containing the control's identifier. + */ + controlId: string; + /** + * Gets the text that has been checked. + * Value: A string, containing checked text. + */ + checkedText: string; + /** + * Gets a value specifying whether spell checking is finished or stopped by the user. + * Value: A string value identifying the reason ("Default" or "User"). + */ + reason: string; +} +/** + * Represents an object that will handle the client-side WordChanged event. + */ +interface ASPxClientWordChangedEventHandler { + /** + * A method that will handle the AfterCheck event. + * @param source The event source. + * @param e An ASPxClientSpellCheckerAfterCheckEventArgs object which contains event data. + */ + (source: S, e: ASPxClientSpellCheckerAfterCheckEventArgs): void; +} +declare enum ASPxClientSpreadsheetPopupMenuType { + ColumnHeading=0, + RowHeading=1, + SheetTab=3, + Picture=4, + Chart=5, + Cell=7, + AutoFilter=8 +} +/** + * A method that will handle the CustomCommandExecuted event. + */ +interface ASPxClientSpreadsheetCustomCommandExecutedEventHandler { + /** + * A method that will handle the CustomCommandExecuted event. + * @param source An object representing the event source. Identifies the Spreadsheet that raised the event. + * @param e A ASPxClientSpreadsheetCustomCommandExecutedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetCustomCommandExecutedEventArgs): void; +} +/** + * Provides data for the CustomCommandExecuted event. + */ +interface ASPxClientSpreadsheetCustomCommandExecutedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value representing the processed command's name. + */ + commandName: string; + /** + * Gets an optional parameter that complements the processed command. + * Value: A string value containing additional information about the processed command. + */ + parameter: string; + /** + * This property is now obsolete. Use the commandName property instead. + */ + item: ASPxClientRibbonItem; +} +/** + * A method that will handle the DocumentChanged event. + */ +interface ASPxClientSpreadsheetDocumentChangedEventHandler { + /** + * A method that will handle the DocumentChanged event. + * @param source An object representing the event source. Identifies the Spreadsheet that raised the event. + * @param e A ASPxClientSpreadsheetDocumentChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetDocumentChangedEventArgs): void; +} +/** + * Provides data for the DocumentChanged event. + */ +interface ASPxClientSpreadsheetDocumentChangedEventArgs extends ASPxClientEventArgs { +} +/** + * A method that will handle the EndSynchronization events. + */ +interface ASPxClientSpreadsheetSynchronizationEventHandler { + /** + * A method that will handle the EndSynchronization events. + * @param source An object representing the event source. Identifies the Spreadsheet that raised the event. + * @param e A ASPxClientSpreadsheetSynchronizationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetSynchronizationEventArgs): void; +} +/** + * Provides data for the EndSynchronization events. + */ +interface ASPxClientSpreadsheetSynchronizationEventArgs extends ASPxClientEventArgs { +} +/** + * A method that will handle the HyperlinkClick event. + */ +interface ASPxClientSpreadsheetHyperlinkClickEventHandler { + /** + * A method that will handle the HyperlinkClick event. + * @param source An object representing the event source. Identifies the Spreadsheet that raised the event. + * @param e An ASPxClientSpreadsheetHyperlinkClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetHyperlinkClickEventArgs): void; +} +/** + * Provides data for the HyperlinkClick event. + */ +interface ASPxClientSpreadsheetHyperlinkClickEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets a value that specifies whether the event is handled, and the default processing is not required. + * Value: true, if if the event is completely handled by custom code and no default processing is required; otherwise, false. + */ + handled: boolean; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; + /** + * Gets a value identifying the clicked hyperlink type. + * Value: One of the values. + */ + hyperlinkType: ASPxClientOfficeDocumentLinkType; + /** + * Gets the clicked link's URI. + * Value: A sting value specifying the link's URI. + */ + targetUri: string; +} +/** + * A method that will handle the PopupMenuShowing event. + */ +interface ASPxClientSpreadsheetPopupMenuShowingEventHandler { + /** + * A method that will handle the PopupMenuShowing event. + * @param source The event sender (typically an ASPxClientSpreadsheet object). + * @param e A ASPxClientSpreadsheetPopupMenuShowingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetPopupMenuShowingEventArgs): void; +} +/** + * Provides data for the PopupMenuShowing event. + */ +interface ASPxClientSpreadsheetPopupMenuShowingEventArgs extends ASPxClientCancelEventArgs { + /** + * Provides access to a collection of menu items in the context menu being invoked. + * Value: A object representing the context menu's item collection. + */ + menuItems: ASPxClientSpreadsheetPopupMenuItemCollection; + /** + * Gets the currently displayed context menu's type. + * Value: One of the enumeration values. + */ + menuType: any; +} +/** + * A client-side equivalent of the ASPxSpreadsheet object. + */ +interface ASPxClientSpreadsheet extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientSpreadsheet. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client when a selection is changed in the ASPxSpreadsheet. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Occurs after a custom command has been executed on the client side. + */ + CustomCommandExecuted: ASPxClientEvent>; + /** + * Fires if any change is made to the Spreadsheet's document on the client. + */ + DocumentChanged: ASPxClientEvent>; + /** + * Fires after a client change has been made to the document and the client-server synchronization starts to apply the change on the server. + */ + BeginSynchronization: ASPxClientEvent>; + /** + * Fires after a document change has been applied to the server and server and client document models have been synchronized. + */ + EndSynchronization: ASPxClientEvent>; + /** + * Occurs on the client side after a hyperlink is clicked within the Spreadsheet's document. + */ + HyperlinkClick: ASPxClientEvent>; + /** + * Occurs before the context menu is displayed and allows menu customization. + */ + PopupMenuShowing: ASPxClientEvent>; + /** + * Sets input focus to the Spreadsheet. + */ + Focus(): void; + /** + * Gets access to the client ribbon object. + */ + GetRibbon(): ASPxClientRibbon; + /** + * Enables you to switch the full-screen mode of the Spreadsheet. + * @param fullscreen true to activate full-screen mode; false to deactivate full-screen mode. + */ + SetFullscreenMode(fullscreen: boolean): void; + /** + * Returns the current selection made in a Spreadsheet. + */ + GetSelection(): ASPxClientSpreadsheetSelection; + /** + * Indicates whether any unsaved changes are contained in the current document. + */ + HasUnsavedChanges(): boolean; + /** + * Gets the value of the specified cell. + * @param colModelIndex An integer value specifying the cell's column index. + * @param rowModelIndex An integer value specifying the cell's row index. + */ + GetCellValue(colModelIndex: number, rowModelIndex: number): Object; + /** + * Returns the comment associated with the specified data cell. + * @param colModelIndex An integer value specifying the data cell's column index. + * @param rowModelIndex An integer value specifying the data cell's row index. + */ + GetCellComment(colModelIndex: number, rowModelIndex: number): Object; + /** + * Gets the value of the currently active cell. + */ + GetActiveCellValue(): Object; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side DocumentCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side DocumentCallback event. + */ + PerformDocumentCallback(parameter: string): void; + /** + * Reconnects the Spreadsheet to an external ribbon. + */ + ReconnectToExternalRibbon(): void; +} +/** + * A method that will handle the client SelectionChanged event. + */ +interface ASPxClientSpreadsheetSelectionChangedEventHandler { + /** + * A method that will handle the SelectionChanged event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientSpreadsheetSelectionChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetSelectionChangedEventArgs): void; +} +/** + * Provides data for the SelectionChanged event. + */ +interface ASPxClientSpreadsheetSelectionChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets an object that determines the currently selected region within the Spreadsheet. + * Value: A object defining the current selection. + */ + selection: ASPxClientSpreadsheetSelection; +} +/** + * Represents the selection in the Spreadsheet. + */ +interface ASPxClientSpreadsheetSelection { + /** + * Gets the column index of the active cell. + * Value: An integer value specifying the active cell column index. + */ + activeCellColumnIndex: number; + /** + * Gets the row index of the active cell. + * Value: An integer value specifying the active cell row index. + */ + activeCellRowIndex: number; + /** + * Gets the index of the selection's left column. + * Value: An integer value specifying the index of the left column within the selection. + */ + leftColumnIndex: number; + /** + * Gets the index of the selection's top row. + * Value: An integer value specifying the index of the top row within the selection. + */ + topRowIndex: number; + /** + * Gets the index of the selection's right column. + * Value: An integer value specifying the index of the right column within the selection. + */ + rightColumnIndex: number; + /** + * Gets the index of the selection's bottom row. + * Value: An integer value specifying the index of the bottom row within the selection. + */ + bottomRowIndex: number; +} +/** + * Represents an individual item of the Spreadsheet's context menu. + */ +interface ASPxClientSpreadsheetPopupMenuItem { + /** + * Gets the immediate parent menu item to which the current menu item belongs. + * Value: A ASPxClientSpreadsheetPopupMenuItem object representing the menu item's immediate parent. + */ + parent: ASPxClientSpreadsheetPopupMenuItem; + /** + * Gets or sets the unique identifier name for the current menu item. + * Value: A string value that specifies the item's unique identifier name. + */ + name: string; + /** + * Gets or sets the text content of the current menu item. + * Value: A string value that specifies the text content of the menu item. + */ + text: string; + /** + * Gets or sets a value that indicates whether the menu item is enabled, allowing the item to respond to end-user interactions. + * Value: true if the item is enabled; otherwise, false. + */ + enabled: boolean; + /** + * Gets or sets the CSS class name defining the menu item's image. + * Value: A string value specifying the class name. + */ + imageClassName: string; + /** + * Gets or sets an URL which defines the navigation location. + * Value: A string value which represents an URL where the client web browser will navigate. + */ + navigateUrl: string; + /** + * Gets or sets the URL of the menu item's image. + * Value: A string value that specifies the location of an image. + */ + imageUrl: string; + /** + * Gets or sets a value that specifies whether the current menu item starts a group. + * Value: true if the current menu item starts a group; otherwise, false. + */ + beginGroup: boolean; + /** + * Gets or sets the current menu item's tooltip text. + * Value: A string which specifies the text content of the current menu item's tooltip. + */ + tooltip: string; + /** + * Gets or sets the window or frame at which to target the contents of the URL associated with the current menu item. + * Value: A string which identifies the window or frame at which to target the URL content. + */ + target: string; + /** + * Gets a collection that contains the submenu items of the current menu item. + */ + GetSubItems(): ASPxClientSpreadsheetPopupMenuItemCollection; + /** + * Returns the menu item's sub-item with the specified index. + * @param index An integer value specifying the index of the sub-item within a collection of the current menu item's submenu items. + */ + GetItem(index: number): ASPxClientSpreadsheetPopupMenuItem; + /** + * Returns the menu item's sub-item with the specified name property value. + * @param name A string value specifying the name property value of the sub-item to find. + */ + GetItemByName(name: string): ASPxClientSpreadsheetPopupMenuItem; + /** + * Returns the total number of the menu item's child items (submenu items). + */ + GetItemCount(): number; +} +/** + * Represents a collection of items in the Spreadhseet's context menu. + */ +interface ASPxClientSpreadsheetPopupMenuItemCollection { + /** + * Adds the specified menu item to the end of the collection. + * @param item An ASPxClientSpreadsheetPopupMenuItem object specifying the item to be added to the collection. + */ + Add(item: ASPxClientSpreadsheetPopupMenuItem): void; + /** + * Removes a menu item specified by its index within the collection. + * @param index An integer value specifying the index of the menu item to remove. + */ + Remove(index: number): void; + /** + * Removes a menu item specified by its name. + * @param name A string value specifying the name property value of a menu item to remove from the collection. + */ + RemoveByName(name: string): void; + /** + * Adds the specified item to the specified position within the collection. + * @param index An integer value that specifies the zero-based index at which the specified item should be inserted. + * @param item An ASPxClientSpreadsheetPopupMenuItem object to insert. + */ + Insert(index: number, item: ASPxClientSpreadsheetPopupMenuItem): void; + /** + * Returns the total number of menu items in the collection. + */ + GetCount(): number; + /** + * Returns an item object with the specified name property value. + * @param name A string value representing the name property value of the required item. + */ + GetByName(name: string): ASPxClientSpreadsheetPopupMenuItem; + /** + * Returns a menu item specified by its index in the collection. + * @param index An integer value that is the zero-based index of the to retrieve from the ASPxClientSpreadsheetPopupMenuItemCollection. + */ + Get(index: number): ASPxClientSpreadsheetPopupMenuItem; + /** + * Removes all menu items from the collection. + */ + Clear(): void; +} +/** + * Represents the client ASPxTreeList. + */ +interface ASPxClientTreeList extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any unhandled server error occurs during server-side processing of a callback sent by the ASPxClientTreeList. + */ + CallbackError: ASPxClientEvent>; + /** + * Enables you to display a context menu. + */ + ContextMenu: ASPxClientEvent>; + /** + * Occurs when a custom command button has been clicked. + */ + CustomButtonClick: ASPxClientEvent>; + /** + * Fires after a toolbar item has been clicked. + */ + ToolbarItemClick: ASPxClientEvent>; + /** + * Fires before the focused node has been changed. + */ + NodeFocusing: ASPxClientEvent>; + /** + * Fires in response to changing node focus. + */ + FocusedNodeChanged: ASPxClientEvent>; + /** + * Fires after the selection has been changed via end-user interaction. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Fires after the Customization Window has been closed. + */ + CustomizationWindowCloseUp: ASPxClientEvent>; + /** + * Fires after the callback has been processed in the CustomDataCallback event handler. + */ + CustomDataCallback: ASPxClientEvent>; + /** + * Fires on the client when a node is clicked. + */ + NodeClick: ASPxClientEvent>; + /** + * Fires on the client when a node is double clicked. + */ + NodeDblClick: ASPxClientEvent>; + /** + * Fires before a node is expanded. + */ + NodeExpanding: ASPxClientEvent>; + /** + * Fires before a node is collapsed. + */ + NodeCollapsing: ASPxClientEvent>; + /** + * Occurs before a node is dragged by an end-user. + */ + StartDragNode: ASPxClientEvent>; + /** + * Occurs after a node drag and drop operation is completed. + */ + EndDragNode: ASPxClientEvent>; + /** + * Enables you to prevent columns from being resized. + */ + ColumnResizing: ASPxClientEvent>; + /** + * Occurs after a column's width has been changed by an end-user. + */ + ColumnResized: ASPxClientEvent>; + /** + * Sets input focus to the ASPxTreeList. + */ + Focus(): void; + /** + * Gets the Popup Edit Form. + */ + GetPopupEditForm(): ASPxClientPopupControl; + /** + * Returns a toolbar specified by its name. + * @param name A string value specifying the toolbar name. + */ + GetToolbarByName(name: string): ASPxClientMenu; + /** + * Returns a toolbar specified by its index. + * @param index An integer value specifying the zero-based index of the toolbar object to retrieve. + */ + GetToolbar(index: number): ASPxClientMenu; + /** + * Returns the focused node's key value. + */ + GetFocusedNodeKey(): string; + /** + * Moves focus to the specified node. + * @param key A String value that uniquely identifies the node. + */ + SetFocusedNodeKey(key: string): void; + /** + * Indicates whether the specified node is selected. + * @param nodeKey A String value that identifies the node by its key value. + */ + IsNodeSelected(nodeKey: string): any; + /** + * Selects the specified node. + * @param nodeKey A string value that identifies the node. + */ + SelectNode(nodeKey: string): void; + /** + * Selects or deselects the specified node. + * @param nodeKey A string value that identifies the node. + * @param state true to select the node; otherwise, false. + */ + SelectNode(nodeKey: string, state: boolean): void; + /** + * Obtains key values of selected nodes that are displayed within the current page. + */ + GetVisibleSelectedNodeKeys(): string[]; + /** + * Indicates whether the Customization Window is displayed. + */ + IsCustomizationWindowVisible(): boolean; + /** + * Invokes the Customization Window. + */ + ShowCustomizationWindow(): void; + /** + * Invokes the Customization Window and displays it over the specified HTML element. + * @param htmlElement An object that specifies the HTML element relative to whose position the customization window is invoked. + */ + ShowCustomizationWindow(htmlElement: Object): void; + /** + * Closes the Customization Window. + */ + HideCustomizationWindow(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCustomCallback(arg: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side CustomDataCallback event. + */ + PerformCustomDataCallback(arg: string): void; + /** + * Obtains specified data source field values within a specified node, and submits them to the specified JavaScript function. + * @param nodeKey A string value that identifies the node. + * @param fieldNames A string value that contains the names of data source fields whose values within the specified node are returned. The field names should be separated by ';'. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetNodeValues(nodeKey: string, fieldNames: string, onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within a specified node, and submits them to the specified JavaScript function. + * @param nodeKey A string value that identifies the node. + * @param fieldNames The names of data source fields whose values within the specified node are returned. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetNodeValues(nodeKey: string, fieldNames: string[], onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within nodes that are displayed within the current page, and submits them to the specified JavaScript function. + * @param fieldNames A string value that contains the names of data source fields whose values within visible nodes are returned. The field names should be separated by ';'. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetVisibleNodeValues(fieldNames: string, onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within nodes that are displayed within the current page, and submits them to the specified JavaScript function. + * @param fieldNames The names of data source fields whose values within visible nodes are returned. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetVisibleNodeValues(fieldNames: string[], onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within selected nodes, and submits them to the specified JavaScript function. + * @param fieldNames A string value that contains the names of data source fields whose values within selected nodes are returned. The field names should be separated by ';'. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetSelectedNodeValues(fieldNames: string, onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within selected nodes, and submits them to the specified JavaScript function. + * @param fieldNames The names of data source fields whose values within selected nodes are returned. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetSelectedNodeValues(fieldNames: string[], onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within selected nodes, and submits them to the specified JavaScript function. + * @param fieldNames A string value that contains the names of data source fields whose values within selected nodes are returned. The field names should be separated by ';'. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + * @param visibleOnly true to return values within selected nodes that are displayed within the current page; false to return values within all selected nodes. + */ + GetSelectedNodeValues(fieldNames: string, onCallback: ASPxClientTreeListValuesCallback, visibleOnly: boolean): void; + /** + * Obtains specified data source field values within selected nodes, and submits them to the specified JavaScript function. + * @param fieldNames The names of data source fields whose values within selected nodes are returned. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + * @param visibleOnly true to return values within selected nodes that are displayed within the current page; false to return values within all selected nodes. + */ + GetSelectedNodeValues(fieldNames: string[], onCallback: ASPxClientTreeListValuesCallback, visibleOnly: boolean): void; + /** + * Selects the specified page. + * @param index An integer value that specifies the active page's index. + */ + GoToPage(index: number): void; + /** + * Activates the previous page. + */ + PrevPage(): void; + /** + * Activates the next page. + */ + NextPage(): void; + /** + * Gets the index of the page currently being selected. + */ + GetPageIndex(): number; + /** + * Gets the number of pages to which the ASPxTreeList's data is divided. + */ + GetPageCount(): number; + /** + * Returns the specified node's state. + * @param nodeKey A String value that identifies the node. + */ + GetNodeState(nodeKey: string): string; + /** + * Expands all nodes. + */ + ExpandAll(): void; + /** + * Collapses all Node. + */ + CollapseAll(): void; + /** + * Expands the specified node preserving the collapsed state of child nodes. + * @param key A String value that uniquely identifies the node. + */ + ExpandNode(key: string): void; + /** + * Collapses the specified node preserving the expanded state of child nodes. + * @param key A String value that uniquely identifies the node. + */ + CollapseNode(key: string): void; + /** + * Obtains key values of nodes that are displayed within the current page. + */ + GetVisibleNodeKeys(): string[]; + /** + * Returns an HTML table row that represents the specified node. + * @param nodeKey A string value that identifies the node. + */ + GetNodeHtmlElement(nodeKey: string): Object; + /** + * Returns the number of visible columns within the client ASPxTreeList. + */ + GetVisibleColumnCount(): number; + /** + * Returns the number of columns within the client ASPxTreeList. + */ + GetColumnCount(): number; + /** + * Returns the column located at the specified position within the Columns collection. + * @param index An integer value that identifies the column within the collection (the column's Index property value). + */ + GetColumnByIndex(index: number): ASPxClientTreeListColumn; + /** + * Returns the column with the specified name. + * @param name A string value that specifies the column's name (the column's Name property value). + */ + GetColumnByName(name: string): ASPxClientTreeListColumn; + /** + * Returns the client column which is bound to the specified data source field. + * @param fieldName A string value that specifies the name of the data source field to which the column is bound (the column's FieldName property value). + */ + GetColumnByFieldName(fieldName: string): ASPxClientTreeListColumn; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + SortBy(columnIndex: number): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + */ + SortBy(columnIndex: number, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(columnIndex: number, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param nameOrFieldName A String value that specifies the column's name or field name. + */ + SortBy(nameOrFieldName: string): void; + /** + * Sorts data by the specified data column's values. + * @param nameOrFieldName A String value that specifies the column's name or field name. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + */ + SortBy(nameOrFieldName: string, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param nameOrFieldName A String value that specifies the column's name or field name. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(nameOrFieldName: string, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientTreeListColumn object that represents the data column. + */ + SortBy(column: ASPxClientTreeListColumn): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientTreeListColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + */ + SortBy(column: ASPxClientTreeListColumn, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientTreeListColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(column: ASPxClientTreeListColumn, sortOrder: string, reset: boolean): void; + /** + * Switches the ASPxTreeList to edit mode. + * @param nodeKey A string value that identifies the node by its key value. + */ + StartEdit(nodeKey: string): void; + /** + * Saves all the changes made and switches the ASPxTreeList to browse mode. + */ + UpdateEdit(): void; + /** + * Cancels all the changes made and switches the ASPxTreeList to browse mode. + */ + CancelEdit(): void; + /** + * Indicates whether the ASPxTreeList is in edit mode. + */ + IsEditing(): boolean; + /** + * Gets the key value of the node currently being edited. + */ + GetEditingNodeKey(): string; + /** + * Moves the specified node to a new position. + * @param nodeKey A string value that identifies the target node by its key value. + * @param parentNodeKey A string value that identifies the node to whose child collection the target node is moved. An empty string to display the target node within the root. + */ + MoveNode(nodeKey: string, parentNodeKey: string): void; + /** + * Deletes the specified node. + * @param nodeKey A string value that identifies the node. + */ + DeleteNode(nodeKey: string): void; + /** + * Switches the ASPxTreeList to edit mode and allows new root node values to be edited. + */ + StartEditNewNode(): void; + /** + * Switches the ASPxTreeList to edit mode and allows new node values to be edited. + * @param parentNodeKey A String value that identifies the parent node, which owns a new node. + */ + StartEditNewNode(parentNodeKey: string): void; + /** + * Returns the editor used to edit the specified column's values. + * @param column An ASPxClientTreeListColumn object that represents the data column within the client ASPxTreeList. + */ + GetEditor(column: ASPxClientTreeListColumn): Object; + /** + * Returns the editor used to edit the specified column's values. + * @param columnIndex An integer value that identifies the column by its position within the column collection. + */ + GetEditor(columnIndex: number): Object; + /** + * Returns the editor used to edit the specified column's values. + * @param columnNameOrFieldName A String value that identifies the column by its name or field name. + */ + GetEditor(columnNameOrFieldName: string): Object; + /** + * Returns the value of the specified edit cell. + * @param column An ASPxClientTreeListColumn object that represents the data column within the client ASPxTreeList. + */ + GetEditValue(column: ASPxClientTreeListColumn): Object; + /** + * Returns the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column by its index within the ASPxTreeList's column collection. + */ + GetEditValue(columnIndex: number): Object; + /** + * Returns the value of the specified edit cell. + * @param columnNameOrFieldName A String value that identifies the column by its name or field name. + */ + GetEditValue(columnNameOrFieldName: string): Object; + /** + * Sets the value of the specified edit cell. + * @param column An ASPxClientTreeListColumn object that represents the data column within the client ASPxTreeList. + * @param value An object that specifies the edit cell's new value. + */ + SetEditValue(column: ASPxClientTreeListColumn, value: Object): void; + /** + * Sets the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column by its index within the ASPxTreeList's column collection. + * @param value An object that specifies the edit cell's new value. + */ + SetEditValue(columnIndex: number, value: Object): void; + /** + * Sets the value of the specified edit cell. + * @param columnNameOrFieldName A String value that identifies the column by its name or field name. + * @param value An object that specifies the edit cell's new value. + */ + SetEditValue(columnNameOrFieldName: string, value: Object): void; + /** + * Moves focus to the specified editor within the edited node. + * @param column A ASPxClientTreeListColumn object that represents the data column within the client ASPxTreeList. + */ + FocusEditor(column: ASPxClientTreeListColumn): void; + /** + * Moves focus to the specified editor within the edited node. + * @param columnIndex An integer value that identifies the data column. + */ + FocusEditor(columnIndex: number): void; + /** + * Moves focus to the specified editor within the edited node. + * @param columnNameOrFieldName A String value that specifies the column's name or field name. + */ + FocusEditor(columnNameOrFieldName: string): void; + /** + * Scrolls the tree list so that the specified node becomes visible. + * @param nodeKey An integer value that specifies the node index within the tree list's client item list. + */ + MakeNodeVisible(nodeKey: string): void; + /** + * Returns the current vertical scroll position of the tree list's content. + */ + GetVerticalScrollPosition(): number; + /** + * Returns the current horizontal scroll position of the tree list's content. + */ + GetHorizontalScrollPosition(): number; + /** + * Specifies the vertical scroll position for the tree list's content. + * @param position An integer value specifying the vertical scroll position. + */ + SetVerticalScrollPosition(position: number): void; + /** + * Specifies the horizontal scroll position for the tree list's content. + * @param position An integer value specifying the horizontal scroll position. + */ + SetHorizontalScrollPosition(position: number): void; +} +/** + * Represents a client column. + */ +interface ASPxClientTreeListColumn { + /** + * Gets the column's position within the collection. + * Value: An integer zero-bazed index that specifies the column's position within the collection. + */ + index: number; + /** + * Gets the name that uniquely identifies the column. + * Value: A string value assigned to the column's Name property. + */ + name: string; + /** + * Gets the name of the database field assigned to the current column. + * Value: A String value that specifies the name of a data field. + */ + fieldName: string; +} +/** + * Provides data for the CustomDataCallback event. + */ +interface ASPxClientTreeListCustomDataCallbackEventArgs extends ASPxClientEventArgs { + /** + * Gets the information that has been collected on the client-side and sent to the server-side CustomDataCallback event. + * Value: A string value that represents the information that has been collected on the client-side and sent to the server-side CustomDataCallback event. + */ + arg: string; + /** + * Gets the information passed from the server-side CustomDataCallback event. + * Value: An object that represents the information passed from the server-side CustomDataCallback event. + */ + result: Object; +} +/** + * A method that will handle the CustomDataCallback event. + */ +interface ASPxClientTreeListCustomDataCallbackEventHandler { + /** + * A method that will handle the CustomDataCallback event. + * @param source The event source. + * @param e An ASPxClientTreeListCustomDataCallbackEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListCustomDataCallbackEventArgs): void; +} +/** + * Provides data for the NodeDblClick events. + */ +interface ASPxClientTreeListNodeEventArgs extends ASPxClientEventArgs { + /** + * Gets the processed node's key value. + * Value: A String value that identifies the processed node. + */ + nodeKey: string; + /** + * Provides access to the parameters associated with the NodeDblClick events. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the NodeDblClick event. + */ +interface ASPxClientTreeListNodeEventHandler { + /** + * A method that will handle the NodeDblClick event. + * @param source The event source. + * @param e An ASPxClientTreeListNodeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListNodeEventArgs): void; +} +/** + * Provides data for the ContextMenu event. + */ +interface ASPxClientTreeListContextMenuEventArgs extends ASPxClientEventArgs { + /** + * Identifies which tree list element has been right-clicked. + * Value: A string value that identifies which tree list element ('Header' or 'Node') has been right-clicked. + */ + objectType: string; + /** + * Gets a value that identifies the right-clicked object. + * Value: The right-clicked object's identifier. + */ + objectKey: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that relates to the processed event. + */ + htmlEvent: Object; + /** + * Gets or sets whether to invoke the browser's context menu. + * Value: true to hide the browser's context menu; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the ContextMenu event. + */ +interface ASPxClientTreeListContextMenuEventHandler { + /** + * A method that will handle the ContextMenu event. + * @param source The event sender. + * @param e An ASPxClientTreeListContextMenuEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListContextMenuEventArgs): void; +} +/** + * Provides data for the StartDragNode event. + */ +interface ASPxClientTreeListStartDragNodeEventArgs extends ASPxClientTreeListNodeEventArgs { + /** + * Gets an array of targets where a node can be dragged. + * Value: An array of objects that represent targets for the dragged node. + */ + targets: Object[]; +} +/** + * A method that will handle the StartDragNode event. + */ +interface ASPxClientTreeListStartDragNodeEventHandler { + /** + * A method that will handle the StartDragNode event. + * @param source The event source. + * @param e An ASPxClientTreeListStartDragNodeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListStartDragNodeEventArgs): void; +} +/** + * Provides data for the EndDragNode event. + */ +interface ASPxClientTreeListEndDragNodeEventArgs extends ASPxClientTreeListNodeEventArgs { + /** + * Gets the target element. + * Value: An object that represents the target element to which the dragged node has been dropped. + */ + targetElement: Object; +} +/** + * A method that will handle the EndDragNode event. + */ +interface ASPxClientTreeListEndDragNodeEventHandler { + /** + * A method that will handle the EndDragNode event. + * @param source The event source. + * @param e An ASPxClientTreeListEndDragNodeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListEndDragNodeEventArgs): void; +} +/** + * Provides data for the CustomButtonClick event. + */ +interface ASPxClientTreeListCustomButtonEventArgs extends ASPxClientEventArgs { + /** + * Gets the key value of the node whose custom button has been clicked. + * Value: A string value that uniquely identifies the node whose custom button has been clicked. + */ + nodeKey: string; + /** + * Gets the button's index. + * Value: An integer value that specifies the button's position within the CustomButtons collection. + */ + buttonIndex: number; + /** + * Gets the value which identifies the custom button. + * Value: A String value that identifies the clicked custom button. + */ + buttonID: string; +} +/** + * A method that will handle the CustomButtonClick event. + */ +interface ASPxClientTreeListCustomButtonEventHandler { + /** + * A method that will handle the CustomButtonClick event. + * @param source The event source. + * @param e An ASPxClientTreeListCustomButtonEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListCustomButtonEventArgs): void; +} +/** + * Represents a JavaScript function which receives the list of row values when a specific client method (such as the GetSelectedNodeValues) is called. + */ +interface ASPxClientTreeListValuesCallback { + /** + * A JavaScript function which receives the list of row values when a specific client method (such as the GetSelectedNodeValues) is called. + * @param result An object that represents the list of row values received from the server. + */ + (result: Object): void; +} +/** + * Provides data for the ColumnResizing event. + */ +interface ASPxClientTreeListColumnResizingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed client column. + * Value: An object that is the processed column. + */ + column: ASPxClientTreeListColumn; +} +/** + * A method that will handle the client ColumnResizing event. + */ +interface ASPxClientTreeListColumnResizingEventHandler { + /** + * A method that will handle the ColumnResizing event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientTreeListColumnResizingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListColumnResizingEventArgs): void; +} +/** + * Provides data for the ColumnResized event. + */ +interface ASPxClientTreeListColumnResizedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the processed client column. + * Value: An object that is the processed column. + */ + column: ASPxClientTreeListColumn; +} +/** + * A method that will handle the client ColumnResized event. + */ +interface ASPxClientTreeListColumnResizedEventHandler { + /** + * A method that will handle the ColumnResized event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientTreeListColumnResizedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListColumnResizedEventArgs): void; +} +/** + * Provides data for the ToolbarItemClick event. + */ +interface ASPxClientTreeListToolbarItemClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the toolbar index related to the event. + * Value: An integer value that is the toolbar index. + */ + toolbarIndex: number; + /** + * Gets the toolbar name. + * Value: A string object that is the toolbar name. + */ + toolbarName: string; + /** + * Gets the toolbar item related to the event. + * Value: An ASPxClientMenuItem object that is the toolbar item. + */ + item: ASPxClientMenuItem; + /** + * Specifies whether a postback or a callback is used to finally process the event on the server side. + * Value: true to perform the round trip to the server side via postback; false to perform the round trip to the server side via callback. + */ + usePostBack: boolean; +} +/** + * A method that will handle the ToolbarItemClick event. + */ +interface ASPxClientTreeListToolbarItemClickEventHandler { + /** + * A method that will handle the ToolbarItemClick event. + * @param source The event source. + * @param e An ASPxClientTreeListToolbarItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListToolbarItemClickEventArgs): void; +} +/** + * Represents a client-side equivalent of the BootstrapAccordion control. + */ +interface BootstrapClientAccordion extends ASPxClientNavBar { +} +interface BootstrapClientBinaryImage extends ASPxClientHyperLink { +} +/** + * Represents a client-side equivalent of the BootstrapButton control. + */ +interface BootstrapClientButton extends ASPxClientButton { + /** + * Returns the text displayed within the button. + */ + GetText(): string; + /** + * Sets the text to be displayed within the button. + * @param value A string value specifying the text to be displayed within the button. + */ + SetText(value: string): void; +} +/** + * Represents a client-side equivalent of the BootstrapCalendar control. + */ +interface BootstrapClientCalendar extends ASPxClientCalendar { +} +/** + * Represents a client-side equivalent of the BootstrapCallbackPanel control. + */ +interface BootstrapClientCallbackPanel extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the BootstrapClientCallbackPanel. + */ + CallbackError: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Returns the HTML code that specifies the contents of the control's window. + */ + GetContentHtml(): string; + /** + * Sets the HTML markup specifying the contents of the control's window. + * @param html A string value that specifies the HTML markup. + */ + SetContentHtml(html: string): void; + /** + * Sets a value specifying whether the callback panel is enabled. + * @param enabled true, to enable the callback panel; false to disable it. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns a value specifying whether a callback panel is enabled. + */ + GetEnabled(): boolean; +} +/** + * Serves as the base type for the BootstrapClientPieChart objects. + */ +interface BootstrapClientChartBase extends ASPxClientControl { + Done: ASPxClientEvent>; + LegendClick: ASPxClientEvent>; + PointClick: ASPxClientEvent>; + PointHoverChanged: ASPxClientEvent>; + PointSelectionChanged: ASPxClientEvent>; + TooltipHidden: ASPxClientEvent>; + TooltipShown: ASPxClientEvent>; + ArgumentAxisClick: ASPxClientEvent>; + SeriesClick: ASPxClientEvent>; + SeriesHoverChanged: ASPxClientEvent>; + SeriesSelectionChanged: ASPxClientEvent>; +} +/** + * Represents a client-side equivalent of the BootstrapChart control. + */ +interface BootstrapClientChart extends BootstrapClientChartBase { + ZoomStart: ASPxClientEvent>; + ZoomEnd: ASPxClientEvent>; +} +/** + * Represents a client-side equivalent of the BootstrapPolarChart control. + */ +interface BootstrapClientPolarChart extends BootstrapClientChartBase { +} +/** + * Represents a client-side equivalent of the BootstrapPieChart control. + */ +interface BootstrapClientPieChart extends BootstrapClientChartBase { +} +interface BootstrapClientChartBaseDoneEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapClientChartBaseLegendClickEventHandler { + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +interface BootstrapClientCoordinateSystemChartArgumentAxisClickEventHandler { + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +interface BootstrapClientChartBasePointClickEventHandler { + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +interface BootstrapClientChartBasePointHoverChangedEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientChartBasePointSelectionChangedEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientChartBaseTooltipHiddenEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientChartBaseTooltipShownEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientCoordinateSystemChartSeriesClickEventHandler { + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +interface BootstrapClientCoordinateSystemChartSeriesHoverChangedEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientCoordinateSystemChartSeriesSelectionChangedEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientChartZoomStartEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapClientChartZoomEndEventHandler { + (source: S, e: BootstrapClientChartZoomEndEventArgs): void; +} +interface BootstrapUIWidgetEventArgsBase extends ASPxClientEventArgs { + component: Object; + element: Object; +} +interface BootstrapClientChartZoomEndEventArgs extends BootstrapUIWidgetEventArgsBase { + rangeStart: Object; + rangeEnd: Object; +} +/** + * Represents a client-side equivalent of the BootstrapCheckBox control. + */ +interface BootstrapClientCheckBox extends ASPxClientEdit { + /** + * Occurs on the client side when the editor's checked state is changed. + */ + CheckedChanged: ASPxClientEvent>; + /** + * Returns a value indicating whether the check box editor is checked. + */ + GetChecked(): boolean; + /** + * Sets a value which specifies the checked status of the check box editor. + * @param isChecked + */ + SetChecked(isChecked: boolean): void; + /** + * Returns the text displayed within the editor. + */ + GetText(): string; + /** + * Returns a value which specifies a check box checked state. + */ + GetCheckState(): string; + /** + * Sets a value specifying the state of a check box. + * @param checkState + */ + SetCheckState(checkState: string): void; + /** + * Sets the text to be displayed within the editor. + * @param text + */ + SetText(text: string): void; +} +/** + * Represents a client-side equivalent of the BootstrapRadioButton control. + */ +interface BootstrapClientRadioButton extends BootstrapClientCheckBox { +} +/** + * Represents a client-side equivalent of the BootstrapComboBox control. + */ +interface BootstrapClientComboBox extends ASPxClientComboBox { + /** + * Returns the combo box editor's selected item. + */ + GetSelectedItem(): BootstrapClientListBoxItem; + /** + * Sets the combo box editor's selected item. + * @param item + */ + SetSelectedItem(item: BootstrapClientListBoxItem): void; + /** + * Returns an item specified by its index within the combo box editor's item collection. + * @param index + */ + GetItem(index: number): BootstrapClientListBoxItem; + /** + * Returns a combo box item by its text. + * @param text + */ + FindItemByText(text: string): BootstrapClientListBoxItem; + /** + * Returns a combo box item by its value. + * @param value + */ + FindItemByValue(value: Object): BootstrapClientListBoxItem; + /** + * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. + */ + AddItem(texts: string[]): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts + * @param value + */ + AddItem(texts: string[], value: Object): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts + * @param value + * @param iconCssClass + */ + AddItem(texts: string[], value: Object, iconCssClass: string): number; + /** + * Adds a new item to the editor specifying the item's display text and returns the index of the added item. + * @param text + */ + AddItem(text: string): number; + /** + * Adds a new item to the editor specifying the item's display text and associated value, and returns the index of the added item. + * @param text + * @param value + */ + AddItem(text: string, value: Object): number; + /** + * Adds a new item to the editor specifying the item's display text, associated value and displayed image, and returns the index of the added item. + * @param text + * @param value + * @param iconCssClass + */ + AddItem(text: string, value: Object, iconCssClass: string): number; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param texts + * @param value + * @param iconCssClass + */ + InsertItem(index: number, texts: string[], value: Object, iconCssClass: string): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param texts + * @param value + */ + InsertItem(index: number, texts: string[], value: Object): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param texts + */ + InsertItem(index: number, texts: string[]): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param text + * @param value + * @param iconCssClass + */ + InsertItem(index: number, text: string, value: Object, iconCssClass: string): void; + /** + * Inserts a new item specified by its display text and associated value into the editor's item collection, at the position specified. + * @param index + * @param text + * @param value + */ + InsertItem(index: number, text: string, value: Object): void; + /** + * Inserts a new item specified by its display text into the editor's item collection, at the position specified. + * @param index + * @param text + */ + InsertItem(index: number, text: string): void; + /** + * Sets the list editor's selected item. + * @param item An ASPxClientListEditItem object that specifies the item to select. + */ + SetSelectedItem(item: ASPxClientListEditItem): void; +} +/** + * Represents a client-side equivalent of the BootstrapDateEdit control. + */ +interface BootstrapClientDateEdit extends ASPxClientDateEdit { +} +/** + * Represents a client-side equivalent of the BootstrapDropDownEdit control. + */ +interface BootstrapClientDropDownEdit extends ASPxClientDropDownEdit { +} +/** + * Represents a client-side equivalent of the BootstrapFormLayout control. + */ +interface BootstrapClientFormLayout extends ASPxClientFormLayout { +} +/** + * Represents a client-side equivalent of the BootstrapHyperLink control. + */ +interface BootstrapClientHyperLink extends ASPxClientHyperLink { +} +interface BootstrapClientImage extends ASPxClientImage { +} +/** + * Represents the client-side equivalent of the BootstrapListEditItem object. + */ +interface BootstrapClientListBoxItem extends ASPxClientListEditItem { + /** + * This member is not in effect for this class. It is overridden only for the purpose of preventing it from appearing in Microsoft Visual Studio designer tools. + */ + imageUrl: string; + iconCssClass: string; + /** + * + * @param columnIndex + */ + GetColumnText(columnIndex: number): string; + /** + * + * @param columnName + */ + GetColumnText(columnName: string): string; + /** + * + * @param fieldIndex + */ + GetFieldText(fieldIndex: number): string; + /** + * + * @param fieldName + */ + GetFieldText(fieldName: string): string; +} +/** + * Represents a client-side equivalent of the BootstrapListBox control. + */ +interface BootstrapClientListBox extends ASPxClientListBox { + /** + * Returns the list box editor's selected item. + */ + GetSelectedItem(): BootstrapClientListBoxItem; + /** + * Sets the list box editor's selected item. + * @param item + */ + SetSelectedItem(item: BootstrapClientListBoxItem): void; + /** + * Returns an item specified by its index within the list box editor's item collection. + * @param index + */ + GetItem(index: number): BootstrapClientListBoxItem; + /** + * Returns an array of the list editor's selected items. + */ + GetSelectedItems(): BootstrapClientListBoxItem[]; + /** + * Selects the specified items within a list box. + * @param items + */ + SelectItems(items: BootstrapClientListBoxItem[]): void; + /** + * Unselects an array of the specified list box items. + * @param items + */ + UnselectItems(items: BootstrapClientListBoxItem[]): void; + /** + * Returns a list box item by its text. + * @param text + */ + FindItemByText(text: string): BootstrapClientListBoxItem; + /** + * Returns a list box item by its value. + * @param value + */ + FindItemByValue(value: Object): BootstrapClientListBoxItem; + /** + * Adds a new item to the end of the editor's items collection, specifying the item's display text, and returns the index of the added item. + * @param texts + */ + AddItem(texts: string[]): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts + * @param value + */ + AddItem(texts: string[], value: Object): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts + * @param value + * @param iconCssClass + */ + AddItem(texts: string[], value: Object, iconCssClass: string): number; + /** + * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. + * @param text + */ + AddItem(text: string): number; + /** + * Adds a new item to the editor, specifying the item's display text and associated value, and returns the index of the added item. + * @param text + * @param value + */ + AddItem(text: string, value: Object): number; + /** + * Adds a new item to the editor, specifying the item's display text, associated value and displayed image, and returns the index of the added item. + * @param text + * @param value + * @param iconCssClass + */ + AddItem(text: string, value: Object, iconCssClass: string): number; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param texts + * @param value + * @param iconCssClass + */ + InsertItem(index: number, texts: string[], value: Object, iconCssClass: string): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param texts + * @param value + */ + InsertItem(index: number, texts: string[], value: Object): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param texts + */ + InsertItem(index: number, texts: string[]): void; + /** + * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. + * @param index + * @param text + * @param value + * @param iconCssClass + */ + InsertItem(index: number, text: string, value: Object, iconCssClass: string): void; + /** + * Inserts a new item specified by its display text and associated value into the editor's item collection, at the position specified. + * @param index + * @param text + * @param value + */ + InsertItem(index: number, text: string, value: Object): void; + /** + * Inserts a new item specified by its display text into the editor's item collection, at the position specified. + * @param index + * @param text + */ + InsertItem(index: number, text: string): void; + /** + * Selects the specified items within a list box. + * @param items An array of ASPxClientListEditItem objects that represent the items. + */ + SelectItems(items: ASPxClientListEditItem[]): void; + /** + * Unselects an array of the specified list box items. + * @param items An array of ASPxClientListEditItem objects that represent the items. + */ + UnselectItems(items: ASPxClientListEditItem[]): void; + /** + * Sets the list editor's selected item. + * @param item An ASPxClientListEditItem object that specifies the item to select. + */ + SetSelectedItem(item: ASPxClientListEditItem): void; +} +/** + * Represents a client-side equivalent of the BootstrapCheckBoxList control. + */ +interface BootstrapClientCheckBoxList extends ASPxClientCheckBoxList { +} +/** + * Represents a client-side equivalent of the BootstrapRadioButtonList control. + */ +interface BootstrapClientRadioButtonList extends ASPxClientRadioButtonList { +} +/** + * Represents a client-side equivalent of the BootstrapMenu control. + */ +interface BootstrapClientMenu extends ASPxClientMenu { +} +/** + * Represents a client-side equivalent of the BootstrapPager control. + */ +interface BootstrapClientPager extends ASPxClientPager { +} +/** + * Represents a client-side equivalent of the BootstrapPopupControl control. + */ +interface BootstrapClientPopupControl extends ASPxClientPopupControl { + /** + * + * @param selector + */ + SetPopupElementCssSelector(selector: string): void; +} +/** + * Represents a client-side equivalent of the BootstrapPopupMenu control. + */ +interface BootstrapClientPopupMenu extends ASPxClientPopupMenu { + /** + * + * @param selector + */ + SetPopupElementCssSelector(selector: string): void; +} +/** + * Represents a client-side equivalent of the BootstrapProgressBar control. + */ +interface BootstrapClientProgressBar extends ASPxClientProgressBar { +} +/** + * Represents a client-side equivalent of the BootstrapSpinEdit control. + */ +interface BootstrapClientSpinEdit extends ASPxClientSpinEdit { +} +/** + * Represents a client-side equivalent of the BootstrapTabControl control. + */ +interface BootstrapClientTabControl extends ASPxClientTabControl { +} +/** + * Represents a client-side equivalent of the BootstrapPageControl control. + */ +interface BootstrapClientPageControl extends ASPxClientPageControl { +} +/** + * Represents a client-side equivalent of the BootstrapTextBox control. + */ +interface BootstrapClientTextBox extends ASPxClientTextBox { +} +/** + * Represents a client-side equivalent of the BootstrapMemo control. + */ +interface BootstrapClientMemo extends ASPxClientMemo { +} +/** + * Represents a client-side equivalent of the BootstrapButtonEdit control. + */ +interface BootstrapClientButtonEdit extends ASPxClientButtonEdit { +} +/** + * Represents a client-side equivalent of the BootstrapTreeView control. + */ +interface BootstrapClientTreeView extends ASPxClientTreeView { +} +interface BootstrapUIWidgetBase extends ASPxClientControl { + Init: ASPxClientEvent>; + Drawn: ASPxClientEvent>; + Disposing: ASPxClientEvent>; + OptionChanged: ASPxClientEvent>; + Exporting: ASPxClientEvent>; + Exported: ASPxClientEvent>; + FileSaving: ASPxClientEvent>; + IncidentOccurred: ASPxClientEvent>; + GetInstance(): Object; + SetOptions(options: Object): void; + SetDataSource(dataSource: Object): void; + GetDataSource(): Object; + ExportTo(format: string, fileName: string): void; + Print(): void; +} +interface BootstrapUIWidgetInitializedEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapUIWidgetDrawnEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapUIWidgetDisposingEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapUIWidgetExportedEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapUIWidgetOptionChangedEventHandler { + (source: S, e: BootstrapUIWidgetOptionChangedEventArgs): void; +} +interface BootstrapUIWidgetOptionChangedEventArgs extends BootstrapUIWidgetEventArgsBase { + fullName: string; + name: string; + previousValue: Object; + value: Object; +} +interface BootstrapUIWidgetExportingEventHandler { + (source: S, e: BootstrapUIWidgetExportEventArgs): void; +} +interface BootstrapUIWidgetFileSavingEventHandler { + (source: S, e: BootstrapUIWidgetExportEventArgs): void; +} +interface BootstrapUIWidgetExportEventArgs extends BootstrapUIWidgetEventArgsBase { + cancel: boolean; + data: Object; + fileName: string; + format: string; +} +interface BootstrapUIWidgetErrorEventHandler { + (source: S, e: BootstrapUIWidgetErrorEventArgs): void; +} +interface BootstrapUIWidgetErrorEventArgs extends BootstrapUIWidgetEventArgsBase { + target: Object; +} +interface BootstrapUIWidgetElementActionEventArgs extends BootstrapUIWidgetEventArgsBase { + target: Object; +} +interface BootstrapUIWidgetElementClickEventArgs extends BootstrapUIWidgetElementActionEventArgs { + jQueryEvent: Object; +} +/** + * Represents a client-side equivalent of the BootstrapUploadControl. + */ +interface BootstrapClientUploadControl extends ASPxClientUploadControl { +} +interface BootstrapClientGridView extends ASPxClientGridView { +} +/** + * A client-side counterpart of the Calendar and CalendarFor extensions. + */ +interface MVCxClientCalendar extends ASPxClientCalendar { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; +} +/** + * A client-side counterpart of the CallbackPanel extension. + */ +interface MVCxClientCallbackPanel extends ASPxClientCallbackPanel { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the Callback Panel by processing the passed information on the server, in an Action specified by the Callback Panel's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the Callback Panel by processing the passed information on the server, in an Action specified by the Callback Panel's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the CardView extension. + */ +interface MVCxClientCardView extends ASPxClientCardView { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the CardView by processing the passed information on the server, in an Action specified via the CardView's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CardView's CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the CardView by processing the passed information on the server, in an Action specified via the CardView's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CardView's CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the CardView's CustomDataActionRouteValues property, and then process the returned result in the specified client function. This method does not update the CardView. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + * @param onCallback A ASPxClientCardViewValuesCallback object that represents the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(data: Object, onCallback: ASPxClientCardViewValuesCallback): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback An ASPxClientCardViewValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientCardViewValuesCallback): void; +} +/** + * A client-side counterpart of the Chart extension. + */ +interface MVCxClientChart extends ASPxClientWebChartControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update a Chart by processing the passed information on the server, in an Action specified via the Chart's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update a Chart by processing the passed information on the server, in an Action specified via the Chart's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the ComboBox and ComboBoxFor extensions. + */ +interface MVCxClientComboBox extends ASPxClientComboBox { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the ComboBox by processing the passed information on the server, in an Action specified by the ComboBox's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the ComboBox by processing the passed information on the server, in an Action specified by the ComboBox's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A client-side counterpart of the DataView extension. + */ +interface MVCxClientDataView extends ASPxClientDataView { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the DataView by processing the passed information on the server, in an Action specified via the DataView's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the DataView by processing the passed information on the server, in an Action specified via the DataView's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the DateEdit extension. + */ +interface MVCxClientDateEdit extends ASPxClientDateEdit { +} +/** + * A client-side counterpart of the DockManager extension. + */ +interface MVCxClientDockManager extends ASPxClientDockManager { + /** + * Sends a callback with a parameter to update the DockManager by processing the passed information on the server, in an Action specified by the DockManager's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the DockManager by processing the passed information on the server, in an Action specified by the DockManager's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that contains any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that contains any information that needs to be sent to the server-side Callback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the DockPanel extension. + */ +interface MVCxClientDockPanel extends ASPxClientDockPanel { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the DockPanel by processing the passed information on the server, in an Action specified by the DockPanel's DockPanelSettings.CallbackRouteValues) property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the DockPanel by processing the passed information on the server, in an Action specified by the DockPanel's DockPanelSettings.CallbackRouteValues) property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side WindowCallback event, passing the specified argument to it. + * @param parameter A string value that is any information that needs to be sent to the server-side WindowCallback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A client-side counterpart of the FileManager extension. + */ +interface MVCxClientFileManager extends ASPxClientFileManager { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the FileManager by processing the passed information on the server, in an Action specified via the extension's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the file manager's CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param data A string value that specifies any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that specifies any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that specifies any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the GridView extension. + */ +interface MVCxClientGridView extends ASPxClientGridView { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the GridView by processing the passed information on the server, in an Action specified via the grid's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the grid's CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the GridView by processing the passed information on the server, in an Action specified via the grid's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the grid's CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the GridView's CustomDataActionRouteValues property, and then process the returned result in the specified client function. This method does not update the GridView. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + * @param onCallback A ASPxClientGridViewValuesCallback object that represents the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(data: Object, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientGridViewValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientGridViewValuesCallback): void; +} +/** + * A client-side counterpart of the HtmlEditor extension. + */ +interface MVCxClientHtmlEditor extends ASPxClientHtmlEditor { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the HtmlEditor's CustomDataCallback event on the client. This method does not update the HtmlEditor. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + */ + PerformDataCallback(data: Object): void; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the HtmlEditor's CustomDataCallback event on the client. This method does not update the HtmlEditor. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + * @param onCallback An ASPxClientDataCallback object that is the JavaScript function which receives the callback data as a parameter. + */ + PerformDataCallback(data: Object, onCallback: ASPxClientDataCallback): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientDataCallback object that represents the JavaScript function which receives the callback data as a parameter. + */ + PerformDataCallback(parameter: string, onCallback: ASPxClientDataCallback): void; +} +/** + * A client-side counterpart of the ImageGallery extension. + */ +interface MVCxClientImageGallery extends ASPxClientImageGallery { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the ImageGallery by processing the passed information on the server, in an Action specified via the ImageGallery's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the ImageGallery by processing the passed information on the server, in an Action specified via the ImageGallery's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the ListBox and ListBoxFor extensions. + */ +interface MVCxClientListBox extends ASPxClientListBox { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the ListBox by processing the passed information on the server, in an Action specified by the ListBox's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the ListBox by processing the passed information on the server, in an Action specified by the ListBox's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server, and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A client-side counterpart of the NavBar extension. + */ +interface MVCxClientNavBar extends ASPxClientNavBar { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; +} +/** + * A client-side counterpart of the PivotGrid extension. + */ +interface MVCxClientPivotGrid extends ASPxClientPivotGrid { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the PivotGrid by processing the passed information on the server, in an Action specified via the grid's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the grid's CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the PivotGrid by processing the passed information on the server, in an Action specified via the grid's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the grid's CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Passes PivotGrid callback parameters to the specified object. + * @param obj An object that receives PivotGrid callback parameters. + */ + FillStateObject(obj: Object): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the PopupControl extension. + */ +interface MVCxClientPopupControl extends ASPxClientPopupControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the PopupControl by processing the passed information on the server, in an Action specified via the PopupControl's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the PopupControl by processing the passed information on the server, in an Action specified via the PopupControl's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback with a parameters to update the popup window by processing the related popup window and the passed information on the server, in an Action specified by the PopupControl's CallbackRouteValues property. + * @param window A ASPxClientPopupWindow object identifying the processed popup window. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformWindowCallback(window: ASPxClientPopupWindow, data: Object): void; + /** + * + * @param window + * @param parameter + */ + PerformWindowCallback(window: ASPxClientPopupWindow, parameter: string): void; + /** + * Sends a callback with parameters to update the popup window by processing the related popup window and the passed information on the server. + * @param window A ASPxClientPopupWindow object identifying the processed popup window. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformWindowCallback(window: ASPxClientPopupWindow, parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side WindowCallback event, passing the specified argument to it. + * @param parameter A string value that is any information that needs to be sent to the server-side WindowCallback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A client-side equivalent of the MVCxDocumentViewer class. + */ +interface MVCxClientDocumentViewer extends ASPxClientDocumentViewer { + /** + * Occurs before performing a document export request. + */ + BeforeExportRequest: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; +} +/** + * Obsolete. Use the MVCxClientDocumentViewer class instead. + */ +interface MVCxClientReportViewer extends ASPxClientReportViewer { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs before performing a document export request. + */ + BeforeExportRequest: ASPxClientEvent>; +} +/** + * A method that will handle the BeforeExportRequest event. + */ +interface MVCxClientBeforeExportRequestEventHandler { + /** + * A method that will handle the BeforeExportRequest event. + * @param source An object which is the event source. Identifies the client object that raised the event. + * @param e A MVCxClientBeforeExportRequestEventArgs object that contains event data. + */ + (source: S, e: MVCxClientBeforeExportRequestEventArgs): void; +} +/** + * Provides data for client BeforeExportRequest events. + */ +interface MVCxClientBeforeExportRequestEventArgs extends ASPxClientEventArgs { + /** + * Gets an object containing specific information (if any, as name/value pairs) that should be passed as a request parameter from the client to the server side for further processing. + * Value: A hash table object containing named values to be passed from the client to the server side via request parameters. + */ + customArgs: Object; +} +/** + * A client-side equivalent of the MVCxReportDesigner class. + */ +interface MVCxClientReportDesigner extends ASPxClientReportDesigner { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs after executing the Save command on the client. + */ + SaveCommandExecuted: ASPxClientEvent>; + /** + * Sends a callback to the server with the specified argument. + * @param arg A Object value, specifying the callback argument. + */ + PerformCallback(arg: Object): void; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(arg: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server with the specified argument. + * @param arg A String value, specifying the callback argument. + */ + PerformCallback(arg: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(arg: string, onSuccess: (arg1: string) => void): void; +} +/** + * A method that will handle the SaveCommandExecuted event. + */ +interface MVCxClientReportDesignerSaveCommandExecutedEventHandler { + /** + * A method that will handle the SaveCommandExecuted event. + * @param source An object which is the event source. Identifies the client object that raised the event. + * @param e A MVCxClientBeforeExportRequestEventArgs object that contains event data. + */ + (source: S, e: MVCxClientReportDesignerSaveCommandExecutedEventArgs): void; +} +/** + * Provides data for the SaveCommandExecuted event. + */ +interface MVCxClientReportDesignerSaveCommandExecutedEventArgs extends ASPxClientEventArgs { + /** + * Returns the operation result. + * Value: A String value, specifying the operation result. + */ + Result: string; +} +/** + * A client-side counterpart of the RichEdit extension. + */ +interface MVCxClientRichEdit extends ASPxClientRichEdit { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the RichEdit by processing the passed information on the server, in an Action specified via the CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the RichEdit by processing the passed information on the server, in an Action specified via the CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the RoundPanel extension. + */ +interface MVCxClientRoundPanel extends ASPxClientRoundPanel { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the Round Panel by processing the passed information on the server, in an Action specified by the Round Panel's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the Round Panel by processing the passed information on the server, in an Action specified by the Round Panel's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side ContentCallback event, passing it the specified argument. + * @param parameter A string value that is any information that needs to be sent to the server-side ContentCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side ContentCallback event, passing it the specified argument. + * @param parameter A string value that is any information that needs to be sent to the server-side ContentCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the Scheduler extension. + */ +interface MVCxClientScheduler extends ASPxClientScheduler { + /** + * Occurs on the client side when the tooltip is about to be displayed. + */ + ToolTipDisplaying: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the Scheduler by processing the passed information on the server, in an Action specified via the Scheduler's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the Scheduler by processing the passed information on the server, in an Action specified via the Scheduler's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A template that is rendered to display a tooltip. + */ +interface MVCxClientSchedulerTemplateToolTip extends ASPxClientToolTipBase { + /** + * Gets the tooltip type. + * Value: A MVCxSchedulerToolTipType object that specifies the tooltip type. + */ + type: MVCxSchedulerToolTipType; +} +/** + * A delegate method that enables you to adjust the tooltip content before displaying. + */ +interface MVCxClientSchedulerToolTipDisplayingEventHandler { + /** + * A method that will handle the ToolTipDisplaying event. + * @param source An object which is the event source. Identifies the client object that raised the event. + * @param e A MVCxClientSchedulerToolTipDisplayingEventArgs object that contains the related arguments. + */ + (source: S, e: MVCxClientSchedulerToolTipDisplayingEventArgs): void; +} +/** + * Provides data for the ToolTipDisplaying event. + */ +interface MVCxClientSchedulerToolTipDisplayingEventArgs extends ASPxClientEventArgs { + /** + * Gets the tooltip related to the event. + * Value: A MVCxClientSchedulerTemplateToolTip object that specifies the tooltip. + */ + toolTip: MVCxClientSchedulerTemplateToolTip; + /** + * Gets information about the tooltip related to the event. + * Value: A ASPxClientSchedulerToolTipData object that specifies information about the tooltip. + */ + data: ASPxClientSchedulerToolTipData; +} +/** + * Lists available tooltip types. + */ +interface MVCxSchedulerToolTipType { +} +/** + * A client-side counterpart of the Spreadsheet extension. + */ +interface MVCxClientSpreadsheet extends ASPxClientSpreadsheet { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the Spreadsheet by processing the passed information on the server, in an Action specified via the CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the Spreadsheet by processing the passed information on the server, in an Action specified via the CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the PageControl extension. + */ +interface MVCxClientPageControl extends ASPxClientPageControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the PageControl by processing the passed information on the server, in an Action specified by the PageControl's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the PageControl by processing the passed information on the server, in an Action specified by the PageControl's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the TokenBox and TokenBoxFor extensions. + */ +interface MVCxClientTokenBox extends ASPxClientTokenBox { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the TokenBox by processing the passed information on the server, in an Action specified by the TokenBox's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the TokenBox by processing the passed information on the server, in an Action specified by the TokenBox's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A client-side counterpart of the TreeList extension. + */ +interface MVCxClientTreeList extends ASPxClientTreeList { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the TreeList by processing the passed information on the server, in an Action specified via the TreeList's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the TreeList by processing the passed information on the server, in an Action specified via the TreeList's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the TreeList's CustomDataCallback event. This method does not update the TreeList. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + */ + PerformCustomDataCallback(data: Object): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side CustomDataCallback event. + */ + PerformCustomDataCallback(arg: string): void; +} +/** + * A client-side counterpart of the TreeView extension. + */ +interface MVCxClientTreeView extends ASPxClientTreeView { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; +} +/** + * A client-side counterpart of the UploadControl extension. + */ +interface MVCxClientUploadControl extends ASPxClientUploadControl { +} +/** + * A method that will handle client BeginCallback events. + */ +interface MVCxClientBeginCallbackEventHandler { + /** + * A method that will handle client BeginCallback events. + * @param source An object which is the event source. Identifies the client object that raised the event. + * @param e A MVCxClientBeginCallbackEventArgs object that contains event data. + */ + (source: S, e: MVCxClientBeginCallbackEventArgs): void; +} +/** + * Provides data for client BeginCallback events. + */ +interface MVCxClientBeginCallbackEventArgs extends ASPxClientBeginCallbackEventArgs { + /** + * Gets an object containing specific information (if any, as name/value pairs) that should be passed as a request parameter from the client to the server side for further processing. + * Value: A hash table object containing named values to be passed from the client to the server side via request parameters. + */ + customArgs: Object; +} +/** + * A method that will handle the BeginCallback event. + */ +interface MVCxClientGlobalBeginCallbackEventHandler { + /** + * A method that will handle the BeginCallback event. + * @param source An object which is the event source. Identifies the client object that raised the event. + * @param e A MVCxClientGlobalBeginCallbackEventArgs object that contains event data. + */ + (source: S, e: MVCxClientGlobalBeginCallbackEventArgs): void; +} +/** + * Provides data for the BeginCallback event. + */ +interface MVCxClientGlobalBeginCallbackEventArgs extends ASPxClientGlobalBeginCallbackEventArgs { + /** + * Gets an object containing specific information (if any, as name/value pairs) that should be passed as a request parameter from the client to the server side for further processing. + * Value: A hash table object containing named values to be passed from the client to the server side via request parameters. + */ + customArgs: Object; +} +/** + * An ASP.NET MVC equivalent of the client ASPxClientGlobalEvents component. + */ +interface MVCxClientGlobalEvents { + /** + * Occurs on the client side after client object models of all DevExpress MVC extensions contained within the page have been initialized. + */ + ControlsInitialized: ASPxClientEvent>; + /** + * Occurs on the client when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by a DevExpress MVC extension. + */ + CallbackError: ASPxClientEvent>; +} +/** + * A client-side counterpart of the VerticalGrid extension. + */ +interface MVCxClientVerticalGrid extends ASPxClientVerticalGrid { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the VerticalGrid by processing the passed information on the server in an Action specified via the grid's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the grid's CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the VerticalGrid by processing the passed information on the server in an Action specified via the grid's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the grid's CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the VerticalGrid's CustomDataActionRouteValues property, and then process the returned result in the specified client function. This method does not update the VerticalGrid. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + * @param onCallback A ASPxClientGridViewValuesCallback object that represents the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(data: Object, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientVerticalGridValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientVerticalGridValuesCallback): void; +} +/** + * A client-side equivalent of the MVCxWebDocumentViewer class. + */ +interface MVCxClientWebDocumentViewer extends ASPxClientWebDocumentViewer { +} +/** + * Serves as the base type for all the objects included in the client-side object model. + */ +interface ASPxClientControlBase { + /** + * Gets the unique, hierarchically-qualified identifier for the control. + * Value: The fully-qualified identifier for the control. + */ + name: string; + /** + * Occurs on the client side after the control has been initialized. + */ + Init: ASPxClientEvent>; + /** + * Returns an HTML element that is the root of the control's hierarchy. + */ + GetMainElement(): Object; + /** + * Specifies the text that Assistive Technologies (screen readers or braille display, for example) will provide to a user. + * @param message A String value that specifies a text. + */ + SendMessageToAssistiveTechnology(message: string): void; + /** + * Returns a value specifying whether a control is displayed. + */ + GetClientVisible(): boolean; + /** + * Specifies whether a control is displayed. + * @param visible + */ + SetClientVisible(visible: boolean): void; + /** + * Returns a value specifying whether a control is displayed. + */ + GetVisible(): boolean; + /** + * Specifies whether a control is displayed. + * @param visible true to make a control visible; false to make it hidden. + */ + SetVisible(visible: boolean): void; + /** + * Returns a value that determines whether a callback request sent by a web control is being currently processed on the server side. + */ + InCallback(): boolean; +} +/** + * Serves as the base type for all the objects included in the client-side object model. + */ +interface ASPxClientControl extends ASPxClientControlBase { + /** + * Returns the control's width. + */ + GetWidth(): number; + /** + * Returns the control's height. + */ + GetHeight(): number; + /** + * Specifies the control's width. + * @param width An integer value that specifies the control's width. + */ + SetWidth(width: number): void; + /** + * Specifies the control's height. Note that this method is not in effect for some controls. + * @param height An integer value that specifies the control's height. + */ + SetHeight(height: number): void; + /** + * Modifies the control's size against the control's container. + */ + AdjustControl(): void; +} +/** + * Represents a client-side equivalent of the ASPxCallback control. + */ +interface ASPxClientCallback extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientCallback. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires on the client side when a callback initiated by the client Callback event's handler returns back to the client. + */ + CallbackComplete: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side Callback event passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + SendCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A method that will handle the client events related to completion of callback server-side processing. + */ +interface ASPxClientCallbackCompleteEventHandler { + /** + * A method that will handle the client events related to completion of callback server-side processing. + * @param source An object representing the event source. Identifies the web control that raised the event. + * @param e An ASPxClientCallbackCompleteEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCallbackCompleteEventArgs): void; +} +/** + * Serves as the base class for arguments of the web controls' client-side events. + */ +interface ASPxClientEventArgs { +} +/** + * Provides data for events concerning the final processing of a callback. + */ +interface ASPxClientCallbackCompleteEventArgs extends ASPxClientEventArgs { + /** + * Gets a string that contains specific information (if any) passed from the client side for server-side processing. + * Value: A string value representing specific information passed from the client to the server side. + */ + parameter: string; + /** + * Gets a string that contains specific information (if any) that has been passed from the server to the client side for further processing. + * Value: A string value representing specific information passed from the server back to the client side. + */ + result: string; +} +/** + * Serves as the base class for controls that implement panel functionality. + */ +interface ASPxClientPanelBase extends ASPxClientControl { + /** + * Returns the HTML code that is the content of the panel. + */ + GetContentHtml(): string; + /** + * Sets the HTML content for the panel. + * @param html A string value that is the HTML code defining the content of the panel. + */ + SetContentHtml(html: string): void; + /** + * Sets a value specifying whether the panel is enabled. + * @param enabled true to enable the panel; false to disable it. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns a value specifying whether a panel is enabled. + */ + GetEnabled(): boolean; +} +/** + * Represents a client-side equivalent of the ASPxPanel control. + */ +interface ASPxClientPanel extends ASPxClientPanelBase { + /** + * Occurs when the expanded panel is closed. + */ + Collapsed: ASPxClientEvent>; + /** + * Occurs when an end-user opens the expand panel. + */ + Expanded: ASPxClientEvent>; + /** + * Expands or collapses the client panel. + */ + Toggle(): void; + /** + * Returns a value specifying whether the panel can be expanded. + */ + IsExpandable(): boolean; + /** + * Returns a value specifying whether the panel is expanded. + */ + IsExpanded(): boolean; + /** + * Expands the collapsed panel. + */ + Expand(): void; + /** + * Collapses the expanded panel. + */ + Collapse(): void; +} +/** + * Represents a client-side equivalent of the ASPxCallbackPanel control. + */ +interface ASPxClientCallbackPanel extends ASPxClientPanel { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientCallbackPanel. + */ + CallbackError: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Returns the text displayed within the control's loading panel. + */ + GetLoadingPanelText(): string; + /** + * Sets the text to be displayed within the control's loading panel. + * @param loadingPanelText A string value specifying the text to be displayed within the loading panel. + */ + SetLoadingPanelText(loadingPanelText: string): void; + /** + * Sets a value specifying whether the callback panel is enabled. + * @param enabled true, to enable the callback panel; false to disable it. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns a value specifying whether a callback panel is enabled. + */ + GetEnabled(): boolean; +} +/** + * Represents the event object used for client-side events. + */ +interface ASPxClientEvent { + /** + * Dynamically connects the event with an appropriate event handler function. + * @param handler An object representing the event handling function's content. + */ + AddHandler(handler: T): void; + /** + * Dynamically disconnects the event from the associated event handler function. + * @param handler An object representing the event handling function's content. + */ + RemoveHandler(handler: T): void; + /** + * Dynamically disconnects the event from all the associated event handler functions. + */ + ClearHandlers(): void; + /** + * For internal use only. + * @param source + * @param e + */ + FireEvent(source: Object, e: ASPxClientEventArgs): void; +} +/** + * A method that will handle the client-side events of a web control's client-side equivalent. + */ +interface ASPxClientEventHandler { + /** + * A method that will handle the client-side events of a web control's client-side equivalent. + * @param source An object representing the event source. Identifies the control that raised the event. + * @param e An ASPxClientEventArgs object that contains event data. + */ + (source: S, e: ASPxClientEventArgs): void; +} +/** + * A method that will handle the cancelable events of a web control's client-side equivalent. + */ +interface ASPxClientCancelEventHandler { + /** + * A method that will handle the cancelable events of a web control's client-side equivalent. + * @param source An object representing the event source. Identifies the web control that raised the event. + * @param e An ASPxClientCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCancelEventArgs): void; +} +/** + * Provides data for cancelable client events. + */ +interface ASPxClientCancelEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the client events which can't be cancelled and allow the event's processing to be passed to the server side. + */ +interface ASPxClientProcessingModeEventHandler { + /** + * A method that will handle the client events which can't be cancelled and allow the event's processing to be passed to the server side. + * @param source An object representing the event source. Identifies the web control that raised the event. + * @param e An ASPxClientProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientProcessingModeEventArgs): void; +} +/** + * Provides data for the client events which can't be cancelled and allow the event's processing to be passed to the server side. + */ +interface ASPxClientProcessingModeEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets a value that specifies whether the event should be finally processed on the server side. + * Value: true to process the event on the server side; false to completely handle it on the client side. + */ + processOnServer: boolean; +} +/** + * A method that will handle the cancelable client-side events which allow the event's processing to be passed to the server side. + */ +interface ASPxClientProcessingModeCancelEventHandler { + /** + * A method that will handle the cancelable client-side events which allow the event's processing to be passed to the server side. + * @param source An object representing the event source. Identifies the web control that raised the event. + * @param e An ASPxClientProcessingModeCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientProcessingModeCancelEventArgs): void; +} +/** + * Provides data for the cancelable client-side events which allow the event's processing to be passed to the server side. + */ +interface ASPxClientProcessingModeCancelEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * Provides access to an observable boolean, that allows you to detect and respond to changes. + */ +interface KnockoutObservableBoolean { +} +/** + * Provides access to observable arrays that allow you to detect and respond to changes in a collection of things. + */ +interface KnockoutObservableArray { +} +/** + * Represents a JavaScript function which receives callback data obtained via a call to a specific client method (such as the PerformDataCallback). + */ +interface ASPxClientDataCallback { + /** + * A JavaScript function which receives a callback data obtained via a call to a specific client method (such as the PerformDataCallback). + * @param sender An object whose client method generated a callback. + * @param result A string value that represents the result of server-side callback processing. + */ + (sender: Object, result: string): void; +} +/** + * Represents a client-side equivalent of the ASPxCloudControl control. + */ +interface ASPxClientCloudControl extends ASPxClientControl { + /** + * Fires after an item has been clicked. + */ + ItemClick: ASPxClientEvent>; +} +/** + * A method that will handle client events involving manipulations with the control's items. + */ +interface ASPxClientCloudControlItemEventHandler { + /** + * A method that will handle client events concerning manipulations with items. + * @param source The event source. This parameter identifies the cloud control object which raised the event. + * @param e An ASPxClientCloudControlItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCloudControlItemEventArgs): void; +} +/** + * Provides data for events which involve clicking on the control's items. + */ +interface ASPxClientCloudControlItemEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the name that uniquely identifies the processed item. + * Value: A string value that represents the value assigned to the item's Name property. + */ + name: Object; + /** + * Gets the HTML object that contains the processed item. + * Value: An object representing a container for the item related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle the client events related to the begining of a callback processing round trip. + */ +interface ASPxClientBeginCallbackEventHandler { + /** + * A method that will handle client BeginCallback events. + * @param source An object representing the event source. Identifies the web control that raised the event. + * @param e An ASPxClientBeginCallbackEventArgs object that contains event data. + */ + (source: S, e: ASPxClientBeginCallbackEventArgs): void; +} +/** + * Provides data for client events related to the beginning of a callback processing round trip. + */ +interface ASPxClientBeginCallbackEventArgs extends ASPxClientEventArgs { + /** + * Gets a command name that identifies which client action forced a callback to be occurred. + * Value: A string value that represents the name of the command which initiated a callback. + */ + command: string; +} +/** + * A method that will handle the BeginCallback event. + */ +interface ASPxClientGlobalBeginCallbackEventHandler { + /** + * A method that will handle the BeginCallback event. + * @param source The event source. + * @param e An ASPxDataValidationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGlobalBeginCallbackEventArgs): void; +} +/** + * Provides data for the BeginCallback event. + */ +interface ASPxClientGlobalBeginCallbackEventArgs extends ASPxClientBeginCallbackEventArgs { + /** + * Gets an object that initiated a callback. + * Value: An class descendant object that is the control that initiated a callback. + */ + control: ASPxClientControl; +} +/** + * A method that will handle the client events related to the completion of a callback processing round trip. + */ +interface ASPxClientEndCallbackEventHandler { + /** + * A method that will handle client EndCallback events. + * @param source An object representing the event source. + * @param e A MenuItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientEndCallbackEventArgs): void; +} +/** + * Provides data for client events related to the completion of a callback processing round trip. + */ +interface ASPxClientEndCallbackEventArgs extends ASPxClientEventArgs { +} +/** + * A method that will handle the EndCallback event. + */ +interface ASPxClientGlobalEndCallbackEventHandler { + /** + * A method that will handle the EndCallback event. + * @param source The event source. + * @param e An ASPxDataValidationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGlobalEndCallbackEventArgs): void; +} +/** + * Provides data for the EndCallback event. + */ +interface ASPxClientGlobalEndCallbackEventArgs extends ASPxClientEndCallbackEventArgs { + /** + * Gets an object that initiated a callback. + * Value: An class descendant object that is the control that initiated a callback. + */ + control: ASPxClientControl; +} +/** + * A method that will handle a CustomCallback client event exposed by some DevExpress web controls. + */ +interface ASPxClientCustomDataCallbackEventHandler { + /** + * A method that will handle the client CustomCallback event of some controls. + * @param source An object representing the event source. + * @param e An ASPxClientCustomDataCallbackEventHandler object that contains event data. + */ + (source: S, e: ASPxClientCustomDataCallbackEventArgs): void; +} +/** + * Provides data for the CustomCallback event. + */ +interface ASPxClientCustomDataCallbackEventArgs extends ASPxClientEventArgs { + /** + * Gets a string that contains specific information (if any) that has been passed from the server to the client side for further processing, related to the CustomCallback event. + * Value: A string value representing specific information passed from the server back to the client side. + */ + result: string; +} +/** + * A method that will handle client events related to server-side errors that occured during callback processing. + */ +interface ASPxClientCallbackErrorEventHandler { + /** + * A method that will handle client CallbackError events. + * @param source An object representing the event source. + * @param e A ASPxClientCallbackErrorEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCallbackErrorEventArgs): void; +} +/** + * Provides data for client events related to server-side errors that occured during callback processing. + */ +interface ASPxClientCallbackErrorEventArgs extends ASPxClientEventArgs { + /** + * Gets the error message that describes the server error that occurred. + * Value: A string value that represents the error message. + */ + message: string; + /** + * Gets or sets whether the event is handled and the default error handling actions are not required. + * Value: true if the error is handled and no default processing is required; otherwise false. + */ + handled: boolean; +} +/** + * A method that will handle the CallbackError event. + */ +interface ASPxClientGlobalCallbackErrorEventHandler { + /** + * A method that will handle the CallbackError event. + * @param source The event source. + * @param e An ASPxDataValidationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGlobalCallbackErrorEventArgs): void; +} +/** + * Provides data for the CallbackError event. + */ +interface ASPxClientGlobalCallbackErrorEventArgs extends ASPxClientCallbackErrorEventArgs { + /** + * Gets an object that initiated a callback. + * Value: An class descendant object that is the control that initiated a callback. + */ + control: ASPxClientControl; +} +/** + * A method that will handle the ValidationCompleted client event. + */ +interface ASPxClientValidationCompletedEventHandler { + /** + * A method that will handle the ValidationCompleted event. + * @param source An object representing the event source. Identifies the ASPxClientGlobalEvents object that raised the event. + * @param e An ASPxClientValidationCompletedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientValidationCompletedEventArgs): void; +} +/** + * Provides data for the ValidationCompleted client event that allows you to centrally validate user input within all DevExpress web controls to which validation is applied. + */ +interface ASPxClientValidationCompletedEventArgs extends ASPxClientEventArgs { + /** + * Gets a container object that holds the validated control(s). + * Value: An object that represents a container of the validated control(s). + */ + container: Object; + /** + * Gets the name of the validation group name to which validation has been applied. + * Value: A string value that represents the name of the validation group that has been validated. + */ + validationGroup: string; + /** + * Gets a value that indicates whether validation has been applied to both visible and invisible controls. + * Value: true if validation has been applied to both visible and invisible controls; false if only visible controls have been validated. + */ + invisibleControlsValidated: boolean; + /** + * Gets a value specifying whether the validation has been completed successfully. + * Value: true if the validation has been completed successfully; otherwise, false. + */ + isValid: boolean; + /** + * Gets the first control (either visible or invisible) that hasn't passed the validation applied. + * Value: An ASPxClientControl object that represents the first invalid control. + */ + firstInvalidControl: ASPxClientControl; + /** + * Gets the first visible control that hasn't passed the validation applied. + * Value: An ASPxClientControl object that represents the first visible invalid control. + */ + firstVisibleInvalidControl: ASPxClientControl; +} +/** + * A method that will handle the client ControlsInitialized event. + */ +interface ASPxClientControlsInitializedEventHandler { + /** + * A method that will handle the client ControlsInitialized event. + * @param source An object representing the event source. + * @param e An ASPxClientControlsInitializedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientControlsInitializedEventArgs): void; +} +/** + * Provides data for the client ControlsInitialized event. + */ +interface ASPxClientControlsInitializedEventArgs extends ASPxClientEventArgs { + /** + * Gets a value that specifies whether a callback is sent during a controls initialization. + * Value: true if a callback is sent; otherwise, false. + */ + isCallback: boolean; +} +/** + * A JavaScript function which returns a value specifying whether an object meets the criteria defined within the method specified by this delegate. + */ +interface ASPxClientControlPredicate { + /** + * A JavaScript function which returns a value specifying whether an object meets the criteria defined within the method specified by this delegate. + * @param control An object to compare against the criteria defined within the method. + */ + (control: Object): boolean; +} +/** + * Represents a JavaScript function which receives the action to perform for a control when the client ForEachControl method is called. + */ +interface ASPxClientControlAction { + /** + * Represents a JavaScript function which receives the action to perform for a control when the client ForEachControl method is called. + * @param control An object that specifies a control. + */ + (control: Object): void; +} +/** + * A collection object used on the client side to maintain particular client control objects + */ +interface ASPxClientControlCollection { + /** + * Occurs on the client side after client object models of all DevExpress web controls contained within the page have been initialized. + */ + ControlsInitialized: ASPxClientEvent>; + /** + * Occurs when the browser window is being resized. + */ + BrowserWindowResized: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated by any DevExpress control. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side, after server-side processing of a callback initiated by any DevExpress web control, has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by any DevExpress web control. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs after the validation initiated for a DevExpress web control (or a group of DevExpress web controls) has been completed. + */ + ValidationCompleted: ASPxClientEvent>; + /** + * Returns a collection item identified by its unique hierarchically-qualified identifier. + * @param name A string value representing the hierarchically-qualified identifier of the required control. + */ + Get(name: Object): Object; + /** + * Returns a DevExpress client control object identified by its unique hierarchically-qualified identifier (either ClientInstanceName or ClientID property value). + * @param name A string value that is the hierarchically-qualified identifier of the required DevExpress control. + */ + GetByName(name: string): Object; + /** + * Returns all controls in the collection that satisfy the specified predicate. + * @param predicate An ASPxClientControlPredicate object that is a predicate used to search for controls in the collection. + */ + GetControlsByPredicate(predicate: ASPxClientControlPredicate): Object[]; + /** + * Returns all controls of the specified type. + * @param type The object specifying the client control type. + */ + GetControlsByType(type: Object): Object[]; + /** + * Performs the specified action for each control in the collection. + * @param action An ASPxClientControlAction object specifying an action to perform. + */ + ForEachControl(action: ASPxClientControlAction): void; +} +/** + * Represents a client-side equivalent of the ASPxDataView object. + */ +interface ASPxClientDataView extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientDataView. + */ + CallbackError: ASPxClientEvent>; + /** + * Activates the specified page. + * @param pageIndex An integer value that specifies the active page's index. + */ + GotoPage(pageIndex: number): void; + /** + * Gets the index of the page that is currently active. + */ + GetPageIndex(): number; + /** + * Gets the size of a single ASPxDataView's page. + */ + GetPageSize(): number; + /** + * Sets the size of a single ASPxDataView's page. + * @param pageSize An integer value that specifies the page size. + */ + SetPageSize(pageSize: number): void; + /** + * Gets the number of pages into which the ASPxDataView's data is divided. + */ + GetPageCount(): number; + /** + * Activates the next page. + */ + NextPage(): void; + /** + * Activates the previous page. + */ + PrevPage(): void; + /** + * Activates the first page. + */ + FirstPage(): void; + /** + * Activates the last page. + */ + LastPage(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A JavaScript function which returns a value specifying whether an object meets the criteria defined within the method specified by this delegate. + */ +interface ASPxClientDockingFilterPredicate { + /** + * A JavaScript function which returns a value specifying whether an object meets the criteria defined within the method specified by this delegate. + * @param item An object to compare against the criteria defined within the method. + */ + (item: Object): boolean; +} +/** + * A client-side equivalent of the ASPxDockManager object. + */ +interface ASPxClientDockManager extends ASPxClientControl { + /** + * Fires on the client side before a panel is docked in a zone and allows you to cancel the action. + */ + BeforeDock: ASPxClientEvent>; + /** + * Fires on the client side after a panel is docked in a zone. + */ + AfterDock: ASPxClientEvent>; + /** + * Fires on the client side before a panel is made floating (undocked from a zone) and allows you to cancel the action. + */ + BeforeFloat: ASPxClientEvent>; + /** + * Fires on the client side after a panel is undocked from a zone. + */ + AfterFloat: ASPxClientEvent>; + /** + * Occurs when a panel dragging operation is started. + */ + StartPanelDragging: ASPxClientEvent>; + /** + * Occurs after a panel dragging operation is complete. + */ + EndPanelDragging: ASPxClientEvent>; + /** + * Occurs on the client side before a panel is closed, and allows you to cancel the action. + */ + PanelClosing: ASPxClientEvent>; + /** + * Occurs on the client side when a panel is closed. + */ + PanelCloseUp: ASPxClientEvent>; + /** + * Occurs on the client side when a panel pops up. + */ + PanelPopUp: ASPxClientEvent>; + /** + * Occurs on the client side after a panel has been invoked. + */ + PanelShown: ASPxClientEvent>; + /** + * Occurs on the client side after a panel has been resized. + */ + PanelResize: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that contains any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that contains any information that needs to be sent to the server-side Callback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Returns a zone specified by its unique identifier (zoneUID). + * @param zoneUID A string value specifying the unique identifier of the zone. + */ + GetZoneByUID(zoneUID: string): ASPxClientDockZone; + /** + * Returns a panel specified by its unique identifier (panelUID). + * @param panelUID A string value specifying the unique identifier of the panel. + */ + GetPanelByUID(panelUID: string): ASPxClientDockPanel; + /** + * Returns an array of panels contained in a page. + */ + GetPanels(): ASPxClientDockPanel[]; + /** + * Returns an array of panels that are contained in a page and meet a specified criteria. + * @param filterPredicate An ASPxClientDockingFilterPredicate delegate that defines a set of criteria and determines whether a panel meets those criteria. + */ + GetPanels(filterPredicate: ASPxClientDockingFilterPredicate): ASPxClientDockPanel[]; + /** + * Returns an array of zones contained in a page. + */ + GetZones(): ASPxClientDockZone[]; + /** + * Returns an array of zones that are contained in a page and meet a specified criteria. + * @param filterPredicate An ASPxClientDockingFilterPredicate delegate that defines a set of criteria and determines whether a zone meets those criteria. + */ + GetZones(filterPredicate: ASPxClientDockingFilterPredicate): ASPxClientDockZone[]; +} +/** + * A method that will handle the client BeforeDock event. + */ +interface ASPxClientDockManagerProcessingModeCancelEventHandler { + /** + * A method that will handle the BeforeDock event. + * @param source The event source. This parameter identifies the dock manager object which raised the event. + * @param e An ASPxClientDockManagerProcessingModeCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockManagerProcessingModeCancelEventArgs): void; +} +/** + * Provides data for the BeforeDock event. + */ +interface ASPxClientDockManagerProcessingModeCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; + /** + * Gets the zone currently being processed. + * Value: An ASPxClientDockZone object that is the processed zone. + */ + zone: ASPxClientDockZone; +} +/** + * A method that will handle the client AfterDock event. + */ +interface ASPxClientDockManagerProcessingModeEventHandler { + /** + * A method that will handle the AfterDock event. + * @param source The event source. This parameter identifies the dock manager object which raised the event. + * @param e An ASPxClientDockManagerProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockManagerProcessingModeEventArgs): void; +} +/** + * Provides data for the AfterDock event. + */ +interface ASPxClientDockManagerProcessingModeEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; + /** + * Gets the zone currently being processed. + * Value: An ASPxClientDockZone object that is the processed zone. + */ + zone: ASPxClientDockZone; +} +/** + * A method that will handle client-side events concerning manipulations with panels. + */ +interface ASPxClientDockManagerEventHandler { + /** + * A method that will handle client-side events concerning manipulations with panels. + * @param source The event source. This parameter identifies the dock manager object which raised the event. + * @param e An ASPxClientDockManagerEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockManagerEventArgs): void; +} +/** + * Provides data for events which concern manipulations on panels. + */ +interface ASPxClientDockManagerEventArgs extends ASPxClientEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; +} +/** + * A method that will handle the client BeforeDock event. + */ +interface ASPxClientDockManagerCancelEventHandler { + /** + * A method that will handle the PanelClosing event. + * @param source The event source. This parameter identifies the dock manager object which raised the event. + * @param e An ASPxClientDockManagerCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockManagerCancelEventArgs): void; +} +/** + * Provides data for the BeforeDock event. + */ +interface ASPxClientDockManagerCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; +} +/** + * Serves as a base class for the ASPxClientPopupControl classes. + */ +interface ASPxClientPopupControlBase extends ASPxClientControl { + /** + * Occurs on the client side when window resizing initiates. + */ + BeforeResizing: ASPxClientEvent>; + /** + * Occurs on the client side when window resizing completes. + */ + AfterResizing: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the control. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side when a control's window closes or hides. + */ + CloseUp: ASPxClientEvent>; + /** + * Enables you to cancel window closing on the client side. + */ + Closing: ASPxClientEvent>; + /** + * Occurs on the client side when a control's window is invoked. + */ + PopUp: ASPxClientEvent>; + /** + * Occurs on the client side after a window has been resized. + */ + Resize: ASPxClientEvent>; + /** + * Occurs on the client side after a control's window has been invoked. + */ + Shown: ASPxClientEvent>; + /** + * Occurs on the client side when the window pin state is changed. + */ + PinnedChanged: ASPxClientEvent>; + /** + * Modifies a control's window size in accordance with the content. + */ + AdjustSize(): void; + /** + * Brings the window to the front of the z-order. + */ + BringToFront(): void; + /** + * Returns a value indicating whether the window is collapsed. + */ + GetCollapsed(): boolean; + /** + * Returns the HTML code that specifies the contents of the control's window. + */ + GetContentHtml(): string; + /** + * Returns an iframe object containing a web page specified via the control's SetContentUrl client method). + */ + GetContentIFrame(): Object; + /** + * Returns an iframe object containing a web page specified via the control's SetContentUrl client method). + */ + GetContentIFrameWindow(): Object; + /** + * Returns the URL pointing to the web page displayed within the control's window. + */ + GetContentUrl(): string; + /** + * Returns the URL pointing to the image displayed within the window footer by default. + */ + GetFooterImageUrl(): string; + /** + * Returns the URL where the web browser will navigate when the text or image is clicked within a window's footer. + */ + GetFooterNavigateUrl(): string; + /** + * Returns the text displayed within a window's footer. + */ + GetFooterText(): string; + /** + * Returns the URL pointing to the image displayed within the window header. + */ + GetHeaderImageUrl(): string; + /** + * Returns the URL where the web browser will navigate when the text or image is clicked within a window's header. + */ + GetHeaderNavigateUrl(): string; + /** + * Returns the text displayed within a window's header. + */ + GetHeaderText(): string; + /** + * Gets the width of the default window's (for ASPxPopupControl) or panel's (for ASPxDockPanel) content region. + */ + GetContentWidth(): number; + /** + * Gets the height of the default window's (for ASPxPopupControl) or panel's (for ASPxDockPanel) content region. + */ + GetContentHeight(): number; + /** + * Returns a value indicating whether the window is maximized. + */ + GetMaximized(): boolean; + /** + * Returns a value indicating whether the window is pinned. + */ + GetPinned(): boolean; + /** + * Sends a callback to the server and generates the server-side WindowCallback event, passing the specified argument to it. + * @param parameter A string value that is any information that needs to be sent to the server-side WindowCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Refreshes the content of the web page displayed within the control's window. + */ + RefreshContentUrl(): void; + /** + * Sets a value indicating whether the window is collapsed. + * @param value true, to collapse the window; otherwise, false. + */ + SetCollapsed(value: boolean): void; + /** + * Sets the HTML markup specifying the contents of the control's window. + * @param html A string value that specifies the HTML markup. + */ + SetContentHtml(html: string): void; + /** + * Sets the URL to point to the web page that should be loaded into, and displayed within the control's window. + * @param url A string value specifying the URL to the web page displayed within the control's window. + */ + SetContentUrl(url: string): void; + /** + * Specifies the URL which points to the image displayed within the window footer by default. + * @param value A string value that is the URL for the image displayed within the window footer. + */ + SetFooterImageUrl(value: string): void; + /** + * Specifies the URL where the web browser will navigate when the text or image is clicked within a window's footer. + * @param value A string value which specifies the required navigation location. + */ + SetFooterNavigateUrl(value: string): void; + /** + * Specifies the text displayed within a window's footer. + * @param value A string value that specifies a window's footer text. + */ + SetFooterText(value: string): void; + /** + * Specifies the URL which points to the image displayed within the window header. + * @param value A string value that is the URL to the image displayed within the header. + */ + SetHeaderImageUrl(value: string): void; + /** + * Specifies the URL where the web browser will navigate when the text or image is clicked within a window's header. + * @param value A string value which specifies the required navigation location. + */ + SetHeaderNavigateUrl(value: string): void; + /** + * Specifies the text displayed within a window's header. + * @param value A string value that specifies a window's header text. + */ + SetHeaderText(value: string): void; + /** + * Sets a value indicating whether the window is maximized. + * @param value true. to maximize the window; otherwise, false. + */ + SetMaximized(value: boolean): void; + /** + * Sets a value indicating whether the window is pinned. + * @param value true, to pin the window; otherwise, false. + */ + SetPinned(value: boolean): void; + /** + * Invokes the control's window. + */ + Show(): void; + /** + * Invokes the control's window at the popup element with the specified index. + * @param popupElementIndex An integer value specifying the zero-based index of the popup element. + */ + Show(popupElementIndex: number): void; + /** + * Invokes the control's window and displays it over the specified HTML element. + * @param htmlElement An object specifying the HTML element relative to whose position the window is invoked. + */ + ShowAtElement(htmlElement: Object): void; + /** + * Invokes the control's window and displays it over an HTML element specified by its unique identifier. + * @param id A string value that specifies the hierarchically qualified identifier of an HTML element relative to whose position the window is invoked. + */ + ShowAtElementByID(id: string): void; + /** + * Invokes the control's window at the specified position. + * @param x A integer value specifying the x-coordinate of the window's display position. + * @param y A integer value specifying the y-coordinate of the window's display position. + */ + ShowAtPos(x: number, y: number): void; + /** + * Closes the control's window. + */ + Hide(): void; + /** + * Returns a value that specifies whether the control's window is displayed. + */ + IsVisible(): boolean; +} +/** + * A client-side equivalent of the ASPxDockPanel object. + */ +interface ASPxClientDockPanel extends ASPxClientPopupControlBase { + /** + * Gets or sets the unique identifier of a panel on a page. + * Value: A string that is the unique identifier of a panel. + */ + panelUID: string; + /** + * Fires on the client side before a panel is docked in a zone and allows you to cancel the action. + */ + BeforeDock: ASPxClientEvent>; + /** + * Fires on the client side after a panel is docked in a zone. + */ + AfterDock: ASPxClientEvent>; + /** + * Fires on the client side before a panel is made floating (undocked from a zone) and allows you to cancel the action. + */ + BeforeFloat: ASPxClientEvent>; + /** + * Fires on the client side after a panel is undocked from a zone. + */ + AfterFloat: ASPxClientEvent>; + /** + * Occurs when a panel dragging operation is started. + */ + StartDragging: ASPxClientEvent>; + /** + * Occurs after a panel dragging operation is complete. + */ + EndDragging: ASPxClientEvent>; + /** + * Retrieves a zone that owns the current panel. + */ + GetOwnerZone(): ASPxClientDockZone; + /** + * Docks the current panel in the specified zone. + * @param zone An ASPxClientDockZone object specifying the zone. + */ + Dock(zone: ASPxClientDockZone): void; + /** + * Docks the current panel in a zone at the specified position. + * @param zone An ASPxClientDockZone object specifying the zone, where the panel is docked + * @param visibleIndex An integer value specifying the visible index position. + */ + Dock(zone: ASPxClientDockZone, visibleIndex: number): void; + /** + * Undocks the current panel. + */ + MakeFloat(): void; + /** + * Undocks the current panel and place it at the specified position. + * @param x An integer value that specifies the X-coordinate of the panel's display position. + * @param y An integer value that specifies the Y-coordinate of the panel's display position. + */ + MakeFloat(x: number, y: number): void; + /** + * Gets a value specifying the position of the current panel, amongst the visible panels within a zone. + */ + GetVisibleIndex(): number; + /** + * Sets a value specifying the position of the current panel, amongst the visible panels in a zone. + * @param visibleIndex An integer value specifying the zero-based index of the panel amongst visible panels in the zone. + */ + SetVisibleIndex(visibleIndex: number): void; + /** + * Returns a value indicating whether the panel is docked. + */ + IsDocked(): boolean; +} +/** + * A method that will handle the client BeforeDock event. + */ +interface ASPxClientDockPanelProcessingModeCancelEventHandler { + /** + * A method that will handle the BeforeDock event. + * @param source A ASPxClientDockPanel object that raised the event. + * @param e A ASPxClientDockPanelProcessingModeCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockPanelProcessingModeCancelEventArgs): void; +} +/** + * Provides data for the BeforeDock event. + */ +interface ASPxClientDockPanelProcessingModeCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the zone currently being processed. + * Value: An ASPxClientDockZone object that is the processed zone. + */ + zone: ASPxClientDockZone; +} +/** + * A method that will handle the client BeforeDock event. + */ +interface ASPxClientDockPanelProcessingModeEventHandler { + /** + * A method that will handle the AfterFloat event. + * @param source A ASPxClientDockPanel object that raised the event. + * @param e A ASPxClientDockPanelProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockPanelProcessingModeEventArgs): void; +} +/** + * Provides data for the AfterFloat event. + */ +interface ASPxClientDockPanelProcessingModeEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the zone currently being processed. + * Value: An ASPxClientDockZone object that is the processed zone. + */ + zone: ASPxClientDockZone; +} +/** + * A client-side equivalent of the ASPxDockZone object. + */ +interface ASPxClientDockZone extends ASPxClientControl { + /** + * Gets or sets the unique identifier of a zone on a page. + * Value: A string that is the unique identifier of a zone. + */ + zoneUID: string; + /** + * Fires on the client side before a panel is docked in a zone and allows you to cancel the action. + */ + BeforeDock: ASPxClientEvent>; + /** + * Fires on the client side after a panel is docked in a zone. + */ + AfterDock: ASPxClientEvent>; + /** + * Returns a value that indicates the orientation in which panels are stacked in the current zone. + */ + IsVertical(): boolean; + /** + * Gets a value that indicates whether the zone can enlarge its size. + */ + GetAllowGrowing(): boolean; + /** + * Gets the number of panels contained in the zone. + */ + GetPanelCount(): number; + /** + * Returns a panel specified by its unique identifier (panelUID). + * @param panelUID A string value specifying the unique identifier of the panel. + */ + GetPanelByUID(panelUID: string): ASPxClientDockPanel; + /** + * Returns a panel specified by its visible index. + * @param visibleIndex An integer value specifying the panel's position among the visible panels within the current zone. + */ + GetPanelByVisibleIndex(visibleIndex: number): ASPxClientDockPanel; + /** + * Returns an array of panels docked in the current zone. + */ + GetPanels(): ASPxClientDockPanel[]; + /** + * Returns an array of panels that are docked in the current zone and meet a specified criteria. + * @param filterPredicate An ASPxClientDockingFilterPredicate delegate that defines a set of criteria and determines whether a panel meets those criteria. + */ + GetPanels(filterPredicate: ASPxClientDockingFilterPredicate): ASPxClientDockPanel[]; +} +/** + * A method that will handle the client BeforeDock event. + */ +interface ASPxClientDockZoneCancelEventHandler { + /** + * A method that will handle the BeforeDock event. + * @param source The event source. This parameter identifies the zone object which raised the event. + * @param e A ASPxClientDockZoneCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockZoneCancelEventArgs): void; +} +/** + * Provides data for the BeforeDock event. + */ +interface ASPxClientDockZoneCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; +} +/** + * A method that will handle the client AfterDock event. + */ +interface ASPxClientDockZoneProcessingModeEventHandler { + /** + * A method that will handle the AfterDock event. + * @param source The event source. This parameter identifies the zone object which raised the event. + * @param e An ASPxClientDockZoneProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockZoneProcessingModeEventArgs): void; +} +/** + * Provides data for the AfterDock event. + */ +interface ASPxClientDockZoneProcessingModeEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; +} +/** + * Represents the client-side equivalent of the ASPxFileManager control. + */ +interface ASPxClientFileManager extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientFileManager. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires on the client side after the selected file has been changed. + */ + SelectedFileChanged: ASPxClientEvent>; + /** + * Fires on the client side when an end-user opens a file by double-clicking it or pressing the Enter key. + */ + SelectedFileOpened: ASPxClientEvent>; + /** + * Fires after the focused item has been changed. + */ + FocusedItemChanged: ASPxClientEvent>; + /** + * Fires after the selection has been changed. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Fires on the client side after the current folder has been changed within a file manager. + */ + CurrentFolderChanged: ASPxClientEvent>; + /** + * Fires on the client side before the folder is created, and allows you to cancel the action. + */ + FolderCreating: ASPxClientEvent>; + /** + * Occurs on the client side after a folder has been created. + */ + FolderCreated: ASPxClientEvent>; + /** + * Fires on the client side before an item is renamed and allows you to cancel the action. + */ + ItemRenaming: ASPxClientEvent>; + /** + * Occurs on the client side after a file manager's item has been renamed. + */ + ItemRenamed: ASPxClientEvent>; + /** + * Fires on the client side before an item is deleted and allows you to cancel the action. + */ + ItemDeleting: ASPxClientEvent>; + /** + * Occurs on the client side after a file manager's item has been deleted. + */ + ItemDeleted: ASPxClientEvent>; + /** + * Occurs on the client side after all the selected items have been deleted. + */ + ItemsDeleted: ASPxClientEvent>; + /** + * Fires on the client side before an item is moved and allows you to cancel the action. + */ + ItemMoving: ASPxClientEvent>; + /** + * Occurs on the client side after a file manager's item has been moved. + */ + ItemMoved: ASPxClientEvent>; + /** + * Occurs on the client side after all the selected items have been moved . + */ + ItemsMoved: ASPxClientEvent>; + /** + * Fires on the client side before an item is copied and allows you to cancel the action. + */ + ItemCopying: ASPxClientEvent>; + /** + * Occurs on the client side after a file manager item has been copied. + */ + ItemCopied: ASPxClientEvent>; + /** + * Occurs on the client side after all the selected items have been copied. + */ + ItemsCopied: ASPxClientEvent>; + /** + * Fires on the client if any error occurs while editing an item. + */ + ErrorOccurred: ASPxClientEvent>; + /** + * Enables you to display the alert with the result error description. + */ + ErrorAlertDisplaying: ASPxClientEvent>; + /** + * Fires when a custom item is clicked, allowing you to perform custom actions. + */ + CustomCommand: ASPxClientEvent>; + /** + * Fires on the client side when the file manager updates the state of toolbar or context menu items. + */ + ToolbarUpdating: ASPxClientEvent>; + /** + * Enables you to highlight the search text, which is specified using the filter box, in templates. + */ + HighlightItemTemplate: ASPxClientEvent>; + /** + * Fires on the client side before a file upload starts, and allows you to cancel the action. + */ + FileUploading: ASPxClientEvent>; + /** + * Fires on the client side before the selected items are uploaded and allows you to cancel the action. + */ + FilesUploading: ASPxClientEvent>; + /** + * Occurs on the client side after a file has been uploaded. + */ + FileUploaded: ASPxClientEvent>; + /** + * Occurs on the client side after upload of all selected files has been completed. + */ + FilesUploaded: ASPxClientEvent>; + /** + * Enables you to specify whether the selected file(s) are valid and provide an error text. + */ + FileUploadValidationErrorOccurred: ASPxClientEvent>; + /** + * Fires on the client side before a file download starts, and allows you to cancel the action. + */ + FileDownloading: ASPxClientEvent>; + /** + * Gets the name of the currently active file manager area. + */ + GetActiveAreaName(): string; + /** + * Client-side scripting method which initiates a round trip to the server, so that the current page will be reloaded. + */ + Refresh(): void; + /** + * Executes the specified command. + * @param commandName A string value that specifies the command to perform. + */ + ExecuteCommand(commandName: string): boolean; + /** + * Returns the selected file within the ASPxFileManager control's file container. + */ + GetSelectedFile(): ASPxClientFileManagerFile; + /** + * Returns an array of the file manager's selected items. + */ + GetSelectedItems(): ASPxClientFileManagerFile[]; + /** + * Returns a list of files that are loaded on the current page. + */ + GetItems(): ASPxClientFileManagerFile[]; + /** + * Sends a callback to the server and returns a list of files that are contained within the current folder. + * @param onCallback A object that represents the JavaScript function which receives the list of row values as a parameter. + */ + GetAllItems(onCallback: ASPxClientFileManagerAllItemsCallback): void; + /** + * Returns a toolbar item specified by its command name. + * @param commandName A string value specifying the command name of the item. + */ + GetToolbarItemByCommandName(commandName: string): ASPxClientFileManagerToolbarItem; + /** + * Returns a context menu item specified by its command name. + * @param commandName A string value specifying the command name of the item. + */ + GetContextMenuItemByCommandName(commandName: string): ASPxClientFileManagerToolbarItem; + /** + * Gets the current folder's path. + */ + GetCurrentFolderPath(): string; + /** + * Gets the current folder's path with the specified separator. + * @param separator A string value that specifies the separator between the folder's name within a path. + */ + GetCurrentFolderPath(separator: string): string; + /** + * Gets the current folder's path with the specified settings. + * @param separator A string value that specifies the separator between the folder's name within the path. + * @param skipRootFolder true to skip the root folder; otherwise, false. + */ + GetCurrentFolderPath(separator: string, skipRootFolder: boolean): string; + /** + * Sets the current folder's path. + * @param path A String value that is the relative path to the folder (without the root folder). + * @param onCallback A ASPxClientFileManagerCallback object that is the JavaScript function that receives the callback data as a parameter. + */ + SetCurrentFolderPath(path: string, onCallback: ASPxClientFileManagerCallback): void; + /** + * Gets the current folder's ID. + */ + GetCurrentFolderId(): string; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that specifies any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that specifies any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; +} +/** + * A JavaScript function which receives callback data obtained via a call to the client SetCurrentFolderPath method. + */ +interface ASPxClientFileManagerCallback { + /** + * A JavaScript function that receives callback data obtained via a call to the SetCurrentFolderPath method. + * @param result An object that contains a callback data. + */ + (result: Object): void; +} +/** + * A client-side equivalent of the file manager's FileManagerItem object and serves as a base class for client file and folder objects. + */ +interface ASPxClientFileManagerItem { + /** + * Gets the name of the current item. + * Value: A string value that is the item's name. + */ + name: string; + /** + * Gets the item's unique identifier. + * Value: A String value that specifies the item's unique identifier. + */ + id: string; + /** + * Gets a value that indicates if the current file manager item is a folder. + * Value: true if the current item is a folder or parent folder; false if the current item is a file. + */ + isFolder: boolean; + /** + * Specifies whether the file manager item is selected. + * @param selected true, to select the item; otherwise, false. + */ + SetSelected(selected: boolean): void; + /** + * Gets a value indicating whether the item is selected in the file manager. + */ + IsSelected(): boolean; + /** + * Gets the current item's full name. + */ + GetFullName(): string; + /** + * Gets the current item's full name with the specified separator. + * @param separator A string value that specifies the separator between the folder name inside the item's full name. + */ + GetFullName(separator: string): string; + /** + * Gets the current item's full name with the specified settings. + * @param separator A string value that specifies the separator between the folder name inside the item's full name. + * @param skipRootFolder true, to skip the root folder; otherwise, false. + */ + GetFullName(separator: string, skipRootFolder: boolean): string; +} +/** + * Represents the client-side equivalent of the FileManagerFile object. + */ +interface ASPxClientFileManagerFile extends ASPxClientFileManagerItem { + /** + * Downloads a file from a file manager. + */ + Download(): void; +} +/** + * A client-side equivalent of the FileManagerFolder object. + */ +interface ASPxClientFileManagerFolder extends ASPxClientFileManagerItem { + /** + * Gets a value specifying whether an item is a parent folder. + * Value: true if an item is a parent folder; false if an item is a file or folder. + */ + isParentFolder: boolean; +} +/** + * A JavaScript function which receives callback data obtained by a call to the client GetAllItems method. + */ +interface ASPxClientFileManagerAllItemsCallback { + /** + * A JavaScript function which receives callback data obtained by a call to the client GetAllItems method. + * @param items An array of ASPxClientFileManagerItem objects that are items contained in the current folder. + */ + (items: ASPxClientFileManagerItem[]): void; +} +/** + * A method that will handle the client SelectedFileOpened events. + */ +interface ASPxClientFileManagerFileEventHandler { + /** + * A method that will handle the SelectedFileOpened events. + * @param source An object representing the event's source. + * @param e An ASPxClientFileManagerFileEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFileEventArgs): void; +} +/** + * Provides data for the SelectedFileOpened events. + */ +interface ASPxClientFileManagerFileEventArgs extends ASPxClientEventArgs { + /** + * Gets a file related to the event. + * Value: An ASPxClientFileManagerFile object that represents a file currently being processed. + */ + file: ASPxClientFileManagerFile; +} +/** + * A method that will handle the client SelectedFileOpened event. + */ +interface ASPxClientFileManagerFileOpenedEventHandler { + /** + * A method that will handle the SelectedFileOpened event. + * @param source The event source. This parameter identifies the file manager object which raised the event. + * @param e An ASPxClientFileManagerFileOpenedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFileOpenedEventArgs): void; +} +/** + * Provides data for the SelectedFileOpened event. + */ +interface ASPxClientFileManagerFileOpenedEventArgs extends ASPxClientFileManagerFileEventArgs { + /** + * Gets or sets a value that specifies whether the event should be finally processed on the server side. + * Value: true to process the event on the server side; false to completely handle it on the client side. + */ + processOnServer: boolean; +} +/** + * Serves as a base for classes that are used as arguments for events generated on the client side. + */ +interface ASPxClientFileManagerActionEventArgsBase extends ASPxClientEventArgs { + /** + * Gets the full name of the item currently being processed. + * Value: A string value that is the item's full name. + */ + fullName: string; + /** + * Gets the name of the currently processed item. + * Value: A string value that specifies the item's name. + */ + name: string; + /** + * Gets a value specifying whether the current processed item is a folder. + * Value: true if the processed item is a folder; false if the processed item is a file. + */ + isFolder: boolean; +} +/** + * A method that will handle the client ItemRenaming events. + */ +interface ASPxClientFileManagerItemEditingEventHandler { + /** + * A method that will handle the ItemRenaming events. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemEditingEventArgs): void; +} +/** + * Provides data for the item editing event. + */ +interface ASPxClientFileManagerItemEditingEventArgs extends ASPxClientFileManagerActionEventArgsBase { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the client ItemRenamed event. + */ +interface ASPxClientFileManagerItemRenamedEventHandler { + /** + * A method that will handle the ItemRenamed event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemRenamedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemRenamedEventArgs): void; +} +/** + * Provides data for the ItemRenamed event. + */ +interface ASPxClientFileManagerItemRenamedEventArgs extends ASPxClientFileManagerActionEventArgsBase { + /** + * Gets the previous name of the renamed item. + * Value: A string value that specifies the item name. + */ + oldName: string; +} +/** + * A method that will handle the client ItemDeleted event. + */ +interface ASPxClientFileManagerItemDeletedEventHandler { + /** + * A method that will handle the ItemDeleted event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemDeletedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemDeletedEventArgs): void; +} +/** + * Provides data for the ItemDeleted event. + */ +interface ASPxClientFileManagerItemDeletedEventArgs extends ASPxClientFileManagerActionEventArgsBase { +} +/** + * A method that will handle the client ItemsDeleted event. + */ +interface ASPxClientFileManagerItemsDeletedEventHandler { + /** + * A method that will handle the ItemsDeleted event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemsDeletedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemsDeletedEventArgs): void; +} +/** + * Provides data for the ItemsDeleted event. + */ +interface ASPxClientFileManagerItemsDeletedEventArgs extends ASPxClientEventArgs { + /** + * Gets an array of the currently processed items. + * Value: An array of ASPxClientFileManagerItem objects that are items currently being processed. + */ + items: ASPxClientFileManagerItem[]; +} +/** + * A method that will handle the client ItemMoved event. + */ +interface ASPxClientFileManagerItemMovedEventHandler { + /** + * A method that will handle the ItemMoved event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemMovedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemMovedEventArgs): void; +} +/** + * Provides data for the ItemMoved event. + */ +interface ASPxClientFileManagerItemMovedEventArgs extends ASPxClientFileManagerActionEventArgsBase { + /** + * Gets the full name of the folder from which an item is moved. + * Value: A string value that specifies the folder's full name. + */ + oldFolderFullName: string; +} +/** + * A method that will handle the client ItemsMoved event. + */ +interface ASPxClientFileManagerItemsMovedEventHandler { + /** + * A method that will handle the ItemsMoved event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemsMovedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemsMovedEventArgs): void; +} +/** + * Provides data for the ItemsMoved event. + */ +interface ASPxClientFileManagerItemsMovedEventArgs extends ASPxClientEventArgs { + /** + * Gets an array of the currently processed items. + * Value: An array of ASPxClientFileManagerItem objects that are items currently being processed. + */ + items: ASPxClientFileManagerItem[]; + /** + * Gets the full name of the folder from which items are moved. + * Value: A string value that specifies the folder's full name. + */ + oldFolderFullName: string; +} +/** + * A method that will handle the client ItemCopied event. + */ +interface ASPxClientFileManagerItemCopiedEventHandler { + /** + * A method that will handle the ItemCopied event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemCopiedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemCopiedEventArgs): void; +} +/** + * Provides data for the ItemCopied event. + */ +interface ASPxClientFileManagerItemCopiedEventArgs extends ASPxClientFileManagerActionEventArgsBase { + /** + * Gets the full name of the folder from which an item is copied. + * Value: A string value that specifies the folder's full name. + */ + oldFolderFullName: string; +} +/** + * A method that will handle the client ItemsCopied event. + */ +interface ASPxClientFileManagerItemsCopiedEventHandler { + /** + * A method that will handle the ItemsCopied event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemsCopiedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemsCopiedEventArgs): void; +} +/** + * Provides data for the ItemsCopied event. + */ +interface ASPxClientFileManagerItemsCopiedEventArgs extends ASPxClientEventArgs { + /** + * Gets an array of the currently processed items. + * Value: An array of ASPxClientFileManagerItem objects that are items currently being processed. + */ + items: ASPxClientFileManagerItem[]; + /** + * Gets the full name of the folder from which items are copied. + * Value: A string value that specifies the folder's full name. + */ + oldFolderFullName: string; +} +/** + * A method that will handle the client FolderCreated event. + */ +interface ASPxClientFileManagerItemCreatedEventHandler { + /** + * A method that will handle the FolderCreated event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemCreatedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemCreatedEventArgs): void; +} +/** + * Provides data for the FolderCreated event. + */ +interface ASPxClientFileManagerItemCreatedEventArgs extends ASPxClientFileManagerActionEventArgsBase { +} +/** + * A method that will handle the client ErrorOccurred event. + */ +interface ASPxClientFileManagerErrorEventHandler { + /** + * A method that will handle the client ErrorOccurred event. + * @param source An object representing the event's source. + * @param e An ASPxClientFileManagerErrorEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerErrorEventArgs): void; +} +/** + * Provides data for the ErrorOccurred event. + */ +interface ASPxClientFileManagerErrorEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value representing the processed command's name. + */ + commandName: string; + /** + * Gets or sets the error description. + * Value: A string value specifying the error description. + */ + errorText: string; + /** + * Gets or sets a value specifying whether an event error message is sent to the ErrorAlertDisplaying event. + * Value: true to sent an error message; otherwise, false. + */ + showAlert: boolean; + /** + * Gets a specifically generated code that uniquely identifies an error, which occurs while editing an item. + * Value: An integer value that specifies the code uniquely identifying an error. + */ + errorCode: number; +} +/** + * A method that will handle the client ErrorAlertDisplaying event. + */ +interface ASPxClientFileManagerErrorAlertDisplayingEventHandler { + /** + * A method that will handle the ErrorAlertDisplaying event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerErrorAlertDisplayingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerErrorAlertDisplayingEventArgs): void; +} +/** + * Provides data for the ErrorAlertDisplaying event. + */ +interface ASPxClientFileManagerErrorAlertDisplayingEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value that is the processed command's name. + */ + commandName: string; + /** + * Gets or sets the errors description. + * Value: A string that is the errors description. + */ + errorText: string; + /** + * Gets or sets a value specifying whether an alert message is displayed when the event fires. + * Value: true to display an alert message; otherwise, false. + */ + showAlert: boolean; +} +/** + * A method that will handle the client FileUploading event. + */ +interface ASPxClientFileManagerFileUploadingEventHandler { + /** + * A method that will handle the FileUploading event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFileUploadingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFileUploadingEventArgs): void; +} +/** + * Provides data for the FileUploading event. + */ +interface ASPxClientFileManagerFileUploadingEventArgs extends ASPxClientEventArgs { + /** + * Gets the path to the folder where a file is being uploaded. + * Value: A string value specifying the path where a file is being uploaded. + */ + folder: string; + /** + * Gets the name of a file selected for upload. + * Value: A string value that specifies the file name. + */ + fileName: string; + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the client FilesUploading event. + */ +interface ASPxClientFileManagerFilesUploadingEventHandler { + /** + * A method that will handle the FilesUploading event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFilesUploadingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFilesUploadingEventArgs): void; +} +/** + * Provides data for the FilesUploading event. + */ +interface ASPxClientFileManagerFilesUploadingEventArgs extends ASPxClientEventArgs { + /** + * Gets the path to the folder where files are being uploaded. + * Value: A string value specifying the folder path. + */ + folder: string; + /** + * Gets the names of files selected for upload. + * Value: An array of string values that are the file names. + */ + fileNames: string[]; + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the client FileUploaded event. + */ +interface ASPxClientFileManagerFileUploadedEventHandler { + /** + * A method that will handle the FileUploaded event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFileUploadedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFileUploadedEventArgs): void; +} +/** + * Provides data for the FileUploaded event. + */ +interface ASPxClientFileManagerFileUploadedEventArgs extends ASPxClientEventArgs { + /** + * Gets the path to the folder where a file is uploaded. + * Value: A string value specifying the uploaded file path. + */ + folder: string; + /** + * Gets the name of the uploaded file. + * Value: A string value that specifies the file name. + */ + fileName: string; +} +/** + * A method that will handle the client FilesUploaded event. + */ +interface ASPxClientFileManagerFilesUploadedEventHandler { + /** + * A method that will handle the FilesUploaded event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFilesUploadedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFilesUploadedEventArgs): void; +} +/** + * Provides data for the FilesUploaded event. + */ +interface ASPxClientFileManagerFilesUploadedEventArgs extends ASPxClientEventArgs { + /** + * Gets the path to the folder where files are uploaded. + * Value: A string value specifying the uploaded files path. + */ + folder: string; + /** + * Gets an array of uploaded file names. + * Value: An array of string values that are the file names. + */ + fileNames: string[]; +} +/** + * A method that will handle the client FileDownloading event. + */ +interface ASPxClientFileManagerFileDownloadingEventHandler { + /** + * A method that will handle the FileDownloading event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFileDownloadingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFileDownloadingEventArgs): void; +} +/** + * Provides data for the FileDownloading event. + */ +interface ASPxClientFileManagerFileDownloadingEventArgs extends ASPxClientFileManagerFileEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event, should be canceled. + * Value: true, if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the client FocusedItemChanged event. + */ +interface ASPxClientFileManagerFocusedItemChangedEventHandler { + /** + * A method that will handle the FocusedItemChanged event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFocusedItemChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFocusedItemChangedEventArgs): void; +} +/** + * Provides data for the FocusedItemChanged event. + */ +interface ASPxClientFileManagerFocusedItemChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the file manager item object related to the event. + * Value: An object, manipulations on which forced the event to be raised. + */ + item: ASPxClientFileManagerItem; + /** + * Gets the name of the focused item. + * Value: A string value that specifies the item's name. + */ + name: string; + /** + * Gets the full name of the item currently being processed. + * Value: A string value that is the item's full name. + */ + fullName: string; +} +/** + * A method that will handle the client CurrentFolderChanged event. + */ +interface ASPxClientFileManagerCurrentFolderChangedEventHandler { + /** + * A method that will handle the CurrentFolderChanged event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerCurrentFolderChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerCurrentFolderChangedEventArgs): void; +} +/** + * Provides data for the CurrentFolderChanged event. + */ +interface ASPxClientFileManagerCurrentFolderChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the currently processed folder. + * Value: A string value that specifies the folder's name. + */ + name: string; + /** + * Gets the full name of the folder currently being processed. + * Value: A string value that is the folder's full name. + */ + fullName: string; +} +/** + * A method that will handle the client SelectionChanged event. + */ +interface ASPxClientFileManagerSelectionChangedEventHandler { + /** + * A method that will handle the SelectionChanged event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerSelectionChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerSelectionChangedEventArgs): void; +} +/** + * Provides data for the SelectionChanged event. + */ +interface ASPxClientFileManagerSelectionChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the file manager item object related to the event. + * Value: An object, manipulations on which forced the event to be raised. + */ + item: ASPxClientFileManagerItem; + /** + * Gets the name of the currently processed file. + * Value: A string value that specifies the file's name. + */ + name: string; + /** + * Gets the full name of the file currently being processed. + * Value: A string value that is the file's full name. + */ + fullName: string; + /** + * Gets whether the item has been selected. + * Value: true if the file has been selected; otherwise, false. + */ + isSelected: boolean; +} +/** + * A method that will handle the CustomCommand event. + */ +interface ASPxClientFileManagerCustomCommandEventHandler { + /** + * A method that will handle the CustomCommand event. + * @param source The event source. + * @param e An ASPxClientFileManagerCustomCommandEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerCustomCommandEventArgs): void; +} +/** + * Provides data for the CustomCommand event. + */ +interface ASPxClientFileManagerCustomCommandEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value that is the processed command's name. + */ + commandName: string; +} +/** + * A method that will handle the ToolbarUpdating event. + */ +interface ASPxClientFileManagerToolbarUpdatingEventHandler { + /** + * A method that will handle the ToolbarUpdating event. + * @param source The event source. + * @param e An ASPxClientFileManagerToolbarUpdatingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerToolbarUpdatingEventArgs): void; +} +/** + * Provides data for the ToolbarUpdating event. + */ +interface ASPxClientFileManagerToolbarUpdatingEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the currently active file manager area. + * Value: A string value that identifies the active area. + */ + activeAreaName: string; +} +/** + * A method that will handle the client HighlightItemTemplate event. + */ +interface ASPxClientFileManagerHighlightItemTemplateEventHandler { + /** + * A method that will handle the HighlightItemTemplate event. + * @param source The event source. This parameter identifies the file manager object that raised the event. + * @param e An ASPxClientFileManagerHighlightItemTemplateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerHighlightItemTemplateEventArgs): void; +} +/** + * Provides data for the HighlightItemTemplate event. + */ +interface ASPxClientFileManagerHighlightItemTemplateEventArgs extends ASPxClientEventArgs { + /** + * Gets a string that is a filter value specified by the filter box. + * Value: A string that is a filter value. + */ + filterValue: string; + /** + * Gets the name of the item currently being processed. + * Value: A string that is the item name. + */ + itemName: string; + /** + * Gets an element containing the item template. + * Value: An object that is an element containing the item template. + */ + templateElement: string; + /** + * Get the name of the cascading style sheet (CSS) class associated with an item in the highlighted state. + * Value: A string that is the name of a CSS class. + */ + highlightCssClassName: string; +} +/** + * Represents a client-side equivalent of the menu's MenuItem object. + */ +interface ASPxClientMenuItem { + /** + * Gets the menu object to which the current item belongs. + * Value: An ASPxClientMenuBase object representing the menu to which the item belongs. + */ + menu: ASPxClientMenuBase; + /** + * Gets the immediate parent item to which the current item belongs. + * Value: An ASPxClientMenuItem object representing the item's immediate parent. + */ + parent: ASPxClientMenuItem; + /** + * Gets the item's index within the parent's collection of items. + * Value: An integer value representing the item's zero-based index within the Items collection of the parent object (a menu or item) to which the item belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the menu item. + * Value: A string value that represents the value assigned to the item's Name property. + */ + name: string; + /** + * For internal use only. + */ + indexPath: string; + /** + * Returns the number of the current menu item's immediate child items. + */ + GetItemCount(): number; + /** + * Returns the current menu item's immediate subitem specified by its index. + * @param index An integer value specifying the zero-based index of the submenu item to be retrieved. + */ + GetItem(index: number): ASPxClientMenuItem; + /** + * Returns the current menu item's subitem specified by its name. + * @param name A string value specifying the name of the menu item. + */ + GetItemByName(name: string): ASPxClientMenuItem; + /** + * Indicates whether the menu item is checked. + */ + GetChecked(): boolean; + /** + * Specifies whether the menu item is checked. + * @param value true if the menu item is checked; otherwise, false. + */ + SetChecked(value: boolean): void; + /** + * Returns a value specifying whether a menu item is enabled. + */ + GetEnabled(): boolean; + /** + * Specifies whether the menu item is enabled. + * @param value true to enable the menu item; otherwise, false. + */ + SetEnabled(value: boolean): void; + /** + * Returns the URL pointing to the image displayed within the menu item. + */ + GetImageUrl(): string; + /** + * Sets the URL which points to the image displayed within the menu item. + * @param value A string value specifying the URL to the image displayed within the menu item. + */ + SetImageUrl(value: string): void; + /** + * Gets a URL which defines the navigation location for the menu item. + */ + GetNavigateUrl(): string; + /** + * Specifies a URL which defines the navigation location for the menu item. + * @param value A string value which specifies a URL to where the client web browser will navigate when the menu item is clicked. + */ + SetNavigateUrl(value: string): void; + /** + * Returns text displayed within the menu item. + */ + GetText(): string; + /** + * Sets the text to be displayed within the menu item. + * @param value A string value specifying the text to be displayed within the menu item. + */ + SetText(value: string): void; + /** + * Returns a value specifying whether a menu item is displayed. + */ + GetVisible(): boolean; + /** + * Specifies the menu item's visibility. + * @param value true if the menu item is visible; otherwise, false. + */ + SetVisible(value: boolean): void; +} +/** + * A client-side equivalent of the file manager's FileManagerToolbarItemBase object. + */ +interface ASPxClientFileManagerToolbarItem extends ASPxClientMenuItem { + /** + * This property is not in effect for the ASPxClientFileManagerToolbarItem class. + */ + menu: ASPxClientMenuBase; + /** + * This property is not in effect for the ASPxClientFileManagerToolbarItem class. + */ + parent: ASPxClientMenuItem; + /** + * This property is not in effect for the ASPxClientFileManagerToolbarItem class. + */ + index: number; +} +/** + * A client-side equivalent of the ASPxFormLayout's LayoutItem object. + */ +interface ASPxClientLayoutItem { + /** + * Gets the form layout object to which the current item belongs. + * Value: An object representing the form layout to which the item belongs. + */ + formLayout: ASPxClientFormLayout; + /** + * Gets the name that uniquely identifies the layout item. + * Value: A string value that represents the value assigned to the layout item's Name property. + */ + name: string; + /** + * Gets the immediate parent layout item to which the current layout item belongs. + * Value: An object representing the item's immediate parent. + */ + parent: ASPxClientLayoutItem; + /** + * Returns the current layout item's subitem specified by its name. + * @param name A string value specifying the name of the layout item. + */ + GetItemByName(name: string): ASPxClientLayoutItem; + /** + * Returns a value specifying whether a layout item is displayed. + */ + GetVisible(): boolean; + /** + * Specifies the layout item's visibility. + * @param value true, if the layout item is visible; otherwise, false. + */ + SetVisible(value: boolean): void; + /** + * Specifies the text displayed in the layout item caption. + * @param caption A string value specifying the item caption. + */ + SetCaption(caption: string): void; + /** + * Returns the text displayed in the layout item caption. + */ + GetCaption(): string; +} +/** + * Represents a client-side equivalent of the ASPxFormLayout object. + */ +interface ASPxClientFormLayout extends ASPxClientControl { + /** + * Returns an item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): ASPxClientLayoutItem; +} +/** + * Represents a client-side equivalent of the ASPxGlobalEvents component. + */ +interface ASPxClientGlobalEvents { + /** + * Occurs on the client side after client object models of all DevExpress web controls contained within the page have been initialized. + */ + ControlsInitialized: ASPxClientEvent>; + /** + * Occurs when the browser window is being resized. + */ + BrowserWindowResized: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated by any DevExpress control. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side, after server-side processing of a callback initiated by any DevExpress web control, has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by any of DevExpress web controls. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side after the validation initiated for a DevExpress web control (or a group of DevExpress web controls) has been completed. + */ + ValidationCompleted: ASPxClientEvent>; +} +/** + * Represents a client-side equivalent of the ASPxHiddenField control. + */ +interface ASPxClientHiddenField extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientHiddenField. + */ + CallbackError: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Adds a new value to the control's collection of property name/value pairs, on the client side. + * @param propertyName A string value that specifies the property name. It can contain letters, digits, underline characters, and dollar signs. It cannot begin with a digit character. + * @param propertyValue An object that represents the value of the specified property. + */ + Add(propertyName: string, propertyValue: Object): void; + /** + * Returns the value with the specified property name. + * @param propertyName A string value that specifies the property name. + */ + Get(propertyName: string): Object; + /** + * Adds a new value to the control's collection of property name/value pairs, on the client side. + * @param propertyName A string value that specifies the property name. It can contain letters, digits, underline characters, and dollar signs. It cannot begin with a digit character. + * @param propertyValue An object that represents the property value. + */ + Set(propertyName: string, propertyValue: Object): void; + /** + * Removes the specified value from the ASPxHiddenField collection. + * @param propertyName A string value representing the property name. + */ + Remove(propertyName: string): void; + /** + * Clears the ASPxHiddenField's value collection. + */ + Clear(): void; + /** + * Returns a value indicating whether the value with the specified property name is contained within the ASPxHiddenField control's value collection. + * @param propertyName A string value that specifies the property name. + */ + Contains(propertyName: string): boolean; +} +/** + * Represents the client-side equivalent of the ASPxHint control. + */ +interface ASPxClientHint extends ASPxClientControl { + /** + * Occurs on the client side when a hint is about to be shown. + */ + Showing: ASPxClientEvent; + /** + * Occurs on the client side when a hint is about to be hidden. + */ + Hiding: ASPxClientEvent; + /** + * This method is not in effect for a ASPxClientHint object. + */ + GetMainElement(): Object; + /** + * Invokes a hint. + * @param targetElement A HTML DOM element near to which the hint is displayed in response to user interaction. + */ + Show(targetElement: Object): ASPxClientHintWindow; + /** + * Invokes a hint. + * @param targetSelector A string value that is the CSS selector used to specify for which UI elements on a web page a hint is displayed. + */ + Show(targetSelector: string): ASPxClientHintWindow; +} +/** + * Represents the client-side equivalent of the ASPxHint's window. + */ +interface ASPxClientHintWindow { + /** + * Forces the ASPxClientHint's window to recalculate its position. + */ + UpdatePosition(): void; +} +/** + * A method that will handle the Showing event. + */ +interface ASPxClientHintShowingEventHandler { + /** + * A method that will handle the Showing event. + * @param sender The event source. + * @param e A ASPxClientHintShowingEventArgs object that contains the required data. + */ + (sender: ASPxClientHintWindow, e: ASPxClientHintShowingEventArgs): void; +} +/** + * Provides data for the Showing event. + */ +interface ASPxClientHintShowingEventArgs extends ASPxClientEventArgs { + /** + * Gets the object that is the hint's target element. + * Value: An object representing the hint's target element related to the event. + */ + targetElement: Object; + /** + * Gets the object that is the hint. + * Value: An object representing the hint related to the event. + */ + hintElement: Object; + /** + * Gets the object that is the hint's content. + * Value: An object representing the hint's content element related to the event. + */ + contentElement: Object; + /** + * Gets the object that is the hint's title. + * Value: An object representing the hint's title element related to the event. + */ + titleElement: Object; + /** + * Gets or sets a value indicating whether the event should be canceled. + * Value: true, if the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the Hiding event. + */ +interface ASPxClientHintHidingEventHandler { + /** + * A method that will handle the Hiding event. + * @param sender The event source. + * @param e A ASPxClientHintHidingEventArgs object that contains the required data. + */ + (sender: ASPxClientHintWindow, e: ASPxClientHintHidingEventArgs): void; +} +/** + * Provides data for the Hiding event. + */ +interface ASPxClientHintHidingEventArgs extends ASPxClientEventArgs { + /** + * Gets the object that is the hint's target element. + * Value: An object representing the hint's target element. + */ + targetElement: Object; + /** + * Gets the object that is the hint element. + * Value: An object representing the hint related to the event. + */ + hintElement: Object; + /** + * Gets the object that is the hint's content. + * Value: An object representing the hint's content element related to the event. + */ + contentElement: Object; + /** + * Gets the object that is the hint's title. + * Value: An object representing the hint's title element related to the event. + */ + titleElement: Object; + /** + * Gets or sets a value indicating whether the event should be canceled. + * Value: true, if the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * The hint control's options. + */ +interface ASPxClientHintOptions { + /** + * Gets or sets which user action triggers a hint. + * Value: A string value that is a user action. + */ + triggerAction: string; + /** + * Gets or sets the delay in displaying the hint. + * Value: An integer value that specifies the time interval, in milliseconds, after which a hint is displayed. + */ + appearAfter: number; + /** + * Gets or sets the duration after which a hint disappears when the mouse pointer is no longer positioned over the target element. + * Value: The length of time (in milliseconds) a hint is displayed after the mouse pointer is no longer positioned over the target element. + */ + disappearAfter: number; + /** + * Gets or sets a value that specifies whether a hint is displayed in a callout box. + * Value: true, to display a hint in a callout box; otherwise, false. + */ + showCallout: boolean; + /** + * Gets or sets where a hint should be positioned. + * Value: A string value that specifies a hint position. + */ + position: string; + /** + * Gets or sets a custom CSS class name that will be assigned to the root ASPxHint element. + * Value: A string value that is the CSS class name. + */ + className: string; + /** + * Gets or sets the attribute name. + * Value: A string value that is the attribute name. + */ + contentAttribute: string; + /** + * Gets or sets the attribute name. + * Value: A string value that is the attribute name. + */ + titleAttribute: string; + /** + * Gets or sets the hint's content. + * Value: A string value that is the hint's content. + */ + content: string; + /** + * Gets or sets a value that is the hint's title. + * Value: A string value that is the title text. + */ + title: string; + /** + * Gets or sets a value that is the HTML DOM-element. + * Value: A string that is the DOM-element. + */ + container: string; + /** + * A handler for the Showing event. + * Value: An delegate method allowing you to implement custom processing. + */ + onShowing: ASPxClientHintShowingEventHandler; + /** + * A handler for the Hiding event. + * Value: An delegate method allowing you to implement custom processing. + */ + onHiding: ASPxClientHintHidingEventHandler; + /** + * Gets or sets a value that is the hint's width. + * Value: A string value that is the hint's width. + */ + width: string; + /** + * Gets or sets a value that is the hint's height. + * Value: A string value that is the hint's height. + */ + height: string; + /** + * Gets or sets the X coordinate. + * Value: An integer value that is the X coordinate. + */ + x: number; + /** + * Gets or sets the Y coordinate. + * Value: An integer value that is the Y coordinate. + */ + y: number; + /** + * Gets or sets a value that specifies whether to flip the hint to the opposite position relative to the target element. + * Value: true, to flip the hint; otherwise, false. + */ + allowFlip: boolean; + /** + * Gets or sets a value that specifies whether to shift a hint if its content and title are hidden outside of the client area. + * Value: true, to shift the hint; otherwise, false. + */ + allowShift: boolean; + /** + * Gets or sets whether it should use animation effects when a hint appears. + * Value: true if animation is enabled; otherwise false. + */ + animation: any; + /** + * Gets the offset of a hint. + * Value: An integer value. + */ + offset: number; +} +/** + * The client-side equivalent of the ASPxImageGallery control. + */ +interface ASPxClientImageGallery extends ASPxClientDataView { + /** + * Fires on the client side before the fullscreen viewer is shown and allows you to cancel the action. + */ + FullscreenViewerShowing: ASPxClientEvent>; + /** + * Occurs on the client side after an active item has been changed within the fullscreen viewer. + */ + FullscreenViewerActiveItemIndexChanged: ASPxClientEvent>; + /** + * Shows the fullscreen viewer with the specified active item. + * @param index An Int32 value that is an index of the active item. + */ + ShowFullscreenViewer(index: number): void; + /** + * Hides the fullscreen viewer. + */ + HideFullscreenViewer(): void; + /** + * Makes the specified item active within the fullscreen viewer on the client side. + * @param index An integer value specifying the index of the item to select. + * @param preventAnimation true to prevent the animation effect; false to change images using animation. + */ + SetFullscreenViewerActiveItemIndex(index: number, preventAnimation: boolean): void; + /** + * Gets the number of items contained in the control's item collection. + */ + GetFullscreenViewerItemCount(): number; + /** + * Returns the index of the active item within the fullscreen viewer. + */ + GetFullscreenViewerActiveItemIndex(): number; + /** + * Plays a slide show within a fullscreen viewer. + */ + PlaySlideShow(): void; + /** + * Pauses a slide show within a fullscreen viewer. + */ + PauseSlideShow(): void; +} +/** + * A method that will handle the client FullscreenViewerShowing event. + */ +interface ASPxClientImageGalleryCancelEventHandler { + /** + * A method that will handle the FullscreenViewerShowing event. + * @param source The event source. Identifies the ASPxImageGallery control that raised the event. + * @param e An ASPxClientImageGalleryCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientImageGalleryCancelEventArgs): void; +} +/** + * Provides data for the FullscreenViewerShowing event. + */ +interface ASPxClientImageGalleryCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the index of the item related to the event. + * Value: An value that is the related item's index. + */ + index: number; + /** + * Gets the unique identifier name of the item related to the event. + * Value: A string value that specifies the item's unique identifier name. + */ + name: string; +} +/** + * A method that will handle the client FullscreenViewerActiveItemIndexChanged event. + */ +interface ASPxClientImageGalleryFullscreenViewerEventHandler { + /** + * A method that will handle the FullscreenViewerActiveItemIndexChanged event. + * @param source The event source. Identifies the ASPxImageGallery control that raised the event. + * @param e An ASPxClientImageGalleryFullscreenViewerEventArgs object that contains event data. + */ + (source: S, e: ASPxClientImageGalleryFullscreenViewerEventArgs): void; +} +/** + * Provides data for the FullscreenViewerActiveItemIndexChanged event. + */ +interface ASPxClientImageGalleryFullscreenViewerEventArgs extends ASPxClientEventArgs { + /** + * Gets the index of the item related to the event. + * Value: An value that is the related item's index. + */ + index: number; + /** + * Gets the unique identifier name of the item related to the event. + * Value: A string value that specifies the item's unique identifier name. + */ + name: string; +} +/** + * A client-side equivalent of the ASPxImageSlider object. + */ +interface ASPxClientImageSlider extends ASPxClientControl { + /** + * Occurs after the active image, displayed within the image area, is changed. + */ + ActiveItemChanged: ASPxClientEvent>; + /** + * Fires after an image item has been clicked within the image area. + */ + ItemClick: ASPxClientEvent>; + /** + * Occurs on the client side when a thumbnail is clicked. + */ + ThumbnailItemClick: ASPxClientEvent>; + /** + * Returns an item specified by its index within the image slider's item collection. + * @param index An integer value specifying the zero-based index of the item to be retrieved. + */ + GetItem(index: number): ASPxClientImageSliderItem; + /** + * Returns an item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): ASPxClientImageSliderItem; + /** + * Returns the index of the active item within the image slider control. + */ + GetActiveItemIndex(): number; + /** + * Makes the specified item active within the image slider control on the client side. + * @param index An integer value specifying the index of the item to select. + * @param preventAnimation true to prevent the animation effect; false to change images using animation. + */ + SetActiveItemIndex(index: number, preventAnimation: boolean): void; + /** + * Returns the active item within the ASPxImageSlider control. + */ + GetActiveItem(): ASPxClientImageSliderItem; + /** + * Makes the specified item active within the image slider control on the client side. + * @param item An ASPxClientImageSliderItem object specifying the item to select. + * @param preventAnimation true to prevent animation effect; false to enable animation. + */ + SetActiveItem(item: ASPxClientImageSliderItem, preventAnimation: boolean): void; + /** + * Gets the number of items contained in the control's item collection. + */ + GetItemCount(): number; + /** + * Sets input focus to the ASPxImageSlider control. + */ + Focus(): void; + /** + * Plays a slide show within an image slider. + */ + Play(): void; + /** + * Pauses a slide show within image slider. + */ + Pause(): void; + /** + * Gets a value indicating whether the slide show is playing. + */ + IsSlideShowPlaying(): boolean; +} +/** + * A method that will handle the ItemClick events. + */ +interface ASPxClientImageSliderItemEventHandler { + /** + * A method that will handle the ItemClick events. + * @param source The event source. Identifies the ASPxImageSlider control that raised the event. + * @param e An ASPxClientImageSliderItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientImageSliderItemEventArgs): void; +} +/** + * Provides data for the ItemClick events. + */ +interface ASPxClientImageSliderItemEventArgs extends ASPxClientEventArgs { + /** + * Gets an item object related to the event. + * Value: An object, manipulations on which forced the event to be raised. + */ + item: ASPxClientImageSliderItem; +} +/** + * A client-side equivalent of the image slider's ImageSliderItem object. + */ +interface ASPxClientImageSliderItem { + /** + * Gets an image slider to which the current item belongs. + * Value: An object that is the item's owner. + */ + imageSlider: ASPxClientImageSlider; + /** + * Gets the item's index within an items collection. + * Value: An integer value is the item's zero-based index within the Items collection. + */ + index: number; + /** + * Gets the name that uniquely identifies the image slider item. + * Value: A string value that is the value assigned to the item's Name property. + */ + name: string; + /** + * Gets or sets the path to the image displayed within the ASPxClientImageSliderItem. + * Value: A value specifying the path to the image. + */ + imageUrl: string; + /** + * Gets the item's display text. + * Value: A string value that is the item's display text. + */ + text: string; +} +/** + * The client-side equivalent of the ASPxImageZoomNavigator object. + */ +interface ASPxClientImageZoomNavigator extends ASPxClientImageSlider { +} +/** + * A client-side equivalent of the ASPxImageZoom object. + */ +interface ASPxClientImageZoom extends ASPxClientControl { + /** + * Sets the properties on an image displayed in the image zoom control. + * @param imageUrl A string value specifying the path to the preview image displayed in the preview image. + * @param largeImageUrl A string value specifying the path to the preview image displayed in the zoom window and the expand window. + * @param zoomWindowText A string value specifying the text displayed in the zoom window. + * @param expandWindowText A string value specifying the text displayed in the expand window. + * @param alternateText A string value that specifies the alternate text displayed instead of the image. + */ + SetImageProperties(imageUrl: string, largeImageUrl: string, zoomWindowText: string, expandWindowText: string, alternateText: string): void; +} +/** + * Represents a client-side equivalent of the ASPxLoadingPanel control. + */ +interface ASPxClientLoadingPanel extends ASPxClientControl { + /** + * Invokes the loading panel. + */ + Show(): void; + /** + * Invokes the loading panel, displaying it over the specified HTML element. + * @param htmlElement An object that specifies the required HTML element. + */ + ShowInElement(htmlElement: Object): void; + /** + * Invokes the loading panel, displaying it over the specified element. + * @param id A string that specifies the required element's identifier. + */ + ShowInElementByID(id: string): void; + /** + * Invokes the loading panel at the specified position. + * @param x An integer value specifying the x-coordinate of the loading panel's display position. + * @param y An integer value specifying the y-coordinate of the loaidng panel's display position. + */ + ShowAtPos(x: number, y: number): void; + /** + * Sets the text to be displayed within the ASPxLoadingPanel. + * @param text A string value specifying the text to be displayed within the ASPxLoadingPanel. + */ + SetText(text: string): void; + /** + * Gets the text displayed within the ASPxLoadingPanel. + */ + GetText(): string; + /** + * Hides the loading panel. + */ + Hide(): void; +} +/** + * Represents the client-side equivalent of the area that is used within the Html Editor's media dialogs. + */ +interface ASPxClientMediaFileSelector extends ASPxClientControl { + /** + * Returns a URL text from the URL text box in Html Editor's media dialogs. + */ + GetUrl(): string; + /** + * Sets a URL text in the Html Editor's media dialogs. + * @param url A string value that is the Url text. + */ + SetUrl(url: string): void; +} +/** + * Serves as the base type for the ASPxClientPopupMenu objects. + */ +interface ASPxClientMenuBase extends ASPxClientControl { + /** + * Fires after a menu item has been clicked. + */ + ItemClick: ASPxClientEvent>; + /** + * Occurs on the client side when the mouse cursor is moved into a menu item. + */ + ItemMouseOver: ASPxClientEvent>; + /** + * Occurs on the client side when the mouse cursor moves outside a menu item. + */ + ItemMouseOut: ASPxClientEvent>; + /** + * Occurs on the client side when a submenu pops up. + */ + PopUp: ASPxClientEvent>; + /** + * Occurs on the client side when a submenu closes. + */ + CloseUp: ASPxClientEvent>; + /** + * Returns the number of menu items at the root menu level. + */ + GetItemCount(): number; + /** + * Returns the menu's root menu item specified by its index. + * @param index An integer value specifying the zero-based index of the root menu item to be retrieved. + */ + GetItem(index: number): ASPxClientMenuItem; + /** + * Returns a menu item specified by its name. + * @param name A string value specifying the name of the menu item. + */ + GetItemByName(name: string): ASPxClientMenuItem; + /** + * Returns the selected item within the menu control. + */ + GetSelectedItem(): ASPxClientMenuItem; + /** + * Selects the specified menu item within a menu control on the client side. + * @param item An ASPxClientMenuItem object specifying the menu item to select. + */ + SetSelectedItem(item: ASPxClientMenuItem): void; + /** + * Returns a root menu item. + */ + GetRootItem(): ASPxClientMenuItem; +} +/** + * Represents a client collection that maintains client menu objects. + */ +interface ASPxClientMenuCollection extends ASPxClientControlCollection { + /** + * Recalculates the position of visible sub menus. + */ + RecalculateAll(): void; + /** + * Hides all menus maitained by the collection. + */ + HideAll(): void; +} +/** + * Represents a client-side equivalent of the ASPxMenu object. + */ +interface ASPxClientMenu extends ASPxClientMenuBase { + /** + * Gets a value specifying the menu orientation. + */ + GetOrientation(): string; + /** + * Sets the menu orientation. + * @param orientation 'Vertical' to orient the menu vertically; 'Horizontal' to orient the menu horizontally. + */ + SetOrientation(orientation: string): void; +} +/** + * A method that will handle the menu's client events concerning manipulations with an item. + */ +interface ASPxClientMenuItemEventHandler { + /** + * A method that will handle the menu's client events concerning manipulations with an item. + * @param source The event source. This parameter identifies the menu object which raised the event. + * @param e An ASPxClientMenuItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientMenuItemEventArgs): void; +} +/** + * Provides data for events which concern manipulations on menu items. + */ +interface ASPxClientMenuItemEventArgs extends ASPxClientEventArgs { + /** + * Gets the menu item object related to the event. + * Value: An ASPxClientMenuItem object, manipulations on which forced the event to be raised. + */ + item: ASPxClientMenuItem; +} +/** + * A method that will handle client events which relate to mouse hovering (such as entering or leaving) over menu items. + */ +interface ASPxClientMenuItemMouseEventHandler { + /** + * A method that will handle the ItemMouseOver events. + * @param source An object representing the event source. + * @param e A MenuItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientMenuItemMouseEventArgs): void; +} +/** + * Provides data for client events which relate to mouse hovering (such as entering or leaving) over menu items. + */ +interface ASPxClientMenuItemMouseEventArgs extends ASPxClientMenuItemEventArgs { + /** + * Gets the HTML object that contains the processed item. + * Value: An HTML object representing a container for the item related to the event. + */ + htmlElement: Object; +} +/** + * A method that will handle client events concerning clicks on the control's items. + */ +interface ASPxClientMenuItemClickEventHandler { + /** + * A method that will handle client ItemClick events. + * @param source An object representing the event source. + * @param e A MenuItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientMenuItemClickEventArgs): void; +} +/** + * Provides data for events which concern clicking on the control's items. + */ +interface ASPxClientMenuItemClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the menu item object related to the event. + * Value: An ASPxClientMenuItem object, manipulations on which forced the event to be raised. + */ + item: ASPxClientMenuItem; + /** + * Gets the HTML object that contains the processed item. + * Value: An object representing a container for the item related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Contains options affecting the touch scrolling functionality. + */ +interface ASPxClientTouchUIOptions { + /** + * Gets or sets a value that specifies whether or not the horizontal scroll bar should be displayed. + * Value: true to display the horizontal scroll bar; otherwise, false. The default value is true. + */ + showHorizontalScrollbar: boolean; + /** + * Gets or sets a value that specifies whether or not the vertical scroll bar should be displayed. + * Value: true to display the vertical scroll bar; otherwise, false. The default value is true. + */ + showVerticalScrollbar: boolean; + /** + * Gets or sets the name of the CSS class defining the vertical scroll bar's appearance. + * Value: A string value specifying the class name. + */ + vScrollClassName: string; + /** + * Gets or sets the name of the CSS class defining the horizontal scroll bar's appearance. + * Value: A string value specifying the class name. + */ + hScrollClassName: string; +} +/** + * Contains a method allowing you to apply the current scroll extender to a specific element. + */ +interface ScrollExtender { + /** + * Applies the current scroll extender to the element specified by the ID. + * @param id A string value specifying the element's ID. + */ + ChangeElement(id: string): void; + /** + * Applies the current scroll extender to the specified DOM element. + * @param element An object specifying the required DOM element. + */ + ChangeElement(element: Object): void; +} +/** + * Represents a client-side equivalent of the ASPxNavBar control. + */ +interface ASPxClientNavBar extends ASPxClientControl { + /** + * Fires after an item has been clicked. + */ + ItemClick: ASPxClientEvent>; + /** + * Fires on the client side after a group's expansion state has been changed. + */ + ExpandedChanged: ASPxClientEvent>; + /** + * Fires on the client side before the expansion state of a group is changed. + */ + ExpandedChanging: ASPxClientEvent>; + /** + * Fires when a group header is clicked. + */ + HeaderClick: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientNavBar. + */ + CallbackError: ASPxClientEvent>; + /** + * Returns the number of groups in the navbar. + */ + GetGroupCount(): number; + /** + * Returns a group specified by its index. + * @param index An integer value specifying the zero-based index of the group object to retrieve. + */ + GetGroup(index: number): ASPxClientNavBarGroup; + /** + * Returns a group specified by its name. + * @param name A string value specifying the name of the group. + */ + GetGroupByName(name: string): ASPxClientNavBarGroup; + /** + * Returns the navbar's active group. + */ + GetActiveGroup(): ASPxClientNavBarGroup; + /** + * Makes the specified group active. + * @param group A ASPxClientNavBarGroup object that specifies the active group. + */ + SetActiveGroup(group: ASPxClientNavBarGroup): void; + /** + * Returns an item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): ASPxClientNavBarItem; + /** + * Returns the selected item within the navbar control. + */ + GetSelectedItem(): ASPxClientNavBarItem; + /** + * Selects the specified item within the navbar control on the client side. + * @param item An ASPxClientNavBarItem object specifying the item to select. + */ + SetSelectedItem(item: ASPxClientNavBarItem): void; + /** + * Collapses all groups of the navbar. + */ + CollapseAll(): void; + /** + * Expands all groups of the navbar. + */ + ExpandAll(): void; +} +/** + * Represents a client-side equivalent of the navbar's NavBarGroup object. + */ +interface ASPxClientNavBarGroup { + /** + * Gets the navbar to which the current group belongs. + * Value: An ASPxClientNavBar object representing the navbar to which the group belongs. + */ + navBar: ASPxClientNavBar; + /** + * Gets the group's index within a collection of a navbar's groups. + * Value: An integer value representing the group's zero-based index within the Groups collection of the navbar to which the group belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the group. + * Value: A string value that represents the value assigned to the group's Name property. + */ + name: string; + /** + * Returns a value specifying whether a group is enabled. + */ + GetEnabled(): boolean; + /** + * Returns a value specifying whether the group is expanded. + */ + GetExpanded(): boolean; + /** + * Sets the group's expansion state. + * @param value true to expand the group; false to collapse the group. + */ + SetExpanded(value: boolean): void; + /** + * Returns a value specifying whether a group is displayed. + */ + GetVisible(): boolean; + /** + * Returns text displayed within a group. + */ + GetText(): string; + /** + * Specifies the text displayed within a group. + * @param text A string value that is the text displayed within the navbar group. + */ + SetText(text: string): void; + /** + * Specifies whether the group is visible. + * @param value true if the group is visible; otherwise, false. + */ + SetVisible(value: boolean): void; + /** + * Returns the number of items in the group. + */ + GetItemCount(): number; + /** + * Returns the group's item specified by its index. + * @param index An integer value specifying the zero-based index of the item to be retrieved. + */ + GetItem(index: number): ASPxClientNavBarItem; + /** + * Returns a group item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): ASPxClientNavBarItem; +} +/** + * Represents a client-side equivalent of the navbar's NavBarItem object. + */ +interface ASPxClientNavBarItem { + /** + * Gets the navbar to which the current item belongs. + * Value: An ASPxClientNavBar object representing the navbar to which the item belongs. + */ + navBar: ASPxClientNavBar; + /** + * Gets the group to which the current item belongs. + * Value: An ASPxClientNavBarGroup object representing the group to which the item belongs. + */ + group: ASPxClientNavBarGroup; + /** + * Gets the item's index within a collection of a group's items. + * Value: An integer value representing the item's zero-based index within the Items collection of the group to which the item belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the item. + * Value: A string value that represents the value assigned to the item's Name property. + */ + name: string; + /** + * Returns a value indicating whether an item is enabled. + */ + GetEnabled(): boolean; + /** + * Specifies whether the item is enabled. + * @param value true if the item is enabled; otherwise, false. + */ + SetEnabled(value: boolean): void; + /** + * Returns the URL which points to the image displayed within the item. + */ + GetImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the item. + * @param value A string value that specifies the URL to the image displayed within the item. + */ + SetImageUrl(value: string): void; + /** + * Gets an URL which defines the item's navigation location. + */ + GetNavigateUrl(): string; + /** + * Specifies a URL which defines the item's navigation location. + * @param value A string value which represents the URL to where the client web browser will navigate when the item is clicked. + */ + SetNavigateUrl(value: string): void; + /** + * Returns text displayed within the item. + */ + GetText(): string; + /** + * Specifies the text displayed within the item. + * @param value A string value that represents the text displayed within the item. + */ + SetText(value: string): void; + /** + * Returns a value specifying whether an item is displayed. + */ + GetVisible(): boolean; + /** + * Specifies whether the item is visible. + * @param value true is the item is visible; otherwise, false. + */ + SetVisible(value: boolean): void; +} +/** + * A method that will handle the navbar's client events concerning manipulations with an item. + */ +interface ASPxClientNavBarItemEventHandler { + /** + * A method that will handle the navbar's client events concerning manipulations with an item. + * @param source An object representing the event's source. Identifies the navbar object that raised the event. + * @param e An ASPxClientNavBarItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientNavBarItemEventArgs): void; +} +/** + * Provides data for events which concern manipulations on items. + */ +interface ASPxClientNavBarItemEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the item object related to the event. + * Value: An ASPxClientNavBarItem object, manipulations on which forced the event to be raised. + */ + item: ASPxClientNavBarItem; + /** + * Gets the HTML object that contains the processed navbar item. + * Value: An object representing a container for the navbar item related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle the navbar's client events concerning manipulations with a group. + */ +interface ASPxClientNavBarGroupEventHandler { + /** + * A method that will handle the navbar's client events concerning manipulations with a group. + * @param source An object representing the event's source. Identifies the navbar object that raised the event. + * @param e An ASPxClientNavBarGroupEventArgs object that contains event data. + */ + (source: S, e: ASPxClientNavBarGroupEventArgs): void; +} +/** + * Provides data for events which concern manipulations on groups. + */ +interface ASPxClientNavBarGroupEventArgs extends ASPxClientEventArgs { + /** + * Gets the group object related to the event. + * Value: An ASPxClientNavBarGroup object, manipulations on which forced the event to be raised. + */ + group: ASPxClientNavBarGroup; +} +/** + * A method that will handle the navbar's cancelable client events concerning manipulations with a group. + */ +interface ASPxClientNavBarGroupCancelEventHandler { + /** + * A method that will handle the navbar's cancelable client events concerning manipulations with a group. + * @param source An object representing the event's source. Identifies the navbar object that raised the event. + * @param e An ASPxClientNavBarGroupCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientNavBarGroupCancelEventArgs): void; +} +/** + * Provides data for cancellable events which concern manipulations on groups. + */ +interface ASPxClientNavBarGroupCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the group object related to the event. + * Value: An ASPxClientNavBarGroup object representing the group manipulations on which forced the navbar to raise the event. + */ + group: ASPxClientNavBarGroup; +} +/** + * A method that will handle client events concerning clicks on the control's group headers. + */ +interface ASPxClientNavBarGroupClickEventHandler { + /** + * A method that will handle the navbar's client events concerning clicks on groups. + * @param source The event source. This parameter identifies the navbar object which raised the event. + * @param e An ASPxClientNavBarGroupClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientNavBarGroupClickEventArgs): void; +} +/** + * Provides data for events which concern clicking on the control's group headers. + */ +interface ASPxClientNavBarGroupClickEventArgs extends ASPxClientNavBarGroupCancelEventArgs { + /** + * Gets the HTML object that contains the processed group. + * Value: An object representing a container for the group related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Represents a client-side equivalent of the ASPxNewsControl object. + */ +interface ASPxClientNewsControl extends ASPxClientDataView { + /** + * Fires after an item's tail has been clicked. + */ + TailClick: ASPxClientEvent>; +} +/** + * A method that will handle client events concerning manipulations with an item. + */ +interface ASPxClientNewsControlItemEventHandler { + /** + * A method that will handle the news control's client events concerning manipulations with an item. + * @param source An object representing the event's source. Identifies the news control object that raised the event. + * @param e An ASPxClientNewsControlItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientNewsControlItemEventArgs): void; +} +/** + * Provides data for events which concern tail clicking within the control's items. + */ +interface ASPxClientNewsControlItemEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the name that uniquely identifies the processed item. + * Value: A string value that represents the value assigned to the processed item's Name property. + */ + name: Object; + /** + * Gets the HTML object that contains the processed item. + * Value: An object representing a container for the item related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Represents a client-side equivalent of the ASPxObjectContainer control. + */ +interface ASPxClientObjectContainer extends ASPxClientControl { + /** + * Occurs on the client side when the FSCommand action is called within the associated flash object's action script. + */ + FlashScriptCommand: ASPxClientEvent>; + /** + * Play the Flash movie backwards. + */ + Back(): void; + /** + * Returns the value of the Flash variable specified. + * @param name A string value that specifies the Flash variable. + */ + GetVariable(name: string): string; + /** + * Play the Flash movie forwards. + */ + Forward(): void; + /** + * Activates the specified frame in the Flash movie. + * @param frameNumber An integer value that specifies the requested frame. + */ + GotoFrame(frameNumber: number): void; + /** + * Indicates whether the Flash movie is currently playing. + */ + IsPlaying(): boolean; + /** + * Loads the Flash movie to the specified layer. + * @param layerNumber An integer value that identifies a layer in which to load the movie. + * @param url A string value that specifies the movie's URL. + */ + LoadMovie(layerNumber: number, url: string): void; + /** + * Pans a zoomed-in Flash movie to the specified coordinates. + * @param x An integer value that specifies the X-coordinate. + * @param y An integer value that specifies the Y-coordinate. + * @param mode 0 the coordinates are pixels; 1 the coordinates are a percentage of the window. + */ + Pan(x: number, y: number, mode: number): void; + /** + * Returns the percent of the Flash Player movie that has streamed into the browser so far. + */ + PercentLoaded(): string; + /** + * Starts playing the Flash movie. + */ + Play(): void; + /** + * Rewinds the Flash movie to the first frame. + */ + Rewind(): void; + /** + * Sets the value of the specified Flash variable. + * @param name A string value that specifies the Flash variable. + * @param value A string value that represents a new value. + */ + SetVariable(name: string, value: string): void; + /** + * Zooms in on the specified rectangular area of the Flash movie. + * @param left An integer value that specifies the x-coordinate of the rectangle's left side, in twips. + * @param top An integer value that specifies the y-coordinate of the rectangle's top side, in twips. + * @param right An integer value that specifies the x-coordinate of the rectangle's right side, in twips. + * @param bottom An integer value that specifies the y-coordinate of the rectangle's bottom side, in twips. + */ + SetZoomRect(left: number, top: number, right: number, bottom: number): void; + /** + * Stops playing the Flash movie. + */ + StopPlay(): void; + /** + * Returns the total number of frames in the Flash movie. + */ + TotalFrames(): number; + /** + * Zooms the Flash view by a relative scale factor. + * @param percent An integer value that specifies the relative scale factor, as a percentage. + */ + Zoom(percent: number): void; + /** + * Starts playing a Quick Time movie. + */ + QTPlay(): void; + /** + * Stops playing a Quick Time movie. + */ + QTStopPlay(): void; + /** + * Rewinds a Quick Time movie to the first frame. + */ + QTRewind(): void; + /** + * Steps through a Quick Time video stream by a specified number of frames. + * @param count An integer value that specifies the number of frames to step. + */ + QTStep(count: number): void; +} +/** + * A method that will handle the FlashScriptCommand event. + */ +interface ASPxClientFlashScriptCommandEventHandler { + /** + * A method that will handle the FlashScriptCommand event. + * @param source The event source. + * @param e A ASPxClientFlashScriptCommandEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFlashScriptCommandEventArgs): void; +} +/** + * Provides data for the FlashScriptCommand client event. + */ +interface ASPxClientFlashScriptCommandEventArgs extends ASPxClientEventArgs { + /** + * Gets a command passed via the FSCommand action of the flash object. + * Value: A string that represents the value of the FSCommand action's command parameter. + */ + command: string; + /** + * Gets arguments passed via the FSCommand action of the flash object. + * Value: A string that represents the value of the FSCommand action's args parameter. + */ + args: string; +} +/** + * Lists the available link types within office documents. + */ +interface ASPxClientOfficeDocumentLinkType { +} +/** + * Represents the client-side equivalent of the ASPxPager control. + */ +interface ASPxClientPager extends ASPxClientControl { +} +/** + * Represents a client-side equivalent of the ASPxPopupControl control. + */ +interface ASPxClientPopupControl extends ASPxClientPopupControlBase { + /** + * Occurs when a popup window's close button is clicked. + */ + CloseButtonClick: ASPxClientEvent>; + /** + * This method is not in effect for a ASPxClientPopupControl object. + */ + GetMainElement(): Object; + /** + * Returns an object containing the information about a mouse event that invoked a default popup window. + */ + GetPopUpReasonMouseEvent(): Object; + /** + * Returns an object containing the information about a mouse event that invoked the specified popup window. + * @param window A ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowPopUpReasonMouseEvent(window: ASPxClientPopupWindow): Object; + /** + * + * @param window + * @param parameter + */ + PerformWindowCallback(window: ASPxClientPopupWindow, parameter: string): void; + /** + * Sends a callback with parameters to update the popup window by processing the related popup window and the passed information on the server. + * @param window A ASPxClientPopupWindow object identifying the processed popup window. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformWindowCallback(window: ASPxClientPopupWindow, parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Specifies the default popup window's size. + * @param width An integer value that specifies the default popup window's width. + * @param height An integer value that specifies the default popup window's height. + */ + SetSize(width: number, height: number): void; + /** + * Gets the width of the specified popup window's content region. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowContentWidth(window: ASPxClientPopupWindow): number; + /** + * Gets the height of the specified popup window's content region. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowContentHeight(window: ASPxClientPopupWindow): number; + /** + * Returns the height of a specific popup window. + * @param window A ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowHeight(window: ASPxClientPopupWindow): number; + /** + * Returns the width of a specific popup window. + * @param window A ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowWidth(window: ASPxClientPopupWindow): number; + /** + * Specifies the size of a specific popup window. + * @param window A ASPxClientPopupWindow object that specifies the required popup window. + * @param width An integer value that specifies the required popup window's width. + * @param height An integer value that specifies the required popup window's height. + */ + SetWindowSize(window: ASPxClientPopupWindow, width: number, height: number): void; + /** + * Returns the HTML code that is the content of the popup control's default popup window. + */ + GetContentHTML(): string; + /** + * Defines the HTML content for the popup control's default popup window. + * @param html A string value that is the HTML code defining the content of the popup window. + */ + SetContentHTML(html: string): void; + /** + * Sets the ID of a web control or HTML element (or a list of IDs) with which the current popup control's window is associated. + * @param window An ASPxClientPopupWindow object representing a popup control's window. + * @param popupElementId A string value specifying the ID (or a list of IDs) of the web control or HTML element with which the popup control's window is associated. + */ + SetWindowPopupElementID(window: ASPxClientPopupWindow, popupElementId: string): void; + /** + * Sets the ID of a web control or HTML element (or a list of IDs) with which the current popup control is associated. + * @param popupElementId A string value specifying the ID (or a list of IDs) of the web control or HTML element to which the popup control is associated. + */ + SetPopupElementID(popupElementId: string): void; + /** + * Returns an index of the object that invoked the default window within the PopupElementID list. + */ + GetCurrentPopupElementIndex(): number; + /** + * Returns an index of the object that invoked the specified popup window, within the window's PopupElementID list. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowCurrentPopupElementIndex(window: ASPxClientPopupWindow): number; + /** + * Returns an object that invoked the default window. + */ + GetCurrentPopupElement(): Object; + /** + * Returns an object that invoked the specified popup window. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowCurrentPopupElement(window: ASPxClientPopupWindow): Object; + /** + * Returns a value that specifies whether the popup control's specific window is displayed. + * @param window A ASPxClientPopupWindow object representing the popup window whose visibility is checked. + */ + IsWindowVisible(window: ASPxClientPopupWindow): boolean; + /** + * Returns a popup window specified by its index. + * @param index An integer value specifying the zero-based index of the popup window object to be retrieved. + */ + GetWindow(index: number): ASPxClientPopupWindow; + /** + * Returns a popup window specified by its name. + * @param name A string value specifying the name of the popup window. + */ + GetWindowByName(name: string): ASPxClientPopupWindow; + /** + * Returns the number of popup windows in the popup control. + */ + GetWindowCount(): number; + /** + * Invokes the popup control's specific window. + * @param window A ASPxClientPopupWindow object representing the popup window to display. + */ + ShowWindow(window: ASPxClientPopupWindow): void; + /** + * Invokes the specified popup window at the popup element with the specified index. + * @param window A ASPxClientPopupWindow object that specifies the required popup window. + * @param popupElementIndex An integer value specifying the zero-based index of the popup element within the window's PopupElementID list. + */ + ShowWindow(window: ASPxClientPopupWindow, popupElementIndex: number): void; + /** + * Invokes the popup control's specific window and displays it over the specified HTML element. + * @param window A ASPxClientPopupWindow object representing the popup window to display. + * @param htmlElement An object specifying the HTML element relative to whose position the default popup window is invoked. + */ + ShowWindowAtElement(window: ASPxClientPopupWindow, htmlElement: Object): void; + /** + * Invokes the popup control's specific window and displays it over an HTML element specified by its unique identifier. + * @param window A ASPxClientPopupWindow object representing the popup window to display. + * @param id A string value that specifies the hierarchically qualified identifier of an HTML element relative to whose position the default popup window is invoked. + */ + ShowWindowAtElementByID(window: ASPxClientPopupWindow, id: string): void; + /** + * Invokes the popup control's specific popup window at the specified position. + * @param window A ASPxClientPopupWindow object representing the popup window to display. + * @param x A integer value specifying the x-coordinate of the popup window's display position. + * @param y A integer value specifying the y-coordinate of the popup window's display position. + */ + ShowWindowAtPos(window: ASPxClientPopupWindow, x: number, y: number): void; + /** + * Brings the specified popup window to the front of the z-order. + * @param window A ASPxClientPopupWindow object representing the popup window. + */ + BringWindowToFront(window: ASPxClientPopupWindow): void; + /** + * Closes the popup control's specified window. + * @param window A ASPxClientPopupWindow object representing the popup window to close. + */ + HideWindow(window: ASPxClientPopupWindow): void; + /** + * Returns the HTML code that represents the contents of the specified popup window. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowContentHtml(window: ASPxClientPopupWindow): string; + /** + * Defines the HTML content for a specific popup window within the popup control. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + * @param html A string value that represents the HTML code defining the content of the specified popup window. + */ + SetWindowContentHtml(window: ASPxClientPopupWindow, html: string): void; + /** + * Returns an iframe object containing a web page specified via the specified popup window's SetWindowContentUrl client method). + * @param window A ASPxClientPopupWindow object representing the required popup window. + */ + GetWindowContentIFrame(window: ASPxClientPopupWindow): Object; + /** + * Returns the URL pointing to the web page displayed within the control's specific popup window. + * @param window A ASPxClientPopupWindow object representing the required popup window. + */ + GetWindowContentUrl(window: ASPxClientPopupWindow): string; + /** + * Sets the URL pointing to the web page that should be loaded into and displayed within the control's specific popup window. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param url A string value specifying the URL to the web page to be displayed within the specified popup window. + */ + SetWindowContentUrl(window: ASPxClientPopupWindow, url: string): void; + /** + * Returns a value indicating whether the specified window is pinned. + * @param window An ASPxClientPopupWindow object specifying the popup window. + */ + GetWindowPinned(window: ASPxClientPopupWindow): boolean; + /** + * Sets a value indicating whether the specified window is pinned. + * @param window An ASPxClientPopupWindow object specifying the popup window. + * @param value true to pin the window; otherwise, false. + */ + SetWindowPinned(window: ASPxClientPopupWindow, value: boolean): void; + /** + * Returns a value indicating whether the specified window is maximized. + * @param window An ASPxClientPopupWindow object specifying the popup window. + */ + GetWindowMaximized(window: ASPxClientPopupWindow): boolean; + /** + * Sets a value indicating whether the specified window is maximized. + * @param window An ASPxClientPopupWindow object specifying the popup window. + * @param value true to maximize the window; otherwise, false. + */ + SetWindowMaximized(window: ASPxClientPopupWindow, value: boolean): void; + /** + * Returns a value indicating whether the specified window is collapsed. + * @param window An ASPxClientPopupWindow object specifying the popup window. + */ + GetWindowCollapsed(window: ASPxClientPopupWindow): boolean; + /** + * Sets a value indicating whether the specified window is collapsed. + * @param window An ASPxClientPopupWindow object specifying the popup window. + * @param value true to collapse the window; otherwise, false. + */ + SetWindowCollapsed(window: ASPxClientPopupWindow, value: boolean): void; + /** + * Refreshes the content of the web page displayed within the control's specific popup window. + * @param window A ASPxClientPopupWindow object representing the required popup window. + */ + RefreshWindowContentUrl(window: ASPxClientPopupWindow): void; + /** + * Updates the default popup window's position, to correctly align it at either the specified element, or the center of the browser's window. + */ + UpdatePosition(): void; + /** + * Updates the default popup window's position, to correctly align it at the specified HTML element. + * @param htmlElement An object specifying the HTML element to which the default popup window is aligned using the PopupVerticalAlign properties. + */ + UpdatePositionAtElement(htmlElement: Object): void; + /** + * Updates the specified popup window's position, to correctly align it at either the specified element, or the center of the browser's window. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + UpdateWindowPosition(window: ASPxClientPopupWindow): void; + /** + * Updates the specified popup window's position, to correctly align it at the specified HTML element. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + * @param htmlElement An object specifying the HTML element to which the specified popup window is aligned using the PopupVerticalAlign properties. + */ + UpdateWindowPositionAtElement(window: ASPxClientPopupWindow, htmlElement: Object): void; + /** + * Refreshes the connection between the ASPxPopupControl and the popup element. + */ + RefreshPopupElementConnection(): void; +} +/** + * Represents a client-side equivalent of a popup control's PopupWindow object. + */ +interface ASPxClientPopupWindow { + /** + * Gets the popup control to which the current popup window belongs. + * Value: An ASPxClientPopupControl object representing the popup control to which the window belongs. + */ + popupControl: ASPxClientPopupControl; + /** + * Gets the index of the current popup window within the popup control's Windows collection. + * Value: An integer value representing the zero-based index of the current popup window within the Windows collection of the popup control to which the window belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the current popup window. + * Value: A string value that represents a value assigned to the popup window's Name property. + */ + name: string; + /** + * Returns the URL pointing to the image displayed within the window header. + */ + GetHeaderImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the window header. + * @param value A string value that is the URL to the image displayed within the header. + */ + SetHeaderImageUrl(value: string): void; + /** + * Returns the URL pointing to the image displayed within the window footer. + */ + GetFooterImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the window footer. + * @param value A string value that is the URL to the image displayed within the window footer. + */ + SetFooterImageUrl(value: string): void; + /** + * Returns the URL where the web browser will navigate when the text or image is clicked within the popup window's header. + */ + GetHeaderNavigateUrl(): string; + /** + * Returns the URL where the web browser will navigate when the text or image is clicked within the popup window's header. + * @param value A string value which specifies the required navigation location. + */ + SetHeaderNavigateUrl(value: string): void; + /** + * Returns the URL where the web browser will navigate when the text or image is clicked within the popup window's footer. + */ + GetFooterNavigateUrl(): string; + /** + * Specifies the URL where the web browser will navigate when the text or image is clicked within the popup window's footer. + * @param value A string value which specifies the required navigation location. + */ + SetFooterNavigateUrl(value: string): void; + /** + * Returns the text displayed within the window's header. + */ + GetHeaderText(): string; + /** + * Specifies the text displayed within the window's header. + * @param value A string value that specifies the window's header text. + */ + SetHeaderText(value: string): void; + /** + * Returns the text displayed within the popup window's footer. + */ + GetFooterText(): string; + /** + * Specifies the text displayed within the window's footer. + * @param value A string value that specifies the window's footer text. + */ + SetFooterText(value: string): void; +} +/** + * A method that will handle the popup control's client events invoked in response to manipulating a popup window. + */ +interface ASPxClientPopupWindowEventHandler { + /** + * A method that will handle the popup control's client events when a popup window is manipulated. + * @param source An object representing the event's source. Identifies the popup control object (ASPxClientPopupControl) that raised the event. + * @param e An ASPxClientPopupWindowEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPopupWindowEventArgs): void; +} +/** + * Provides data for events concerning client manipulations on popup windows. + */ +interface ASPxClientPopupWindowEventArgs extends ASPxClientEventArgs { + /** + * Gets the popup window object related to the event. + * Value: An ASPxClientPopupWindow object representing the popup window that was manipulated, causing the popup control to raise the event. + */ + window: ASPxClientPopupWindow; +} +/** + * A method that will handle the popup window's cancellable client events, such as the Closing. + */ +interface ASPxClientPopupWindowCancelEventHandler { + /** + * A method that will handle the popup window's cancelable client events. + * @param source An object representing the event's source. Identifies the popup window object that raised the event. + * @param e An ASPxClientPopupWindowCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPopupWindowCancelEventArgs): void; +} +/** + * Provides data for the popup control's cancellable client events, such as the Closing. + */ +interface ASPxClientPopupWindowCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the popup window object related to the event. + * Value: An ASPxClientPopupWindow object representing the popup window that was manipulated, causing the popup control to raise the event. + */ + window: ASPxClientPopupWindow; + /** + * Gets the value that identifies the reason the popup window is about to close. + * Value: One of the ASPxClientPopupControlCloseReason enumeration values. + */ + closeReason: ASPxClientPopupControlCloseReason; +} +/** + * A method that will handle the CloseUp event. + */ +interface ASPxClientPopupWindowCloseUpEventHandler { + /** + * A method that will handle the CloseUp event. + * @param source The event source. + * @param e An ASPxClientPopupWindowCloseUpEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPopupWindowCloseUpEventArgs): void; +} +/** + * Provides data for the CloseUp event. + */ +interface ASPxClientPopupWindowCloseUpEventArgs extends ASPxClientPopupWindowEventArgs { + /** + * Gets the value that identifies the reason the popup window closes. + * Value: One of the ASPxClientPopupControlCloseReason enumeration values. + */ + closeReason: ASPxClientPopupControlCloseReason; +} +/** + * A method that will handle the Resize event. + */ +interface ASPxClientPopupWindowResizeEventHandler { + /** + * A method that will handle the Resize event. + * @param source The event source. + * @param e A ASPxClientPopupWindowResizeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPopupWindowResizeEventArgs): void; +} +/** + * Provides data for the Resize event. + */ +interface ASPxClientPopupWindowResizeEventArgs extends ASPxClientPopupWindowEventArgs { + /** + * Returns the value indicating the window state after resizing. + * Value: The integer value indicating the window resize state. + */ + resizeState: number; +} +/** + * A method that will handle the PinnedChanged event. + */ +interface ASPxClientPopupWindowPinnedChangedEventHandler { + /** + * A method that will handle the PinnedChanged event. + * @param source The event source. + * @param e A ASPxClientPopupWindowPinnedChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPopupWindowPinnedChangedEventArgs): void; +} +/** + * Provides data for the PinnedChanged event. + */ +interface ASPxClientPopupWindowPinnedChangedEventArgs extends ASPxClientPopupWindowEventArgs { + /** + * Gets a value indicating whether the processed popup window has been pinned. + * Value: true, if the window has been pinned; otherwise, false. + */ + pinned: boolean; +} +/** + * Represents a client collection that maintains client popup control objects. + */ +interface ASPxClientPopupControlCollection extends ASPxClientControlCollection { + /** + * Hides all popup windows maintained by the collection. + */ + HideAllWindows(): void; +} +/** + * Declares client constants that identify the reason the popup window closes. + */ +interface ASPxClientPopupControlCloseReason { +} +/** + * Represents a client-side equivalent of the ASPxPopupMenu object. + */ +interface ASPxClientPopupMenu extends ASPxClientMenuBase { + /** + * Sets the ID of a web control or HTML element (or a list of IDs) with which the current popup menu is associated. + * @param popupElementId A string value specifying the ID (or a list of IDs) of the web control or HTML element with which the popup menu is associated. + */ + SetPopupElementID(popupElementId: string): void; + /** + * Returns an index of the object that invoked the popup menu within the PopupElementID list. + */ + GetCurrentPopupElementIndex(): number; + /** + * Returns an object that invoked the popup menu. + */ + GetCurrentPopupElement(): Object; + /** + * Refreshes the connection between the ASPxPopupMenu and the popup element. + */ + RefreshPopupElementConnection(): void; + /** + * Hides the popup menu. + */ + Hide(): void; + /** + * Invokes the popup menu. + */ + Show(): void; + /** + * Invokes the popup menu at the popup element with the specified index. + * @param popupElementIndex An integer value specifying the zero-based index of the popup element. + */ + Show(popupElementIndex: number): void; + /** + * Invokes the popup menu and displays it over the specified HTML element. + * @param htmlElement An object specifying the HTML element relative to which position the popup menu is invoked. + */ + ShowAtElement(htmlElement: Object): void; + /** + * Invokes the popup menu and displays it over an HTML element specified by its unique identifier. + * @param id A string value that specifies the hierarchically qualified identifier of an HTML element relative to which position the popup menu is invoked. + */ + ShowAtElementByID(id: string): void; + /** + * Invokes the popup menu at the specified position. + * @param x An integer value specifying the x-coordinate of the popup menu's display position. + * @param y An integer value specifying the y-coordinate of the popup menu's display position. + */ + ShowAtPos(x: number, y: number): void; +} +/** + * Represents the client-side equivalent of the ASPxRatingControl control. + */ +interface ASPxClientRatingControl extends ASPxClientControl { + /** + * Fires on the server after an item has been clicked. + */ + ItemClick: ASPxClientEvent>; + /** + * Occurs on the client side when the mouse cursor is moved into a rating control item. + */ + ItemMouseOver: ASPxClientEvent>; + /** + * Occurs on the client side when the mouse cursor moves outside a rating control item. + */ + ItemMouseOut: ASPxClientEvent>; + /** + * Gets the item tooltip title specified by the item index. + * @param index An integer value specifying the item index. + */ + GetTitle(index: number): string; + /** + * Returns a value indicating whether the control's status is read-only. + */ + GetReadOnly(): boolean; + /** + * Specifies whether the control's status is read-only. + * @param value true to make the control read-only; otherwise, false. + */ + SetReadOnly(value: boolean): void; + /** + * Returns the value of the ASPxRatingControl. + */ + GetValue(): number; + /** + * Modifies the value of the ASPxRatingControl on the client side. + * @param value A decimal value representing the value of the control. + */ + SetValue(value: number): void; +} +/** + * A method that will handle the client ItemClick event. + */ +interface ASPxClientRatingControlItemClickEventHandler { + /** + * A method that will handle the client ItemClick event. + * @param source An object representing the event source. + * @param e A ASPxClientRatingControlItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRatingControlItemClickEventArgs): void; +} +/** + * Provides data for the ItemClick event. + */ +interface ASPxClientRatingControlItemClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the index of the item related to the event. + * Value: An integer value that represents the clicked item's index. + */ + index: number; +} +/** + * A method that will handle the rating control's ItemMouseOver and ItemMouseOut client events (such as ItemMouseOut). + */ +interface ASPxClientRatingControlItemMouseEventHandler { + /** + * A method that will handle the ItemMouseOver events. + * @param source The event source. + * @param e An ASPxClientRatingControlItemMouseEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRatingControlItemMouseEventArgs): void; +} +/** + * Provides data for the rating control's ItemMouseOver and ItemMouseOut client events (such as ItemMouseOut). + */ +interface ASPxClientRatingControlItemMouseEventArgs extends ASPxClientEventArgs { + /** + * Gets the index of the item related to the event. + * Value: An integer value that represents the related item's index. + */ + index: number; +} +/** + * Represents the client-side equivalent of the ASPxRibbon control. + */ +interface ASPxClientRibbon extends ASPxClientControl { + /** + * Occurs after an end-user executes an action on a ribbon item. + */ + CommandExecuted: ASPxClientEvent>; + /** + * Fires on the client side after the active tab has been changed within a ribbon control. + */ + ActiveTabChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the ribbon minimization state is changed by end-user actions. + */ + MinimizationStateChanged: ASPxClientEvent>; + /** + * Occurs when the file tab is clicked. + */ + FileTabClicked: ASPxClientEvent>; + /** + * Fires on the client side after a dialog box launcher has been clicked. + */ + DialogBoxLauncherClicked: ASPxClientEvent>; + /** + * Fires after key tips are closed by pressing Esc. + */ + KeyTipsClosedOnEscape: ASPxClientEvent>; + /** + * Specifies whether the ribbon control is enabled. + * @param enabled true to enable the ribbon; false to disable it. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns a value indicating whether the ribbon is enabled. + */ + GetEnabled(): boolean; + /** + * Returns a tab specified by its index. + * @param index An integer value specifying the zero-based index of the tab object to retrieve. + */ + GetTab(index: number): ASPxClientRibbonTab; + /** + * Returns a tab specified by its name. + * @param name A string value specifying the name of the tab. + */ + GetTabByName(name: string): ASPxClientRibbonTab; + /** + * Returns the number of tabs in the ribbon Tabs collection. + */ + GetTabCount(): number; + /** + * Returns the active tab within the ribbon control. + */ + GetActiveTab(): ASPxClientRibbonTab; + /** + * Makes the specified tab active in the ribbon control on the client side. + * @param tab A ASPxClientRibbonTab object specifying the tab selection. + */ + SetActiveTab(tab: ASPxClientRibbonTab): void; + /** + * Makes a tab active within the ribbon control, specifying the tab's index. + * @param index An integer value specifying the index of the tab to select. + */ + SetActiveTabIndex(index: number): void; + /** + * Returns a ribbon item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): ASPxClientRibbonItem; + /** + * Returns a value of item with the specified name. + * @param name A string value specifying the name of the item. + */ + GetItemValueByName(name: string): Object; + /** + * Sets the value of the item with the specified name. + * @param name A string value specifying the name of the item. + * @param value An object that is the new item value. + */ + SetItemValueByName(name: string, value: Object): void; + /** + * Specifies whether the ribbon is minimized. + * @param minimized true to set the ribbon state to minimized; false to set the ribbon state to normal. + */ + SetMinimized(minimized: boolean): void; + /** + * Gets a value specifying whether the ribbon is minimized. + */ + GetMinimized(): boolean; + /** + * Specifies the visibility of a context tab category specified by its name. + * @param categoryName A Name property value of the required category. + * @param visible true to make a category visible; false to make it hidden. + */ + SetContextTabCategoryVisible(categoryName: string, visible: boolean): void; + /** + * Shows ribbon key tips. + */ + ShowKeyTips(): void; +} +/** + * A client-side equivalent of the ribbon's RibbonTab object. + */ +interface ASPxClientRibbonTab { + /** + * Gets the client ribbon object to which the current tab belongs. + * Value: An object to which the tab belongs. + */ + ribbon: ASPxClientRibbon; + /** + * Gets or sets the tab's index within the collection. + * Value: An integer value that is the zero-based index of the tab within the collection. + */ + index: number; + /** + * Gets the name of the current ribbon tab. + * Value: A string value that is the tab's name. + */ + name: string; + /** + * Returns the text displayed in the tab. + */ + GetText(): string; + /** + * Sets a value specifying whether the tab is enabled. + * @param enabled true to enable the tab; false to disable it. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns a value indicating whether a ribbon tab is enabled. + */ + GetEnabled(): boolean; + /** + * Returns a value specifying whether a ribbon tab is displayed. + */ + GetVisible(): boolean; +} +/** + * A client-side equivalent of the ribbon's RibbonGroup object. + */ +interface ASPxClientRibbonGroup { + /** + * Gets the client ribbon object to which the current group belongs. + * Value: An object to which the group belongs. + */ + ribbon: ASPxClientRibbon; + /** + * Gets the client tab object to which the current group belongs. + * Value: An object to which the group belongs. + */ + tab: ASPxClientRibbonTab; + /** + * Gets or sets the group's index within the collection. + * Value: An integer value that is the zero-based index of the group within the collection. + */ + index: number; + /** + * Gets the name of the current ribbon group. + * Value: A string value that is the group's name. + */ + name: string; + /** + * Returns a value specifying whether a ribbon group is displayed. + */ + GetVisible(): boolean; +} +/** + * A client-side equivalent of the ribbon's RibbonItemBase object. + */ +interface ASPxClientRibbonItem { + /** + * Gets the client group object to which the current item belongs. + * Value: An object to which the item belongs. + */ + group: ASPxClientRibbonGroup; + /** + * Gets or sets the item's index within the collection. + * Value: An integer value that is the zero-based index of the item within the collection. + */ + index: number; + /** + * Gets the name of the current ribbon item. + * Value: A string value that is the item's name. + */ + name: string; + /** + * Gets the client ribbon object to which the current item belongs. + * Value: An object to which the item belongs. + */ + ribbon: ASPxClientRibbon; + /** + * Returns a value indicating whether a ribbon item is enabled. + */ + GetEnabled(): boolean; + /** + * Sets a value specifying whether the item is enabled. + * @param enabled true to enable the item; false to disable it. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns the item value. + */ + GetValue(): Object; + /** + * Sets the item value. + * @param value An that specifies the item value. + */ + SetValue(value: Object): void; + /** + * Returns a value specifying whether a ribbon item is displayed. + */ + GetVisible(): boolean; +} +/** + * A method that will handle the CommandExecuted event. + */ +interface ASPxClientRibbonCommandExecutedEventHandler { + /** + * A method that will handle the CommandExecuted event. + * @param source The event source. Identifies the ASPxRibbon control that raised the event. + * @param e An ASPxClientRibbonCommandExecutedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRibbonCommandExecutedEventArgs): void; +} +/** + * Provides data for the CommandExecuted event. + */ +interface ASPxClientRibbonCommandExecutedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets an item object related to the event. + * Value: An object, manipulations on which forced the event to be raised. + */ + item: ASPxClientRibbonItem; + /** + * Gets an optional parameter that complements the processed command. + * Value: A string value containing additional information about the processed command. + */ + parameter: string; +} +/** + * A method that will handle the ActiveTabChanged event. + */ +interface ASPxClientRibbonTabEventHandler { + /** + * A method that will handle the ActiveTabChanged event. + * @param source The event source. Identifies the ASPxRibbon control that raised the event. + * @param e A ASPxClientRibbonTabEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRibbonTabEventArgs): void; +} +/** + * Provides data for the ActiveTabChanged event. + */ +interface ASPxClientRibbonTabEventArgs extends ASPxClientEventArgs { + /** + * Gets the tab object related to the event. + * Value: An object that is the tab, manipulations on which forced the ribbon control to raise the event. + */ + tab: ASPxClientRibbonTab; +} +/** + * A method that will handle the MinimizationStateChanged event. + */ +interface ASPxClientRibbonMinimizationStateEventHandler { + /** + * A method that will handle the MinimizationStateChanged event. + * @param source The event source. Identifies the ASPxRibbon control that raised the event. + * @param e An ASPxClientRibbonMinimizationStateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRibbonMinimizationStateEventArgs): void; +} +/** + * Provides data for the MinimizationStateChanged event. + */ +interface ASPxClientRibbonMinimizationStateEventArgs extends ASPxClientEventArgs { + /** + * Returns the value indicating the new ribbon state. + * Value: The integer value indicating the ribbon minimization state. + */ + ribbonState: number; +} +/** + * A method that will handle the DialogBoxLauncherClicked event. + */ +interface ASPxClientRibbonDialogBoxLauncherClickedEventHandler { + /** + * A method that will handle the DialogBoxLauncherClicked event. + * @param source The event source. This parameter identifies the ribbon object which raised the event. + * @param e An ASPxClientRibbonDialogBoxLauncherClickedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRibbonDialogBoxLauncherClickedEventArgs): void; +} +/** + * Provides data for the DialogBoxLauncherClicked event. + */ +interface ASPxClientRibbonDialogBoxLauncherClickedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the client group object to which the clicked dialog box launcher belongs. + * Value: An object to which the dialog box launcher belongs. + */ + group: ASPxClientRibbonGroup; +} +/** + * Represents a client-side equivalent of the ASPxRoundPanel control. + */ +interface ASPxClientRoundPanel extends ASPxClientPanelBase { + /** + * Fires on the client side after a panel has been expanded or collapsed via end-user interactions, i.e., by clicking a panel header or collapse button. + */ + CollapsedChanged: ASPxClientEvent>; + /** + * Fires on the client side before a panel is expanded or collapsed by end-user interactions, i.e., by clicking a panel header or collapse button. + */ + CollapsedChanging: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientRoundPanel. + */ + CallbackError: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side ContentCallback event, passing it the specified argument. + * @param parameter A string value that is any information that needs to be sent to the server-side ContentCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side ContentCallback event, passing it the specified argument. + * @param parameter A string value that is any information that needs to be sent to the server-side ContentCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Returns the text displayed within the panel's header. + */ + GetHeaderText(): string; + /** + * Specifies the text displayed in the panel's header. + * @param text A string value that specifies the panel header's text. + */ + SetHeaderText(text: string): void; + /** + * Returns a value indicating whether the panel is collapsed. + */ + GetCollapsed(): boolean; + /** + * Sets a value indicating whether the panel is collapsed. + * @param collapsed true, to collapse the panel; otherwise, false. + */ + SetCollapsed(collapsed: boolean): void; +} +/** + * Represents a client-side equivalent of the ASPxSplitter object. + */ +interface ASPxClientSplitter extends ASPxClientControl { + /** + * Fires before a pane is resized. + */ + PaneResizing: ASPxClientEvent>; + /** + * Fires after a pane has been resized. + */ + PaneResized: ASPxClientEvent>; + /** + * Fires before a pane is collapsed. + */ + PaneCollapsing: ASPxClientEvent>; + /** + * Fires after a pane has been collapsed. + */ + PaneCollapsed: ASPxClientEvent>; + /** + * Fires before a pane is expanded. + */ + PaneExpanding: ASPxClientEvent>; + /** + * Fires after a pane has been expanded. + */ + PaneExpanded: ASPxClientEvent>; + /** + * Occurs when a pane resize operation has been completed. + */ + PaneResizeCompleted: ASPxClientEvent>; + /** + * Fires after a specific web page has been loaded into a pane. + */ + PaneContentUrlLoaded: ASPxClientEvent>; + /** + * Returns the number of panes at the root level of a splitter. + */ + GetPaneCount(): number; + /** + * Returns the splitter's root pane specified by its index within the Panes collection. + * @param index An integer value specifying the zero-based index of the root pane to be retrieved. + */ + GetPane(index: number): ASPxClientSplitterPane; + /** + * Returns a pane specified by its name. + * @param name A string value specifying the name of the pane. + */ + GetPaneByName(name: string): ASPxClientSplitterPane; + /** + * Specifies whether the control's panes can be resized by end-users on the client side. + * @param allowResize true if pane resizing is allowed; otherwise, false. + */ + SetAllowResize(allowResize: boolean): void; + /** + * Returns a string value that represents the client state of splitter panes. + */ + GetLayoutData(): string; +} +/** + * Represents a client-side equivalent of the splitter's SplitterPane object. + */ +interface ASPxClientSplitterPane { + /** + * Gets the index of the current pane within the pane collection to which it belongs. + * Value: An integer value representing the zero-based index of the current pane within the SplitterPaneCollection collection. + */ + index: number; + /** + * Gets the name that uniquely identifies the current splitter pane. + * Value: A string value that represents the value assigned to the pane's Name property. + */ + name: string; + /** + * Returns a client splitter object that contains the current pane. + */ + GetSplitter(): ASPxClientSplitter; + /** + * Returns the immediate parent of the current pane. + */ + GetParentPane(): ASPxClientSplitterPane; + /** + * Returns the previous sibling pane of the current pane. + */ + GetPrevPane(): ASPxClientSplitterPane; + /** + * Returns the next sibling pane of the current pane. + */ + GetNextPane(): ASPxClientSplitterPane; + /** + * Determines whether the current pane is the first pane within the SplitterPaneCollection. + */ + IsFirstPane(): boolean; + /** + * Determines whether the current pane is the last pane within the SplitterPaneCollection. + */ + IsLastPane(): boolean; + /** + * Returns a value that indicates the orientation in which the current pane and its sibling panes are stacked. + */ + IsVertical(): boolean; + /** + * Returns the number of the current pane's immediate child panes. + */ + GetPaneCount(): number; + /** + * Returns the current pane's immediate child pane specified by its index. + * @param index An integer value specifying the zero-based index of the child pane to be retrieved. + */ + GetPane(index: number): ASPxClientSplitterPane; + /** + * Returns the current pane's child pane specified by its name. + * @param name A string value specifying the name of the pane. + */ + GetPaneByName(name: string): ASPxClientSplitterPane; + /** + * Gets the width of the pane's content area. + */ + GetClientWidth(): number; + /** + * Gets the height of the pane's content area. + */ + GetClientHeight(): number; + /** + * Collapses the current pane and occupies its space by maximizing the specified pane. + * @param maximizedPane A ASPxClientSplitterPane object specifying the pane to be maximized to occupy the freed space. + */ + Collapse(maximizedPane: ASPxClientSplitterPane): boolean; + /** + * Collapses the current pane in a forward direction and occupies its space by maximizing the previous adjacent pane. + */ + CollapseForward(): boolean; + /** + * Collapses the current pane in a backward direction, and occupies its space by maximizing the next adjacent pane. + */ + CollapseBackward(): boolean; + /** + * Expands the current pane object on the client side. + */ + Expand(): boolean; + /** + * Returns whether the pane is collapsed. + */ + IsCollapsed(): boolean; + /** + * Returns whether the pane's content is loaded from an external web page. + */ + IsContentUrlPane(): boolean; + /** + * Gets the URL of a web page displayed as a pane's content. + */ + GetContentUrl(): string; + /** + * Sets the URL to point to a web page that should be loaded into, and displayed within the current pane. + * @param url A string value specifying the URL to a web page displayed within the pane. + */ + SetContentUrl(url: string): void; + /** + * Sets the URL to point to a web page that should be loaded into, and displayed within the current pane, but should not be cached by a client browser. + * @param url A string value specifying the URL to a web page displayed within the pane. + * @param preventBrowserCaching true to prevent the browser to cache the loaded content; false to allow browser caching. + */ + SetContentUrl(url: string, preventBrowserCaching: boolean): void; + /** + * Refreshes the content of the web page displayed within the current pane. + */ + RefreshContentUrl(): void; + /** + * Returns an iframe object containing a web page specified via the pane's SetContentUrl client method). + */ + GetContentIFrame(): Object; + /** + * Specifies whether the current pane can be resized by end-users on the client side. + * @param allowResize true if pane resizing is allowed; otherwise, false. + */ + SetAllowResize(allowResize: boolean): void; + /** + * Forces the client PaneResized event to be generated. + */ + RaiseResizedEvent(): void; + /** + * Returns an HTML element representing a splitter pane object. + */ + GetElement(): Object; + /** + * Specifies the splitter pane's size in pixels. + * @param size An integer value that specifies the splitter pane's size. + */ + SetSize(size: number): void; + /** + * Specifies the splitter pane's size, in pixels or percents. + * @param size A string value that specifies the splitter pane's size, in pixels or percents. + */ + SetSize(size: string): void; + /** + * Returns the splitter pane's size, in pixels or percents. + */ + GetSize(): string; + /** + * Returns the distance between the top edge of the pane content and the topmost portion of the content currently visible in the pane. + */ + GetScrollTop(): number; + /** + * Specifies the distance between the top edge of the pane content and the topmost portion of the content currently visible in the pane. + * @param value An integer value that is the distance (in pixels). + */ + SetScrollTop(value: number): void; + /** + * Returns the distance between the left edge of the pane content and the leftmost portion of the content currently visible in the pane. + */ + GetScrollLeft(): number; + /** + * Specifies the distance between the left edge of the pane content and the leftmost portion of the content currently visible in the pane. + * @param value An integer value that is the distance (in pixels). + */ + SetScrollLeft(value: number): void; +} +/** + * A method that will handle the splitter's client events concerning manipulations with a pane. + */ +interface ASPxClientSplitterPaneEventHandler { + /** + * A method that will handle the splitter's client events concerning pane manipulations. + * @param source An object representing the event's source. Identifies the splitter object that raised the event. + * @param e An ASPxClientSplitterPaneEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSplitterPaneEventArgs): void; +} +/** + * A method that will handle the splitter's client events concerning manipulations with a pane. + */ +interface ASPxClientSplitterPaneEventArgs extends ASPxClientEventArgs { + /** + * Gets the pane object related to the event. + * Value: An ASPxClientSplitterPane object, manipulations on which forced the event to be raised. + */ + pane: ASPxClientSplitterPane; +} +/** + * A method that will handle a splitter control's cancelable client events concerning manipulations with a pane. + */ +interface ASPxClientSplitterPaneCancelEventHandler { + /** + * A method that will handle a splitter control's cancelable client events concerning pane manipulations. + * @param source An object representing the event's source. Identifies the splitter control object that raised the event. + * @param e An ASPxClientSplitterPaneCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSplitterPaneCancelEventArgs): void; +} +/** + * Provides data for a splitter control's cancelable client events concerning manipulations with a pane. + */ +interface ASPxClientSplitterPaneCancelEventArgs extends ASPxClientSplitterPaneEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * Represents a base for the ASPxClientPageControl objects. + */ +interface ASPxClientTabControlBase extends ASPxClientControl { + /** + * Fires when a tab is clicked. + */ + TabClick: ASPxClientEvent>; + /** + * Fires on the client side after the active tab has been changed within a tab control. + */ + ActiveTabChanged: ASPxClientEvent>; + /** + * Fires on the client side before the active tab is changed within a tab control. + */ + ActiveTabChanging: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by a client tab control. + */ + CallbackError: ASPxClientEvent>; + /** + * Modifies a tab page's size in accordance with the content. + */ + AdjustSize(): void; + /** + * Returns the active tab within the tab control. + */ + GetActiveTab(): ASPxClientTab; + /** + * Makes the specified tab active within the tab control on the client side. + * @param tab An ASPxClientTab object specifying the tab to select. + */ + SetActiveTab(tab: ASPxClientTab): void; + /** + * Returns the index of the active tab within the tab control. + */ + GetActiveTabIndex(): number; + /** + * Makes a tab active within the tab control, specifying the tab's index. + * @param index An integer value specifying the index of the tab to select. + */ + SetActiveTabIndex(index: number): void; + /** + * Returns the number of tabs in the ASPxTabControl. + */ + GetTabCount(): number; + /** + * Returns a tab specified by its index. + * @param index An integer value specifying the zero-based index of the tab object to retrieve. + */ + GetTab(index: number): ASPxClientTab; + /** + * Returns a tab specified by its name. + * @param name A string value specifying the name of the tab. + */ + GetTabByName(name: string): ASPxClientTab; +} +/** + * Represents a client-side equivalent of the ASPxTabControl object. + */ +interface ASPxClientTabControl extends ASPxClientTabControlBase { +} +/** + * Represents a client-side equivalent of the ASPxPageControl object. + */ +interface ASPxClientPageControl extends ASPxClientTabControlBase { + /** + * Returns the HTML code that represents the contents of the specified page within the page control. + * @param tab An ASPxClientTab object that specifies the required page. + */ + GetTabContentHTML(tab: ASPxClientTab): string; + /** + * Defines the HTML content for a specific tab page within the page control. + * @param tab An ASPxClientTab object that specifies the required tab page. + * @param html A string value that represents the HTML code defining the content of the specified page. + */ + SetTabContentHTML(tab: ASPxClientTab, html: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * Represents a client-side equivalent of a tab control's TabPage object. + */ +interface ASPxClientTab { + /** + * Gets the tab control to which the current tab belongs. + * Value: An ASPxClientTabControlBase object representing the control to which the tab belongs. + */ + tabControl: ASPxClientTabControlBase; + /** + * Gets the index of the current tab (tabbed page) within the control's collection of tabs (tabbed pages). + * Value: An integer value representing the zero-based index of the current tab (tabbed page) within the TabPages) collection of the control to which the tab belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the current tab. + * Value: A string value that represents the value assigned to the tab's Name property. + */ + name: string; + /** + * Returns a value specifying whether a tab is enabled. + */ + GetEnabled(): boolean; + /** + * Specifies whether the tab is enabled. + * @param value true to enable the tab; otherwise, false. + */ + SetEnabled(value: boolean): void; + /** + * Returns the URL pointing to the image displayed within the tab. + */ + GetImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the tab. + * @param value A string value that is the URL to the image displayed within the tab. + */ + SetImageUrl(value: string): void; + /** + * Returns the URL pointing to the image displayed within the active tab. + */ + GetActiveImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the active tab. + * @param value A string value that is the URL to the image displayed within the active tab. + */ + SetActiveImageUrl(value: string): void; + /** + * Gets an URL which defines the navigation location for the tab. + */ + GetNavigateUrl(): string; + /** + * Specifies a URL which defines the navigation location for the tab. + * @param value A string value which is a URL to where the client web browser will navigate when the tab is clicked. + */ + SetNavigateUrl(value: string): void; + /** + * Returns text displayed within the tab. + */ + GetText(): string; + /** + * Specifies the text displayed within the tab. + * @param value A string value that is the text displayed within the tab. + */ + SetText(value: string): void; + /** + * Returns a value specifying whether a tab is displayed. + */ + GetVisible(): boolean; + /** + * Specifies whether the tab is visible. + * @param value true is the tab is visible; otherwise, false. + */ + SetVisible(value: boolean): void; +} +/** + * A method that will handle a tab control's client events concerning manipulations with a tab. + */ +interface ASPxClientTabControlTabEventHandler { + /** + * A method that will handle a tab control's client events concerning manipulations with a tab. + * @param source An object representing the event's source. Identifies the tab control object that raised the event. + * @param e An ASPxClientTabControlTabEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTabControlTabEventArgs): void; +} +/** + * Provides data for events which concern manipulations on tabs. + */ +interface ASPxClientTabControlTabEventArgs extends ASPxClientEventArgs { + /** + * Gets the tab object related to the event. + * Value: An ASPxClientTab object, manipulations on which forced the event to be raised. + */ + tab: ASPxClientTab; +} +/** + * A method that will handle a tab control's cancelable client events concerning manipulations with a tab. + */ +interface ASPxClientTabControlTabCancelEventHandler { + /** + * A method that will handle a tab control's cancelable client events concerning manipulations with a tab. + * @param source An object representing the event's source. Identifies the tab control object that raised the event. + * @param e An ASPxClientTabControlTabCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTabControlTabCancelEventArgs): void; +} +/** + * Provides data for cancellable events which concern manipulations on tabs. + */ +interface ASPxClientTabControlTabCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the tab object related to the event. + * Value: An ASPxClientTab object representing the tab manipulations on which forced the tab control to raise the event. + */ + tab: ASPxClientTab; + /** + * Gets or sets a value specifying whether a callback should be sent to the server to reload the content of the page being activated. + * Value: true to reload the page's content; otherwise, false. + */ + reloadContentOnCallback: boolean; +} +/** + * A method that will handle client events concerning clicks on the control's tabs. + */ +interface ASPxClientTabControlTabClickEventHandler { + /** + * A method that will handle client events concerning clicks on tabs. + * @param source The event source. This parameter identifies the tab control object which raised the event. + * @param e An ASPxClientTabControlTabClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTabControlTabClickEventArgs): void; +} +/** + * Provides data for events which concern clicking on the control's tabs. + */ +interface ASPxClientTabControlTabClickEventArgs extends ASPxClientTabControlTabCancelEventArgs { + /** + * Gets the HTML object that contains the processed tab. + * Value: An object representing a container for the tab related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Represents a client-side equivalent of the ASPxTimer object. + */ +interface ASPxClientTimer extends ASPxClientControl { + /** + * Fires on the client side when the specified timer interval has elapsed, and the timer is enabled. + */ + Tick: ASPxClientEvent>; + /** + * Returns a value indicating whether the timer is enabled. + */ + GetEnabled(): boolean; + /** + * Enables the timer. + * @param enabled true to turn the timer on; false, to turn the timer off. + */ + SetEnabled(enabled: boolean): void; + /** + * Gets the time before the Tick event. + */ + GetInterval(): number; + /** + * Specifies the time before the Tick event. + * @param interval An integer value that specifies the number of milliseconds before the Tick event is raised relative to the last occurrence of the Tick event. The value cannot be less than one. + */ + SetInterval(interval: number): void; +} +/** + * Represents a client-side equivalent of the ASPxTitleIndex object. + */ +interface ASPxClientTitleIndex extends ASPxClientControl { + /** + * Fires after an item has been clicked. + */ + ItemClick: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientTitleIndex. + */ + CallbackError: ASPxClientEvent>; +} +/** + * A method that will handle client events concerning manipulations with an item. + */ +interface ASPxClientTitleIndexItemEventHandler { + /** + * A method that will handle the title index control's client events concerning manipulations with an item. + * @param source An object representing the event's source. Identifies the title index control object that raised the event. + * @param e An ASPxClientTitleIndexItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTitleIndexItemEventArgs): void; +} +/** + * Provides data for events which concern manipulations on the control's items. + */ +interface ASPxClientTitleIndexItemEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the name that uniquely identifies the processed item. + * Value: A string value that represents the value assigned to the processed item's Name property. + */ + name: Object; + /** + * Gets the HTML object that contains the processed item. + * Value: An object representing a container for the item related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Represents a client-side equivalent of the ASPxTreeView object. + */ +interface ASPxClientTreeView extends ASPxClientControl { + /** + * Fires on the client side after a node has been clicked. + */ + NodeClick: ASPxClientEvent>; + /** + * Fires on the client side after a node's expansion state has been changed by end-user interaction. + */ + ExpandedChanged: ASPxClientEvent>; + /** + * Fires on the client side before the expansion state of a node is changed via end-user interaction. + */ + ExpandedChanging: ASPxClientEvent>; + /** + * Occurs on the client side when the node's checked state is changed by clicking on a check box. + */ + CheckedChanged: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientTreeView. + */ + CallbackError: ASPxClientEvent>; + /** + * Returns a node specified by its index within the ASPxTreeView's node collection. + * @param index An integer value specifying the zero-based index of the node to be retrieved. + */ + GetNode(index: number): ASPxClientTreeViewNode; + /** + * Returns a node specified by its name. + * @param name A string value specifying the name of the node. + */ + GetNodeByName(name: string): ASPxClientTreeViewNode; + /** + * Returns a node specified by its text. + * @param text A string value specifying the text content of the node. + */ + GetNodeByText(text: string): ASPxClientTreeViewNode; + /** + * Returns the number of nodes at the ASPxTreeView's zero level. + */ + GetNodeCount(): number; + /** + * Returns the selected node within the ASPxTreeView control on the client side. + */ + GetSelectedNode(): ASPxClientTreeViewNode; + /** + * Selects the specified node within the ASPxTreeView control on the client side. + * @param node An ASPxClientTreeViewNode object specifying the node to select. + */ + SetSelectedNode(node: ASPxClientTreeViewNode): void; + /** + * Gets the root node of the ASPxTreeView object. + */ + GetRootNode(): ASPxClientTreeViewNode; + /** + * Collapses all nodes in the ASPxTreeView on the client side. + */ + CollapseAll(): void; + /** + * Expands all nodes in the ASPxTreeView on the client side. + */ + ExpandAll(): void; +} +/** + * Represents a client-side equivalent of the ASPxTreeView's TreeViewNode object. + */ +interface ASPxClientTreeViewNode { + /** + * Gets the client representation of the ASPxTreeView control to which the current node belongs. + * Value: An ASPxClientTreeView object representing the control to which the node belongs. + */ + treeView: ASPxClientTreeView; + /** + * Gets the current node's parent node. + * Value: An ASPxClientTreeViewNode object representing the node's immediate parent. + */ + parent: ASPxClientTreeViewNode; + /** + * Gets the node's index within the parent's collection of nodes. + * Value: An integer value representing the node's zero-based index within the Nodes collection of the node to which the node belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the node. + * Value: A string value that represents the value assigned to the node's Name property. + */ + name: string; + /** + * Returns the number of the current node's immediate child nodes. + */ + GetNodeCount(): number; + /** + * Returns the current node's immediate child node specified by its index. + * @param index An integer value specifying the zero-based index of the node to be retrieved. + */ + GetNode(index: number): ASPxClientTreeViewNode; + /** + * Returns the current node's child node specified by its name. + * @param name A string value specifying the name of the node. + */ + GetNodeByName(name: string): ASPxClientTreeViewNode; + /** + * Returns the current node's child node specified by its text. + * @param text A string value specifying the text content of the node. + */ + GetNodeByText(text: string): ASPxClientTreeViewNode; + /** + * Returns a value indicating whether the node is expanded. + */ + GetExpanded(): boolean; + /** + * Sets a value which specifies the node's expansion state. + * @param value true if the node is expanded; otherwise, false. + */ + SetExpanded(value: boolean): void; + /** + * Returns a value indicating whether the node is checked. + */ + GetChecked(): boolean; + /** + * Sets a value indicating whether the node is checked. + * @param value true if the node is checked; otherwise, false. + */ + SetChecked(value: boolean): void; + /** + * Returns a value which specifies the node's check state. + */ + GetCheckState(): string; + /** + * Returns a value specifying whether the node is enabled. + */ + GetEnabled(): boolean; + /** + * Sets a value specifying whether the node is enabled. + * @param value true to make the node enabled; false to disable it. + */ + SetEnabled(value: boolean): void; + /** + * Returns the URL pointing to the image displayed within the node. + */ + GetImageUrl(): string; + /** + * Sets the URL which points to the image displayed within the node. + * @param value A string value specifying the URL to the image displayed within the node. + */ + SetImageUrl(value: string): void; + /** + * Gets an URL which defines the navigation location for the node's hyperlink. + */ + GetNavigateUrl(): string; + /** + * Specifies a URL which defines the node's navigate URL. + * @param value A string value which specifies a URL to where the client web browser will navigate when the node is clicked. + */ + SetNavigateUrl(value: string): void; + /** + * Gets the text, displayed within the node. + */ + GetText(): string; + /** + * Specifies the text, displayed within the node. + * @param value A string value that represents the text displayed within the node. + */ + SetText(value: string): void; + /** + * Returns a value specifying whether a node is displayed. + */ + GetVisible(): boolean; + /** + * Specifies whether the node is visible. + * @param value true if the node is visible; otherwise, false. + */ + SetVisible(value: boolean): void; + /** + * Gets the HTML object that contains the current node. + */ + GetHtmlElement(): Object; +} +/** + * A method that will handle the client events concerned with node processing. + */ +interface ASPxClientTreeViewNodeProcessingModeEventHandler { + /** + * A method that will handle the client events concerned with node processing. + * @param source An object representing the event source. Identifies the ASPxClientTreeView control that raised the event. + * @param e An ASPxClientTreeViewNodeProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeViewNodeProcessingModeEventArgs): void; +} +/** + * Provides data for the client events concerned with node processing, and that allow the event's processing to be passed to the server side. + */ +interface ASPxClientTreeViewNodeProcessingModeEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets a node object related to the event. + * Value: An ASPxClientTreeViewNode object, manipulations on which forced the event to be raised. + */ + node: ASPxClientTreeViewNode; +} +/** + * A method that will handle the ASPxClientTreeView.ItemClick event. + */ +interface ASPxClientTreeViewNodeClickEventHandler { + /** + * A method that will handle the NodeClick event. + * @param source The ASPxClientTreeView control which fires the event. + * @param e An ASPxClientTreeViewNodeClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeViewNodeClickEventArgs): void; +} +/** + * Provides data for the NodeClick event. + */ +interface ASPxClientTreeViewNodeClickEventArgs extends ASPxClientTreeViewNodeProcessingModeEventArgs { + /** + * Gets the HTML object that contains the processed node. + * Value: An object representing a container for the node related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle the ASPxTreeView control's client events concerning manipulations with a node. + */ +interface ASPxClientTreeViewNodeEventHandler { + /** + * A method that will handle the ASPxTreeView control's client events, concerning manipulations with a node. + * @param source An object representing the event's source. Identifies the ASPxClientTreeView control object that raised the event. + * @param e An ASPxClientTreeViewNodeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeViewNodeEventArgs): void; +} +/** + * Provides data for the ExpandedChanged events. + */ +interface ASPxClientTreeViewNodeEventArgs extends ASPxClientEventArgs { + /** + * Gets a node object related to the event. + * Value: An ASPxClientTreeViewNode object, manipulations on which forced the event to be raised. + */ + node: ASPxClientTreeViewNode; +} +/** + * A method that will handle the ASPxTreeView's cancelable client events, concerning manipulations with nodes. + */ +interface ASPxClientTreeViewNodeCancelEventHandler { + /** + * A method that will handle the ASPxTreeView's cancelable client events, concerning manipulations with nodes. + * @param source An object representing the event's source. Identifies the ASPxClientTreeView object that raised the event. + * @param e An ASPxClientTreeViewNodeCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeViewNodeCancelEventArgs): void; +} +/** + * Provides data for the ExpandedChanging event. + */ +interface ASPxClientTreeViewNodeCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets a node object related to the event. + * Value: An ASPxClientTreeViewNode object, manipulations on which forced the event to be raised. + */ + node: ASPxClientTreeViewNode; +} +/** + * Represents a client-side equivalent of the ASPxUploadControl control. + */ +interface ASPxClientUploadControl extends ASPxClientControl { + /** + * Occurs on the client after a file has been uploaded. + */ + FileUploadComplete: ASPxClientEvent>; + /** + * Occurs on the client after upload of all selected files has been completed. + */ + FilesUploadComplete: ASPxClientEvent>; + /** + * Occurs on the client side before upload of the specified files starts. + */ + FileUploadStart: ASPxClientEvent>; + /** + * Occurs on the client side before file upload is started. + */ + FilesUploadStart: ASPxClientEvent>; + /** + * Fires on the client side when the text within the control's edit box is changed while the control has focus. + */ + TextChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the progress bar indicator position is changed. + */ + UploadingProgressChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the file input elements count is changed. + */ + FileInputCountChanged: ASPxClientEvent>; + /** + * Enables you to specify whether the selected file(s) are valid and provide an error text. + */ + ValidationErrorOccurred: ASPxClientEvent>; + /** + * Fires when the mouse enters a drop zone or an external drop zone element while dragging a file. + */ + DropZoneEnter: ASPxClientEvent>; + /** + * Fires when the mouse leaves a drop zone or an external drop zone element while dragging a file. + */ + DropZoneLeave: ASPxClientEvent>; + /** + * Specifies whether the upload control's Advanced mode is enabled. + */ + IsAdvancedModeEnabled(): boolean; + /** + * Initiates uploading of the specified file to the web server's memory. + */ + UploadFile(): void; + /** + * Adds a new file input element to the ASPxUploadControl. + */ + AddFileInput(): void; + /** + * Removes a file input element from the ASPxUploadControl. + * @param index An integer value that represents a file input element's index. + */ + RemoveFileInput(index: number): void; + /** + * Removes a file with the specified index from the selected file list. + * @param fileIndex An integer value that is the zero-based index of an item in the file list. + */ + RemoveFileFromSelection(fileIndex: number): void; + /** + * Removes the specified file from the list of files selected for uploading in the upload control. + * @param file An ASPxClientUploadControl object that is the file to be removed from the list of files. + */ + RemoveFileFromSelection(file: ASPxClientUploadControlFile): void; + /** + * Returns files selected for uploading within the specified file input. + * @param inputIndex An integer value that specifies the index of a file input. Default value is "0". + */ + GetSelectedFiles(inputIndex: number): ASPxClientUploadControlFile[]; + /** + * Gets the text displayed within the edit box of the specified file input element. + * @param index An integer value that specifies the required file input element's index. + */ + GetText(index: number): string; + /** + * Gets the number of file input elements contained within the ASPxUploadControl. + */ + GetFileInputCount(): number; + /** + * Specifies the count of the file input elements within the upload control. + * @param count An integer value that specifies the file input elements count. + */ + SetFileInputCount(count: number): void; + /** + * Specifies whether the upload control is enabled. + * @param enabled true, to enable the upload control; otherwise, false. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns a value indicating whether the upload control is enabled. + */ + GetEnabled(): boolean; + /** + * Initiates uploading of the specified file(s) to the web server's memory. + */ + Upload(): void; + /** + * Cancels the initiated file uploading process. + */ + Cancel(): void; + /** + * Clears the file selection in the upload control. + */ + ClearText(): void; + /** + * Sets the text to be displayed within the add button. + * @param text A string value specifying the text to be displayed within the button. + */ + SetAddButtonText(text: string): void; + /** + * Sets the text to be displayed within the upload button. + * @param text A string value specifying the text to be displayed within the button. + */ + SetUploadButtonText(text: string): void; + /** + * Returns the text displayed within the add button. + */ + GetAddButtonText(): string; + /** + * Returns the text displayed within the upload button. + */ + GetUploadButtonText(): string; + /** + * Sets the ID of a web control or HTML element (or a list of IDs), a click on which invokes file upload dialog. + * @param ids A string value specifying the ID or a list of IDs separated by the semicolon (;). + */ + SetDialogTriggerID(ids: string): void; +} +/** + * A method that will handle the client FilesUploadStart event. + */ +interface ASPxClientUploadControlFilesUploadStartEventHandler { + /** + * A method that will handle the FilesUploadStart event. + * @param source The event source. Identifies the ASPxUploadControl control that raised the event. + * @param e A ASPxClientUploadControlFilesUploadStartEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlFilesUploadStartEventArgs): void; +} +/** + * Provides data for the FilesUploadStart event. + */ +interface ASPxClientUploadControlFilesUploadStartEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that handles the FileUploadComplete client event. + */ +interface ASPxClientUploadControlFileUploadCompleteEventHandler { + /** + * A method that will handle the corresponding client event. + * @param source The event source. This parameter identifies the upload control which raised the event. + * @param e An ASPxClientUploadControlFileUploadCompleteEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlFileUploadCompleteEventArgs): void; +} +/** + * Provides data for the FileUploadComplete event. + */ +interface ASPxClientUploadControlFileUploadCompleteEventArgs extends ASPxClientEventArgs { + /** + * Gets the index of a file input element within the ASPxUploadControl. + * Value: An integer value that specifies the file input element's index. + */ + inputIndex: number; + /** + * Gets or sets a value indicating whether the uploaded file passes validation. + * Value: true if the file is valid; otherwise, false. + */ + isValid: boolean; + /** + * Gets the error text to be displayed within the ASPxUploadControl's error frame. + * Value: A string value that represents the error text. + */ + errorText: string; + /** + * Gets a string that contains specific information (if any) passed from the server side for further client processing. + * Value: A string value representing callback data passed from the server. + */ + callbackData: string; +} +/** + * A method that will handle the FilesUploadComplete client event. + */ +interface ASPxClientUploadControlFilesUploadCompleteEventHandler { + /** + * A method that will handle the client FilesUploadComplete event. + * @param source The event source. This parameter identifies the upload control which raised the event. + * @param e A object that contains event data. + */ + (source: S, e: ASPxClientUploadControlFilesUploadCompleteEventArgs): void; +} +/** + * Provides data for the FilesUploadComplete client event, which enables you to perform specific actions after all selected files have been uploaded. + */ +interface ASPxClientUploadControlFilesUploadCompleteEventArgs extends ASPxClientEventArgs { + /** + * Gets the error text to be displayed within the upload control's error frame. + * Value: A string value that is the error text. + */ + errorText: string; + /** + * Gets a string that contains specific information (if any) passed from the server side for further client processing. + * Value: A string value that is the callback data passed from the server. + */ + callbackData: string; +} +/** + * A method that will handle the TextChanged client event. + */ +interface ASPxClientUploadControlTextChangedEventHandler { + /** + * A method that will handle the TextChanged client event. + * @param source The event source. This parameter identifies the upload control which raised the event. + * @param e An ASPxClientUploadControlTextChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlTextChangedEventArgs): void; +} +/** + * Provides data for the TextChanged client event that allows you to respond to an end-user changing an edit box's text. + */ +interface ASPxClientUploadControlTextChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the index of a file input element within the ASPxUploadControl. + * Value: An integer value that specifies the file input element's index. + */ + inputIndex: number; +} +/** + * A method that will handle the ASPxUploadControl's client event, concerned with changes in upload progress. + */ +interface ASPxClientUploadControlUploadingProgressChangedEventHandler { + /** + * A method that will handle the ASPxUploadControl's client event concerning the uploading process being changed. + * @param source An object representing the event's source. Identifies the ASPxUploadControl object that raised the event. + * @param e An ASPxClientUploadControlUploadingProgressChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlUploadingProgressChangedEventArgs): void; +} +/** + * Provides data for the UploadingProgressChanged event. + */ +interface ASPxClientUploadControlUploadingProgressChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the number of the files selected for upload. + * Value: An integer value that represents the total number of selected files. + */ + fileCount: number; + /** + * Gets the name of the file being currently uploaded. + * Value: A string value that represents the file name. + */ + currentFileName: string; + /** + * Gets the content length of the currently uploaded file. + * Value: An integer value specifying the content length. + */ + currentFileContentLength: number; + /** + * Gets the content length of the current file already uploaded to the server. + * Value: An integer value that is the content length. + */ + currentFileUploadedContentLength: number; + /** + * Gets the position of the current file upload progress. + * Value: An value specifying the upload progress position. + */ + currentFileProgress: number; + /** + * Gets the content length of the files selected for upload. + * Value: An integer value specifying the total content length of the selected files. + */ + totalContentLength: number; + /** + * Gets the content length of the files already uploaded to the server. + * Value: An integer value that represents the content length. + */ + uploadedContentLength: number; + /** + * Gets the current position of total upload progress. + * Value: An value specifying the total upload progress position. + */ + progress: number; +} +/** + * A method that will handle the ValidationErrorOccurred client event. + */ +interface ASPxClientUploadControlValidationErrorOccurredEventHandler { + /** + * A method that will handle the ValidationErrorOccurred event. + * @param source The event source. + * @param e An ASPxClientUploadControlValidationErrorOccurredEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlValidationErrorOccurredEventArgs): void; +} +/** + * Provides data for the ValidationErrorOccurred event. + */ +interface ASPxClientUploadControlValidationErrorOccurredEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets the error text. + * Value: A string value that represents the error text. + */ + errorText: string; + /** + * Gets or sets a value specifying whether an alert message is displayed when the ValidationErrorOccurred event fires. + * Value: true, to display an alert message; otherwise, false. + */ + showAlert: boolean; + /** + * Gets the validation settings for the selected files. + * Value: An ASPxClientUploadControlValidationSettings object that provides validation settings. + */ + validationSettings: ASPxClientUploadControlValidationSettings; + /** + * Returns an array of invalid files. + * Value: An array of the ASPxClientUploadControlInvalidFileInfo objects. + */ + invalidFiles: ASPxClientUploadControlInvalidFileInfo[]; +} +/** + * Contains settings that relate to the ValidationErrorOccurred client event. + */ +interface ASPxClientUploadControlValidationSettings { + /** + * Gets the maximum file size. + * Value: An value that specifies the maximum file size, in bytes. + */ + maxFileSize: any; + /** + * Gets the maximum count of files that can be selected for uploading at once. + * Value: An integer value that specifies the maximum count of files. + */ + maxFileCount: number; + /** + * Gets the allowed file extensions. + * Value: An array of string values that contains file extensions that are allowed. + */ + allowedFileExtensions: string[]; + /** + * Gets which characters in a file name are not allowed. + * Value: An array of string values that contains characters that are not allowed. + */ + invalidFileNameCharacters: string[]; +} +/** + * Contains settings of the file that hasn't passed validation. + */ +interface ASPxClientUploadControlInvalidFileInfo { + /** + * Gets the name of the invalid file. + * Value: A string value that specifies the file name. + */ + fileName: string; + /** + * Gets the size of the invalid file. + * Value: An integer value that specifies the file size. + */ + fileSize: number; + /** + * Gets the error type. + * Value: An ASPxClientUploadControlValidationErrorTypeConsts object that provides possible types of errors. + */ + errorType: ASPxClientUploadControlValidationErrorTypeConsts; +} +/** + * Declares client constants containing codes of validation errors that can occur while selecting files for uploading. + */ +interface ASPxClientUploadControlValidationErrorTypeConsts { +} +/** + * Represents a client file that corresponds to a particular file selected for uploading in the upload control. + */ +interface ASPxClientUploadControlFile { + /** + * Gets the name of the file selected for uploading. + * Value: A string value that specifies the file's name. + */ + name: string; + /** + * Gets the size of the file selected for uploading. + * Value: An Int64 value specifying the file's size, in bytes. + */ + size: any; + /** + * Provides access to the file as a native Javascript object. + * Value: A JavaScript object that is the file selected for uploading. + */ + sourceFileObject: any; +} +/** + * A method that will handle the DropZoneEnter event. + */ +interface ASPxClientUploadControlDropZoneEnterEventHandler { + /** + * A method that will handle the DropZoneEnter event. + * @param source The event source. This parameter identifies the upload control object which raised the event. + * @param e An ASPxClientUploadControlDropZoneEnterEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlDropZoneEnterEventArgs): void; +} +/** + * Provides data for the DropZoneEnter event. + */ +interface ASPxClientUploadControlDropZoneEnterEventArgs extends ASPxClientEventArgs { + /** + * Gets a drop zone object related to the processed event. + * Value: An object that is a drop zone related to the processed event. + */ + dropZone: Object; +} +/** + * A method that will handle the DropZoneLeave event. + */ +interface ASPxClientUploadControlDropZoneLeaveEventHandler { + /** + * A method that will handle the DropZoneLeave event. + * @param source The event source. Identifies the upload control object that raised the event. + * @param e A ASPxClientUploadControlDropZoneLeaveEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlDropZoneLeaveEventArgs): void; +} +/** + * Provides data for the DropZoneLeave event. + */ +interface ASPxClientUploadControlDropZoneLeaveEventArgs extends ASPxClientEventArgs { + /** + * Gets a drop zone object related to the processed event. + * Value: An object that is a drop zone related to the processed event. + */ + dropZone: Object; +} +/** + * The JavaScript equivalent of the ASPxChartDesigner class. + */ +interface ASPxClientChartDesigner extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientChartDesigner. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs when executing the Save command on the client. + */ + SaveCommandExecute: ASPxClientEvent>; + /** + * Enables you to customize the menu actions of a Client Chart Designer. + */ + CustomizeMenuActions: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(arg: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(arg: string, onSuccess: (arg1: string) => void): void; + /** + * Updates the localization settings of the ASPxClientChartDesigner properties. + * @param localization A dictionary containing the property names, along with their localized equivalents. + */ + UpdateLocalization(localization: { [key: string]: string; }): void; + /** + * Returns the model of the Client Chart Designer. + */ + GetDesignerModel(): Object; + /** + * For internal use. + */ + GetJsonChartModel(): string; +} +/** + * A method that will handle the SaveCommandExecute event. + */ +interface ASPxClientChartDesignerSaveCommandExecuteEventHandler { + /** + * Represents a method that will handle the SaveCommandExecute event. + * @param source The event source. This parameter identifies the ASPxChartDesigner which raised the event. + * @param e A ASPxClientChartDesignerSaveCommandExecuteEventArgs object which contains event data. + */ + (source: S, e: ASPxClientChartDesignerSaveCommandExecuteEventArgs): void; +} +/** + * Provides data for a chart control's SaveCommandExecute event. + */ +interface ASPxClientChartDesignerSaveCommandExecuteEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets a value specifying whether an event has been handled. + * Value: true, if the event hasn't been handled by a control; otherwise, false. + */ + handled: boolean; +} +/** + * Represents a method that will handle the CustomizeMenuActions events. + */ +interface ASPxClientChartDesignerCustomizeMenuActionsEventHandler { + /** + * Represents a method that will handle the CustomizeMenuActions event. + * @param source The event source. This parameter identifies the ASPxChartDesigner which raised the event. + * @param e An ASPxClientChartDesignerCustomizeMenuActionsEventArgs object which contains event data. + */ + (source: S, e: ASPxClientChartDesignerCustomizeMenuActionsEventArgs): void; +} +/** + * An action of the Client Chart Designer's menu. + */ +interface ASPxClientChartDesignerMenuAction { + /** + * Provides access to the text for the command. + * Value: A String value. + */ + text: string; + /** + * Provides access to the CSS class of the command's glyph. + * Value: A String value. + */ + imageClassName: string; + /** + * Provides access to the action performed when the Client Chart Designer's button is clicked. + * Value: The specific action implementation. + */ + clickAction: Function; + /** + * Provides access to the value that specifies whether or not the command is disabled by default. + * Value: true, if the command is disabled by default; otherwise, false. + */ + disabled: boolean; + /** + * Provides access to the value that specifies whether or not the command is visible in the designer user interface. + * Value: true if the command is visible; otherwise false. + */ + visible: boolean; + /** + * Provides access to the keyboard shortcut used to invoke the command. + * Value: A String value. + */ + hotKey: string; + /** + * Provides access to the value that specifies whether or not the command has a visual separator. + * Value: true, if the command has a visual separator; otherwise, false. + */ + hasSeparator: string; + /** + * Provides access to the location of the displayed command. + * Value: A String value. + */ + container: string; +} +/** + * Provides data for a chart control's CustomizeMenuActions event on the client side. + */ +interface ASPxClientChartDesignerCustomizeMenuActionsEventArgs extends ASPxClientEventArgs { + /** + * Returns an array of the Client Chart Designer's menu actions. + * Value: An array of the ASPxClientChartDesignerMenuAction objects. + */ + actions: ASPxClientChartDesignerMenuAction[]; +} +/** + * A class which provides access to the entire hierarchy of chart elements on the client side. + */ +interface ASPxClientWebChartControl extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientWebChartControl. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side when any chart element is hot-tracked. + */ + ObjectHotTracked: ASPxClientEvent>; + /** + * Occurs before crosshair items are drawn when the chart's contents are being drawn. + */ + CustomDrawCrosshair: ASPxClientEvent>; + /** + * Occurs on the client side when any chart element is selected. + */ + ObjectSelected: ASPxClientEvent>; + /** + * Returns an ASPxClientWebChart object, which contains information about the hierarchy of a chart control, and provides access to the main properties of chart elements on the client side. + */ + GetChart(): ASPxClientWebChart; + /** + * Returns the printing options of the chart control. + */ + GetPrintOptions(): ASPxClientChartPrintOptions; + /** + * Changes the mouse pointer, which is shown when the mouse is over the chart control, to the pointer with the specified name. + * @param cursor A string value representing the name of the desired cursor. + */ + SetCursor(cursor: string): void; + /** + * Returns the specific chart element which is located under the test point. + * @param x An integer value that specifies the x coordinate of the test point. + * @param y An integer value that specifies the y coordinate of the test point. + */ + HitTest(x: number, y: number): ASPxClientHitObject[]; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Prints the current chart on the client side. + */ + Print(): void; + /** + * Loads a chart which should be customized from its object model. + * @param serializedChartObjectModel A String object representing the chart model. + */ + LoadFromObjectModel(serializedChartObjectModel: string): void; + /** + * Exports a chart to the file of the specified format, and saves it to the disk. + * @param format A string value specifying the format, to which a chart should be exported. + */ + SaveToDisk(format: string): void; + /** + * Exports a chart to a file in the specified format, and saves it to disk, using the specified file name. + * @param format A string value specifying the format, to which a chart should be exported. + * @param filename A string value specifying the file name, to which a chart should be exported. If this parameter is missing or set to an empty string, then the created file will be named using the client-side name of a chart. + */ + SaveToDisk(format: string, filename: string): void; + /** + * Exports a report to the file of the specified format, and shows it in a new Web Browser window. + * @param format A string value specifying a format in which a report should be exported. + */ + SaveToWindow(format: string): void; + /** + * Gets the main DOM (Document Object Model) element on a Web Page representing this ASPxClientWebChartControl object. + */ + GetMainDOMElement(): Object; +} +/** + * A method that will handle the CustomDrawCrosshair event. + */ +interface ASPxClientWebChartControlCustomDrawCrosshairEventHandler { + /** + * A method that will handle the CustomDrawCrosshair event. + * @param source The event source. This parameter identifies the chartControl which raised the event. + * @param e An ASPxClientWebChartControlCustomDrawCrosshairEventArgs object which contains event data. + */ + (source: S, e: ASPxClientWebChartControlCustomDrawCrosshairEventArgs): void; +} +/** + * Provides data for a chart control's CustomDrawCrosshair event. + */ +interface ASPxClientWebChartControlCustomDrawCrosshairEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets crosshair elements settings to custom draw a crosshair cursor. + * Value: An ASPxClientCrosshairElement object. + */ + crosshairElements: ASPxClientCrosshairElement; + /** + * Gets the settings of crosshair axis label elements to customize their appearance. + * Value: An ASPxClientCrosshairAxisLabelElement object. + */ + cursorCrosshairAxisLabelElements: ASPxClientCrosshairAxisLabelElement; + /** + * Gets crosshair line element settings that are used to custom draw a crosshair cursor. + * Value: An ASPxClientCrosshairLineElement object that contains crosshair line element settings. + */ + cursorCrosshairLineElement: ASPxClientCrosshairLineElement; + /** + * Gets the settings of crosshair group header elements to customize their appearance. + * Value: An ASPxClientCrosshairGroupHeaderElement object. + */ + crosshairGroupHeaderElements: ASPxClientCrosshairGroupHeaderElement; + /** + * Provides access to the settings of crosshair elements and crosshair group header elements to customize their appearance. + * Value: An ASPxClientCrosshairElementGroup object. + */ + crosshairElementGroups: ASPxClientCrosshairElementGroup; +} +/** + * Represents the client-side equivalent of the CrosshairElement class. + */ +interface ASPxClientCrosshairElement { + /** + * Gets a series that a crosshair element hovers over when implementing a custom draw. + * Value: An ASPxClientSeries object which represents the series currently being painted. + */ + Series: ASPxClientSeries; + /** + * Gets the series point that a crosshair element hovers over when implementing a custom draw. + * Value: An ASPxClientSeriesPoint object, representing the series point that a crosshair element hovers over. + */ + Point: ASPxClientSeriesPoint; + /** + * Gets or sets the crosshair line element to custom draw a crosshair cursor. + * Value: An ASPxClientCrosshairLineElement object, representing the crosshair line element. + */ + LineElement: ASPxClientCrosshairLineElement; + /** + * Provides access to the crosshair axis label element. + * Value: An ASPxClientCrosshairAxisLabelElement object, representing the crosshair axis label element. + */ + AxisLabelElement: ASPxClientCrosshairAxisLabelElement; + /** + * Gets the crosshair label element. + * Value: An ASPxClientCrosshairSeriesLabelElement object, representing the crosshair label element. + */ + LabelElement: ASPxClientCrosshairSeriesLabelElement; + /** + * Specifies whether the crosshair element is visible when implementing custom drawing in the crosshair cursor. + * Value: true, if the crosshair element is visible; otherwise, false. + */ + visible: boolean; +} +/** + * Represents the client-side equivalent of the CrosshairLineElement class. + */ +interface ASPxClientCrosshairLineElement { +} +/** + * Represents the client-side equivalent of the CrosshairAxisLabelElement class. + */ +interface ASPxClientCrosshairAxisLabelElement { +} +/** + * The client-side equivalent of the CrosshairGroupHeaderElement class. + */ +interface ASPxClientCrosshairGroupHeaderElement { +} +/** + * The client-side equivalent of the CrosshairLabelElement class. + */ +interface ASPxClientCrosshairSeriesLabelElement { +} +/** + * Represents the client-side equivalent of the CrosshairElementGroup class. + */ +interface ASPxClientCrosshairElementGroup { +} +/** + * Represents a method that will handle the ObjectSelected events. + */ +interface ASPxClientWebChartControlHotTrackEventHandler { + /** + * Represents a method that will handle the ObjectSelected events. + * @param source The event source. This parameter identifies the ASPxClientWebChartControl which raised the event. + * @param e An ASPxClientWebChartControlHotTrackEventArgs object which contains event data. + */ + (source: S, e: ASPxClientWebChartControlHotTrackEventArgs): void; +} +/** + * Provides data for a chart control's ObjectSelected events on the client side. + */ +interface ASPxClientWebChartControlHotTrackEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Provides access on the client side to the chart element, for which the event was raised. + * Value: An ASPxClientWebChartElement object, which represents the chart element for which the event was raised. + */ + hitObject: ASPxClientWebChartElement; + /** + * Provides access on the client side to the object, which is in some way related to the object being hit. The returned value depends on the hitObject type and hit point location. + * Value: An ASPxClientWebChartElement object representing an additional object that relates to the one being hit. + */ + additionalHitObject: ASPxClientWebChartElement; + /** + * Gets details on the chart elements located at the point where an end-user has clicked when hot-tracking or selecting a chart element on the client side. + * Value: An ASPxClientWebChartHitInfo object, which contains information about the chart elements located at the point where an end-user has clicked. + */ + hitInfo: ASPxClientWebChartHitInfo; + /** + * Provides access on the client side to the chart and all its elements. + * Value: An ASPxClientWebChart object, which provides access to chart properties. + */ + chart: ASPxClientWebChart; + /** + * Gets the HTML object that contains the processed item. + * Value: An object representing a container for the item related to the event. + */ + htmlElement: Object; + /** + * Gets the X-coordinate of the hit test point, relative to the top left corner of the chart. + * Value: An integer value specifying X-coordinate of the hit test point (in pixels). + */ + x: number; + /** + * Gets the Y-coordinate of the hit test point, relative to the top left corner of the chart. + * Value: An integer value specifying Y-coordinate of the hit test point (in pixels). + */ + y: number; + /** + * Gets the X-coordinate of the hit test point, relative to the top left corner of the Web Page containing this chart. + * Value: An integer value specifying X-coordinate of the hit test point (in pixels). + */ + absoluteX: number; + /** + * Gets the Y-coordinate of the hit test point, relative to the top left corner of the Web Page containing this chart. + * Value: An integer value specifying Y-coordinate of the hit test point (in pixels). + */ + absoluteY: number; + /** + * Gets a value indicating whether the hot-tracking or object selection should be canceled. + * Value: true to cancel the hot-tracking or selection of an object; otherwise, false. + */ + cancel: boolean; +} +/** + * Represents an object under the hit test point within a chart control, on the client side. + */ +interface ASPxClientHitObject { + /** + * Gets the chart element for which the event was raised. + * Value: An ASPxClientWebChartElement object, representing the chart element for which the event was raised. + */ + Object: ASPxClientWebChartElement; + /** + * Provides access to an object, which is in some way related to the object being hit. The returned value depends on the Object type and hit point location. + * Value: An ASPxClientWebChartElement object that represents an additional object related to the one being hit. + */ + AdditionalObject: ASPxClientWebChartElement; +} +/** + * Contains information about a specific test point within a chart control, on the client side. + */ +interface ASPxClientWebChartHitInfo { + /** + * Gets a value indicating whether the test point is within the chart. + * Value: true if the test point is within a chart; otherwise, false. + */ + inChart: boolean; + /** + * Gets a value indicating whether the test point is within the chart title. + * Value: true if the test point is within a chart title; otherwise, false. + */ + inChartTitle: boolean; + /** + * Gets a value indicating whether the test point is within the axis. + * Value: true if the test point is within an axis; otherwise, false. + */ + inAxis: boolean; + /** + * Gets a value indicating whether the test point is within the axis label item. + * Value: true if the test point is within an axis label item; otherwise, false. + */ + inAxisLabelItem: boolean; + /** + * Gets a value indicating whether the test point is within the axis title. + * Value: true if the test point is within an axis title; otherwise, false. + */ + inAxisTitle: boolean; + /** + * Gets a value indicating whether the test point is within the constant line. + * Value: true if the test point is within a constant line; otherwise, false. + */ + inConstantLine: boolean; + /** + * Gets a value indicating whether the test point is within the diagram. + * Value: true if the test point is within a diagram; otherwise, false. + */ + inDiagram: boolean; + /** + * Gets a value indicating whether the test point is within the non-default pane. + * Value: true if the test point is within a non-default pane; otherwise, false. + */ + inNonDefaultPane: boolean; + /** + * Gets a value indicating whether the test point is within the legend. + * Value: true if the test point is within a legend; otherwise, false. + */ + inLegend: boolean; + /** + * Gets the value indicating whether or not the test point is within a custom legend item. + * Value: true if the test point is within a custom legend item; otherwise, false. + */ + inCustomLegendItem: boolean; + /** + * Gets a value indicating whether the test point is within the series. + * Value: true if the test point is within a series; otherwise, false. + */ + inSeries: boolean; + /** + * Gets a value indicating whether the test point is within the series label. + * Value: true if the test point is within a series label; otherwise, false. + */ + inSeriesLabel: boolean; + /** + * Gets a value indicating whether the test point is within the series point. + * Value: true if the test point is within a series point; otherwise, false. + */ + inSeriesPoint: boolean; + /** + * Gets a value indicating whether the test point is within the series title. + * Value: true if the test point is within a series title; otherwise, false. + */ + inSeriesTitle: boolean; + /** + * Gets a value indicating whether the test point is within the trendline. + * Value: true if the test point is within a trendline; otherwise, false. + */ + inTrendLine: boolean; + /** + * Gets a value indicating whether the test point is within the Fibonacci Indicator. + * Value: true if the test point is within a Fibonacci Indicator; otherwise, false. + */ + inFibonacciIndicator: boolean; + /** + * Gets a value indicating whether the test point is within the regression line. + * Value: true if the test point is within a regression line; otherwise, false. + */ + inRegressionLine: boolean; + /** + * Gets a value specifying whether the test point is within an indicator. + * Value: true if the test point is within an indicator; otherwise, false. + */ + inIndicator: boolean; + /** + * Gets a value indicating whether the test point is within an annotation. + * Value: true if the test point is within an annotation; otherwise, false. + */ + inAnnotation: boolean; + /** + * Gets a value indicating whether the test point is within a hyperlink. + * Value: true, if the test point is within a hyperlink; otherwise, false. + */ + inHyperlink: boolean; + /** + * Gets the client-side chart instance from under the test point. + * Value: An ASPxClientWebChart object. + */ + chart: ASPxClientWebChart; + /** + * Gets the client-side chart title instance from under the test point. + * Value: An ASPxClientChartTitle object. + */ + chartTitle: ASPxClientChartTitle; + /** + * Gets the client-side axis instance from under the test point. + * Value: An ASPxClientAxisBase descendant. + */ + axis: ASPxClientAxisBase; + /** + * Gets the client-side constant line instance from under the test point. + * Value: An ASPxClientConstantLine object. + */ + constantLine: ASPxClientConstantLine; + /** + * Gets the client-side diagram instance from under the test point. + * Value: An ASPxClientXYDiagramBase descendant. + */ + diagram: ASPxClientXYDiagramBase; + /** + * Gets the client-side non-default pane instance from under the test point. + * Value: An ASPxClientXYDiagramPane object. + */ + nonDefaultPane: ASPxClientXYDiagramPane; + /** + * Gets the client-side legend instance from under the test point. + * Value: An ASPxClientLegend object. + */ + legend: ASPxClientLegend; + /** + * Gets a custom legend item which is located under the test point. + * Value: An ASPxClientCustomLegendItem object which represents the item located under the test point. + */ + customLegendItem: ASPxClientCustomLegendItem; + /** + * Gets the client-side series instance from under the test point. + * Value: An ASPxClientSeries object. + */ + series: ASPxClientSeries; + /** + * Gets the client-side series label instance from under the test point. + * Value: An ASPxClientSeriesLabel object. + */ + seriesLabel: ASPxClientSeriesLabel; + /** + * Gets the client-side series title instance from under the test point. + * Value: An ASPxClientSeriesTitle object. + */ + seriesTitle: ASPxClientSeriesTitle; + /** + * Gets the client-side trendline instance from under the test point. + * Value: An ASPxClientTrendLine object. + */ + trendLine: ASPxClientTrendLine; + /** + * Gets the client-side Fibonacci indicator instance from under the test point. + * Value: An ASPxClientFibonacciIndicator object. + */ + fibonacciIndicator: ASPxClientFibonacciIndicator; + /** + * Gets the client-side regression line instance from under the test point. + * Value: An ASPxClientRegressionLine object. + */ + regressionLine: ASPxClientRegressionLine; + /** + * Gets the client-side indicator instance from under the test point. + * Value: An ASPxClientIndicator descendant. + */ + indicator: ASPxClientIndicator; + /** + * Gets the client-side annotation instance from under the test point. + * Value: An ASPxClientAnnotation object. + */ + annotation: ASPxClientAnnotation; + /** + * Gets the client-side series point instance from under the test point. + * Value: An ASPxClientSeriesPoint object. + */ + seriesPoint: ASPxClientSeriesPoint; + /** + * Gets the client-side axis label item instance from under the test point. + * Value: An ASPxClientAxisLabelItem object. + */ + axisLabelItem: ASPxClientAxisLabelItem; + /** + * Gets the client-side axis title instance from under the test point. + * Value: An ASPxClientAxisTitle object. + */ + axisTitle: ASPxClientAxisTitle; + /** + * Returns a hyperlink which is located under the test point. + * Value: A String object representing a hyperlink. + */ + hyperlink: string; +} +/** + * Represents the client-side equivalent of the DiagramCoordinates class. + */ +interface ASPxClientDiagramCoordinates { + /** + * Gets the type of the argument scale. + * Value: A string object which contains the current scale type. + */ + argumentScaleType: string; + /** + * Gets the type of the value scale. + * Value: A string object which contains the current scale type. + */ + valueScaleType: string; + /** + * Gets the argument of the data point as a text string. + * Value: A string object, representing a data point's argument. + */ + qualitativeArgument: string; + /** + * Gets the numerical representation of the data point's argument. + * Value: A Double value, representing the data point's argument. + */ + numericalArgument: number; + /** + * Gets the date-time representation of the data point's argument. + * Value: A date object, representing the point's argument. + */ + dateTimeArgument: Date; + /** + * Gets the numerical representation of the data point's value. + * Value: A Double value, representing the data point's value. + */ + numericalValue: number; + /** + * Gets the date-time representation of the data point's value. + * Value: A date object, representing the point's value. + */ + dateTimeValue: Date; + /** + * Gets the X-axis of the diagram point. + * Value: An ASPxClientAxisBase descendant, representing the axis of arguments (X-axis). + */ + axisX: ASPxClientAxisBase; + /** + * Gets the Y-axis of the diagram point. + * Value: An ASPxClientAxisBase descendant, representing the axis of values (Y-axis). + */ + axisY: ASPxClientAxisBase; + /** + * Gets the pane of the diagram point. + * Value: An ASPxClientXYDiagramPane descendant, representing the pane. + */ + pane: ASPxClientXYDiagramPane; + /** + * Checks whether the current object represents a point outside the diagram area. + */ + IsEmpty(): boolean; + /** + * Gets the value of the client-side axis instance. + * @param axis An ASPxClientAxisBase class descendant, representing the axis that contains the requested value. + */ + GetAxisValue(axis: ASPxClientAxisBase): ASPxClientAxisValue; +} +/** + * Contains the information about an axis value. + */ +interface ASPxClientAxisValue { + /** + * Gets the axis scale type. + * Value: A String value, specifying the axis scale type. + */ + scaleType: string; + /** + * Gets the axis value, if the axis scale type is qualitative. + * Value: A String value, specifying the axis value. + */ + qualitativeValue: string; + /** + * Gets the axis value, if the axis scale type is numerical. + * Value: A Double value, specifying the axis value. + */ + numericalValue: number; + /** + * Gets the axis value, if the axis scale type is date-time. + * Value: A DateTime value, specifying the axis value. + */ + dateTimeValue: Date; +} +/** + * Represents the client-side equivalent of the ControlCoordinates class. + */ +interface ASPxClientControlCoordinates { + /** + * Gets the point's pane. + * Value: An ASPxClientXYDiagramPane object. + */ + pane: ASPxClientXYDiagramPane; + /** + * Gets the point's X-coordinate, in pixels. + * Value: An integer value, specifying the X-coordinate (in pixels). + */ + x: number; + /** + * Gets the point's Y-coordinate, in pixels. + * Value: An integer value, specifying the Y-coordinate (in pixels). + */ + y: number; + /** + * Gets the point's visibility state. + * Value: "Visible", "Hidden", or "Undefined". + */ + visibility: string; +} +/** + * Represents the client-side equivalent of the ChartElement class. + */ +interface ASPxClientWebChartElement { + /** + * Gets the chart that owns the current chart element. + * Value: An ASPxClientWebChart object, to which the chart element belongs. + */ + chart: ASPxClientWebChart; +} +/** + * Represents a base class for chart elements, which are not necessarily required to be present on the client side. + */ +interface ASPxClientWebChartEmptyElement extends ASPxClientWebChartElement { +} +/** + * Represents a base class for chart elements, which are required to be present on the client side. + */ +interface ASPxClientWebChartRequiredElement extends ASPxClientWebChartElement { +} +/** + * Represents the client-side equivalent of the ChartElementNamed class. + */ +interface ASPxClientWebChartElementNamed extends ASPxClientWebChartRequiredElement { + /** + * Gets the name of the chart element. + * Value: A string object representing the name of the chart element. + */ + name: string; +} +/** + * Represents the client-side equivalent of the WebChartControl control. + */ +interface ASPxClientWebChart extends ASPxClientWebChartRequiredElement { + /** + * Gets the client-side Chart Control that owns the current chart. + * Value: An ASPxClientWebChartControl object, to which the chart belongs. + */ + chartControl: ASPxClientWebChartControl; + /** + * Gets the chart's diagram and provides access to its settings. + * Value: An ASPxClientRadarDiagram), that represents the chart's diagram. + */ + diagram: ASPxClientWebChartElement; + /** + * Provides access to the chart's collection of series. + * Value: An array of ASPxClientSeries objects that represent the collection of series. + */ + series: ASPxClientSeries[]; + /** + * Provides access to the collection of chart titles. + * Value: An array of ASPxClientChartTitle objects, that represent the collection of chart titles. + */ + titles: ASPxClientChartTitle[]; + /** + * Provides access to the chart's collection of annotations. + * Value: An array of ASPxClientAnnotation objects, representing the collection of annotations. + */ + annotations: ASPxClientAnnotation[]; + /** + * Gets the chart's legend and provides access to its settings. + * Value: An ASPxClientLegend object that represents the chart's legend. + */ + legend: ASPxClientLegend; + /** + * Returns the collection of legends. + * Value: An array of ASPxClientLegend objects. + */ + legends: ASPxClientLegend[]; + /** + * Gets the name of the appearance, which is currently used to draw the chart's elements. + * Value: A string value that represents the appearance name. + */ + appearanceName: string; + /** + * Gets the name of the palette currently used to draw the chart's series. + * Value: A string value that represents the palette name. + */ + paletteName: string; + /** + * Gets a value indicating whether series tooltips should be shown. + * Value: true to show tooltips for series; otherwise, false. + */ + showSeriesToolTip: boolean; + /** + * Gets a value indicating whether point tooltips should be shown. + * Value: true to show tooltips for series points; otherwise, false. + */ + showPointToolTip: boolean; + /** + * Gets a value indicating whether a crosshair cursor should be shown. + * Value: true to show a crosshair cursor; otherwise, false. + */ + showCrosshair: boolean; + /** + * Gets a value that contains information on how the tooltip position is defined, for example, relative to a mouse pointer or chart element. + * Value: An ASPxClientToolTipPosition class descendant that defines the tooltip position type. + */ + toolTipPosition: ASPxClientToolTipPosition; + /** + * Returns the tooltip controller that shows tooltips for chart elements. + * Value: An ASPxClientToolTipController object. + */ + toolTipController: ASPxClientToolTipController; + /** + * Gets the settings for a crosshair cursor concerning its position and appearance on a diagram. + * Value: An ASPxClientCrosshairOptions object descendant which provides access to crosshair cursor options on a diagram. + */ + crosshairOptions: ASPxClientCrosshairOptions; + /** + * Gets a css postfix for a chart. + * Value: A string value. + */ + cssPostfix: string; + /** + * Gets or sets a value which specifies how the chart elements are selected. + * Value: A String object representing the name of the selection mode. + */ + selectionMode: string; +} +/** + * Represents the client-side equivalent of the SimpleDiagram class. + */ +interface ASPxClientSimpleDiagram extends ASPxClientWebChartEmptyElement { +} +/** + * Represents the base class for all diagram classes, which have X and Y axes. + */ +interface ASPxClientXYDiagramBase extends ASPxClientWebChartRequiredElement { + /** + * Gets the X-axis. + * Value: An ASPxClientAxisBase object which represents the X-axis. + */ + axisX: ASPxClientAxisBase; + /** + * Gets the Y-axis. + * Value: An ASPxClientAxisBase object which represents the Y-axis. + */ + axisY: ASPxClientAxisBase; +} +/** + * Represents the client-side equivalent of the XYDiagram2D class. + */ +interface ASPxClientXYDiagram2D extends ASPxClientXYDiagramBase { + /** + * Provides access to a collection of secondary X-axes for a given 2D XY-diagram. + * Value: An array of ASPxClientAxis objects, that is a collection of secondary X-axes. + */ + secondaryAxesX: ASPxClientAxis[]; + /** + * Provides access to a collection of secondary Y-axes for a given 2D XY-diagram. + * Value: An array of ASPxClientAxis objects, that is a collection of secondary X-axes. + */ + secondaryAxesY: ASPxClientAxis[]; + /** + * Provides access to a default pane object. + * Value: An ASPxClientXYDiagramPane object which represents the default pane of a chart. + */ + defaultPane: ASPxClientXYDiagramPane; + /** + * Provides access to an array of a diagram's panes. + * Value: An array of ASPxClientXYDiagramPane objects. + */ + panes: ASPxClientXYDiagramPane[]; + /** + * Converts the display coordinates into a diagram coordinates object. + * @param x An integer value, representing the X-coordinate of a point (measured in pixels relative to the top left corner of a chart). + * @param y An integer value, representing the Y-coordinate of a point (measured in pixels relative to the top left corner of a chart). + */ + PointToDiagram(x: number, y: number): ASPxClientDiagramCoordinates; + /** + * Converts the diagram coordinates of a point into screen coordinates. + * @param argument An object, representing the point's argument. + * @param value An object, representing the point's value. + * @param axisX An ASPxClientAxis2D descendant, representing the X-axis. + * @param axisY An ASPxClientAxis2D descendant, representing the Y-axis. + * @param pane An ASPxClientXYDiagramPane object, representing the pane. + */ + DiagramToPoint(argument: Object, value: Object, axisX: ASPxClientAxis2D, axisY: ASPxClientAxis2D, pane: ASPxClientXYDiagramPane): ASPxClientControlCoordinates; + /** + * Shows the Crosshair Cursor at the point with the specified coordinates. + * @param screenX The horizontal coordinate that is related to the top-left angle of the chart. + * @param screenY The vertical coordinate that is related to the top-left angle of the chart. + */ + ShowCrosshair(screenX: number, screenY: number): void; +} +/** + * Represents the client-side equivalent of the XYDiagram class. + */ +interface ASPxClientXYDiagram extends ASPxClientXYDiagram2D { + /** + * Gets a value indicating whether the diagram is rotated. + * Value: true if the diagram is rotated; otherwise, false. + */ + rotated: boolean; +} +/** + * Represents the client-side equivalent of the SwiftPlotDiagram class. + */ +interface ASPxClientSwiftPlotDiagram extends ASPxClientXYDiagram2D { +} +/** + * Represents the client-side equivalent of the XYDiagramPane class. + */ +interface ASPxClientXYDiagramPane extends ASPxClientWebChartElementNamed { + /** + * Gets the diagram that owns the current pane object. + * Value: An ASPxClientXYDiagram object, to which the pane belongs. + */ + diagram: ASPxClientXYDiagram; +} +/** + * Represents the client-side equivalent of the XYDiagram3D class. + */ +interface ASPxClientXYDiagram3D extends ASPxClientXYDiagramBase { +} +/** + * Represents the client-side equivalent of the RadarDiagram class. + */ +interface ASPxClientRadarDiagram extends ASPxClientXYDiagramBase { + /** + * Converts the display coordinates into a diagram coordinates object. + * @param x An integer value, representing the X-coordinate of a point (measured in pixels relative to the top left corner of a chart). + * @param y An integer value, representing the Y-coordinate of a point (measured in pixels relative to the top left corner of a chart). + */ + PointToDiagram(x: number, y: number): ASPxClientDiagramCoordinates; + /** + * Converts the diagram coordinates of a point into screen coordinates. + * @param argument An object, representing the point's argument. + * @param value An object, representing the point's value. + */ + DiagramToPoint(argument: Object, value: Object): ASPxClientControlCoordinates; +} +/** + * Represents the client-side equivalent of the AxisBase class. + */ +interface ASPxClientAxisBase extends ASPxClientWebChartElementNamed { + /** + * Provides access to the XY-diagram which contains the current axis. + * Value: An ASPxClientXYDiagramBase class descendant. + */ + diagram: ASPxClientXYDiagramBase; + /** + * Provides acess to the range of the axis coordinates. + * Value: An ASPxClientAxisRange object, which contains the common range settings of the axis coordinates. + */ + range: ASPxClientAxisRange; +} +/** + * Represents the client-side equivalent of the Axis2D class. + */ +interface ASPxClientAxis2D extends ASPxClientAxisBase { + /** + * Provides access to an axis title object. + * Value: An ASPxClientAxisTitle object which represents the axis title. + */ + axisTitle: ASPxClientAxisTitle; + /** + * Provides access to the axis strips collection. + * Value: An array of ASPxClientStrip objects. + */ + strips: ASPxClientStrip[]; + /** + * Provides access to the collection of the axis constant lines. + * Value: An array of ASPxClientConstantLine objects which represent constant lines that belong to this axis. + */ + constantLines: ASPxClientConstantLine[]; +} +/** + * Represents the client-side equivalent of the Axis class. + */ +interface ASPxClientAxis extends ASPxClientAxis2D { + /** + * Gets a value indicating whether the axis is reversed. + * Value: true if the axis is reversed; otherwise, false. + */ + reverse: boolean; +} +/** + * Represents the client-side equivalent of the SwiftPlotDiagramAxis class. + */ +interface ASPxClientSwiftPlotDiagramAxis extends ASPxClientAxis2D { +} +/** + * Represents the client-side equivalent of the Axis3D class. + */ +interface ASPxClientAxis3D extends ASPxClientAxisBase { +} +/** + * Represents the client-side equivalent of the RadarAxis class. + */ +interface ASPxClientRadarAxis extends ASPxClientAxisBase { +} +/** + * Represents the client-side equivalent of the AxisTitle class. + */ +interface ASPxClientAxisTitle extends ASPxClientWebChartRequiredElement { + /** + * Gets the axis to which the axis title belongs. + * Value: An ASPxClientAxisBase descendant, which identifies the axis. + */ + axis: ASPxClientAxisBase; + /** + * Gets the text of the axis title. + * Value: A string object which contains the axis title's text. + */ + text: string; +} +/** + * Represents the client-side equivalent of the AxisLabelItem class. + */ +interface ASPxClientAxisLabelItem extends ASPxClientWebChartRequiredElement { + /** + * Gets the axis to which an axis label item belongs. + * Value: An ASPxClientAxisBase descendant, which identifies the axis. + */ + axis: ASPxClientAxisBase; + /** + * Gets the text of an axis label item. + * Value: A string object which contains the axis label item's text. + */ + text: string; + /** + * Gets the axis value to which an axis label item corresponds. + * Value: An object that specifies the axis value. + */ + axisValue: Object; + /** + * Gets the internal representation of the axis value to which an axis label item corresponds. + * Value: A Double value which specifies the internal representation of the axis value. + */ + axisValueInternal: number; +} +/** + * Represents the client-side equivalent of the AxisRange class. + */ +interface ASPxClientAxisRange extends ASPxClientWebChartRequiredElement { + /** + * Gets the axis that owns the current axis range object. + * Value: An ASPxClientAxisBase object, to which the axis range belongs. + */ + axis: ASPxClientAxisBase; + /** + * Gets the minimum value to display on an axis. + * Value: An object representing the minimum value of the axis range. + */ + minValue: Object; + /** + * Gets the maximum value to display on an axis. + * Value: An object representing the maximum value of the axis range. + */ + maxValue: Object; + /** + * Gets the internal float representation of the range minimum value. + * Value: A Double value which specifies the internal representation of the range minimum value. + */ + minValueInternal: number; + /** + * Gets the internal float representation of the range maximum value. + * Value: A Double value which specifies the internal representation of the range maximum value. + */ + maxValueInternal: number; +} +/** + * Represents the client-side equivalent of the Strip class. + */ +interface ASPxClientStrip extends ASPxClientWebChartElementNamed { + /** + * Gets the axis that owns the current strip object. + * Value: An ASPxClientAxis object, to which the strip belongs. + */ + axis: ASPxClientAxis; + /** + * Gets the minimum value of the strip's range. + * Value: An object that represents the minimum value of the strip's range. + */ + minValue: Object; + /** + * Gets the maximum value of the strip's range. + * Value: An object that represents the maximum value of the strip's range. + */ + maxValue: Object; +} +/** + * Represents the client-side equivalent of the ConstantLine class. + */ +interface ASPxClientConstantLine extends ASPxClientWebChartElementNamed { + /** + * Gets the axis that owns the current constant line object. + * Value: An ASPxClientAxis object, to which the constant line belongs. + */ + axis: ASPxClientAxis; + /** + * Gets the constant line's position along the axis. + * Value: An object that specifies the constant line's position. + */ + value: Object; + /** + * Gets the constant line title. + * Value: A string object, representing the title's text. + */ + title: string; +} +/** + * Represents the client-side equivalent of the Series class. + */ +interface ASPxClientSeries extends ASPxClientWebChartElementNamed { + /** + * Gets a value that specifies the view type of the series. + * Value: A string object which contains the current view type. + */ + viewType: string; + /** + * Gets a value that specifies the scale type for the argument data of the series' data points. + * Value: A string object which contains the current scale type. + */ + argumentScaleType: string; + /** + * Gets a value that specifies the scale type for the value data of the series' data points. + * Value: A string object which contains the current scale type. + */ + valueScaleType: string; + /** + * Gets the X-Axis that is used to plot the current series on the XY-diagram. + * Value: A string object, which represents the X-axis name. + */ + axisX: string; + /** + * Gets the Y-Axis that is used to plot the current series on the XY-diagram. + * Value: A string object, which represents the Y-axis name. + */ + axisY: string; + /** + * Gets the pane that is used to plot the current series on the XY-diagram. + * Value: A string object, which represents the pane's name. + */ + pane: string; + /** + * Gets a value indicating whether the series is visible. + * Value: true if the series is visible; otherwise, false. + */ + visible: boolean; + /** + * Gets a value that specifies whether or not a tooltip is enabled for a chart. + * Value: true - a tooltip is enabled for a chart; false - a tooltip is disabled. + */ + toolTipEnabled: boolean; + /** + * Gets the text to be displayed within series tooltips. + * Value: A string value. + */ + toolTipText: string; + /** + * Gets an image to be displayed within series tooltips. + * Value: A string value. + */ + toolTipImage: string; + /** + * Gets the settings of series labels. + * Value: An ASPxClientSeriesLabel object, which provides the series label settings. + */ + label: ASPxClientSeriesLabel; + /** + * Gets the series' collection of data points. + * Value: An array of ASPxClientSeriesPoint objects, that represent the series' data points. + */ + points: ASPxClientSeriesPoint[]; + /** + * Provides access to the collection of series titles. + * Value: An array of ASPxClientSeriesTitle objects, that represent the collection of series titles. + */ + titles: ASPxClientSeriesTitle[]; + /** + * Gets the series' collection of indicators. + * Value: An array of ASPxClientIndicator objects, that belong to the series. + */ + indicators: ASPxClientIndicator[]; + /** + * Provides access to the collection of regression lines. + * Value: An array of ASPxClientRegressionLine objects which represent regression lines available for the series. + */ + regressionLines: ASPxClientRegressionLine[]; + /** + * Provides access to the collection of trendlines. + * Value: An array of ASPxClientTrendLine objects, that represent the collection of trendlines. + */ + trendLines: ASPxClientTrendLine[]; + /** + * Provides access to the collection of Fibonacci Indicators. + * Value: An array of ASPxClientFibonacciIndicator objects, that represent the collection of Fibonacci Indicators. + */ + fibonacciIndicators: ASPxClientFibonacciIndicator[]; + /** + * Gets the color of a series. + * Value: A string value. + */ + color: string; + /** + * Gets a value that defines a group for stacked series. + * Value: A string value. + */ + stackedGroup: string; + /** + * Gets a string which represents the pattern specifying the text to be displayed within a crosshair label for the current Series type. + * Value: A Empty. + */ + crosshairLabelPattern: string; + /** + * This property is intended for internal use only. + * Value: A String value. + */ + groupedElementsPattern: string; + /** + * Returns a collection of crosshair value items. + * Value: An array of ASPxClientCrosshairValueItem objects. + */ + crosshairValueItems: ASPxClientCrosshairValueItem[]; + /** + * Gets a value indicating whether a crosshair cursor is enabled. + * Value: true if a crosshair cursor is enabled; otherwise, false. + */ + actualCrosshairEnabled: boolean; + /** + * Gets a value indicating whether a crosshair label should be shown for this series. + * Value: true if crosshair labels are visible; otherwise, false. + */ + actualCrosshairLabelVisibility: boolean; +} +/** + * Represents the client-side equivalent of the SeriesLabelBase class. + */ +interface ASPxClientSeriesLabel extends ASPxClientWebChartElement { + /** + * Gets the series that owns the current series label object. + * Value: An ASPxClientSeries object, to which the series label belongs. + */ + series: ASPxClientSeries; + /** + * Gets the common text for all series point labels. + * Value: Returns an empty string object. + */ + text: string; +} +/** + * Represents the client-side equivalent of the SeriesPoint class. + */ +interface ASPxClientSeriesPoint extends ASPxClientWebChartRequiredElement { + /** + * Gets the series that owns the current series point object. + * Value: An ASPxClientSeries object, to which the series point belongs. + */ + series: ASPxClientSeries; + /** + * Gets the data point's argument. + * Value: An object that specifies the data point's argument. + */ + argument: Object; + /** + * Gets the point's data value(s). + * Value: An array of objects that represent the data value(s) of the series data point. + */ + values: Object[]; + /** + * Gets the text to be displayed within series points tooltips. + * Value: A string value. + */ + toolTipText: string; + /** + * Gets the color of a series point. + * Value: A string value. + */ + color: string; + /** + * Gets the percent value of a series point. + * Value: A float value. + */ + percentValue: number; + /** + * Gets a hint that is shown in series points tooltips. + * Value: A string value. + */ + toolTipHint: string; +} +/** + * Represents the client-side equivalent of the Legend class. + */ +interface ASPxClientLegend extends ASPxClientWebChartEmptyElement { + /** + * Returns a value which determines whether to use checkboxes instead of markers on a chart legend for all legend items. + * Value: true, if legend checkboxes are shown instead of markers for all legend items; otherwise, false. + */ + useCheckBoxes: boolean; + /** + * Returns a collection of custom legend items of the legend. + * Value: A collection of ASPxClientCustomLegendItem objects. + */ + customItems: ASPxClientCustomLegendItem[]; + /** + * Returns the name of the legend. + * Value: The string value representing the name of the legend. + */ + name: string; +} +/** + * Represents the base for ASPxClientSeriesTitle classes. + */ +interface ASPxClientTitleBase extends ASPxClientWebChartRequiredElement { + /** + * Gets the lines of text within a title. + * Value: An array of string values containing the text of a title. + */ + lines: string[]; + /** + * Gets the alignment of the title. + * Value: A string value containing the text, which specifies the alignment of a title. + */ + alignment: string; + /** + * Gets a value that specifies to which edges of a parent element the title should be docked. + * Value: A string value. + */ + dock: string; +} +/** + * Represents the client-side equivalent of the ChartTitle class. + */ +interface ASPxClientChartTitle extends ASPxClientTitleBase { +} +/** + * Represents the client-side equivalent of the SeriesTitle class. + */ +interface ASPxClientSeriesTitle extends ASPxClientTitleBase { + /** + * Gets the series that owns the current title object. + * Value: An ASPxClientSeries object, to which the series title belongs. + */ + series: ASPxClientSeries; +} +/** + * Represents the client-side equivalent of the Indicator class. + */ +interface ASPxClientIndicator extends ASPxClientWebChartElementNamed { + /** + * Gets the indicator's associated series. + * Value: An ASPxClientSeries object. + */ + series: ASPxClientSeries; +} +/** + * Represents the client-side equivalent of the FinancialIndicator class. + */ +interface ASPxClientFinancialIndicator extends ASPxClientIndicator { + /** + * Gets the first point of the financial indicator. + * Value: An ASPxClientFinancialIndicatorPoint object, which represents a financial indicator's first point. + */ + point1: ASPxClientFinancialIndicatorPoint; + /** + * Gets the second point of the financial indicator. + * Value: An ASPxClientFinancialIndicatorPoint object, which represents a financial indicator's second point. + */ + point2: ASPxClientFinancialIndicatorPoint; +} +/** + * Represents the client-side equivalent of the TrendLine class. + */ +interface ASPxClientTrendLine extends ASPxClientFinancialIndicator { +} +/** + * Represents the client-side equivalent of the FibonacciIndicator class. + */ +interface ASPxClientFibonacciIndicator extends ASPxClientFinancialIndicator { +} +/** + * Represents the client-side equivalent of the FinancialIndicatorPoint class. + */ +interface ASPxClientFinancialIndicatorPoint extends ASPxClientWebChartRequiredElement { + /** + * Gets the financial indicator that owns the current financial indicator point. + * Value: An ASPxClientFinancialIndicator object, to which the point belongs. + */ + financialIndicator: ASPxClientFinancialIndicator; + /** + * Gets the argument of the financial indicator's point. + * Value: An object that specifies the point argument. + */ + argument: Object; + /** + * Gets a value, indicating how the value of a financial indicator's point is obtained. + * Value: A string value, which indicates how to obtain a financial indicator point's value. + */ + valueLevel: string; +} +/** + * The client-side equivalent of the SingleLevelIndicator class. + */ +interface ASPxClientSingleLevelIndicator extends ASPxClientIndicator { + /** + * Gets a value specifying the value level to which the single-level indicator corresponds. + * Value: A string value. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the RegressionLine class. + */ +interface ASPxClientRegressionLine extends ASPxClientSingleLevelIndicator { +} +/** + * The client-side equivalent of the MovingAverage class. + */ +interface ASPxClientMovingAverage extends ASPxClientSingleLevelIndicator { + /** + * Gets the number of data points used to calculate the moving average. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value specifying whether to display a Moving Average, Envelope, or both. + * Value: A string value. + */ + kind: string; + /** + * Gets a value specifying the Envelope percent. + * Value: A double value which specifies the Envelope percent. + */ + envelopePercent: number; +} +/** + * The client-side equivalent of the SimpleMovingAverage class. + */ +interface ASPxClientSimpleMovingAverage extends ASPxClientMovingAverage { +} +/** + * The client-side equivalent of the ExponentialMovingAverage class. + */ +interface ASPxClientExponentialMovingAverage extends ASPxClientMovingAverage { +} +/** + * The client-side equivalent of the WeightedMovingAverage class. + */ +interface ASPxClientWeightedMovingAverage extends ASPxClientMovingAverage { +} +/** + * The client-side equivalent of the TriangularMovingAverage class. + */ +interface ASPxClientTriangularMovingAverage extends ASPxClientMovingAverage { +} +/** + * Represents the client-side equivalent of the TripleExponentialMovingAverageTema class. + */ +interface ASPxClientTripleExponentialMovingAverageTema extends ASPxClientMovingAverage { +} +/** + * Represents the client-side equivalent of the BollingerBands class. + */ +interface ASPxClientBollingerBands extends ASPxClientIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the MedianPrice class. + */ +interface ASPxClientMedianPrice extends ASPxClientIndicator { +} +/** + * Represents the client-side equivalent of the TypicalPrice class. + */ +interface ASPxClientTypicalPrice extends ASPxClientIndicator { +} +/** + * Represents the client-side equivalent of the WeightedClose class. + */ +interface ASPxClientWeightedClose extends ASPxClientIndicator { +} +/** + * Represents the client-side equivalent of the SeparatePaneIndicator class. + */ +interface ASPxSeparatePaneIndicator extends ASPxClientIndicator { + /** + * Returns the name of the Y-axis that is used to plot the current indicator on a ASPxClientXYDiagram. + * Value: A string value specifying the Y-axis name. + */ + axisY: string; + /** + * Returns the name of a pane, used to plot the separate pane indicator on an XYDiagram. + * Value: A string that is the name of a pane. + */ + pane: string; +} +/** + * Represents the client-side equivalent of the AverageTrueRange class. + */ +interface ASPxClientAverageTrueRange extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; +} +/** + * Represents the client-side equivalent of the ChaikinsVolatility class. + */ +interface ASPxClientChaikinsVolatility extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; +} +/** + * Represents the client-side equivalent of the CommodityChannelIndex class. + */ +interface ASPxClientCommodityChannelIndex extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; +} +/** + * Represents the client-side equivalent of the DetrendedPriceOscillator class. + */ +interface ASPxClientDetrendedPriceOscillator extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the MassIndex class. + */ +interface ASPxClientMassIndex extends ASPxSeparatePaneIndicator { + /** + * Returns the count of points used to calculate the exponential moving average (EMA). + * Value: An integer value, specifying the count of points used to calculate EMA. + */ + movingAveragePointsCount: number; + /** + * Returns the count of summable values. + * Value: An integer value specifying the count of summable ratios. + */ + sumPointsCount: number; +} +/** + * Represents the client-side equivalent of the MovingAverageConvergenceDivergence class. + */ +interface ASPxClientMovingAverageConvergenceDivergence extends ASPxSeparatePaneIndicator { + /** + * Returns the short period value required to calculate the indicator. + * Value: An integer value specifying the short period value. + */ + shortPeriod: number; + /** + * Returns the long period value required to calculate the indicator. + * Value: An integer value specifying the long period. + */ + longPeriod: number; + /** + * Returns the smoothing period value required to calculate the indicator. + * Value: An integer value specifying the smoothing period value. + */ + signalSmoothingPeriod: number; +} +/** + * Represents the client-side equivalent of the RateOfChange class. + */ +interface ASPxClientRateOfChange extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the RelativeStrengthIndex class. + */ +interface ASPxClientRelativeStrengthIndex extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the StandardDeviation class. + */ +interface ASPxClientStandardDeviation extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the TripleExponentialMovingAverageTrix class. + */ +interface ASPxClientTripleExponentialMovingAverageTrix extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the WilliamsR class. + */ +interface ASPxClientWilliamsR extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; +} +/** + * Represents the client-side equivalent of the FixedValueErrorBars class. + */ +interface ASPxClientFixedValueErrorBars extends ASPxClientIndicator { + /** + * Gets or sets the fixed positive error value. + * Value: A double value specifying the positive error value. + */ + positiveError: number; + /** + * Returns the fixed negative error value. + * Value: A double value specifying the negative error value. + */ + negativeError: number; +} +/** + * Represents the client-side equivalent of the PercentageErrorBars class. + */ +interface ASPxClientPercentageErrorBars extends ASPxClientIndicator { + /** + * Returns the value specifying the percentage of error values of series point values. + * Value: A double value specifying the percentage. Values less than or equal to 0 are not allowed. + */ + percent: number; +} +/** + * Represents the client-side equivalent of the StandardDeviationErrorBars class. + */ +interface ASPxClientStandardDeviationErrorBars extends ASPxClientIndicator { + /** + * Returns the multiplier on which the standard deviation value is multiplied before display. + * Value: A double value specifying the multiplier. Values less than 0 are not allowed. + */ + multiplier: number; +} +/** + * Represents the client-side equivalent of the StandardErrorBars class. + */ +interface ASPxClientStandardErrorBars extends ASPxClientIndicator { +} +/** + * Represents the client-side equivalent of the DataSourceBasedErrorBars class. + */ +interface ASPxClientDataSourceBasedErrorBars extends ASPxClientIndicator { +} +/** + * Represents the client-side equivalent of the Annotation class. + */ +interface ASPxClientAnnotation extends ASPxClientWebChartElementNamed { +} +/** + * Represents the client-side equivalent of the TextAnnotation class. + */ +interface ASPxClientTextAnnotation extends ASPxClientAnnotation { + /** + * Gets the lines of text within an annotation. + * Value: An array of string values containing the text of a title. + */ + lines: string[]; +} +/** + * Represents the client-side equivalent of the ImageAnnotation class. + */ +interface ASPxClientImageAnnotation extends ASPxClientAnnotation { +} +/** + * The client-side equivalent of the CrosshairValueItem class. + */ +interface ASPxClientCrosshairValueItem { + /** + * Gets the value that is displayed in a crosshair label. + * Value: A float value. + */ + value: number; + /** + * Gets an index of a point for which this crosshair value item is displayed. + * Value: An integer value. + */ + pointIndex: number; +} +/** + * The client-side equivalent of the ChartToolTipController class. + */ +interface ASPxClientToolTipController extends ASPxClientWebChartEmptyElement { + /** + * Gets a value indicating whether an image should be shown in tooltips. + * Value: true to show an image in tooltips; otherwise, false. + */ + showImage: boolean; + /** + * Gets a value indicating whether it is necessary to show text in tooltips. + * Value: true to show text in tooltips; otherwise, false. + */ + showText: boolean; + /** + * Gets a value that defines the position of an image within a tooltip. + * Value: A string value. + */ + imagePosition: string; + /** + * Gets a value that defines when tooltips should be invoked. + * Value: A string value. + */ + openMode: string; +} +/** + * The client-side equivalent of the ToolTipPosition class. + */ +interface ASPxClientToolTipPosition { +} +/** + * The client-side equivalent of the ToolTipRelativePosition class. + */ +interface ASPxClientToolTipRelativePosition extends ASPxClientToolTipPosition { + /** + * Gets the horizontal offset of a tooltip. + * Value: An integer value. + */ + offsetX: number; + /** + * Gets the vertical offset of a tooltip. + * Value: An integer value. + */ + offsetY: number; +} +/** + * The client-side equivalent of the ToolTipFreePosition class. + */ +interface ASPxClientToolTipFreePosition extends ASPxClientToolTipPosition { + /** + * Gets the horizontal offset of a tooltip. + * Value: An integer value. + */ + offsetX: number; + /** + * Gets the vertical offset of a tooltip. + * Value: An integer value. + */ + offsetY: number; + /** + * Gets the ID of a pane. + * Value: An integer value. + */ + paneID: number; + /** + * Gets an object containing settings that define how a tooltip should be docked. + * Value: A string value. + */ + dockPosition: string; +} +/** + * The client-side equivalent of the CrosshairLabelPosition class. + */ +interface ASPxClientCrosshairPosition { + /** + * Gets the horizontal offset of a crosshair cursor. + * Value: An integer value that is the X-offset. + */ + offsetX: number; + /** + * Gets the vertical offset of a crosshair cursor. + * Value: An integer value that is the Y-offset. + */ + offsetY: number; +} +/** + * The client-side equivalent of the CrosshairMousePosition class. + */ +interface ASPxClientCrosshairMousePosition extends ASPxClientCrosshairPosition { +} +/** + * The client-side equivalent of the CrosshairFreePosition class. + */ +interface ASPxClientCrosshairFreePosition extends ASPxClientCrosshairPosition { + /** + * Gets a Pane's ID when the crosshair cursor is in the free position mode. + * Value: An integer value that is the pane's ID. + */ + paneID: number; + /** + * Gets a string containing information on a crosshair label's dock position when the crosshair cursor is in the free position mode. + * Value: A string value containing information on a crosshair label's dock position. + */ + dockPosition: string; +} +/** + * Defines line style settings. + */ +interface ASPxClientLineStyle extends ASPxClientWebChartElement { + /** + * Gets the dash style used to paint the line. + * Value: A string value that contains information about the style used to paint the line. + */ + dashStyle: string; + /** + * Gets the thickness that corresponds to the value of the current ASPxClientLineStyle object. + * Value: An integer value which specifies the thickness, in pixels. + */ + thickness: number; + /** + * Returns the join style for the ends of consecutive lines. + * Value: A string representing the name of the line join type. + */ + lineJoin: string; +} +/** + * The client-side equivalent of the CrosshairOptions class. + */ +interface ASPxClientCrosshairOptions extends ASPxClientWebChartEmptyElement { + /** + * Gets a value indicating whether it is necessary to show a crosshair label for the X-axis. + * Value: true to show a crosshair label for the X-axis; otherwise, false. + */ + showAxisXLabels: boolean; + /** + * Gets a value indicating whether it is necessary to show a crosshair label for the Y-axis. + * Value: true to show the crosshair label for the Y-axis; otherwise, false. + */ + showAxisYLabels: boolean; + /** + * Gets a value that defines whether a crosshair label of a series point indicated by a crosshair cursor is shown on a diagram. + * Value: true if a crosshair label indicated by a crosshair cursor is shown on a diagram; otherwise, false. + */ + showCrosshairLabels: boolean; + /** + * Gets a value that indicates whether a crosshair cursor argument line is shown for a series point on a diagram. + * Value: true if a crosshair cursor argument line is displayed on a diagram; otherwise, false. + */ + showArgumentLine: boolean; + /** + * Specifies whether to show a value line of a series point indicated by a crosshair cursor on a diagram. + * Value: true to display a value line indicated by a crosshair cursor on a diagram; otherwise, false. + */ + showValueLine: boolean; + /** + * Gets a value that specifies whether to show a crosshair cursor in a focused pane only. + * Value: true to display a crosshair cursor in a focused pane; otherwise, false. + */ + showOnlyInFocusedPane: boolean; + /** + * Specifies the current snap mode of a crosshair cursor. + * Value: A string value. + */ + snapMode: string; + /** + * Specifies the way in which the crosshair label is shown for a series on a diagram. + * Value: A string value that specifies how the crosshair label is shown for a series. + */ + crosshairLabelMode: string; + /** + * Gets a value that indicates whether to show a header for each series group in crosshair cursor labels. + * Value: true, to show a group header in crosshair cursor labels; otherwise, false. + */ + showGroupHeaders: boolean; + /** + * Gets a string which represents the pattern specifying the group header text to be displayed within the crosshair label. + * Value: A String, which represents the group header's pattern. + */ + groupHeaderPattern: string; + /** + * Gets a value that specifies whether the Crosshair cursor should show points that are out of visual range. + * Value: true if the out of visual range points should be shown in the Crosshair label; otherwise false. + */ + showOutOfRangePoints: boolean; + /** + * Gets the identifier specifying the behavior of the selection of points shown in the crosshair label. + * Value: The selection behavior identifier. + */ + valueSelectionMode: string; + /** + * Gets the color of a crosshair argument line. + * Value: A String value, specifying the color of a crosshair argument line. + */ + argumentLineColor: string; + /** + * Gets the color of a crosshair value line. + * Value: A String value, specifying the color of a crosshair value line. + */ + valueLineColor: string; +} +/** + * The chart print options storage. + */ +interface ASPxClientChartPrintOptions { + /** + * Gets the size mode used to print a chart. + */ + GetSizeMode(): string; + /** + * Sets the size mode used to print a chart. + * @param sizeMode A System.String object, specifying the name of the size mode. + */ + SetSizeMode(sizeMode: string): void; + /** + * Gets a value indicating that the landscape orientation will be used to print a chart. + */ + GetLandscape(): boolean; + /** + * Sets a value indicating that the landscape orientation will be used to print a chart. + * @param landscape A Boolean value, specifying that the landscape orientation will be used to print a chart. + */ + SetLandscape(landscape: boolean): void; + /** + * Gets the left margin which will be used to print a chart. + */ + GetMarginLeft(): number; + /** + * Sets the left margin which will be used to print a chart. + * @param marginLeft A System.Int32 value, specifying the margin in hundredths of an inch. + */ + SetMarginLeft(marginLeft: number): void; + /** + * Gets the top margin which will be used to print a chart. + */ + GetMarginTop(): number; + /** + * Sets the top margin which will be used to print a chart. + * @param marginTop A System.Int32 value, specifying the margin in hundredths of an inch. + */ + SetMarginTop(marginTop: number): void; + /** + * Gets the right margin which will be used to print a chart. + */ + GetMarginRight(): number; + /** + * Sets the right margin which will be used to print a chart. + * @param marginRight A System.Int32 value, specifying the margin in hundredths of an inch. + */ + SetMarginRight(marginRight: number): void; + /** + * Gets the bottom margin which will be used to print a chart. + */ + GetMarginBottom(): number; + /** + * Sets the bottom margin which will be used to print a chart. + * @param marginBottom A System.Int32 value, specifying the margin in hundredths of an inch. + */ + SetMarginBottom(marginBottom: number): void; + /** + * Gets the predefined size ratio of the paper which will be used to print a chart. + */ + GetPaperKind(): string; + /** + * Sets the predefined size ratio of the paper which will be used to print a chart. + * @param paperKind A System.String object, specifying the name of a size ratio. + */ + SetPaperKind(paperKind: string): void; + /** + * Gets the custom paper width which will be used to print a chart. + */ + GetCustomPaperWidth(): number; + /** + * Sets the custom paper width which will be used to print a chart. + * @param customPaperWidth A System.Int32 object, specifying the width in hundredths of an inch. + */ + SetCustomPaperWidth(customPaperWidth: number): void; + /** + * Gets the custom paper height which will be used to print a chart. + */ + GetCustomPaperHeight(): number; + /** + * Sets the custom paper height which will be used to print a chart. + * @param customPaperHeight A System.Int32 object, specifying the height in hundredths of an inch. + */ + SetCustomPaperHeight(customPaperHeight: number): void; + /** + * Gets the name of the custom paper width-height ratio used to print the chart. + */ + GetCustomPaperName(): string; + /** + * Sets the name of the custom paper width-height ratio used to print a chart. + * @param customPaperName A String object, specifying the name of the custom paper width-height ratio. + */ + SetCustomPaperName(customPaperName: string): void; +} +/** + * Represents the client-side equivalent of the CustomLegendItem class. + */ +interface ASPxClientCustomLegendItem extends ASPxClientWebChartElementNamed { + /** + * Returns the text displayed by the custom legend item. + * Value: A string value that specifies legend item text. + */ + text: string; +} +/** + * The client-side equivalent of the ASPxDocumentViewer control. + */ +interface ASPxClientDocumentViewer extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientDocumentViewer. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs when the value of an item within the Document Viewer's report toolbar is changed. + */ + ToolbarItemValueChanged: ASPxClientEvent>; + /** + * Occurs when an item within the Document Viewer's report toolbar is clicked. + */ + ToolbarItemClick: ASPxClientEvent>; + /** + * Occurs on the client side when a report page is loaded into this ASPxClientDocumentViewer instance. + */ + PageLoad: ASPxClientEvent>; + /** + * Provides access to the Splitter of the ASPxClientDocumentViewer. + */ + GetSplitter(): ASPxClientSplitter; + /** + * Provides access to the ASPxClientDocumentViewer's preview that exposes methods to print and export the document. + */ + GetViewer(): ASPxClientReportViewer; + /** + * Provides access to the Document Viewer toolbar on the client. + */ + GetToolbar(): ASPxClientReportToolbar; + /** + * Provides access to the Ribbon of the ASPxClientDocumentViewer. + */ + GetRibbonToolbar(): ASPxClientRibbon; + /** + * Provides access to the parameters panel of the ASPxClientDocumentViewer. + */ + GetParametersPanel(): ASPxClientReportParametersPanel; + /** + * Provides access to the document of the ASPxClientDocumentViewer. + */ + GetDocumentMap(): ASPxClientReportDocumentMap; + /** + * Sets focus on the report control specified by its bookmark. + * @param pageIndex An integer value, specifying the page index. + * @param bookmarkPath A String value, specifying the path to the bookmark. + */ + GotoBookmark(pageIndex: number, bookmarkPath: string): void; + /** + * Initiates a round trip to the server so that the current page will be reloaded. + */ + Refresh(): void; + /** + * Prints the current document. + */ + Print(): void; + /** + * Prints the document's page with the specified page index. + * @param pageIndex A Int32 representing the index of the page to be printed. + */ + Print(pageIndex: number): void; + /** + * Displays the specified report page. + * @param pageIndex An integer value, identifying the report page. + */ + GotoPage(pageIndex: number): void; + /** + * Invokes the Search dialog, which allows end-users to search for specific text in a report. + */ + Search(): void; + /** + * Gets a value indicating whether or not searching text across a report is permitted in the web browser. + */ + IsSearchAllowed(): boolean; + /** + * Exports a report to a file of the specified format, and shows it in a new Web Browser window. + * @param format A string specifying the format to which a report should be exported. + */ + SaveToWindow(format: string): void; + /** + * Exports a report to a file of the specified format, and saves it to the disk. + * @param format A string specifying the format to which a report should be exported. + */ + SaveToDisk(format: string): void; +} +/** + * A method that will handle the ItemValueChanged event. + */ +interface ASPxClientToolbarItemValueChangedEventHandler { + /** + * A method that will handle the ToolbarItemValueChanged event. + * @param source A Object that is the event source. + * @param e An ASPxClientToolbarItemValueChangedEventArgs object, containing the event arguments. + */ + (source: S, e: ASPxClientToolbarItemValueChangedEventArgs): void; +} +/** + * Provides data for the ItemValueChanged event. + */ +interface ASPxClientToolbarItemValueChangedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the menu item object related to the event. + * Value: An ASPxClientMenuItem object, manipulations on which forced the event to be raised. + */ + item: ASPxClientMenuItem; + /** + * Provides access to the toolbar's value editor on the client. + * Value: An ASPxClientControl descendant. + */ + editor: ASPxClientControl; +} +/** + * The client-side equivalent of the ASPxQueryBuilder control. + */ +interface ASPxClientQueryBuilder extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientQueryBuilder. + */ + CallbackError: ASPxClientEvent>; + /** + * Enables you to customize the menu actions of a Query Builder. + */ + CustomizeToolbarActions: ASPxClientEvent>; + /** + * Occurs when executing the Save command on the client. + */ + SaveCommandExecute: ASPxClientEvent>; + /** + * Sends a callback to the server with the specified argument. + * @param arg A String value, specifying the callback argument. + */ + PerformCallback(arg: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(arg: string, onSuccess: (arg1: string) => void): void; + /** + * Updates the localization settings of the ASPxClientQueryBuilder properties. + * @param localization A dictionary containing the property names, along with their localized equivalents. + */ + UpdateLocalization(localization: { [key: string]: string; }): void; + /** + * Returns the object model of a Query Builder. + */ + GetDesignerModel(): Object; + /** + * Gets a client-side model of the currently opened query serialized to Json. + */ + GetJsonQueryModel(): string; + /** + * Saves the current query. + */ + Save(): void; + /** + * Invokes a Data Preview for the current query. + */ + ShowPreview(): void; + /** + * Specifies whether or not the current query is a valid SQL string. + */ + IsQueryValid(): boolean; +} +/** + * A method that will handle the SaveCommandExecute event. + */ +interface ASPxClientQueryBuilderSaveCommandExecuteEventHandler { + /** + * A method that will handle the SaveCommandExecute event. + * @param source The event sender. + * @param e An ASPxClientQueryBuilderSaveCommandExecuteEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientQueryBuilderSaveCommandExecuteEventArgs): void; +} +/** + * Provides data for the SaveCommandExecute event. + */ +interface ASPxClientQueryBuilderSaveCommandExecuteEventArgs extends ASPxClientEventArgs { + /** + * Specifies whether or not the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * A method that will handle the CustomizeToolbarActions event. + */ +interface ASPxClientQueryBuilderCustomizeToolbarActionsEventHandler { + /** + * A method that will handle the CustomizeToolbarActions event. + * @param source The event sender. + * @param e An ASPxClientCustomizeMenuActionsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeMenuActionsEventArgs): void; +} +/** + * The client-side equivalent of the Web Report Designer control. + */ +interface ASPxClientReportDesigner extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientReportDesigner. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs when executing the Save command on the client. + */ + SaveCommandExecute: ASPxClientEvent>; + /** + * Enables you to customize the menu actions of the Web Report Designer. + */ + CustomizeMenuActions: ASPxClientEvent>; + /** + * Occurs each time a standard editor is created for a report parameter based on a parameter type. + */ + CustomizeParameterEditors: ASPxClientEvent>; + /** + * Occurs each time a look-up editor is created for a report parameter. + */ + CustomizeParameterLookUpSource: ASPxClientEvent>; + /** + * Occurs on the client side when the Report Designer is being closed. + */ + ExitDesigner: ASPxClientEvent>; + /** + * Occurs when a report is about to be saved in the Web Report Designer. + */ + ReportSaving: ASPxClientEvent>; + /** + * Occurs when a report has been saved in the Web Report Designer. + */ + ReportSaved: ASPxClientEvent>; + /** + * Occurs when a report is about to be opened in the Web Report Designer. + */ + ReportOpening: ASPxClientEvent>; + /** + * Occurs when a report has been opened in the Web Report Designer. + */ + ReportOpened: ASPxClientEvent>; + /** + * Occurs on the client each time a server-side error raises. + */ + OnServerError: ASPxClientEvent>; + /** + * Occurs after a component has been added to the report currently being edited in the Web Report Designer. + */ + ComponentAdded: ASPxClientEvent>; + /** + * Enables you to customize UI elements of the Web Report Designer. + */ + CustomizeElements: ASPxClientEvent>; + /** + * Enables you to customize the Save dialog of the Web Report Designer. + */ + CustomizeSaveDialog: ASPxClientEvent>; + /** + * Enables you to customize the Save Report dialog of the Web Report Designer. + */ + CustomizeSaveAsDialog: ASPxClientEvent>; + /** + * Enables you to customize the Open Report dialog of the Web Report Designer. + */ + CustomizeOpenDialog: ASPxClientEvent>; + /** + * Enables you to customize the Toolbox of the Web Report Designer. + */ + CustomizeToolbox: ASPxClientEvent>; + /** + * Occurs after a report has been switched to Print Preview. + */ + PreviewDocumentReady: ASPxClientEvent>; + /** + * Occurs each time a value of an editing field changes in Print Preview. + */ + PreviewEditingFieldChanged: ASPxClientEvent>; + /** + * Enables you to customize UI elements of a Document Viewer built into a Web Report Designer. + */ + PreviewCustomizeElements: ASPxClientEvent>; + /** + * Enables you to customize the actions of a Document Viewer built into a Web Report Designer. + */ + PreviewCustomizeMenuActions: ASPxClientEvent>; + /** + * Occurs when the left mouse button has been clicked over a report document in Print Preview. + */ + PreviewClick: ASPxClientEvent>; + /** + * Occurs after report parameter values have been reset to their default values in Print Preview. + */ + PreviewParametersReset: ASPxClientEvent>; + /** + * Occurs after report parameter values have been submitted in Print Preview. + */ + PreviewParametersSubmitted: ASPxClientEvent>; + /** + * Sends a callback to the server with the specified argument. + * @param arg A String value, specifying the callback argument. + */ + PerformCallback(arg: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(arg: string, onSuccess: (arg1: string) => void): void; + /** + * Updates the localization settings of the ASPxClientReportDesigner properties. + * @param localization A dictionary containing the property names, along with their localized equivalents. + */ + UpdateLocalization(localization: { [key: string]: string; }): void; + /** + * Returns the object model of a Web Report Designer. + */ + GetDesignerModel(): Object; + /** + * Provides access to the preview model of the ASPxClientReportDesigner. + */ + GetPreviewModel(): Object; + /** + * Returns information about the specified property of the specified control. + * @param controlType A string that specifies the control type. + * @param path A string that specifies the path to the property. + */ + GetPropertyInfo(controlType: string, path: string): ASPxDesignerElementSerializationInfo; + /** + * Returns information about the specified properties of the specified control. + * @param controlType A string that specifies the control type. + * @param path An array of strings that specify paths to properties. + */ + GetPropertyInfo(controlType: string, path: string[]): ASPxDesignerElementSerializationInfo; + /** + * Returns actions performed by buttons available in the menu and toolbar of the Web Report Designer. + */ + GetButtonStorage(): Object; + /** + * Gets a client-side model of the currently opened report serialized to Json. + */ + GetJsonReportModel(): string; + /** + * Indicates whether or not the current ASPxClientReportDesigner instance has been modified. + */ + IsModified(): boolean; + /** + * Resets the value returned by the IsModified method. + */ + ResetIsModified(): void; + /** + * Adds a custom property to the Properties Panel. + * @param groupName A string that specifies the name of group to which a property should be added. + * @param property An object that provides information required to serialize a property. + */ + AddToPropertyGrid(groupName: string, property: ASPxDesignerElementSerializationInfo): void; + /** + * Adds a custom parameter type to the Web End-User Report Designer. + * @param parameterInfo An object that provides information about a parameter type to be added. + * @param editorOptions An object that provides information about an editor used to specify parameter values in design mode. + */ + AddParameterType(parameterInfo: ASPxDesignerParameterType, editorOptions: ASPxDesignerEditorOptions): void; + /** + * Removes the specified parameter type from the Web End-User Report Designer. + * @param parameterType A string that specifies a parameter type to be deleted. + */ + RemoveParameterType(parameterType: string): void; + /** + * Returns an object that contains information on the specified parameter type. + * @param parameterType A string that specifies a parameter type. + */ + GetParameterInfo(parameterType: string): ASPxDesignerParameterType; + /** + * Returns a value editor associated with the specified parameter type. + * @param parameterType A string that specifies a parameter type. + */ + GetParameterEditor(parameterType: string): ASPxDesignerEditorOptions; + /** + * Returns the report layout stored in a report storage under the specified URL. + * @param url A string that specifies the report URL. + */ + ReportStorageGetData(url: string): any; + /** + * Stores the specified report to a report storage using the specified URL. + * @param reportLayout A string that specifies the report layout to be saved. + * @param url A string that specifies the URL used to save a report. + */ + ReportStorageSetData(reportLayout: string, url: string): any; + /** + * Stores the specified report to a report storage using a new URL. + * @param reportLayout A string that specifies the report layout to be saved. + * @param url A string that specifies the default report URL. + */ + ReportStorageSetNewData(reportLayout: string, url: string): any; + /** + * Saves the current report. + */ + SaveReport(): any; + /** + * Closes the report tab currently being opened in the Web Report Designer. + */ + CloseCurrentTab(): void; + /** + * Saves the current report under a new name. + * @param reportName A string that specifies the report name. + */ + SaveNewReport(reportName: string): any; + /** + * Returns the report URLs and display names existing in a report storage. + */ + ReportStorageGetUrls(): any; + /** + * Opens the specified report on the client side of the Web Report Designer. + * @param url A string that specifies the URL of a report to be opened. + */ + OpenReport(url: string): void; + /** + * Switches the Web Report Designer to the preview mode. + */ + ShowPreview(): void; +} +/** + * A method that will handle the SaveCommandExecute event. + */ +interface ASPxClientReportDesignerSaveCommandExecuteEventHandler { + /** + * A method that will handle the SaveCommandExecute event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerSaveCommandExecuteEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerSaveCommandExecuteEventArgs): void; +} +/** + * Provides data for the SaveCommandExecute event. + */ +interface ASPxClientReportDesignerSaveCommandExecuteEventArgs extends ASPxClientEventArgs { + /** + * Specifies whether or not the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * Provides data for the ExitDesigner event. + */ +interface ASPxClientReportDesignerExitDesignerEventArgs extends ASPxClientEventArgs { +} +/** + * Provides data for the events related to opening and saving reports in the Web Report Designer. + */ +interface ASPxClientReportDesignerDialogEventArgs extends ASPxClientEventArgs { + /** + * Specifies the URL of the report currently being processed. + * Value: A string that specifies the URL of the report currently being processed. + */ + Url: string; + /** + * Specifies the report currently being processed. + * Value: An object that specifies the report currently being processed. + */ + Report: Object; + /** + * Specifies whether or not the operation performed with a report should be canceled. + * Value: true, if the operation should be canceled; otherwise, false. + */ + Cancel: boolean; +} +/** + * Provides data for the OnServerError event. + */ +interface ASPxClientReportDesignerErrorEventArgs extends ASPxClientEventArgs { + /** + * Provides access to information about a server-side error. + * Value: An object that provides information about an error. + */ + Error: Object; +} +/** + * Provides data for the ComponentAdded event. + */ +interface ASPxClientReportDesignerComponentAddedEventArgs extends ASPxClientEventArgs { + /** + * Gets the model of a component that has been added to a report. + * Value: An object that specifies the component model. + */ + Model: Object; + /** + * Gets the parent of a component that has been added to a report. + * Value: An object that specifies the component parent. + */ + Parent: Object; +} +/** + * Provides data for the CustomizeSaveDialog event. + */ +interface ASPxClientReportDesignerCustomizeSaveDialogEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the Save dialog. + * Value: An object that specifies the Save dialog. + */ + Popup: ASPxDesignerSaveDialog; + /** + * Customizes the Save dialog based on the specified template and model. + * @param template A string that specifies the name of an HTML template for the dialog. + * @param model A model of the Save dialog. + */ + Customize(template: string, model: ASPxDesignerDialogModel): void; +} +/** + * Provides data for the CustomizeSaveAsDialog event. + */ +interface ASPxClientReportDesignerCustomizeSaveAsDialogEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the Save Report dialog. + * Value: An object that specifies the Save Report dialog. + */ + Popup: ASPxDesignerSaveAsDialog; + /** + * Customizes the Save Report dialog based on the specified template and model. + * @param template A string that specifies the name of an HTML template for the dialog. + * @param model A model of the Save Report dialog. + */ + Customize(template: string, model: ASPxDesignerDialogModel): void; +} +/** + * Provides data for the CustomizeOpenDialog event. + */ +interface ASPxClientReportDesignerCustomizeOpenDialogEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the Open Report dialog. + * Value: An object that specifies the Open Report dialog. + */ + Popup: ASPxDesignerOpenDialog; + /** + * Customizes the Open Report dialog based on the specified template and model. + * @param template A string that specifies the name of an HTML template for the dialog. + * @param model A model of the Open Report dialog. + */ + Customize(template: string, model: ASPxDesignerDialogModel): void; +} +/** + * Provides data for the CustomizeToolbox event. + */ +interface ASPxClientReportDesignerCustomizeToolboxEventArgs extends ASPxClientEventArgs { + /** + * Provides information about all controls available in the Toolbox. + * Value: An ASPxDesignerControlsFactory object that provides information about toolbox controls. + */ + ControlsFactory: ASPxDesignerControlsFactory; +} +/** + * A method that will handle the CustomizeMenuActions event. + */ +interface ASPxClientReportDesignerCustomizeMenuActionsEventHandler { + /** + * A method that will handle the CustomizeMenuActions event. + * @param source The event sender. + * @param e An ASPxClientCustomizeMenuActionsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeMenuActionsEventArgs): void; +} +/** + * A method that will handle the CustomizeParameterLookUpSource event. + */ +interface ASPxClientReportDesignerCustomizeParameterLookUpSourceEventHandler { + /** + * A method that will handle the CustomizeParameterLookUpSource event. + * @param source The event sender. + * @param e An ASPxClientCustomizeParameterLookUpSourceEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeParameterLookUpSourceEventArgs): void; +} +/** + * A method that will handle the CustomizeParameterEditors event. + */ +interface ASPxClientReportDesignerCustomizeParameterEditorsEventHandler { + /** + * A method that will handle the CustomizeParameterEditors event. + * @param source The event sender. + * @param e An ASPxClientCustomizeParameterEditorsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeParameterEditorsEventArgs): void; +} +/** + * A method that will handle the CustomizeElements event. + */ +interface ASPxClientReportDesignerCustomizeElementsEventHandler { + /** + * A method that will handle the CustomizeElements event. + * @param source The event sender. + * @param e An ASPxClientCustomizeElementsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeElementsEventArgs): void; +} +/** + * A method that will handle the ExitDesigner event. + */ +interface ASPxClientReportDesignerExitDesignerEventHandler { + /** + * A method that will handle the ExitDesigner event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerExitDesignerEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerExitDesignerEventArgs): void; +} +/** + * A method that will handle the ReportSaving event. + */ +interface ASPxClientReportDesignerReportSavingEventHandler { + /** + * A method that will handle the ReportSaving event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; +} +/** + * A method that will handle the ReportSaved event. + */ +interface ASPxClientReportDesignerReportSavedEventHandler { + /** + * A method that will handle the ReportSaved event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; +} +/** + * A method that will handle the ReportOpening event. + */ +interface ASPxClientReportDesignerReportOpeningEventHandler { + /** + * A method that will handle the ReportOpening event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; +} +/** + * A method that will handle the ReportOpened event. + */ +interface ASPxClientReportDesignerReportOpenedEventHandler { + /** + * A method that will handle the ReportOpened event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; +} +/** + * A method that will handle the OnServerError event. + */ +interface ASPxClientReportDesignerErrorEventHandler { + /** + * A method that will handle the OnServerError event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerErrorEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerErrorEventArgs): void; +} +/** + * A method that will handle the ComponentAdded event. + */ +interface ASPxClientReportDesignerComponentAddedEventHandler { + /** + * A method that will handle the ComponentAdded event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerComponentAddedEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerComponentAddedEventArgs): void; +} +/** + * A method that will handle the CustomizeSaveDialog event. + */ +interface ASPxClientReportDesignerCustomizeSaveDialogEventHandler { + /** + * A method that will handle the CustomizeSaveDialog event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerCustomizeSaveDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerCustomizeSaveDialogEventArgs): void; +} +/** + * A method that will handle the CustomizeSaveAsDialog event. + */ +interface ASPxClientReportDesignerCustomizeSaveAsDialogEventHandler { + /** + * A method that will handle the CustomizeSaveAsDialog event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerCustomizeSaveAsDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerCustomizeSaveAsDialogEventArgs): void; +} +/** + * A method that will handle the CustomizeOpenDialog event. + */ +interface ASPxClientReportDesignerCustomizeOpenDialogEventHandler { + /** + * A method that will handle the CustomizeOpenDialog event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerCustomizeOpenDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerCustomizeOpenDialogEventArgs): void; +} +/** + * A method that will handle the CustomizeToolbox event. + */ +interface ASPxClientReportDesignerCustomizeToolboxEventHandler { + /** + * A method that will handle the CustomizeToolbox event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerCustomizeToolboxEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerCustomizeToolboxEventArgs): void; +} +/** + * Provides information about a value editor used in the Property Grid. + */ +interface ASPxDesignerEditorOptions { + /** + * Provides access to the name of an HTML template specifying the editor and header of a complex object. + * Value: A string that specifies the HTML template. + */ + header: string; + /** + * Provides access to the name of an HTML template used by a complex object's editor. + * Value: A string that specifies the name of an HTML template. + */ + content: string; + /** + * Provides access to the type of the editor model. + * Value: An object that specifies the editor type. + */ + editorType: Object; +} +/** + * Provides functionality to an undo/redo engine in the Web Report Designer. + */ +interface ASPxDesignerUndoEngine { + /** + * Provides access to a value that specifies whether or not the redo action can currently be performed. + * Value: A knockout observable boolean object, whose value is true if the redo action can be performed, and false otherwise. + */ + redoEnabled: any; + /** + * Provides access to a value that specifies whether or not the undo action can currently be performed. + * Value: A knockout observable boolean object, whose value is true if the undo action can be performed, and false otherwise. + */ + undoEnabled: any; + /** + * Provides access to a value that specifies whether or not a report has been changed. + * Value: A knockout observable boolean object, whose value is true if the report has been modified, and false otherwise. + */ + isDirty: any; + /** + * Undoes all changes made to a report. + */ + undoAll(): void; + /** + * Clears information about edit operations made to a report, so they cannot not be undone. + */ + clearHistory(): void; + /** + * Undoes the last edit action in a report. + */ + undo(): void; + /** + * Reverses the results of the last undo action. + */ + redo(): void; +} +/** + * Provides functionality for a tab displayed a report in the Web Report Designer. + */ +interface ASPxDesignerNavigateTab { + /** + * Provides access to a value that specifies the display name of the current tab. + * Value: A knockout computed string that specifies the tab's display name. + */ + displayName: any; + /** + * Provides access to a value that specifies whether or not the report in the current tab has been changed. + * Value: A knockout computed boolean object, whose value is true if the report has been modified, and false otherwise. + */ + isDirty: any; + /** + * Provides access to a report opened in the current tab. + * Value: A knockout observable object that specifies a report opened in the current tab. + */ + report: any; + /** + * Provides access to an engine that manages undo and redo operations in the Web Report Designer. + * Value: An object that specifies an undo/redo engine. + */ + undoEngine: ASPxDesignerUndoEngine; + /** + * Provides access to the URL of a report opened in the current tab. + * Value: A knockout observable string that specifies the report URL. + */ + url: any; +} +/** + * A model of dialogs used to save and open reports in the Web Report Designer. + */ +interface ASPxDesignerDialogModel { + /** + * Provides access to the collection of buttons displayed in a dialog. + * Value: An array of objects that specify buttons displayed in a dialog. + */ + popupButtons: Object[]; + /** + * Specifies a function that gets the report URL. + */ + getUrl(): string; + /** + * Specifies a function that sets the report URL. + * @param url A string that specifies the report URL. + */ + setUrl(url: string): void; + /** + * Specifies a function to be executed when showing a dialog. + * @param tab An object that specifies the report tab for which a dialog is invoked. + */ + onShow(tab: ASPxDesignerNavigateTab): void; +} +/** + * Provides the base functionality for dialogs used to open and save reports on the client side of the Web Report Designer. + */ +interface ASPxDesignerReportDialogBase { + /** + * Provides access to a dialog's width. + * Value: A knockout observable object that specifies a dialog's width. + */ + width: any; + /** + * Provides access to a dialog's height. + * Value: A knockout observable object that specifies a dialog's height. + */ + height: any; + /** + * Provides access to the name of an HTML template used by a dialog. + * Value: A knockout observable string that specifies the name of the HTML template used by a dialog. + */ + template: any; + /** + * Provides access to buttons displayed in a dialog. + * Value: An array of objects that specify buttons displayed in the dialog. + */ + buttons: Object[]; + /** + * Provides access to a dialog's model. + * Value: A knockout observable object of the ASPxDesignerDialogModel type. + */ + model: any; + /** + * Provides access to a report tab for which a dialog appears. + * Value: A knockout observable object of the ASPxDesignerNavigateTab type. + */ + tab: any; + /** + * Provides access to a value that specifies a dialog's visibility state. + * Value: true, if the dialog is visible; otherwise, false; + */ + visible: any; + /** + * Provides access to a dialog's title. + * Value: A string that specifies a dialog's title. + */ + title: string; + /** + * Shows the dialog for the specified report tab. + * @param tab A report tab for which the dialog should be shown. + */ + show(tab: ASPxDesignerNavigateTab): void; + /** + * Customizes the dialog based on the specified template and model. + * @param template A string that specifies the name of an HTML template for the dialog. + * @param model An object that specifies the dialog model. + */ + customize(template: string, model: ASPxDesignerDialogModel): void; + /** + * Cancels the dialog. + */ + cancel(): void; +} +/** + * Provides functionality for the Save dialog on the client side of the Web Report Designer. + */ +interface ASPxDesignerSaveDialog extends ASPxDesignerReportDialogBase { + /** + * Provides access to the Save Report dialog that appears if a user selected to save changes in the Save dialog. + * Value: An object that specifies the Save As dialog. + */ + saveReportDialog: ASPxDesignerSaveAsDialog; + /** + * Saves the report with the specified URL. + * @param url A string that specifies an URL of the report to be saved. + */ + save(url: string): void; + /** + * Closes the dialog without saving the current report. + */ + notSave(): void; +} +/** + * Provides functionality for the Save Report dialog on the client side of the Web Report Designer. + */ +interface ASPxDesignerSaveAsDialog extends ASPxDesignerReportDialogBase { + /** + * Saves the report with the specified URL. + * @param url A string that specifies a URL of the report to be saved. + */ + save(url: string): void; +} +/** + * Provides functionality for the Open Report dialog on the client side of the Web Report Designer. + */ +interface ASPxDesignerOpenDialog extends ASPxDesignerReportDialogBase { + /** + * Opens the report with the specified URL. + * @param url A string that specifies an URL of the report to be opened. + */ + open(url: string): void; +} +/** + * Provides information about a toolbox control item. + */ +interface ASPxDesignerToolboxItem { + /** + * Provides access to information required to serialize a toolbox control. + * Value: An array of ASPxDesignerElementSerializationInfo objects that provide information required to serialize an element. + */ + info: ASPxDesignerElementSerializationInfo[]; + /** + * Provides access to a surface type of toolbox control. + * Value: A surface type of toolbox control. + */ + surfaceType: any; + /** + * Provides access to a toolbox control type. + * Value: A toolbox control type. + */ + type: any; + /** + * Provides access to a zero-based index of a control in the toolbox. + * Value: An integer value that specifies a control index in the toolbox. + */ + toolboxIndex: number; + /** + * Provides access to the default property values used for a toolbox control. + * Value: An object that specifies default propery values. + */ + defaultVal: Object; + /** + * Provides access to popular properties of a toolbox control. + * Value: An array of strings that specify names of popular properties. + */ + popularProperties: string[]; + /** + * Gets whether a control item is displayed in a toolbox. + * Value: true, if the control is available in the toolbox; otherwise, false. + */ + isToolboxItem: boolean; +} +/** + * Enables you to customize controls available in the Toolbox of the Web Report Designer. + */ +interface ASPxDesignerControlsFactory { + /** + * Returns information about the specified toolbox control. + * @param controlType A string that specifies the control type. + */ + getControlInfo(controlType: string): ASPxDesignerToolboxItem; + /** + * Returns a control type by the specified model. + * @param model An object that specifies the control model. + */ + getControlType(model: Object): string; + /** + * Registers the specified control in the Toolbox of the Web Report Designer. + * @param typeName A string that specifies the name of a custom control. + * @param metadata An ASPxDesignerToolboxItem object that provides information about a toolbox item. + */ + registerControl(typeName: string, metadata: ASPxDesignerToolboxItem): void; + /** + * Returns information about the specified property of the specified control. + * @param controlType A string that specifies the control type. + * @param propertyDisplayName A string that specifies the property display name. + */ + getPropertyInfo(controlType: string, propertyDisplayName: string): ASPxDesignerElementSerializationInfo; +} +/** + * Provides information about a report parameter type. + */ +interface ASPxDesignerParameterType { + /** + * Provides access to an actual parameter type. + * Value: A string that specifies the parameter type. + */ + value: string; + /** + * Provides access to a text displayed to end-users when creating parameters of the current type. + * Value: A string displayed to end-users. + */ + displayValue: string; + /** + * Provides access to the default value for parameters of the current type. + * Value: An object that specifies the default value. + */ + defaultVal: Object; + /** + * Provides access to the specifics of a current parameter type. + * Value: Parameter type specifics. + */ + specifics: string; + /** + * Converts the specified parameter value to the current parameter type. + * @param val An object that specifies the parameter value to be converted. + */ + valueConverter(val: Object): Object; +} +/** + * The client-side equivalent of the ASPxClientDocumentViewer control's Document Map. + */ +interface ASPxClientReportDocumentMap extends ASPxClientControl { + /** + * Occurs after the content of the Document Viewer's document map is updated. + */ + ContentChanged: ASPxClientEvent>; +} +/** + * The client-side equivalent of the ASPxClientDocumentViewer control's Parameters Panel. + */ +interface ASPxClientReportParametersPanel extends ASPxClientControl { + /** + * Assigns a value to a parameter of the report displayed in the document viewer. + * @param parametersInfo An array of ASPxClientReportParameterInfo values specifying parameters and values to assign. + */ + AssignParameters(parametersInfo: ASPxClientReportParameterInfo[]): void; + /** + * Assigns a value to a parameter of the report displayed in the document viewer. + * @param path A System.String specifying the parameter's path. + * @param value An object specifying the parameter value. + */ + AssignParameter(path: string, value: Object): void; + /** + * Returns an array storing the names of parameters available in a report. + */ + GetParameterNames(): string[]; + /** + * Returns a value editor that is associated with a parameter with the specified name. + * @param parameterName A String value, specifying the parameter name. + */ + GetEditorByParameterName(parameterName: string): ASPxClientControl; +} +/** + * Provides information about a report parameter on the client side. + */ +interface ASPxClientReportParameterInfo { + /** + * Specifies the parameter path, relative to its parent container (e.g., "subreport1.subreportParameter1" for a subreport's parameter, or "parameter1" for a report's parameter). + * Value: A String value, specifying the parameter path (e.g., "subreport1.subreportParameter1"). + */ + Path: string; + /** + * Provides access to a parameter value on the client. + * Value: A Object value. + */ + Value: Object; +} +/** + * The client-side equivalent of the ASPxClientDocumentViewer control's toolbar. + */ +interface ASPxClientReportToolbar extends ASPxClientControl { + /** + * Provides access to the control template assigned for the specified menu item. + * @param name A String value, specifying the menu item name. + */ + GetItemTemplateControl(name: string): ASPxClientControl; +} +/** + * The client-side equivalent of the ReportViewer. + */ +interface ASPxClientReportViewer extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientReportViewer. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side when another report page is loaded into this ASPxClientReportViewer instance. + */ + PageLoad: ASPxClientEvent>; + /** + * Submits the values of the specified parameters. + * @param parameters A dictionary containing the parameter names, along with their Object values. + */ + SubmitParameters(parameters: { [key: string]: Object; }): void; + /** + * Prints a report shown in the ReportViewer. + */ + Print(): void; + /** + * Prints a report page with the specified page index. + * @param pageIndex An integer value which specifies an index of the page to be printed. + */ + Print(pageIndex: number): void; + /** + * Displays a report page with the specified page index in the ReportViewer. + * @param pageIndex An integer value which specifies the index of a page to be displayed. + */ + GotoPage(pageIndex: number): void; + /** + * Initiates a round trip to the server so that the current page will be reloaded. + */ + Refresh(): void; + /** + * Invokes the Search dialog, which allows end-users to search for specific text in a report. + */ + Search(): void; + /** + * Exports a report to a file of the specified format, and shows it in a new Web Browser window. + * @param format A string specifying the format, to which a report should be exported. + */ + SaveToWindow(format: string): void; + /** + * Exports a report to a file of the specified format, and saves it to the disk. + * @param format A string specifying the format, to which a report should be exported. + */ + SaveToDisk(format: string): void; + /** + * Gets a value indicating whether or not searching text across a report is permitted in the web browser. + */ + IsSearchAllowed(): boolean; +} +/** + * A method that will handle the PageLoad events. + */ +interface ASPxClientReportViewerPageLoadEventHandler { + /** + * A method that will handle the PageLoad event. + * @param source The event sender. + * @param e An ASPxClientReportViewerPageLoadEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportViewerPageLoadEventArgs): void; +} +/** + * Provides data for the PageLoad events on the client side. + */ +interface ASPxClientReportViewerPageLoadEventArgs extends ASPxClientEventArgs { + /** + * Gets a value specifying a zero-based index of a page to be displayed in a report viewer. + * Returns: $ + */ + PageIndex: number; + /** + * Gets a value specifying the total number of pages displayed in a report viewer. + * Returns: $ + */ + PageCount: number; + /** + * Gets a value indicating whether a report page, which is currently loaded into the ASPxClientReportViewer, is the first page of a report. + */ + IsFirstPage(): boolean; + /** + * Gets a value indicating whether a report page, which is currently loaded into the ASPxClientReportViewer, is the last page of a report. + */ + IsLastPage(): boolean; +} +/** + * Provides data for the CustomizeParameterEditors events. + */ +interface ASPxClientCustomizeParameterEditorsEventArgs extends ASPxClientEventArgs { + /** + * Provides access to an object that stores information about a parameter. + * Value: An ASPxDesignerElementParameterDescriptor object. + */ + parameter: ASPxDesignerElementParameterDescriptor; + /** + * Provides access to an object that stores information required to serialize a parameter editor. + * Value: An ASPxDesignerElementSerializationInfo object. + */ + info: ASPxDesignerElementSerializationInfo; +} +/** + * Provides data for the CustomizeParameterLookUpSource events. + */ +interface ASPxClientCustomizeParameterLookUpSourceEventArgs extends ASPxClientEventArgs { + /** + * Provides access to an object that stores information about a parameter. + * Value: An ASPxDesignerElementParameterDescriptor object that stores information about the parameter. + */ + parameter: ASPxDesignerElementParameterDescriptor; + /** + * Provides access to the collection of look-up parameter values. + * Value: An array of ASPxDesignerElementEditorItem objects that store information about look-up parameter values. + */ + items: ASPxDesignerElementEditorItem[]; + /** + * Specifies the data source that provides look-up values for the parameter editor. + * Value: An Object specifying the data source that provides look-up values to the parameter editor. + */ + dataSource: Object; +} +/** + * Provides information about a command available in the toolbar or menu. + */ +interface ASPxClientMenuAction { + /** + * Provides access to the text for the command. + * Value: A string that is the command text. + */ + text: string; + /** + * Provides access to the CSS class of the command's glyph. + * Value: A string that specifies the name of the CSS class. + */ + imageClassName: string; + /** + * Provides access to the action performed when a button is clicked. + * Value: The specific action implementation. + */ + clickAction: Function; + /** + * Provides access to the value that specifies whether or not the command is disabled by default. + * Value: true, if the command is disabled by default; otherwise, false. + */ + disabled: boolean; + /** + * Provides access to the value that specifies whether or not the command is visible in the user interface. + * Value: true if the command is visible; otherwise false. + */ + visible: boolean; + /** + * Provides access to the keyboard shortcut used to invoke the command. + * Value: An ASPxClientMenuActionHotKey object that specifies the keyboard shortcut. + */ + hotKey: ASPxClientMenuActionHotKey; + /** + * Provides access to the value that specifies whether or not the command has a visual separator. + * Value: true, if the command has a visual separator; otherwise, false. + */ + hasSeparator: string; + /** + * Provides access to a value that specifies the command location. + * Value: A string that specifies the command location. + */ + container: string; +} +/** + * Provides information about a hot key used to perform an action assigned to a menu item. + */ +interface ASPxClientMenuActionHotKey { + /** + * Provides access to a hot key code. + * Value: An integer value that specifies the hot key code. + */ + keyCode: number; + /** + * Provides access to a value that specifies whether the CTRL key is used in combination with a hot key. + * Value: true, if the CTRL key is included into the key combination; otherwise, false. + */ + ctrlKey: boolean; +} +/** + * Provides data for the CustomizeMenuActions. + */ +interface ASPxClientCustomizeMenuActionsEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the collection of actions available in the toolbar and menu. + * Value: An array of ASPxClientMenuAction objects. + */ + Actions: ASPxClientMenuAction[]; + /** + * Returns a menu action with the specified ID. + * @param actionId A String value that specifies the action ID. + */ + GetById(actionId: string): ASPxClientMenuAction; +} +/** + * Provides data for the CustomizeElements events. + */ +interface ASPxClientCustomizeElementsEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the collection of UI elements. + * Value: An array of the ASPxReportUIElement objects. + */ + Elements: ASPxReportUIElement[]; + /** + * Returns UI elements with the specified ID. + * @param templateId A string that specifies the element ID. + */ + GetById(templateId: string): ASPxReportUIElement[]; +} +/** + * Provides general information about a report parameter. + */ +interface ASPxDesignerElementParameterDescriptor { + /** + * Provides access to the parameter description. + * Value: A String value, specifying the parameter description. + */ + description: string; + /** + * Provides access to the parameter name. + * Value: A String value, specifying the parameter name. + */ + name: string; + /** + * Provides access to the parameter type. + * Value: A String value, specifying the parameter type. + */ + type: string; + /** + * Provides access to the parameter value. + * Value: A Object, specifying the parameter value. + */ + value: Object; + /** + * Provides access to the parameter visibility state. + * Value: true if the parameter is visible; otherwise false. + */ + visible: boolean; +} +/** + * Provides information required to serialize an element. + */ +interface ASPxDesignerElementSerializationInfo { + /** + * Gets the property name that will be used in the model to store the property value. + * Value: A String value. + */ + propertyName: string; + /** + * Gets the property name in the model that is displayed in the Property grid. + * Value: A String value. + */ + displayName: string; + /** + * Gets the property name that will be used during serialization to store the property value. + * Value: A String value. + */ + modelName: string; + /** + * Gets the default property value used for serialization. + * Value: A Object value. + */ + defaultVal: Object; + /** + * Gets the information about a complex object's content. + * Value: An array of ASPxDesignerElementSerializationInfo objects. + */ + info: ASPxDesignerElementSerializationInfo[]; + /** + * Gets a value indicating whether or not the property returns an array. + * Value: true if the property returns an array; otherwise false. + */ + array: boolean; + /** + * Gets a value indicating whether an object should be serialized to the ComponentStorage property. + * Value: true to serialize an object to the ObjectStorage; otherwise false. + */ + link: boolean; + /** + * Gets a value specifying the type of value editor for the Property Grid. + * Value: An ASPxDesignerElementEditor object. + */ + editor: ASPxDesignerElementEditor; + /** + * Gets the collection of values displayed in the Property grid. + * Value: An array of ASPxDesignerElementEditorItem objects. + */ + valuesArray: ASPxDesignerElementEditorItem[]; + /** + * Gets the rules for validating the property value entered into its editor. + * Value: An array of Object values. + */ + validationRules: Object[]; + /** + * Gets the visibility state of the value editor in the Property Grid. + * Value: A Object value. + */ + visible: Object; + /** + * Gets a value, indicating whether or not the property value can be edited. + * Value: true to disable the property editing; otherwise false. + */ + disabled: Object; +} +/** + * Provides information about a serialized property's value editor used in the Property Grid. + */ +interface ASPxDesignerElementEditor { + /** + * Gets the name of an HTML template specifying the editor and header of a complex object (i.e., an object having its content properties specified). + * Value: A String value. + */ + header: string; + /** + * Gets a nullable value, specifying the name of an HTML template used by a complex object's editor. + * Value: A String value. + */ + content: string; + /** + * Gets additional options for DevExtreme UI widgets. + * Value: An object that provides editor options. + */ + extendedOptions: Object; + /** + * Gets a nullable value, specifying the type of the editor's model. + * Value: A Object value. + */ + editorType: Object; +} +/** + * Provides information about property values. + */ +interface ASPxDesignerElementEditorItem { + /** + * Gets an actual property value. + * Value: A Object value. + */ + value: Object; + /** + * Gets a value displayed by a property editor. + * Value: A String value. + */ + displayValue: string; +} +/** + * Provides information about a UI element of the Web Report Designer or Web Document Viewer. + */ +interface ASPxReportUIElement { + /** + * Provides access to an element model. + * Value: An object that specifies the element model. + */ + model: Object; + /** + * Provides access to the name of an HTML template used by an element. + * Value: A string that specifies the name of the HTML template. + */ + templateName: string; +} +/** + * Provides data for the PreviewDocumentReady events. + */ +interface ASPxClientWebDocumentViewerDocumentReadyEventArgs extends ASPxClientEventArgs { + /** + * Specifies the report ID. + */ + ReportId: string; + /** + * Specifies the report document ID. + */ + DocumentId: string; + /** + * Specifies the total number of pages in a report document. + */ + PageCount: number; +} +/** + * Provides data for the PreviewEditingFieldChanged events. + */ +interface ASPxClientWebDocumentViewerEditingFieldChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets an editing field whose value has been changed. + * Value: An object that specifies an editing field whose content has been changed. + */ + Field: ASPxClientWebDocumentViewerEditingField; + /** + * Provides access to a previous value of an editing field. + * Value: An object that specifies an editing field's previous value. + */ + OldValue: Object; + /** + * Provides access to a new value of an editing field. + * Value: An object that specifies an editing field's new value. + */ + NewValue: Object; +} +/** + * Provides functionality for a field whose content can be edited in the Web Document Viewer. + */ +interface ASPxClientWebDocumentViewerEditingField { + /** + * Provides access to a value that specifies whether or not an editing field's content can be customized in Print Preview. + * Returns: true, if a field cannot be edited in Print Preview; otherwise, false. + */ + readOnly: any; + /** + * Provides access to the current value of an editing field. + * Returns: An object that specifies the current field value. + */ + editValue: any; + /** + * Returns the unique identifier of an editing field. + */ + id(): string; + /** + * Returns the ID of a logical group to which an editing field for a check box belongs. + */ + groupID(): string; + /** + * Returns the name of an editor used to change a field value in Print Preview. + */ + editorName(): string; + /** + * Returns the index of the page on which an editing field is located. + */ + pageIndex(): number; +} +/** + * Provides data for the PreviewParametersSubmitted events. + */ +interface ASPxClientParametersSubmittedEventArgs extends ASPxClientEventArgs { + /** + * Provides access to a View Model for report parameters. + * Value: A View Model object. + */ + ParametersViewModel: Object; + /** + * Provides access to report parameters and their submitted values. + * Value: A dictionary containing the parameter names along with their values. + */ + Parameters: { [key: string]: Object; }; +} +/** + * Provides data for the PreviewParametersReset events. + */ +interface ASPxClientParametersResetEventArgs extends ASPxClientEventArgs { + /** + * Provides access to a View Model for report parameters. + * Value: A View Model object. + */ + ParametersViewModel: Object; + /** + * Provides access to report parameters whose values have been reset. + * Value: An ASPxClientWebDocumentViewerParameter array. + */ + Parameters: ASPxClientWebDocumentViewerParameter[]; +} +/** + * Provides general information about a report parameter on the client-side of the Web Document Viewer. + */ +interface ASPxClientWebDocumentViewerParameter { + /** + * Provides access to the current value of a report parameter. + * Value: An object that specifies the report parameter's current value. + */ + value: Object; + /** + * Provides access to a report parameter's value type. + * Value: An object that specifies the report parameter type. + */ + type: Object; + /** + * Provides access to a value that specifies whether or not a parameter can have multiple values. + * Value: true, if a parameter can have multiple values; otherwise, false. + */ + isMultiValue: boolean; + /** + * Returns an object that provides general information about a report parameter. + */ + getParameterDescriptor(): ASPxDesignerElementParameterDescriptor; +} +/** + * Provides data for the PreviewClick events. + */ +interface ASPxClientPreviewClickEventArgs extends ASPxClientEventArgs { + /** + * Gets a value specifying the zero-based index of the page that has been clicked. + * Value: An integer value that specifies a page index. + */ + PageIndex: number; + /** + * Provides information on a visual brick representing content of a report control that has been clicked. + * Value: An object that provides information on a visual brick. + */ + Brick: ASPxClientWebDocumentViewerBrick; + /** + * Specifies whether or not the event was handled and no default processing is required. + * Value: true, if the event is completely handled by custom code and no default processing is required; otherwise, false. + */ + Handled: boolean; + /** + * Specifies the default function used to handle the PreviewClick event. + */ + DefaultHandler(): void; + /** + * Returns the text displayed by the Brick. + */ + GetBrickText(): string; + /** + * Returns a string providing additional information on the Brick. + */ + GetBrickValue(): string; +} +/** + * Provides information about a visual brick used to render a report control to construct a document in the Web Document Viewer. + */ +interface ASPxClientWebDocumentViewerBrick { + /** + * Provides access to a brick's content. + * Value: A dictionary that stores content keys along with the corresponding contents. + */ + content: { [key: string]: string; }; + /** + * Provides access to navigation settings of the current brick. + * Value: An object that provides a brick's navigation settings. + */ + navigation: ASPxClientWebDocumentViewerBrickNavigation; + /** + * Provides access to a brick's top vertical coordinate. + * Value: An integer value that specifies the brick's top coordinate. + */ + top: number; + /** + * Provides access to a brick's left horizontal coordinate. + * Value: An integer value that specifies the brick's left coordinate. + */ + left: number; + /** + * Provides access to a brick's width. + * Value: An integer value that specifies the brick width. + */ + width: number; + /** + * Provides access to a brick's height. + * Value: An integer value that specifies the brick height. + */ + height: number; + /** + * Provides access to a value that specifies whether or not the right-to-left feature is enabled for a brick. + * Value: true, if the right-to-left feature is enabled; otherwise, false. + */ + rtl: boolean; +} +/** + * Provides navigation settings for a brick used to construct a document in the Web Document Viewer. + */ +interface ASPxClientWebDocumentViewerBrickNavigation { + /** + * Provides access to the URL to navigate to when a brick is a clicked. + * Value: A string that specifies the URL. + */ + url: string; + /** + * Provides access to a value that specifies the target window or frame in which to display the linked Web page's content when the brick is clicked. + * Value: A string that specifies the window or frame to which to target the URL's content. + */ + target: string; + /** + * Provides access to a drill-down key. + * Value: A string that specifies a drill-down key. + */ + drillDownKey: string; +} +/** + * A client-side equivalent of the ASPxWebDocumentViewer class. + */ +interface ASPxClientWebDocumentViewer extends ASPxClientControl { + /** + * Occurs after a report document has been loaded to the Web Document Viewer. + */ + DocumentReady: ASPxClientEvent>; + /** + * Occurs each time a value of an editing field changes. + */ + EditingFieldChanged: ASPxClientEvent>; + /** + * Enables you to customize UI elements of the Web Document Viewer. + */ + CustomizeElements: ASPxClientEvent>; + /** + * Enables you to customize the menu actions of a Web Document Viewer. + */ + CustomizeMenuActions: ASPxClientEvent>; + /** + * Occurs each time a standard editor is created for a report parameter based on a parameter type. + */ + CustomizeParameterEditors: ASPxClientEvent>; + /** + * Occurs each time a look-up editor is created for a report parameter. + */ + CustomizeParameterLookUpSource: ASPxClientEvent>; + /** + * Occurs when the left mouse button has been clicked over a report document. + */ + PreviewClick: ASPxClientEvent>; + /** + * Occurs after report parameter values have been reset to their default values. + */ + ParametersReset: ASPxClientEvent>; + /** + * Occurs after report parameter values have been submitted. + */ + ParametersSubmitted: ASPxClientEvent>; + /** + * Provides access to the preview model of the ASPxClientWebDocumentViewer. + */ + GetPreviewModel(): Object; + /** + * Returns a model for a report parameter. + */ + GetParametersModel(): Object; + /** + * Opens the specified report on the client side of the Web Document Viewer. + * @param url A string that specifies the URL of a report to be opened. + */ + OpenReport(url: string): any; + /** + * Prints the current document. + */ + Print(): void; + /** + * Prints the document's page with the specified index. + * @param pageIndex An index of the page to be printed. + */ + Print(pageIndex: number): void; + /** + * Exports the document to a PDF file. + */ + ExportTo(): void; + /** + * Exports the document to a specified file format. + * @param format A String value, specifying the export format. The following formats are currently supported: 'csv', 'html', 'image', 'mht', 'pdf', 'rtf', 'docx', 'txt', 'xls', and 'xlsx'. + */ + ExportTo(format: string): void; + /** + * Exports the document to a specified file format. + * @param format A String value that specifies the export format. The following formats are currently supported: 'csv', 'html', 'image', 'mht', 'pdf', 'rtf', 'docx', 'txt', 'xls', and 'xlsx'. + * @param inlineResult true, to try opening the result file in a new browser tab without a download; otherwise, false. + */ + ExportTo(format: string, inlineResult: boolean): void; + /** + * Returns the zero-based index of the currently displayed page. + */ + GetCurrentPageIndex(): number; + /** + * Displays the report page with the specified page index. + * @param pageIndex A zero-based integer value that specifies the index of a page to be displayed. + */ + GoToPage(pageIndex: number): void; + /** + * Closes the document currently being opened in the Web Document Viewer. + */ + Close(): void; + /** + * Resets the values of report parameters to their default values. + */ + ResetParameters(): void; + /** + * Starts building a report document. + */ + StartBuild(): void; + /** + * Updates the localization settings of the ASPxClientWebDocumentViewer properties. + * @param localization A dictionary containing the property names, along with their localized equivalents. + */ + UpdateLocalization(localization: { [key: string]: string; }): void; +} +/** + * A method that will handle the EditingFieldChanged event. + */ +interface ASPxClientWebDocumentViewerEditingFieldChangedEventHandler { + /** + * A method that will handle the PreviewEditingFieldChanged event. + * @param source The event sender. + * @param e An ASPxClientWebDocumentViewerEditingFieldChangedEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientWebDocumentViewerEditingFieldChangedEventArgs): void; +} +/** + * A method that will handle the DocumentReady event. + */ +interface ASPxClientWebDocumentViewerDocumentReadyEventHandler { + /** + * A method that will handle the PreviewDocumentReady event. + * @param source The event sender. + * @param e An ASPxClientWebDocumentViewerDocumentReadyEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientWebDocumentViewerDocumentReadyEventArgs): void; +} +/** + * A method that will handle the CustomizeElements event. + */ +interface ASPxClientWebDocumentViewerCustomizeElementsEventHandler { + /** + * A method that will handle the PreviewCustomizeElements event. + * @param source The event sender. + * @param e An ASPxClientCustomizeElementsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeElementsEventArgs): void; +} +/** + * A method that will handle the CustomizeMenuActions event. + */ +interface ASPxClientWebDocumentViewerCustomizeMenuActionsEventHandler { + /** + * A method that will handle the CustomizeMenuActions event. + * @param source The event sender. + * @param e An ASPxClientCustomizeMenuActionsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeMenuActionsEventArgs): void; +} +/** + * A method that will handle the CustomizeParameterEditors event. + */ +interface ASPxClientWebDocumentViewerCustomizeParameterEditorsEventHandler { + /** + * A method that will handle the CustomizeParameterEditors event. + * @param source The event sender. + * @param e An ASPxClientCustomizeParameterEditorsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeParameterEditorsEventArgs): void; +} +/** + * A method that will handle the CustomizeParameterLookUpSource event. + */ +interface ASPxClientWebDocumentViewerCustomizeParameterLookUpSourceEventHandler { + /** + * A method that will handle the CustomizeParameterLookUpSource event. + * @param source The event sender. + * @param e An ASPxClientCustomizeParameterLookUpSourceEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeParameterLookUpSourceEventArgs): void; +} +/** + * A method that will handle the PreviewClick event. + */ +interface ASPxClientWebDocumentViewerPreviewClickEventHandler { + /** + * A method that will handle the PreviewClick event. + * @param source The event sender. + * @param e An ASPxClientPreviewClickEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientPreviewClickEventArgs): void; +} +/** + * A method that will handle the ParametersReset event. + */ +interface ASPxClientWebDocumentViewerParametersResetEventHandler { + /** + * A method that will handle the PreviewParametersReset event. + * @param source The event sender. + * @param e An ASPxClientParametersResetEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientParametersResetEventArgs): void; +} +/** + * A method that will handle the ParametersSubmitted event. + */ +interface ASPxClientWebDocumentViewerParametersSubmittedEventHandler { + /** + * A method that will handle the PreviewParametersSubmitted event. + * @param source The event sender. + * @param e An ASPxClientParametersSubmittedEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientParametersSubmittedEventArgs): void; +} + +interface MVCxClientDashboardViewerStatic extends ASPxClientDashboardViewerStatic { +} +interface DashboardDataAxisNamesStatic { + /** + * Identifies a default axis in all data-bound dashboard items. + */ + DefaultAxis: string; + /** + * Identifies a series axis in a chart and pie. + */ + ChartSeriesAxis: string; + /** + * Identifies an argument axis in a chart, scatter chart and pie. + */ + ChartArgumentAxis: string; + /** + * Identifies a sparkline axis in a grid and cards. + */ + SparklineAxis: string; + /** + * Identifies a pivot column axis. + */ + PivotColumnAxis: string; + /** + * Identifies a pivot row axis. + */ + PivotRowAxis: string; +} +interface DashboardSpecialValuesStatic { + /** + * Represents a null value. + */ + NullValue: string; + /** + * Represents a null value in OLAP mode. + */ + OlapNullValue: string; + /** + * Represents an Others value. + */ + OthersValue: string; + /** + * Represents an error value for calculated fields. + */ + ErrorValue: string; + /** + * Returns whether or not the specified value is an NullValue. + * @param value The specified value. + */ + IsNullValue(value: Object): boolean; + /** + * Returns whether or not the specified value is an OlapNullValue. + * @param value The specified value. + */ + IsOlapNullValue(value: Object): boolean; + /** + * Returns whether or not the specified value is an OthersValue. + * @param value The specified value. + */ + IsOthersValue(value: Object): boolean; + /** + * Returns whether or not the specified value is an ErrorValue. + * @param value The specified value. + */ + IsErrorValue(value: Object): boolean; +} +interface DashboardExportPageLayoutStatic { + /** + * The page orientation used to export a dashboard (dashboard item) is portrait. + */ + Portrait: string; + /** + * The page orientation used to export a dashboard (dashboard item) is landscape. + */ + Landscape: string; +} +interface DashboardExportPaperKindStatic { + /** + * Letter paper (8.5 in. by 11 in.). + */ + Letter: string; + /** + * Legal paper (8.5 in. by 14 in.). + */ + Legal: string; + /** + * Executive paper (7.25 in. by 10.5 in.). + */ + Executive: string; + /** + * A5 paper (148 mm by 210 mm). + */ + A5: string; + /** + * A4 paper (210 mm by 297 mm). + */ + A4: string; + /** + * A3 paper (297 mm by 420 mm). + */ + A3: string; +} +interface DashboardExportScaleModeStatic { + /** + * The dashboard (dashboard item) on the exported page retains its original size. + */ + None: string; + /** + * The size of the dashboard (dashboard item) on the exported page is changed according to the scale factor value. + */ + UseScaleFactor: string; + /** + * The size of the dashboard (dashboard item) is changed according to the width of the exported page. + */ + AutoFitToPageWidth: string; + /** + * The size of the dashboard (dashboard item) is changed to fit its content on a single page. + */ + AutoFitWithinOnePage: string; +} +interface DashboardExportFilterStateStatic { + /** + * The filter state is not included in the exported document. + */ + None: string; + /** + * The filter state is placed below the dashboard (dashboard item) in the exported document. + */ + Below: string; + /** + * The filter state is placed on a separate page in the exported document. + */ + SeparatePage: string; +} +interface DashboardStateExportPositionStatic { + /** + * The dashboard state is placed below the exported dashboard/dashboard item. + */ + Below: string; + /** + * The dashboard state is placed on a separate page. + */ + SeparatePage: string; +} +interface DashboardStateExcelExportPositionStatic { + /** + * The dashboard state is placed below the exported data. + */ + Below: string; + /** + * The dashboard state is placed on a separate sheet. + */ + SeparateSheet: string; +} +interface DashboardExportImageFormatStatic { + /** + * The PNG image format. + */ + Png: string; + /** + * The GIF image format. + */ + Gif: string; + /** + * The JPG image format. + */ + Jpg: string; +} +interface ExcelExportFilterStateStatic { + none: string; + below: string; + separatePage: string; +} +interface DashboardExportExcelFormatStatic { + /** + * The Excel 97 - Excel 2003 (XLS) file format. + */ + Xls: string; + /** + * The Office Excel 2007 XML-based (XLSX) file format. + */ + Xlsx: string; + /** + * A comma-separated values (CSV) file format. + */ + Csv: string; +} +interface ChartExportSizeModeStatic { + /** + * A chart dashboard item is exported in a size identical to that shown on the dashboard. + */ + None: string; + /** + * A chart dashboard item is stretched or shrunk to fit the page to which it is exported. + */ + Stretch: string; + /** + * A chart dashboard item is resized proportionally to best fit the exported page. + */ + Zoom: string; +} +interface MapExportSizeModeStatic { + /** + * A map dashboard item is exported in a size identical to that shown on the dashboard + */ + None: string; + /** + * A map dashboard item is resized proportionally to best fit the exported page. + */ + Zoom: string; +} +interface TreemapExportSizeModeStatic { + /** + * For internal use. + */ + none: string; + /** + * For internal use. + */ + zoom: string; +} +interface RangeFilterExportSizeModeStatic { + /** + * A Range Filter dashboard item is exported in a size identical to that shown on the dashboard. + */ + None: string; + /** + * A Range Filter dashboard item is stretched or shrunk to fit the page to which it is exported. + */ + Stretch: string; + /** + * A Range Filter dashboard item is resized proportionally to best fit the printed page. + */ + Zoom: string; +} +interface DashboardSelectionModeStatic { + None: string; + Single: string; + Multiple: string; +} +interface ASPxClientDashboardStatic extends ASPxClientControlStatic { +} +interface ASPxClientDashboardViewerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDashboardViewer; +} +interface ASPxClientEditBaseStatic extends ASPxClientControlStatic { +} +interface ASPxClientEditStatic extends ASPxClientEditBaseStatic { + /** + * Assigns a null value to all editors in a specified visibility state, which are located within a specified container and belong to a specific validation group. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value specifying the validation group's name. + * @param clearInvisibleEditors true to clear both visible and invisible editors that belong to the specified container and group; false to clear only visible editors. + */ + ClearEditorsInContainer(container: Object, validationGroup: string, clearInvisibleEditors: boolean): void; + /** + * Assigns a null value to all visible editors located within a specified container, and belonging to a specific validation group. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value specifying the validation group's name. + */ + ClearEditorsInContainer(container: Object, validationGroup: string): void; + /** + * Assigns a null value to all visible editors located within a specified container. + * @param container An HTML element specifying the container of editors to be validated. + */ + ClearEditorsInContainer(container: Object): void; + /** + * Assigns a null value to all editors which are located within the specified container object, and belonging to a specific validation group, dependent on the visibility state specified. + * @param containerId A string value specifying the editor container's identifier. + * @param validationGroup A string value specifying the validatiion group's name. + * @param clearInvisibleEditors true to clear both visible and invisible editors that belong to the specified container and group; false to clear only visible editors. + */ + ClearEditorsInContainerById(containerId: string, validationGroup: string, clearInvisibleEditors: boolean): void; + /** + * Assigns a null value to all visible editors that are located within the specified container object, and belonging to a specific validation group. + * @param containerId A string value specifying the editor container's identifier. + * @param validationGroup A string value specifying the validatiion group's name. + */ + ClearEditorsInContainerById(containerId: string, validationGroup: string): void; + /** + * Assigns a null value to all visible editors that are located within the specified container object. + * @param containerId A string value specifying the editor container's identifier. + */ + ClearEditorsInContainerById(containerId: string): void; + /** + * Assigns a null value to all editors which belong to a specific validation group, dependent on the visibility state specified. + * @param validationGroup A string value specifying the validation group's name. + * @param clearInvisibleEditors true to clear both visible and invisible editors that belong to the specified validation group; false to clear only visible editors. + */ + ClearGroup(validationGroup: string, clearInvisibleEditors: boolean): void; + /** + * Assigns a null value to all visible editors which belong to a specific validation group. + * @param validationGroup A string value specifying the validation group's name. + */ + ClearGroup(validationGroup: string): void; + /** + * Performs validation of all editors in a specified visibility state, which are located within a specified container and belong to a specific validation group. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value that specifies the validation group's name. + * @param validateInvisibleEditors true to validate both visible and invisible editors that belong to the specified container and group; false to validate only visible editors. + */ + ValidateEditorsInContainer(container: Object, validationGroup: string, validateInvisibleEditors: boolean): boolean; + /** + * Performs validation of visible editors that are located within the specified container and belong to a specific validation group. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value that specifies the validation group's name. + */ + ValidateEditorsInContainer(container: Object, validationGroup: string): boolean; + /** + * Performs validation of visible editors that are located within the specified container. + * @param container An HTML element specifying the container of editors to be validated. + */ + ValidateEditorsInContainer(container: Object): boolean; + /** + * Performs validation of the editors which are located within the specified container and belong to a specific validation group, dependent on the visibility state specified. + * @param containerId A string value specifying the editor container's identifier. + * @param validationGroup A string value that specifies the validation group's name. + * @param validateInvisibleEditors true to validate both visible and invisible editors that belong to the specified container and group; false to validate only visible editors. + */ + ValidateEditorsInContainerById(containerId: string, validationGroup: string, validateInvisibleEditors: boolean): boolean; + /** + * Performs validation of visible editors that are located within the specified container and belong to a specific validation group. + * @param containerId A string value that specifies the container's unique identifier. + * @param validationGroup A string value that specifies the validation group's name. + */ + ValidateEditorsInContainerById(containerId: string, validationGroup: string): boolean; + /** + * Performs validation of visible editors which are located within the specified container. + * @param containerId A string value that specifies the container's unique identifier. + */ + ValidateEditorsInContainerById(containerId: string): boolean; + /** + * Performs validation of editors contained within the specified validation group, dependent on the editor visibility state specified. + * @param validationGroup A string value specifying the validation group's name. + * @param validateInvisibleEditors true to validate both visible and invisible editors that belong to the specified validation group; false to validate only visible editors. + */ + ValidateGroup(validationGroup: string, validateInvisibleEditors: boolean): boolean; + /** + * Performs validation of visible editors contained within the specified validation group. + * @param validationGroup A string value specifying the validation group's name. + */ + ValidateGroup(validationGroup: string): boolean; + /** + * Verifies whether the editors in a specified visibility state, which are located within a specified container and belong to a specific validation group, are valid. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value that specifies the validation group's name. + * @param checkInvisibleEditors true to check both visible and invisible editors that belong to the specified container; false to check only visible editors. + */ + AreEditorsValid(container: Object, validationGroup: string, checkInvisibleEditors: boolean): boolean; + /** + * Verifies whether visible editors, which are located within a specified container and belong to a specific validation group, are valid. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value that specifies the validation group's name. + */ + AreEditorsValid(container: Object, validationGroup: string): boolean; + /** + * Verifies whether visible editors located in a specified container are valid. + * @param container An HTML element specifying the container of editors to be validated. + */ + AreEditorsValid(container: Object): boolean; + /** + * Verifies whether the editors with the specified settings are valid. + * @param containerId A string value that specifies the container's unique identifier. + * @param validationGroup A string value that specifies the validation group's name. + * @param checkInvisibleEditors true to check both visible and invisible editors that belong to the specified container; false to check only visible editors. + */ + AreEditorsValid(containerId: string, validationGroup: string, checkInvisibleEditors: boolean): boolean; + /** + * Verifies whether visible editors with the specified settings are valid. + * @param containerId A string value that specifies the container's unique identifier. + * @param validationGroup A string value that specifies the validation group's name. + */ + AreEditorsValid(containerId: string, validationGroup: string): boolean; + /** + * Verifies whether visible editors with the specified settings are valid. + * @param containerId A string value that specifies the container's unique identifier. + */ + AreEditorsValid(containerId: string): boolean; + /** + * Verifies whether visible editors on a page are valid. + */ + AreEditorsValid(): boolean; +} +interface ASPxClientBinaryImageStatic extends ASPxClientEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientBinaryImage; +} +interface ASPxClientButtonStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientButton; +} +interface ASPxClientCalendarStatic extends ASPxClientEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCalendar; +} +interface ASPxClientCaptchaStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCaptcha; +} +interface ASPxClientCheckBoxStatic extends ASPxClientEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCheckBox; +} +interface ASPxClientRadioButtonStatic extends ASPxClientCheckBoxStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientRadioButton; +} +interface ASPxClientTextEditStatic extends ASPxClientEditStatic { +} +interface ASPxClientTextBoxBaseStatic extends ASPxClientTextEditStatic { +} +interface ASPxClientButtonEditBaseStatic extends ASPxClientTextBoxBaseStatic { +} +interface ASPxClientDropDownEditBaseStatic extends ASPxClientButtonEditBaseStatic { +} +interface ASPxClientColorEditStatic extends ASPxClientDropDownEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientColorEdit; +} +interface ASPxClientComboBoxStatic extends ASPxClientDropDownEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientComboBox; +} +interface ASPxClientDateEditStatic extends ASPxClientDropDownEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDateEdit; +} +interface ASPxClientDropDownEditStatic extends ASPxClientDropDownEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDropDownEdit; +} +interface ASPxClientFilterControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientFilterControl; +} +interface ASPxClientListEditStatic extends ASPxClientEditStatic { +} +interface ASPxClientListBoxStatic extends ASPxClientListEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientListBox; +} +interface ASPxClientCheckListBaseStatic extends ASPxClientListEditStatic { +} +interface ASPxClientRadioButtonListStatic extends ASPxClientCheckListBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientRadioButtonList; +} +interface ASPxClientCheckBoxListStatic extends ASPxClientCheckListBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCheckBoxList; +} +interface ASPxClientProgressBarStatic extends ASPxClientEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientProgressBar; +} +interface ASPxClientSpinEditBaseStatic extends ASPxClientButtonEditBaseStatic { +} +interface ASPxClientSpinEditStatic extends ASPxClientSpinEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientSpinEdit; +} +interface ASPxClientTimeEditStatic extends ASPxClientSpinEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTimeEdit; +} +interface ASPxClientStaticEditStatic extends ASPxClientEditBaseStatic { +} +interface ASPxClientHyperLinkStatic extends ASPxClientStaticEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientHyperLink; +} +interface ASPxClientImageBaseStatic extends ASPxClientStaticEditStatic { +} +interface ASPxClientImageStatic extends ASPxClientImageBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientImage; +} +interface ASPxClientLabelStatic extends ASPxClientStaticEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientLabel; +} +interface ASPxClientTextBoxStatic extends ASPxClientTextBoxBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTextBox; +} +interface ASPxClientMemoStatic extends ASPxClientTextEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientMemo; +} +interface ASPxClientButtonEditStatic extends ASPxClientButtonEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientButtonEdit; +} +interface ASPxClientTokenBoxStatic extends ASPxClientComboBoxStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTokenBox; +} +interface ASPxClientTrackBarStatic extends ASPxClientEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTrackBar; +} +interface ASPxClientValidationSummaryStatic extends ASPxClientControlStatic { +} +interface ASPxClientGaugeControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientGaugeControl; +} +interface ASPxClientGridBaseStatic extends ASPxClientControlStatic { +} +interface ASPxClientGridViewCallbackCommandStatic { + /** + * Default value: "NEXTPAGE" + */ + NextPage: string; + /** + * Default value: "PREVPAGE" + */ + PreviousPage: string; + /** + * Default value: "GOTOPAGE" + */ + GotoPage: string; + /** + * Default value: "SELECTROWS" + */ + SelectRows: string; + /** + * Default value: "SELECTROWSKEY" + */ + SelectRowsKey: string; + /** + * Default value: "SELECTION" + */ + Selection: string; + /** + * Default value: "FOCUSEDROW" + */ + FocusedRow: string; + /** + * Default value: "GROUP" + */ + Group: string; + /** + * Default value: "UNGROUP" + */ + UnGroup: string; + /** + * Default value: "SORT" + */ + Sort: string; + /** + * Default value: "COLUMNMOVE" + */ + ColumnMove: string; + /** + * Default value: "COLLAPSEALL" + */ + CollapseAll: string; + /** + * Default value: "EXPANDALL" + */ + ExpandAll: string; + /** + * Default value: "EXPANDROW" + */ + ExpandRow: string; + /** + * Default value: "COLLAPSEROW" + */ + CollapseRow: string; + /** + * Default value: "HIDEALLDETAIL" + */ + HideAllDetail: string; + /** + * Default value: "SHOWALLDETAIL" + */ + ShowAllDetail: string; + /** + * Default value: "SHOWDETAILROW" + */ + ShowDetailRow: string; + /** + * Default value: "HIDEDETAILROW" + */ + HideDetailRow: string; + /** + * Default value: "PAGERONCLICK" + */ + PagerOnClick: string; + /** + * Default value: "APPLYFILTER" + */ + ApplyFilter: string; + /** + * Default value: "APPLYCOLUMNFILTER" + */ + ApplyColumnFilter: string; + /** + * Default value: "APPLYMULTICOLUMNFILTER" + */ + ApplyMultiColumnFilter: string; + /** + * Default value: "APPLYHEADERCOLUMNFILTER" + */ + ApplyHeaderColumnFilter: string; + /** + * Default value: "APPLYSEARCHPANELFILTER" + */ + ApplySearchPanelFilter: string; + /** + * Default value: "APPLYCUSTOMIZATIONDIALOGCHANGES" + */ + ApplyCustomizationDialogChanges: string; + /** + * Default value: "FILTERROWMENU" + */ + FilterRowMenu: string; + /** + * Default value: "STARTEDIT" + */ + StartEdit: string; + /** + * Default value: "CANCELEDIT" + */ + CancelEdit: string; + /** + * Default value: "UPDATEEDIT" + */ + UpdateEdit: string; + /** + * Default value: "ADDNEWROW" + */ + AddNewRow: string; + /** + * Default value: "DELETEROW" + */ + DeleteRow: string; + /** + * Default value: "CUSTOMBUTTON" + */ + CustomButton: string; + /** + * Default value: "CUSTOMCALLBACK" + */ + CustomCallback: string; + /** + * Default value: "SHOWFILTERCONTROL" + */ + ShowFilterControl: string; + /** + * Default value: "CLOSEFILTERCONTROL" + */ + CloseFilterControl: string; + /** + * Default value: "SETFILTERENABLED" + */ + SetFilterEnabled: string; + /** + * Default value: "REFRESH" + */ + Refresh: string; + /** + * Default value: "SELFIELDVALUES" + */ + SelFieldValues: string; + /** + * Default value: "ROWVALUES" + */ + RowValues: string; + /** + * Default value: "PAGEROWVALUES" + */ + PageRowValues: string; + /** + * Default value: "FILTERPOPUP" + */ + FilterPopup: string; + /** + * Default value: "CONTEXTMENU" + */ + ContextMenu: string; + /** + * Default value: "TOOLBAR" + */ + Toolbar: string; + /** + * Default value: "CUSTOMVALUES" + */ + CustomValues: string; +} +interface ASPxClientGridLookupStatic extends ASPxClientDropDownEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientGridLookup; +} +interface ASPxClientCardViewStatic extends ASPxClientGridBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCardView; +} +interface ASPxClientGridViewStatic extends ASPxClientGridBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientGridView; +} +interface ASPxClientVerticalGridStatic extends ASPxClientGridBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientVerticalGrid; +} +interface ASPxClientVerticalGridCallbackCommandStatic { + /** + * Default value: "EXPANDROW" + */ + ExpandRow: string; +} +interface ASPxClientCommandConstsStatic { + /** + * Identifies a command that shows a search panel. + * Value: "showsearchpanel" + */ + SHOWSEARCHPANEL_COMMAND: string; + /** + * Identifies a command that invokes the Find and Replace dialog. + * Value: "findandreplacedialog" + */ + FINDANDREPLACE_DIALOG_COMMAND: string; + /** + * Identifies a command that applies the bold text formatting to the selected text. If it's already applied, cancels it. + * Value: "bold" + */ + BOLD_COMMAND: string; + /** + * Identifies a command that makes the selected text italic or regular type depending on the current state. + * Value: "italic" + */ + ITALIC_COMMAND: string; + /** + * Identifies a command that applies the underline text formatting to the selected text. If it's already applied, cancels it. + * Value: "underline" + */ + UNDERLINE_COMMAND: string; + /** + * Identifies a command that applies the strike through text formatting to the selected text. If it's already applied, cancels it. + * Value: "strikethrough" + */ + STRIKETHROUGH_COMMAND: string; + /** + * Identifies a command that applies the superscript text formatting to the selected text. If it's already applied, cancels it. + * Value: "superscript" + */ + SUPERSCRIPT_COMMAND: string; + /** + * Identifies a command that applies the subscript text formatting to the selected text. If it's already applied, cancels it. + * Value: "subscript" + */ + SUBSCRIPT_COMMAND: string; + /** + * Identifies a command that centers the content of the currently focused paragraph. + * Value: "justifycenter" + */ + JUSTIFYCENTER_COMMAND: string; + /** + * Identifies a command that left justifies the content of the currently focused paragraph. + * Value: "justifyleft" + */ + JUSTIFYLEFT_COMMAND: string; + /** + * Identifies a command that creates an indent for the selected paragarph. + * Value: "indent" + */ + INDENT_COMMAND: string; + /** + * Identifies a command that creates an outdent for the focused paragarph. + * Value: "outdent" + */ + OUTDENT_COMMAND: string; + /** + * Identifies a command that right justifies the content of the currently focused paragraph. + * Value: "justifyright" + */ + JUSTIFYRIGHT_COMMAND: string; + /** + * Identifies a command that fully justifies the content of the currently focused paragraph (aligned with both the left and right margines). + * Value: "justifyfull" + */ + JUSTIFYFULL_COMMAND: string; + /** + * Identifies a command that changes the size of the selected text. + * Value: "fontsize" + */ + FONTSIZE_COMMAND: string; + /** + * Identifies a command that changes the font of the selected text. + * Value: "fontname" + */ + FONTNAME_COMMAND: string; + /** + * Identifies a command that changes the color of a fore color pickers and sets the selected text fore color. + * Value: "forecolor" + */ + FONTCOLOR_COMMAND: string; + /** + * Identifies a command that changes the color of a back color pickers and sets the selected text back color. + * Value: "backcolor" + */ + BACKCOLOR_COMMAND: string; + /** + * Identifies a command that wraps the selected paragraph in the specified html tag. + * Value: "formatblock" + */ + FORMATBLOCK_COMMAND: string; + /** + * Identifies a command that wraps the currently selected text content in a specific html tag with a css class assigned to it. + * Value: "applycss" + */ + APPLYCSS_COMMAND: string; + /** + * Identifies a command that removes all formatting from the selected content. + * Value: "removeformat" + */ + REMOVEFORMAT_COMMAND: string; + /** + * Identifies a command that cancels the last action. + * Value: "undo" + */ + UNDO_COMMAND: string; + /** + * Identifies a command that returns a previously canceled action. + * Value: "redo" + */ + REDO_COMMAND: string; + /** + * Identifies a command that copies the selected content. + * Value: "copy" + */ + COPY_COMMAND: string; + /** + * Identifies a command that pastes the content of the clipboard at the current cursor position. + * Value: "paste" + */ + PASTE_COMMAND: string; + /** + * Identifies a command that pastes a specified content taking into account that it was copied from Word. + * Value: "pastefromword" + */ + PASTEFROMWORD_COMMAND: string; + /** + * Identifies a command that invokes the Paste from Word dialog. + * Value: "pastefromworddialog" + */ + PASTEFROMWORDDIALOG_COMMAND: string; + /** + * Identifies a command that cuts the selected content. + * Value: "cut" + */ + CUT_COMMAND: string; + /** + * Identifies a command that selects all content inside the html editor. + * Value: "selectall" + */ + SELECT_ALL: string; + /** + * Identifies a command that deletes the selected content. + * Value: "delete" + */ + DELETE_COMMAND: string; + /** + * Identifies a command that can be used to correctly insert HTML code into the editor. + * Value: "pastehtml" + */ + PASTEHTML_COMMAND: string; + /** + * Identifies a command that inserts a new ordered list. + * Value: "insertorderedlist" + */ + INSERTORDEREDLIST_COMMAND: string; + /** + * Identifies a command that inserts a new unordered list. + * Value: "insertunorderedlist" + */ + INSERTUNORDEREDLIST_COMMAND: string; + /** + * Identifies a command that restarts the current ordered list. + * Value: "restartorderedlist" + */ + RESTARTORDEREDLIST_COMMAND: string; + /** + * Identifies a command that continues a disrupted ordered list. + * Value: "continueorderedlist" + */ + CONTINUEORDEREDLIST_COMMAND: string; + /** + * Identifies a command that removes a hyperlink from the selected text or image. + * Value: "unlink" + */ + UNLINK_COMMAND: string; + /** + * Identifies a command that inserts a new hyperlink. + * Value: "insertlink" + */ + INSERTLINK_COMMAND: string; + /** + * Identifies a command that inserts a new image. + * Value: "insertimage" + */ + INSERTIMAGE_COMMAND: string; + /** + * Identifies a command that changes the selected image. + * Value: "changeimage" + */ + CHANGEIMAGE_COMMAND: string; + /** + * Identifies a command that initiates spell checking. + * Value: "checkspelling" + */ + CHECKSPELLING_COMMAND: string; + /** + * Identifies a command that invokes the Insert Image dialog. + * Value: "insertimagedialog" + */ + INSERTIMAGE_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Image dialog. + * Value: "changeimagedialog" + */ + CHANGEIMAGE_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Insert Link dialog. + * Value: "insertlinkdialog" + */ + INSERTLINK_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Link dialog. + * Value: "changelinkdialog" + */ + CHANGELINK_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Insert Table dialog. + * Value: "inserttabledialog" + */ + INSERTTABLE_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Table Properties dialog. + * Value: "tablepropertiesdialog" + */ + TABLEPROPERTIES_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Cell Properties dialog. + * Value: "tablecellpropertiesdialog" + */ + TABLECELLPROPERTIES_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Column Properties dialog. + * Value: "tablecolumnpropertiesdialog" + */ + TABLECOLUMNPROPERTIES_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Row Properties dialog. + * Value: "tablerowpropertiesdialog" + */ + TABLEROWPROPERTIES_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes a default browser Print dialog, allowing an end-user to print the content of the html editor. + * Value: "print" + */ + PRINT_COMMAND: string; + /** + * Identifies a command that toggles the full-screen mode. + * Value: "fullscreen" + */ + FULLSCREEN_COMMAND: string; + /** + * Identifies a command that inserts a new table. + * Value: "inserttable" + */ + INSERTTABLE_COMMAND: string; + /** + * Identifies a command that changes the selected table. + * Value: "changetable" + */ + CHANGETABLE_COMMAND: string; + /** + * Identifies a command that changes the selected table cell. + * Value: "changetablecell" + */ + CHANGETABLECELL_COMMAND: string; + /** + * Identifies a command that changes the selected table row. + * Value: "changetablerow" + */ + CHANGETABLEROW_COMMAND: string; + /** + * Identifies a command that changes the selected table column. + * Value: "changetablecolumn" + */ + CHANGETABLECOLUMN_COMMAND: string; + /** + * Identifies a command that deletes the currently selected table. + * Value: "deletetable" + */ + DELETETABLE_COMMAND: string; + /** + * Identifies a command that deletes the currently selected table row. + * Value: "deletetablerow" + */ + DELETETABLEROW_COMMAND: string; + /** + * Identifies a command that deletes the currently selected table column. + * Value: "deletetablecolumn" + */ + DELETETABLECOLUMN_COMMAND: string; + /** + * Identifies a command that inserts a new column to the left from the currently focused one. + * Value: "inserttablecolumntoleft" + */ + INSERTTABLECOLUMNTOLEFT_COMMAND: string; + /** + * Identifies a command that inserts a new column to the right from the currently focused one. + * Value: "inserttablecolumntoright" + */ + INSERTTABLECOLUMNTORIGHT_COMMAND: string; + /** + * Identifies a command that inserts a new row below the currently focused one. + * Value: "inserttablerowbelow" + */ + INSERTTABLEROWBELOW_COMMAND: string; + /** + * Identifies a command that inserts a new row above the currently focused one. + * Value: "inserttablerowabove" + */ + INSERTTABLEROWABOVE_COMMAND: string; + /** + * Identifies a command that splits the current table cell horizontally. + * Value: "splittablecellhorizontally" + */ + SPLITTABLECELLHORIZONTALLY_COMMAND: string; + /** + * Identifies a command that splits the current table cell vertically. + * Value: "splittablecellvertically" + */ + SPLITTABLECELLVERTICALLY_COMMAND: string; + /** + * Identifies a command that merges the focused table cell with the one to the right. + * Value: "mergetablecellright" + */ + MERGETABLECELLRIGHT_COMMAND: string; + /** + * Identifies a command that merges the focused table cell with the one below. + * Value: "mergetablecelldown" + */ + MERGETABLECELLDOWN_COMMAND: string; + /** + * Identifies a command that invokes a custom dialog. + * Value: "customdialog" + */ + CUSTOMDIALOG_COMMAND: string; + /** + * Identifies a command that exports the html editor content. + * Value: "export" + */ + EXPORT_COMMAND: string; + /** + * Identifies a command that inserts a new audio element. + * Value: "insertaudio" + */ + INSERTAUDIO_COMMAND: string; + /** + * Identifies a command that inserts a new video. + * Value: "insertvideo" + */ + INSERTVIDEO_COMMAND: string; + /** + * Identifies a command that inserts a new flash element. + * Value: "insertflash" + */ + INSERTFLASH_COMMAND: string; + /** + * Identifies a command that inserts a new YouTube video. + * Value: "insertyoutubevideo" + */ + INSERTYOUTUBEVIDEO_COMMAND: string; + /** + * Identifies a command that changes the selected audio element. + * Value: "changeaudio" + */ + CHANGEAUDIO_COMMAND: string; + /** + * Identifies a command that changes the selected video element. + * Value: "changevideo" + */ + CHANGEVIDEO_COMMAND: string; + /** + * Identifies a command that changes the selected flash element. + * Value: "changeflash" + */ + CHANGEFLASH_COMMAND: string; + /** + * Identifies a command that changes the selected YouTube video element. + * Value: "changeyoutubevideo" + */ + CHANGEYOUTUBEVIDEO_COMMAND: string; + /** + * Identifies a command that invokes the Insert Audio dialog. + * Value: "insertaudiodialog" + */ + INSERTAUDIO_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Insert Video dialog. + * Value: "insertvideodialog" + */ + INSERTVIDEO_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Insert Flash dialog. + * Value: "insertflashdialog" + */ + INSERTFLASH_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Insert YouTube Video dialog. + * Value: "insertyoutubevideodialog" + */ + INSERTYOUTUBEVIDEO_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Audio dialog. + * Value: "changeaudiodialog" + */ + CHANGEAUDIO_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Video dialog. + * Value: "changevideodialog" + */ + CHANGEVIDEO_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Flash dialog. + * Value: "changeflash" + */ + CHANGEFLASH_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change YouTube Video dialog. + * Value: "changeyoutubevideodialog" + */ + CHANGEYOUTUBEVIDEO_DIALOG_COMMAND: string; + /** + * Identifies a command that pastes the content of the clipboard to the current cursor position, taking into account that the PasteMode property is set to SourceFormatting. + * Value: "pastehtmlsourceformatting" + */ + PASTEHTMLSOURCEFORMATTING_COMMAND: string; + /** + * Identifies a command that pastes the content of the clipboard to the current cursor position, taking into account that the PasteMode property is set to PlainText. + * Value: "pastehtmlplaintext" + */ + PASTEHTMLPLAINTEXT_COMMAND: string; + /** + * Identifies a command that pastes the content of the clipboard to the current cursor position, taking into account that the PasteMode property is set to MergeFormatting. + * Value: "pastehtmlmergeformatting" + */ + PASTEHTMLMERGEFORMATTING_COMMAND: string; + /** + * Identifies a command that inserts a new placeholder. + * Value: "insertplaceholder" + */ + INSERTPLACEHOLDER_COMMAND: string; + /** + * Identifies a command that changes the selected placeholder. + * Value: "changeplaceholder" + */ + CHANGEPLACEHOLDER_COMMAND: string; + /** + * Identifies a command that invokes the Insert Placeholder dialog. + * Value: "insertplaceholderdialog" + */ + INSERTPLACEHOLDER_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Placeholder dialog. + * Value: "changeplaceholderdialog" + */ + CHANGEPLACEHOLDER_DIALOG_COMMAND: string; + /** + * Identifies a command that updates the editor content. + * Value: "updatedocument" + */ + UPDATEDOCUMENT_COMMAND: string; + /** + * Identifies a command that changes properties of the element selected in the tag inspector. + * Value: "changeelementproperties" + */ + CHANGEELEMENTPROPERTIES_COMMAND: string; + /** + * Identifies a command that invokes the Change Element Properties dialog. + * Value: "changeelementpropertiesdialog" + */ + CHANGEELEMENTPROPERTIES_DIALOG_COMMAND: string; + /** + * Identifies a command that comments the selected HTML code. If no code is selected, it comments the focused tag. + * Value: "comment" + */ + COMMENT_COMMAND: string; + /** + * Identifies a command that uncomments the selected HTML code. If no code is selected, the command uncomments the currently focused tag. + * Value: "uncomment" + */ + UNCOMMENTHTML_COMMAND: string; + /** + * Identifies a command that formats the current HTML document. + * Value: "formatdocument" + */ + FORMATDOCUMENT_COMMAND: string; + /** + * Identifies a command that applies the indent formatting to the selected content. + * Value: "indent" + */ + INDENTLINE_COMMAND: string; + /** + * Identifies a command that applies the outdent formatting to the focused content. + * Value: "outdent" + */ + OUTDENTLINE_COMMAND: string; + /** + * Identifies a command that collapses the selected HTML tag. + * Value: "collapsetag" + */ + COLLAPSETAG_COMMAND: string; + /** + * Identifies a command that expands the selected HTML tag. + * Value: "expandtag" + */ + EXPANDTAG_COMMAND: string; + /** + * Identifies a command that shows intellisense for the HTML code editor. + * Value: "showintellisense" + */ + SHOWINTELLISENSE_COMMAND: string; +} +interface ASPxClientHtmlEditorStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientHtmlEditor; + /** + * Programmatically closes a custom dialog, supplying it with specific parameters. + * @param status An object representing a custom dialog's closing status. + * @param data An object representing custom data associated with a custom dialog. + */ + CustomDialogComplete(status: Object, data: Object): void; +} +interface ASPxClientHtmlEditorMediaPreloadModeStatic { + /** + * The browser does not load a media file when the page loads. + */ + None: string; + /** + * The browser loads the entire video when the page loads. + */ + Auto: string; + /** + * The browser loads only metadata when the page loads. + */ + Metadata: string; +} +interface ASPxClientPivotGridStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPivotGrid; +} +interface ASPxClientPivotCustomizationStatic extends ASPxClientControlStatic { +} +interface ASPxClientRichEditStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientRichEdit; +} +interface ASPxSchedulerDateTimeHelperStatic { + /** + * Returns the date part of the specified DateTime value. + * @param date A DateTime object from which to extract the date. + */ + TruncToDate(date: Date): Date; + /** + * Returns the day time part of the specified DateTime value. + * @param date A DateTime object from which to extract the day time. + */ + ToDayTime(date: Date): any; + /** + * Adds the specified number of days to a DateTime object and returns the result. + * @param date A DateTime object to which to add days. + * @param dayCount The number of days to add. + */ + AddDays(date: Date, dayCount: number): Date; + /** + * Adds the specified timespan to a DateTime object and returns the result. + * @param date A DateTime object to which to add a timespan. + * @param timeSpan A TimeSpan object specifying the timespan to add. + */ + AddTimeSpan(date: Date, timeSpan: any): Date; + /** + * Rounds a DateTime value up to the nearest interval. + * @param date A DateTime object containing a value to round. + * @param spanInMs A TimeSpan object specifying an interval to which to round. + */ + CeilDateTime(date: Date, spanInMs: any): Date; +} +interface ASPxClientWeekDaysCheckEditStatic extends ASPxClientControlStatic { +} +interface ASPxClientRecurrenceRangeControlStatic extends ASPxClientControlStatic { +} +interface ASPxClientRecurrenceControlBaseStatic extends ASPxClientControlStatic { +} +interface ASPxClientDailyRecurrenceControlStatic extends ASPxClientRecurrenceControlBaseStatic { +} +interface ASPxClientWeeklyRecurrenceControlStatic extends ASPxClientRecurrenceControlBaseStatic { +} +interface ASPxClientMonthlyRecurrenceControlStatic extends ASPxClientRecurrenceControlBaseStatic { +} +interface ASPxClientYearlyRecurrenceControlStatic extends ASPxClientRecurrenceControlBaseStatic { +} +interface ASPxClientRecurrenceTypeEditStatic extends ASPxClientRadioButtonListStatic { +} +interface ASPxClientTimeIntervalStatic { + /** + * Gets the duration of a time interval between two points in time. + * @param start A DateTime object specifying the starting point of the time interval. + * @param end A DateTime object specifying the ending point of the time interval. + */ + CalculateDuration(start: Date, end: Date): number; +} +interface ASPxClientSchedulerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientScheduler; +} +interface ASPxClientSpellCheckerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientSpellChecker; +} +interface ASPxClientSpellCheckerStopCheckingReasonStatic { + /** + * Spell checking is finished normally. + */ + Default: string; + /** + * The user stopped spell checking. + */ + User: string; +} +interface ASPxClientSpreadsheetStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientSpreadsheet; +} +interface ASPxClientTreeListStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTreeList; +} +interface BootstrapClientAccordionStatic extends ASPxClientNavBarStatic { +} +interface BootstrapClientBinaryImageStatic extends ASPxClientHyperLinkStatic { +} +interface BootstrapClientButtonStatic extends ASPxClientButtonStatic { +} +interface BootstrapClientCalendarStatic extends ASPxClientCalendarStatic { +} +interface BootstrapClientCallbackPanelStatic extends ASPxClientControlStatic { +} +interface BootstrapClientChartBaseStatic extends ASPxClientControlStatic { +} +interface BootstrapClientChartStatic extends BootstrapClientChartBaseStatic { +} +interface BootstrapClientPolarChartStatic extends BootstrapClientChartBaseStatic { +} +interface BootstrapClientPieChartStatic extends BootstrapClientChartBaseStatic { +} +interface BootstrapClientCheckBoxStatic extends ASPxClientEditStatic { +} +interface BootstrapClientRadioButtonStatic extends BootstrapClientCheckBoxStatic { +} +interface BootstrapClientComboBoxStatic extends ASPxClientComboBoxStatic { +} +interface BootstrapClientDateEditStatic extends ASPxClientDateEditStatic { +} +interface BootstrapClientDropDownEditStatic extends ASPxClientDropDownEditStatic { +} +interface BootstrapClientFormLayoutStatic extends ASPxClientFormLayoutStatic { +} +interface BootstrapClientHyperLinkStatic extends ASPxClientHyperLinkStatic { +} +interface BootstrapClientImageStatic extends ASPxClientImageStatic { +} +interface BootstrapClientListBoxStatic extends ASPxClientListBoxStatic { +} +interface BootstrapClientCheckBoxListStatic extends ASPxClientCheckBoxListStatic { +} +interface BootstrapClientRadioButtonListStatic extends ASPxClientRadioButtonListStatic { +} +interface BootstrapClientMenuStatic extends ASPxClientMenuStatic { +} +interface BootstrapClientPagerStatic extends ASPxClientPagerStatic { +} +interface BootstrapClientPopupControlStatic extends ASPxClientPopupControlStatic { +} +interface BootstrapClientPopupMenuStatic extends ASPxClientPopupMenuStatic { +} +interface BootstrapClientProgressBarStatic extends ASPxClientProgressBarStatic { +} +interface BootstrapClientSpinEditStatic extends ASPxClientSpinEditStatic { +} +interface BootstrapClientTabControlStatic extends ASPxClientTabControlStatic { +} +interface BootstrapClientPageControlStatic extends ASPxClientPageControlStatic { +} +interface BootstrapClientTextBoxStatic extends ASPxClientTextBoxStatic { +} +interface BootstrapClientMemoStatic extends ASPxClientMemoStatic { +} +interface BootstrapClientButtonEditStatic extends ASPxClientButtonEditStatic { +} +interface BootstrapClientTreeViewStatic extends ASPxClientTreeViewStatic { +} +interface BootstrapUIWidgetBaseStatic extends ASPxClientControlStatic { +} +interface BootstrapClientUploadControlStatic extends ASPxClientUploadControlStatic { +} +interface BootstrapClientGridViewStatic extends ASPxClientGridViewStatic { +} +interface MVCxClientCalendarStatic extends ASPxClientCalendarStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientCalendar; +} +interface MVCxClientCallbackPanelStatic extends ASPxClientCallbackPanelStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientCallbackPanel; +} +interface MVCxClientCardViewStatic extends ASPxClientCardViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientCardView; +} +interface MVCxClientChartStatic extends ASPxClientWebChartControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientChart; +} +interface MVCxClientComboBoxStatic extends ASPxClientComboBoxStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientComboBox; +} +interface MVCxClientDataViewStatic extends ASPxClientDataViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientDataView; +} +interface MVCxClientDateEditStatic extends ASPxClientDateEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientDateEdit; +} +interface MVCxClientDockManagerStatic extends ASPxClientDockManagerStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientDockManager; +} +interface MVCxClientDockPanelStatic extends ASPxClientDockPanelStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientDockPanel; +} +interface MVCxClientFileManagerStatic extends ASPxClientFileManagerStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientFileManager; +} +interface MVCxClientGridViewStatic extends ASPxClientGridViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientGridView; +} +interface MVCxClientHtmlEditorStatic extends ASPxClientHtmlEditorStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientHtmlEditor; +} +interface MVCxClientImageGalleryStatic extends ASPxClientImageGalleryStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientImageGallery; +} +interface MVCxClientListBoxStatic extends ASPxClientListBoxStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientListBox; +} +interface MVCxClientNavBarStatic extends ASPxClientNavBarStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientNavBar; +} +interface MVCxClientPivotGridStatic extends ASPxClientPivotGridStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientPivotGrid; +} +interface MVCxClientPopupControlStatic extends ASPxClientPopupControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientPopupControl; +} +interface MVCxClientDocumentViewerStatic extends ASPxClientDocumentViewerStatic { +} +interface MVCxClientReportViewerStatic extends ASPxClientReportViewerStatic { +} +interface MVCxClientReportDesignerStatic extends ASPxClientReportDesignerStatic { +} +interface MVCxClientRichEditStatic extends ASPxClientRichEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientRichEdit; +} +interface MVCxClientRoundPanelStatic extends ASPxClientRoundPanelStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientRoundPanel; +} +interface MVCxClientSchedulerStatic extends ASPxClientSchedulerStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientScheduler; +} +interface MVCxSchedulerToolTipTypeStatic { + /** + * The tooltip is displayed for a selected appointment. + */ + Appointment: number; + /** + * The tooltip is displayed for a dragged appointment. + */ + AppointmentDrag: number; + /** + * The tooltip is displayed for a selected time interval. + */ + Selection: number; +} +interface MVCxClientSpreadsheetStatic extends ASPxClientSpreadsheetStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientSpreadsheet; +} +interface MVCxClientPageControlStatic extends ASPxClientPageControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientPageControl; +} +interface MVCxClientTokenBoxStatic extends ASPxClientTokenBoxStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientTokenBox; +} +interface MVCxClientTreeListStatic extends ASPxClientTreeListStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientTreeList; +} +interface MVCxClientTreeViewStatic extends ASPxClientTreeViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientTreeView; +} +interface MVCxClientUploadControlStatic extends ASPxClientUploadControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientUploadControl; +} +interface MVCxClientUtilsStatic { + /** + * Loads service resources (such as scripts, CSS files, etc.) required for DevExpress functionality to work properly after a non DevExpress callback has been processed on the server and returned back to the client. + */ + FinalizeCallback(): void; + /** + * Returns values of editors placed in the specified container. + * @param containerOrId A container of editors, or its ID. + */ + GetSerializedEditorValuesInContainer(containerOrId: Object): Object; + /** + * Returns values of editors placed in the specified container. + * @param containerOrId A container of editors, or its ID. + * @param processInvisibleEditors true to process both visible and invisible editors that belong to the specified container; false to process only visible editors. + */ + GetSerializedEditorValuesInContainer(containerOrId: Object, processInvisibleEditors: boolean): Object; +} +interface MVCxClientGlobalEventsStatic { + /** + * Dynamically connects the ControlsInitialized client event with an appropriate event handler function. + * @param handler A object representing the event handling function's content. + */ + AddControlsInitializedEventHandler(handler: ASPxClientControlsInitializedEventHandler): void; + /** + * Dynamically connects the BeginCallback client event with an appropriate event handler function. + * @param handler A object containing the event handling function's content. + */ + AddBeginCallbackEventHandler(handler: MVCxClientBeginCallbackEventHandler): void; + /** + * Dynamically connects the EndCallback client event with an appropriate event handler function. + * @param handler A object containing the event handling function's content. + */ + AddEndCallbackEventHandler(handler: ASPxClientEndCallbackEventHandler): void; + /** + * Dynamically connects the CallbackError client event with an appropriate event handler function. + * @param handler A object containing the event handling function's content. + */ + AddCallbackErrorHandler(handler: ASPxClientCallbackErrorEventHandler): void; +} +interface MVCxClientVerticalGridStatic extends ASPxClientVerticalGridStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientVerticalGrid; +} +interface MVCxClientWebDocumentViewerStatic extends ASPxClientWebDocumentViewerStatic { +} +interface ASPxClientControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientControlBase; +} +interface ASPxClientControlStatic extends ASPxClientControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientControl; + /** + * Modifies the controls size on the page. + */ + AdjustControls(): void; + /** + * Modifies the controls size within the specified container. + * @param container An HTML element that is the container of the controls. + */ + AdjustControls(container: Object): void; + /** + * Returns a collection of client web control objects. + */ + GetControlCollection(): ASPxClientControlCollection; +} +interface ASPxClientCallbackStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCallback; +} +interface ASPxClientPanelBaseStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPanelBase; +} +interface ASPxClientPanelStatic extends ASPxClientPanelBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPanel; +} +interface ASPxClientCallbackPanelStatic extends ASPxClientPanelStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCallbackPanel; +} +interface ASPxClientCloudControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCloudControl; +} +interface ASPxClientDataViewStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDataView; +} +interface ASPxClientDockManagerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDockManager; +} +interface ASPxClientPopupControlBaseStatic extends ASPxClientControlStatic { +} +interface ASPxClientDockPanelStatic extends ASPxClientPopupControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDockPanel; +} +interface ASPxClientDockZoneStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDockZone; +} +interface ASPxClientFileManagerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientFileManager; +} +interface ASPxClientFileManagerCommandConstsStatic { + /** + * The name of a command that is executed when an end-user renames an item. + */ + Rename: string; + /** + * The name of a command that is executed when an end-user moves an item. + */ + Move: string; + /** + * The name of a command that is executed when an end-user deletes an item. + */ + Delete: string; + /** + * The name of a command that is executed when an end-user creates a folder. + */ + Create: string; + /** + * The name of a command that is executed when an end-user uploads a file. + */ + Upload: string; + /** + * The name of a command that is executed when an end-user downloads an item. + */ + Download: string; + /** + * The name of a command that is executed when an end-user copies an item. + */ + Copy: string; + /** + * The name of a command that is executed when an end-user opens an item. + */ + Open: string; +} +interface ASPxClientFileManagerErrorConstsStatic { + /** + * The specified file is not found. Return Value: 0 + */ + FileNotFound: number; + /** + * The specified folder is not found. Return Value: 1 + */ + FolderNotFound: number; + /** + * Access is denied. Return Value: 2 + */ + AccessDenied: number; + /** + * Unspecified IO error occurs. Return Value: 3 + */ + UnspecifiedIO: number; + /** + * Unspecified error occurs. Return Value: 4 + */ + Unspecified: number; + /** + * The file/folder name is empty. Return Value: 5 + */ + EmptyName: number; + /** + * The operation was canceled. Return Value: 6 + */ + CanceledOperation: number; + /** + * The specified name contains invalid characters. Return Value: 7 + */ + InvalidSymbols: number; + /** + * The specified file extension is not allowed. Return Value: 8 + */ + WrongExtension: number; + /** + * The file/folder is being used by another process. Return Value: 9 + */ + UsedByAnotherProcess: number; + /** + * The specified file/folder already exists. Return Value: 10 + */ + AlreadyExists: number; +} +interface ASPxClientFormLayoutStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientFormLayout; +} +interface ASPxClientHiddenFieldStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientHiddenField; +} +interface ASPxClientHintStatic extends ASPxClientControlStatic { + /** + * Forces the hint to reselect target UI elements according to the specified CSS selector. + */ + Update(): void; + /** + * Forces the hint to recalculate its position. + */ + UpdatePosition(): void; + /** + * Forces the hint to recalculate its position. + * @param hintElementOrTargetElement An object that is the hint element or the target element. + */ + UpdatePosition(hintElementOrTargetElement: Object): void; + /** + * Registers a hint's functionality with the specified settings. + * @param targetSelector A string value that is the CSS selector. Specifies to which UI elements the hint is displayed. + * @param options An ASPxClientHintOptions object that is the hint's options. + */ + Register(targetSelector: string, options: ASPxClientHintOptions): ASPxClientHint; + /** + * Registers a hint's functionality with the specified settings. + * @param targetSelector A string value that is the CSS selector. Specifies to which UI elements the hint is displayed. + * @param contentAttribute A string value that is the attribute name. Specifies from which target element's attribute a hint obtains its content. + */ + Register(targetSelector: string, contentAttribute: string): ASPxClientHint; + /** + * Registers a hint's functionality with the specified settings. + * @param targetSelector A string value that is the CSS selector. Specifies for which UI elements the hint is displayed. + * @param onShowing An ASPxClientHintShowingEventHandler object that is a handler for the displayed event. + */ + Register(targetSelector: string, onShowing: ASPxClientHintShowingEventHandler): ASPxClientHint; + /** + * Invokes a hint. + * @param targetSelector A string value that is the CSS selector. + * @param options An ASPxClientHintOptions object that is the hint's options. + */ + Show(targetSelector: string, options: ASPxClientHintOptions): void; + /** + * Invokes a hint. + * @param targetSelector A string value that is the CSS selector used to specify for which UI elements on a web page a hint is displayed. + * @param content A string value that is the hint's content. + */ + Show(targetSelector: string, content: string): void; + /** + * Invokes a hint. + * @param targetElement An object that is the target element. + * @param options An ASPxClientHintOptions object that is the hint's options. + */ + Show(targetElement: Object, options: ASPxClientHintOptions): void; + /** + * Invokes a hint. + * @param targetElement A HTML DOM element near to which the hint is displayed in response to user interaction. + * @param content A string value that is the hint's content. + */ + Show(targetElement: Object, content: string): void; + /** + * Invokes a hint. + * @param options An ASPxClientHintOptions object that is the hint's options. + */ + Show(options: ASPxClientHintOptions): void; + /** + * Hides a hint window. + * @param targetSelector A string value that is the CSS selector. + */ + Hide(targetSelector: string): void; + /** + * Hides a hint window. + * @param targetElementOrHintElement An object that is the target element or hint element. + */ + Hide(targetElementOrHintElement: Object): void; + /** + * Hides all hints. + */ + HideAll(): void; +} +interface ASPxClientImageGalleryStatic extends ASPxClientDataViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientImageGallery; +} +interface ASPxClientImageSliderStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientImageSlider; +} +interface ASPxClientImageZoomNavigatorStatic extends ASPxClientImageSliderStatic { +} +interface ASPxClientImageZoomStatic extends ASPxClientControlStatic { +} +interface ASPxClientLoadingPanelStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientLoadingPanel; +} +interface ASPxClientMediaFileSelectorStatic extends ASPxClientControlStatic { +} +interface ASPxClientMenuBaseStatic extends ASPxClientControlStatic { + /** + * Returns a collection of client menu objects. + */ + GetMenuCollection(): ASPxClientMenuCollection; +} +interface ASPxClientMenuStatic extends ASPxClientMenuBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientMenu; +} +interface ASPxClientTouchUIStatic { + /** + * Extends the specified element's functionality with scrolling via touch behavior (one finger) and the ability to display vertical and horizontal scroll bars. + * @param id A string value specifying the element's ID. + */ + MakeScrollable(id: string): ScrollExtender; + /** + * Extends the specified element's functionality with scrolling via touch behavior (one finger) and the ability to display vertical and horizontal scroll bars. + * @param element An object that specifies the required DOM element. + */ + MakeScrollable(element: Object): ScrollExtender; + /** + * Extends the specified element's functionality with scrolling via touch behavior (one finger) and customized scrollbar-related options. + * @param id A string value specifying the name of a DOM element that should be extended with the touch scrolling functionality. + * @param options An ASPxClientTouchUIOptions object that provides options affecting the touch scrolling functionality. + */ + MakeScrollable(id: string, options: ASPxClientTouchUIOptions): ScrollExtender; + /** + * Extends the specified element's functionality with scrolling via touch behavior (one finger) and customized scrollbar-related options. + * @param element An object specifying the DOM element to extend with the touch scrolling functionality. + * @param options An ASPxClientTouchUIOptions object that provides options affecting the touch scrolling functionality. + */ + MakeScrollable(element: Object, options: ASPxClientTouchUIOptions): ScrollExtender; +} +interface ASPxClientNavBarStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientNavBar; +} +interface ASPxClientNewsControlStatic extends ASPxClientDataViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientNewsControl; +} +interface ASPxClientObjectContainerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientObjectContainer; +} +interface ASPxClientPagerStatic extends ASPxClientControlStatic { +} +interface ASPxClientPopupControlStatic extends ASPxClientPopupControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPopupControl; + /** + * Returns a collection of client popup control objects. + */ + GetPopupControlCollection(): ASPxClientPopupControlCollection; +} +interface ASPxClientPopupControlResizeStateStatic { + /** + * A window has been resized. Returns 0. + */ + Resized: number; + /** + * A window has been collapsed. Returns 1. + */ + Collapsed: number; + /** + * A window has been expanded. Returns 2. + */ + Expanded: number; + /** + * A window has been maximized. Returns 3. + */ + Maximized: number; + /** + * A window has been restored after maximizing. Returns 4. + */ + RestoredAfterMaximized: number; +} +interface ASPxClientPopupControlCloseReasonStatic { + /** + * The window has been closed by an API. + */ + API: string; + /** + * An end-user clicks the close header button. + */ + CloseButton: string; + /** + * An end-user clicks outside the window's region + */ + OuterMouseClick: string; + /** + * An end-user moves the mouse pointer out of the window region. + */ + MouseOut: string; + /** + * An end-user presses the ESC key. + */ + Escape: string; +} +interface ASPxClientPopupMenuStatic extends ASPxClientMenuBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPopupMenu; +} +interface ASPxClientRatingControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientRatingControl; +} +interface ASPxClientRibbonStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientRibbon; +} +interface ASPxClientRibbonStateStatic { + /** + * A ribbon is in the normal state. Returns 0 + */ + Normal: number; + /** + * A ribbon is minimized. Returns 1 + */ + Minimized: number; + /** + * A ribbon is temporarily shown. Returns 2 + */ + TemporaryShown: number; +} +interface ASPxClientRoundPanelStatic extends ASPxClientPanelBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientRoundPanel; +} +interface ASPxClientSplitterStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientSplitter; +} +interface ASPxClientTabControlBaseStatic extends ASPxClientControlStatic { +} +interface ASPxClientTabControlStatic extends ASPxClientTabControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTabControl; +} +interface ASPxClientPageControlStatic extends ASPxClientTabControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPageControl; +} +interface ASPxClientTimerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTimer; +} +interface ASPxClientTitleIndexStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTitleIndex; +} +interface ASPxClientTreeViewStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTreeView; +} +interface ASPxClientUploadControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientUploadControl; +} +interface ASPxClientUploadControlValidationErrorTypeConstsStatic { + /** + * The allowed maximum file size is exceeded. Return Value: 1 + */ + MaxFileSizeExceeded: number; + /** + * The file's extension is not allowed. Return Value: 2 + */ + NotAllowedFileExtension: number; + /** + * The allowed maximum count of the files is exceeded. Return Value: 3 + */ + MaxFileCountExceeded: number; + /** + * A file name contains invalid character.Return Value: 4 + */ + FileNameContainsInvalidCharacter: number; +} +interface ASPxClientUtilsStatic { + /** + * Gets the user-agent string, which identifies the client browser and provides certain system details of the client computer. + * Value: A string value representing the browser's user-agent string. + */ + agent: string; + /** + * Gets a value that specifies whether the client browser is Opera. + * Value: true if the client browser is Opera; otherwise, false. + */ + opera: boolean; + /** + * Gets a value that specifies whether the client browser is Opera version 9. + * Value: true if the client browser is Opera version 9; otherwise, false. + */ + opera9: boolean; + /** + * Gets a value that specifies whether the client browser is Safari. + * Value: true if the client browser is Safari; otherwise, false. + */ + safari: boolean; + /** + * Gets a value that specifies whether the client browser is Safari version 3. + * Value: true if the client browser is Safari version 3; otherwise, false. + */ + safari3: boolean; + /** + * Gets a value that specifies whether the client browser is Safari, running under a MacOS operating system. + * Value: true if the client browser is Safari, running under a MacOS operating system; otherwise, false. + */ + safariMacOS: boolean; + /** + * Gets a value that specifies whether the client browser is Google Chrome. + * Value: true if the client browser is Google Chrome; otherwise, false. + */ + chrome: boolean; + /** + * Gets a value that specifies whether the client browser is Internet Explorer. + * Value: true if the client browser is Intenet Explorer; otherwise, false. + */ + ie: boolean; + /** + * Gets a value that specifies whether the client browser is Internet Explorer version 7. + * Value: true if the client browser is Intenet Explorer version 7; otherwise, false. + */ + ie7: boolean; + /** + * Gets a value that specifies whether the client browser is Firefox. + * Value: true if the client browser is Firefox; otherwise, false. + */ + firefox: boolean; + /** + * Gets a value that specifies whether the client browser is Firefox version 3. + * Value: true if the client browser is Firefox version 3; otherwise, false. + */ + firefox3: boolean; + /** + * Gets a value that specifies whether the client browser is Mozilla. + * Value: true if the client browser is Mozilla; otherwise, false. + */ + mozilla: boolean; + /** + * Gets a value that specifies whether the client browser is Netscape. + * Value: true if the client browser is Netscape; otherwise, false. + */ + netscape: boolean; + /** + * Gets a value that specifies a client browser's full version. + * Value: A double precision floating-point value that specifies a client browser's version. + */ + browserVersion: number; + /** + * Gets a value that specifies a client browser's major version. + * Value: An integer value that specifies a client browser's major version. + */ + browserMajorVersion: number; + /** + * Gets a value that specifies whether the application is run under a MacOS platform. + * Value: true if the application is run under the MacOS platform; otherwise, false. + */ + macOSPlatform: boolean; + /** + * Gets a value that specifies whether the application is run under the Windows platform. + * Value: true if the application is run under the Windows platform; otherwise, false. + */ + windowsPlatform: boolean; + /** + * Gets a value that specifies whether a client browser is based on WebKit. + * Value: true if the client browser is based on WebKit; otherwise, false. + */ + webKitFamily: boolean; + /** + * Gets a value that specifies whether a client browser is based on Netscape. + * Value: true if client browser is based on Netscape; otherwise, false. + */ + netscapeFamily: boolean; + /** + * Gets a value that specifies whether the client browser supports touch. + * Value: true if the client browser supports touch; otherwise, false. + */ + touchUI: boolean; + /** + * Gets a value that specifies whether the client browser supports the WebKit touch user interface. + * Value: true if the client browser supports the WebKit touch user interface; otherwise, false. + */ + webKitTouchUI: boolean; + /** + * Gets a value that specifies whether the client browser supports the Microsoft touch user interface. + * Value: true if the client browser supports the Microsoft touch user interface; otherwise, false. + */ + msTouchUI: boolean; + /** + * Gets a value that specifies whether the application is run under an iOS platform. + * Value: true if the application is run under the iOS platform; otherwise, false. + */ + iOSPlatform: boolean; + /** + * Gets a value that specifies whether the application is run under the Android platform. + * Value: true if the application is run under the Android platform; otherwise, false. + */ + androidPlatform: boolean; + /** + * Inserts the specified item into the specified array object. + * @param array An object that specifies the array to manipulate. + * @param element An object that specifies the array item to insert. + */ + ArrayInsert(array: Object[], element: Object): void; + /** + * Removes the specified item from the specified array object. + * @param array An object that specifies the array to manipulate. + * @param element An object that specifies the array item to remove. + */ + ArrayRemove(array: Object[], element: Object): void; + /** + * Removes an item at the specified index location from the specified array object. + * @param array An object that specifies the array to manipulate. + * @param index The zero-based index location of the array item to remove. + */ + ArrayRemoveAt(array: Object[], index: number): void; + /** + * Removes all items from the specified array object. + * @param array An object that specifies the array to manipulate. + */ + ArrayClear(array: Object[]): void; + /** + * Searches for the specified array item and returns the zero-based index of its first occurrence within the specified array object. + * @param array An object that specifies the array to manipulate. + * @param element An object that specifies the array item to locate. + */ + ArrayIndexOf(array: Object[], element: Object): number; + /** + * Binds the specified function to a specific element's event, so that the function gets called whenever the event fires on the element. + * @param element An object specifying the required element. + * @param eventName A string value that specifies the required event name without the "on" prefix. + * @param method An object that specifies the event's handling function. + */ + AttachEventToElement(element: Object, eventName: string, method: Object): void; + /** + * Unbinds the specified function from a specific element's event, so that the function stops receiving notifications when the event fires. + * @param element An object specifying the required element. + * @param eventName A string value that specifies the required event name. + * @param method An object that specifies the event's handling function. + */ + DetachEventFromElement(element: Object, eventName: string, method: Object): void; + /** + * Returns the object that fired the event. + * @param htmlEvent An object that represents the current event. + */ + GetEventSource(htmlEvent: Object): Object; + /** + * Gets the x-coordinate of the event-related mouse pointer position relative to an end-user's screen. + * @param htmlEvent An object specifying the required HTML event. + */ + GetEventX(htmlEvent: Object): number; + /** + * Gets the y-coordinate of the event-related mouse pointer position relative to an end-user's screen. + * @param htmlEvent An object specifying the required HTML event. + */ + GetEventY(htmlEvent: Object): number; + /** + * Gets the keyboard code for the specified event. + * @param htmlEvent An object specifying the required HTML event. + */ + GetKeyCode(htmlEvent: Object): number; + /** + * Cancels the default action of the specified event. + * @param htmlEvent An object that specifies the required HTML event. + */ + PreventEvent(htmlEvent: Object): boolean; + /** + * Cancels both the specified event's default action and the event's bubbling upon the hierarchy of event handlers. + * @param htmlEvent An object that specifies the required HTML event. + */ + PreventEventAndBubble(htmlEvent: Object): boolean; + /** + * Removes mouse capture from the specified event's source object. + * @param htmlEvent An object that specifies the required HTML event. + */ + PreventDragStart(htmlEvent: Object): boolean; + /** + * Clears any text selection made within the window's client region. + */ + ClearSelection(): void; + /** + * Gets a value that indicates whether the specified object exists on the client side. + * @param obj The object to test. + */ + IsExists(obj: Object): boolean; + /** + * Gets a value that indicates whether the specified object is a function. + * @param obj The object to test. + */ + IsFunction(obj: Object): boolean; + /** + * Gets the x-coordinate of the specified element's top left corner relative to the client area of the window, excluding scroll bars. + * @param element An object identifying the HTML element whose position should be obtained. + */ + GetAbsoluteX(element: Object): number; + /** + * Gets the y-coordinate of the specified element's top left corner relative to the client area of the window, excluding scroll bars. + * @param element An object identifying the HTML element whose position should be obtained. + */ + GetAbsoluteY(element: Object): number; + /** + * Sets the x-coordinate of the specified element's top left corner relative to the client area of the window, excluding scroll bars. + * @param element An object identifying the HTML element whose position should be defined. + * @param x An integer value specifying the required element's x-coordinate, in pixels. + */ + SetAbsoluteX(element: Object, x: number): void; + /** + * Sets the y-coordinate of the specified element's top left corner relative to the client area of the window, excluding scroll bars. + * @param element An object identifying the HTML element whose position should be defined. + * @param y An integer value specifying the required element's y-coordinate, in pixels. + */ + SetAbsoluteY(element: Object, y: number): void; + /** + * Returns the distance between the top edge of the document and the topmost portion of the content currently visible in the window. + */ + GetDocumentScrollTop(): number; + /** + * Returns the distance between the left edge of the document and the leftmost portion of the content currently visible in the window. + */ + GetDocumentScrollLeft(): number; + /** + * Gets the width of the window's client region. + */ + GetDocumentClientWidth(): number; + /** + * Gets the height of the window's client region. + */ + GetDocumentClientHeight(): number; + /** + * Gets a value indicating whether the object passed via the parentElement parameter is a parent of the object passed via the element parameter. + * @param parentElement An object specifying the parent HTML element. + * @param element An object specifying the child HTML element. + */ + GetIsParent(parentElement: Object, element: Object): boolean; + /** + * Returns a reference to the specified HTML element's first parent object which has an ID that matches the specified value. + * @param element An object specifying the child HTML element whose parent elements are searched. + * @param id A string specifying the required parent's ID. + */ + GetParentById(element: Object, id: string): Object; + /** + * Returns a reference to the specified HTML element's first parent object whose element name matches the specified value. + * @param element An object specifying the child HTML element whose parent elements are searched. + * @param tagName A string value specifying the element name (tag name) of the desired HTML element. + */ + GetParentByTagName(element: Object, tagName: string): Object; + /** + * Returns a reference to the specified HTML element's first parent object whose class name matches the specified value. + * @param element An object specifying the child HTML element whose parent elements are searched. + * @param className A string value specifying the class name of the desired HTML element. + */ + GetParentByClassName(element: Object, className: string): Object; + /** + * Returns a reference to the first element that has the specified ID in the parent HTML element specified. + * @param element An object identifying the parent HTML element to search. + * @param id A string specifying the ID attribute value of the desired child element. + */ + GetChildById(element: Object, id: string): Object; + /** + * Returns a reference to the particular element that has the specified element name and is contained within the specified parent HTML element. + * @param element An object specifying the parent HTML element to search. + * @param tagName A string value specifying the element name (tag name) of the desired HTML element. + * @param index An integer value specifying the zero-based index of the desired element amongst all the matching elements found. + */ + GetChildByTagName(element: Object, tagName: string, index: number): Object; + /** + * Creates or updates the HTTP cookie for the response. + * @param name A string value that represents the name of a cookie. + * @param value A string representing the cookie value. + */ + SetCookie(name: string, value: string): void; + /** + * Creates or updates the HTTP cookie for the response. + * @param name A string value that represents the name of a cookie. + * @param value A string representing the cookie value. + * @param expirationDate A date-time object that represents the expiration date and time for the cookie. + */ + SetCookie(name: string, value: string, expirationDate: Date): void; + /** + * Retrieves a cookie with the specified name. + * @param name A string value that represents the name of a cookie. + */ + GetCookie(name: string): string; + /** + * Deletes a cookie with the specified name. + * @param name A string value that represents the name of a cookie. + */ + DeleteCookie(name: string): void; + /** + * Returns a specifically generated code that uniquely identifies the combination of keys specified via the parameters. + * @param keyCode An integer value that specifies the code of the key. + * @param isCtrlKey true if the CTRL key should be included into the key combination; otherwise, false. + * @param isShiftKey true if the SHIFT key should be included into the key combination; otherwise, false. + * @param isAltKey true if the ALT key should be included into the key combination; otherwise, false. + */ + GetShortcutCode(keyCode: number, isCtrlKey: boolean, isShiftKey: boolean, isAltKey: boolean): number; + /** + * Returns a specifically generated code that uniquely identifies the pressed key combination, which is specified by the related HTML event. + * @param htmlEvent A DHTML event object that relates to a key combination being pressed. + */ + GetShortcutCodeByEvent(htmlEvent: Object): number; + /** + * Returns a specifically generated code that uniquely identifies the combination of keys specified via the parameter. + * @param shortcutString A string value that specifies the key combination. + */ + StringToShortcutCode(shortcutString: string): number; + /** + * Trims all leading and trailing whitespaces from the string. + * @param str A string value representing the string for trimming. + */ + Trim(str: string): string; + /** + * Trims all leading whitespaces from the string. + * @param str A string value representing the string for trimming. + */ + TrimStart(str: string): string; + /** + * Trims all trailing whitespaces from the string. + * @param str A string value representing the string for trimming. + */ + TrimEnd(str: string): string; + /** + * Specifies the text that Assistive Technologies (screen readers or braille display, for example) will provide to a user. + * @param message A String value that specifies a text. + */ + SendMessageToAssistiveTechnology(message: string): void; +} +interface ASPxClientChartDesignerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientChartDesigner; +} +interface ASPxClientWebChartControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientWebChartControl; +} +interface ASPxClientDocumentViewerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDocumentViewer; +} +interface ASPxClientQueryBuilderStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientQueryBuilder; +} +interface ASPxClientReportDesignerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientReportDesigner; +} +interface ASPxClientReportDocumentMapStatic extends ASPxClientControlStatic { +} +interface ASPxClientReportParametersPanelStatic extends ASPxClientControlStatic { +} +interface ASPxClientReportToolbarStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientReportToolbar; +} +interface ASPxClientReportViewerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientReportViewer; +} +interface ASPxClientWebDocumentViewerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientWebDocumentViewer; +} + +declare var MVCxClientDashboardViewer: MVCxClientDashboardViewerStatic; +declare var DashboardDataAxisNames: DashboardDataAxisNamesStatic; +declare var DashboardSpecialValues: DashboardSpecialValuesStatic; +declare var DashboardExportPageLayout: DashboardExportPageLayoutStatic; +declare var DashboardExportPaperKind: DashboardExportPaperKindStatic; +declare var DashboardExportScaleMode: DashboardExportScaleModeStatic; +declare var DashboardExportFilterState: DashboardExportFilterStateStatic; +declare var DashboardStateExportPosition: DashboardStateExportPositionStatic; +declare var DashboardStateExcelExportPosition: DashboardStateExcelExportPositionStatic; +declare var DashboardExportImageFormat: DashboardExportImageFormatStatic; +declare var ExcelExportFilterState: ExcelExportFilterStateStatic; +declare var DashboardExportExcelFormat: DashboardExportExcelFormatStatic; +declare var ChartExportSizeMode: ChartExportSizeModeStatic; +declare var MapExportSizeMode: MapExportSizeModeStatic; +declare var TreemapExportSizeMode: TreemapExportSizeModeStatic; +declare var RangeFilterExportSizeMode: RangeFilterExportSizeModeStatic; +declare var DashboardSelectionMode: DashboardSelectionModeStatic; +declare var ASPxClientDashboard: ASPxClientDashboardStatic; +declare var ASPxClientDashboardViewer: ASPxClientDashboardViewerStatic; +declare var ASPxClientEditBase: ASPxClientEditBaseStatic; +declare var ASPxClientEdit: ASPxClientEditStatic; +declare var ASPxClientBinaryImage: ASPxClientBinaryImageStatic; +declare var ASPxClientButton: ASPxClientButtonStatic; +declare var ASPxClientCalendar: ASPxClientCalendarStatic; +declare var ASPxClientCaptcha: ASPxClientCaptchaStatic; +declare var ASPxClientCheckBox: ASPxClientCheckBoxStatic; +declare var ASPxClientRadioButton: ASPxClientRadioButtonStatic; +declare var ASPxClientTextEdit: ASPxClientTextEditStatic; +declare var ASPxClientTextBoxBase: ASPxClientTextBoxBaseStatic; +declare var ASPxClientButtonEditBase: ASPxClientButtonEditBaseStatic; +declare var ASPxClientDropDownEditBase: ASPxClientDropDownEditBaseStatic; +declare var ASPxClientColorEdit: ASPxClientColorEditStatic; +declare var ASPxClientComboBox: ASPxClientComboBoxStatic; +declare var ASPxClientDateEdit: ASPxClientDateEditStatic; +declare var ASPxClientDropDownEdit: ASPxClientDropDownEditStatic; +declare var ASPxClientFilterControl: ASPxClientFilterControlStatic; +declare var ASPxClientListEdit: ASPxClientListEditStatic; +declare var ASPxClientListBox: ASPxClientListBoxStatic; +declare var ASPxClientCheckListBase: ASPxClientCheckListBaseStatic; +declare var ASPxClientRadioButtonList: ASPxClientRadioButtonListStatic; +declare var ASPxClientCheckBoxList: ASPxClientCheckBoxListStatic; +declare var ASPxClientProgressBar: ASPxClientProgressBarStatic; +declare var ASPxClientSpinEditBase: ASPxClientSpinEditBaseStatic; +declare var ASPxClientSpinEdit: ASPxClientSpinEditStatic; +declare var ASPxClientTimeEdit: ASPxClientTimeEditStatic; +declare var ASPxClientStaticEdit: ASPxClientStaticEditStatic; +declare var ASPxClientHyperLink: ASPxClientHyperLinkStatic; +declare var ASPxClientImageBase: ASPxClientImageBaseStatic; +declare var ASPxClientImage: ASPxClientImageStatic; +declare var ASPxClientLabel: ASPxClientLabelStatic; +declare var ASPxClientTextBox: ASPxClientTextBoxStatic; +declare var ASPxClientMemo: ASPxClientMemoStatic; +declare var ASPxClientButtonEdit: ASPxClientButtonEditStatic; +declare var ASPxClientTokenBox: ASPxClientTokenBoxStatic; +declare var ASPxClientTrackBar: ASPxClientTrackBarStatic; +declare var ASPxClientValidationSummary: ASPxClientValidationSummaryStatic; +declare var ASPxClientGaugeControl: ASPxClientGaugeControlStatic; +declare var ASPxClientGridBase: ASPxClientGridBaseStatic; +declare var ASPxClientGridViewCallbackCommand: ASPxClientGridViewCallbackCommandStatic; +declare var ASPxClientGridLookup: ASPxClientGridLookupStatic; +declare var ASPxClientCardView: ASPxClientCardViewStatic; +declare var ASPxClientGridView: ASPxClientGridViewStatic; +declare var ASPxClientVerticalGrid: ASPxClientVerticalGridStatic; +declare var ASPxClientVerticalGridCallbackCommand: ASPxClientVerticalGridCallbackCommandStatic; +declare var ASPxClientCommandConsts: ASPxClientCommandConstsStatic; +declare var ASPxClientHtmlEditor: ASPxClientHtmlEditorStatic; +declare var ASPxClientHtmlEditorMediaPreloadMode: ASPxClientHtmlEditorMediaPreloadModeStatic; +declare var ASPxClientPivotGrid: ASPxClientPivotGridStatic; +declare var ASPxClientPivotCustomization: ASPxClientPivotCustomizationStatic; +declare var ASPxClientRichEdit: ASPxClientRichEditStatic; +declare var ASPxSchedulerDateTimeHelper: ASPxSchedulerDateTimeHelperStatic; +declare var ASPxClientWeekDaysCheckEdit: ASPxClientWeekDaysCheckEditStatic; +declare var ASPxClientRecurrenceRangeControl: ASPxClientRecurrenceRangeControlStatic; +declare var ASPxClientRecurrenceControlBase: ASPxClientRecurrenceControlBaseStatic; +declare var ASPxClientDailyRecurrenceControl: ASPxClientDailyRecurrenceControlStatic; +declare var ASPxClientWeeklyRecurrenceControl: ASPxClientWeeklyRecurrenceControlStatic; +declare var ASPxClientMonthlyRecurrenceControl: ASPxClientMonthlyRecurrenceControlStatic; +declare var ASPxClientYearlyRecurrenceControl: ASPxClientYearlyRecurrenceControlStatic; +declare var ASPxClientRecurrenceTypeEdit: ASPxClientRecurrenceTypeEditStatic; +declare var ASPxClientTimeInterval: ASPxClientTimeIntervalStatic; +declare var ASPxClientScheduler: ASPxClientSchedulerStatic; +declare var ASPxClientSpellChecker: ASPxClientSpellCheckerStatic; +declare var ASPxClientSpellCheckerStopCheckingReason: ASPxClientSpellCheckerStopCheckingReasonStatic; +declare var ASPxClientSpreadsheet: ASPxClientSpreadsheetStatic; +declare var ASPxClientTreeList: ASPxClientTreeListStatic; +declare var BootstrapClientAccordion: BootstrapClientAccordionStatic; +declare var BootstrapClientBinaryImage: BootstrapClientBinaryImageStatic; +declare var BootstrapClientButton: BootstrapClientButtonStatic; +declare var BootstrapClientCalendar: BootstrapClientCalendarStatic; +declare var BootstrapClientCallbackPanel: BootstrapClientCallbackPanelStatic; +declare var BootstrapClientChartBase: BootstrapClientChartBaseStatic; +declare var BootstrapClientChart: BootstrapClientChartStatic; +declare var BootstrapClientPolarChart: BootstrapClientPolarChartStatic; +declare var BootstrapClientPieChart: BootstrapClientPieChartStatic; +declare var BootstrapClientCheckBox: BootstrapClientCheckBoxStatic; +declare var BootstrapClientRadioButton: BootstrapClientRadioButtonStatic; +declare var BootstrapClientComboBox: BootstrapClientComboBoxStatic; +declare var BootstrapClientDateEdit: BootstrapClientDateEditStatic; +declare var BootstrapClientDropDownEdit: BootstrapClientDropDownEditStatic; +declare var BootstrapClientFormLayout: BootstrapClientFormLayoutStatic; +declare var BootstrapClientHyperLink: BootstrapClientHyperLinkStatic; +declare var BootstrapClientImage: BootstrapClientImageStatic; +declare var BootstrapClientListBox: BootstrapClientListBoxStatic; +declare var BootstrapClientCheckBoxList: BootstrapClientCheckBoxListStatic; +declare var BootstrapClientRadioButtonList: BootstrapClientRadioButtonListStatic; +declare var BootstrapClientMenu: BootstrapClientMenuStatic; +declare var BootstrapClientPager: BootstrapClientPagerStatic; +declare var BootstrapClientPopupControl: BootstrapClientPopupControlStatic; +declare var BootstrapClientPopupMenu: BootstrapClientPopupMenuStatic; +declare var BootstrapClientProgressBar: BootstrapClientProgressBarStatic; +declare var BootstrapClientSpinEdit: BootstrapClientSpinEditStatic; +declare var BootstrapClientTabControl: BootstrapClientTabControlStatic; +declare var BootstrapClientPageControl: BootstrapClientPageControlStatic; +declare var BootstrapClientTextBox: BootstrapClientTextBoxStatic; +declare var BootstrapClientMemo: BootstrapClientMemoStatic; +declare var BootstrapClientButtonEdit: BootstrapClientButtonEditStatic; +declare var BootstrapClientTreeView: BootstrapClientTreeViewStatic; +declare var BootstrapUIWidgetBase: BootstrapUIWidgetBaseStatic; +declare var BootstrapClientUploadControl: BootstrapClientUploadControlStatic; +declare var BootstrapClientGridView: BootstrapClientGridViewStatic; +declare var MVCxClientCalendar: MVCxClientCalendarStatic; +declare var MVCxClientCallbackPanel: MVCxClientCallbackPanelStatic; +declare var MVCxClientCardView: MVCxClientCardViewStatic; +declare var MVCxClientChart: MVCxClientChartStatic; +declare var MVCxClientComboBox: MVCxClientComboBoxStatic; +declare var MVCxClientDataView: MVCxClientDataViewStatic; +declare var MVCxClientDateEdit: MVCxClientDateEditStatic; +declare var MVCxClientDockManager: MVCxClientDockManagerStatic; +declare var MVCxClientDockPanel: MVCxClientDockPanelStatic; +declare var MVCxClientFileManager: MVCxClientFileManagerStatic; +declare var MVCxClientGridView: MVCxClientGridViewStatic; +declare var MVCxClientHtmlEditor: MVCxClientHtmlEditorStatic; +declare var MVCxClientImageGallery: MVCxClientImageGalleryStatic; +declare var MVCxClientListBox: MVCxClientListBoxStatic; +declare var MVCxClientNavBar: MVCxClientNavBarStatic; +declare var MVCxClientPivotGrid: MVCxClientPivotGridStatic; +declare var MVCxClientPopupControl: MVCxClientPopupControlStatic; +declare var MVCxClientDocumentViewer: MVCxClientDocumentViewerStatic; +declare var MVCxClientReportViewer: MVCxClientReportViewerStatic; +declare var MVCxClientReportDesigner: MVCxClientReportDesignerStatic; +declare var MVCxClientRichEdit: MVCxClientRichEditStatic; +declare var MVCxClientRoundPanel: MVCxClientRoundPanelStatic; +declare var MVCxClientScheduler: MVCxClientSchedulerStatic; +declare var MVCxSchedulerToolTipType: MVCxSchedulerToolTipTypeStatic; +declare var MVCxClientSpreadsheet: MVCxClientSpreadsheetStatic; +declare var MVCxClientPageControl: MVCxClientPageControlStatic; +declare var MVCxClientTokenBox: MVCxClientTokenBoxStatic; +declare var MVCxClientTreeList: MVCxClientTreeListStatic; +declare var MVCxClientTreeView: MVCxClientTreeViewStatic; +declare var MVCxClientUploadControl: MVCxClientUploadControlStatic; +declare var MVCxClientUtils: MVCxClientUtilsStatic; +declare var MVCxClientGlobalEvents: MVCxClientGlobalEventsStatic; +declare var MVCxClientVerticalGrid: MVCxClientVerticalGridStatic; +declare var MVCxClientWebDocumentViewer: MVCxClientWebDocumentViewerStatic; +declare var ASPxClientControlBase: ASPxClientControlBaseStatic; +declare var ASPxClientControl: ASPxClientControlStatic; +declare var ASPxClientCallback: ASPxClientCallbackStatic; +declare var ASPxClientPanelBase: ASPxClientPanelBaseStatic; +declare var ASPxClientPanel: ASPxClientPanelStatic; +declare var ASPxClientCallbackPanel: ASPxClientCallbackPanelStatic; +declare var ASPxClientCloudControl: ASPxClientCloudControlStatic; +declare var ASPxClientDataView: ASPxClientDataViewStatic; +declare var ASPxClientDockManager: ASPxClientDockManagerStatic; +declare var ASPxClientPopupControlBase: ASPxClientPopupControlBaseStatic; +declare var ASPxClientDockPanel: ASPxClientDockPanelStatic; +declare var ASPxClientDockZone: ASPxClientDockZoneStatic; +declare var ASPxClientFileManager: ASPxClientFileManagerStatic; +declare var ASPxClientFileManagerCommandConsts: ASPxClientFileManagerCommandConstsStatic; +declare var ASPxClientFileManagerErrorConsts: ASPxClientFileManagerErrorConstsStatic; +declare var ASPxClientFormLayout: ASPxClientFormLayoutStatic; +declare var ASPxClientHiddenField: ASPxClientHiddenFieldStatic; +declare var ASPxClientHint: ASPxClientHintStatic; +declare var ASPxClientImageGallery: ASPxClientImageGalleryStatic; +declare var ASPxClientImageSlider: ASPxClientImageSliderStatic; +declare var ASPxClientImageZoomNavigator: ASPxClientImageZoomNavigatorStatic; +declare var ASPxClientImageZoom: ASPxClientImageZoomStatic; +declare var ASPxClientLoadingPanel: ASPxClientLoadingPanelStatic; +declare var ASPxClientMediaFileSelector: ASPxClientMediaFileSelectorStatic; +declare var ASPxClientMenuBase: ASPxClientMenuBaseStatic; +declare var ASPxClientMenu: ASPxClientMenuStatic; +declare var ASPxClientTouchUI: ASPxClientTouchUIStatic; +declare var ASPxClientNavBar: ASPxClientNavBarStatic; +declare var ASPxClientNewsControl: ASPxClientNewsControlStatic; +declare var ASPxClientObjectContainer: ASPxClientObjectContainerStatic; +declare var ASPxClientPager: ASPxClientPagerStatic; +declare var ASPxClientPopupControl: ASPxClientPopupControlStatic; +declare var ASPxClientPopupControlResizeState: ASPxClientPopupControlResizeStateStatic; +declare var ASPxClientPopupControlCloseReason: ASPxClientPopupControlCloseReasonStatic; +declare var ASPxClientPopupMenu: ASPxClientPopupMenuStatic; +declare var ASPxClientRatingControl: ASPxClientRatingControlStatic; +declare var ASPxClientRibbon: ASPxClientRibbonStatic; +declare var ASPxClientRibbonState: ASPxClientRibbonStateStatic; +declare var ASPxClientRoundPanel: ASPxClientRoundPanelStatic; +declare var ASPxClientSplitter: ASPxClientSplitterStatic; +declare var ASPxClientTabControlBase: ASPxClientTabControlBaseStatic; +declare var ASPxClientTabControl: ASPxClientTabControlStatic; +declare var ASPxClientPageControl: ASPxClientPageControlStatic; +declare var ASPxClientTimer: ASPxClientTimerStatic; +declare var ASPxClientTitleIndex: ASPxClientTitleIndexStatic; +declare var ASPxClientTreeView: ASPxClientTreeViewStatic; +declare var ASPxClientUploadControl: ASPxClientUploadControlStatic; +declare var ASPxClientUploadControlValidationErrorTypeConsts: ASPxClientUploadControlValidationErrorTypeConstsStatic; +declare var ASPxClientUtils: ASPxClientUtilsStatic; +declare var ASPxClientChartDesigner: ASPxClientChartDesignerStatic; +declare var ASPxClientWebChartControl: ASPxClientWebChartControlStatic; +declare var ASPxClientDocumentViewer: ASPxClientDocumentViewerStatic; +declare var ASPxClientQueryBuilder: ASPxClientQueryBuilderStatic; +declare var ASPxClientReportDesigner: ASPxClientReportDesignerStatic; +declare var ASPxClientReportDocumentMap: ASPxClientReportDocumentMapStatic; +declare var ASPxClientReportParametersPanel: ASPxClientReportParametersPanelStatic; +declare var ASPxClientReportToolbar: ASPxClientReportToolbarStatic; +declare var ASPxClientReportViewer: ASPxClientReportViewerStatic; +declare var ASPxClientWebDocumentViewer: ASPxClientWebDocumentViewerStatic; + diff --git a/types/devexpress-web/v171/tsconfig.json b/types/devexpress-web/v171/tsconfig.json new file mode 100644 index 0000000000..af3cbffe0a --- /dev/null +++ b/types/devexpress-web/v171/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "devexpress-web": [ + "devexpress-web/v171" + ], + "devexpress-web/*": [ + "devexpress-web/v171/*" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "devexpress-web-tests.ts" + ] +} \ No newline at end of file diff --git a/types/devexpress-web/v171/tslint.json b/types/devexpress-web/v171/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/devexpress-web/v171/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-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/diff-tests.ts b/types/diff/diff-tests.ts index e787c44f48..0dea2a305e 100644 --- a/types/diff/diff-tests.ts +++ b/types/diff/diff-tests.ts @@ -3,11 +3,17 @@ const one = 'beep boop'; const other = 'beep boob blah'; let diff = jsdiff.diffChars(one, other); +printDiff(diff); -diff.forEach(part => { - const mark = part.added ? '+' : - part.removed ? '-' : ' '; - console.log(`${mark} ${part.value}`); +const diffArraysResult = jsdiff.diffArrays(['a', 'b', 'c'], ['a', 'c', 'd']); +diffArraysResult.forEach(result => { + if (result.added) { + console.log(`added ${result.value.length} line(s):`, ...result.value); + } else if (result.removed) { + console.log(`removed ${result.value.length} line(s):`, ...result.value); + } else { + console.log(`no changes`); + } }); // -------------------------- @@ -22,13 +28,13 @@ class LineDiffWithoutWhitespace extends jsdiff.Diff { } } -const obj = new LineDiffWithoutWhitespace(true); +const obj = new LineDiffWithoutWhitespace(); diff = obj.diff(one, other); printDiff(diff); function printDiff(diff: jsdiff.IDiffResult[]) { - function addLineHeader(decorator: string, str: string) { - return str.split("\n").map((line, index, array) => { + function addLineHeader(decorator: string, str: string | string[]) { + return (typeof str === 'string' ? str.split("\n") : str).map((line, index, array) => { if (index === array.length - 1 && line === "") { return line; } else { @@ -52,7 +58,8 @@ function verifyPatchMethods(oldStr: string, newStr: string, uniDiff: jsdiff.IUni const verifyPatch = jsdiff.parsePatch( jsdiff.createTwoFilesPatch("oldFile.ts", "newFile.ts", oldStr, newStr, "old", "new", { context: 1 })); - if (JSON.stringify(verifyPatch) !== JSON.stringify(uniDiff)) { + + if (JSON.stringify(verifyPatch[0], Object.keys(verifyPatch[0]).sort()) !== JSON.stringify(uniDiff, Object.keys(uniDiff).sort())) { console.error("Patch did not match uniDiff"); } } @@ -82,7 +89,11 @@ function verifyApplyMethods(oldStr: string, newStr: string, uniDiff: jsdiff.IUni }); } -const uniDiff = jsdiff.structuredPatch("oldFile.ts", "newFile.ts", one, other, +const uniDiffPatch = jsdiff.structuredPatch("oldFile.ts", "newFile.ts", one, other, "old", "new", { context: 1 }); -verifyPatchMethods(one, other, uniDiff); -verifyApplyMethods(one, other, uniDiff); +verifyPatchMethods(one, other, uniDiffPatch); + +const uniDiffStr = jsdiff.createPatch("file.ts", one, other, "old", "new", + { context: 1 }); +const uniDiffApply = jsdiff.parsePatch(uniDiffStr)[0]; +verifyApplyMethods(one, other, uniDiffApply); diff --git a/types/diff/index.d.ts b/types/diff/index.d.ts index 720a8d3270..33d337d1b7 100644 --- a/types/diff/index.d.ts +++ b/types/diff/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for diff 3.2 +// Type definitions for diff 3.5 // Project: https://github.com/kpdecker/jsdiff // Definitions by: vvakame +// szdc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -8,15 +9,19 @@ export = JsDiff; export as namespace JsDiff; declare namespace JsDiff { - interface ICaseOptions { + interface IOptions { ignoreCase: boolean; } - interface ILinesOptions { + interface ILinesOptions extends IOptions { ignoreWhitespace?: boolean; newlineIsToken?: boolean; } + interface IArrayOptions extends IOptions { + comparator?: (left: any, right: any) => number; + } + interface IDiffResult { value: string; count?: number; @@ -24,6 +29,13 @@ declare namespace JsDiff { removed?: boolean; } + interface IDiffArraysResult { + value: T[]; + count?: number; + added?: boolean; + removed?: boolean; + } + interface IBestPath { newPos: number; componenets: IDiffResult[]; @@ -42,38 +54,45 @@ declare namespace JsDiff { newFileName: string; oldHeader: string; newHeader: string; + index: string; hunks: IHunk[]; } class Diff { - ignoreWhitespace: boolean; + diff(oldString: string, newString: string, options?: IOptions): IDiffResult[]; - constructor(ignoreWhitespace?: boolean); - - diff(oldString: string, newString: string): IDiffResult[]; - - pushComponent(components: IDiffResult[], value: string, added: boolean, removed: boolean): void; + pushComponent(components: IDiffResult[], added: boolean, removed: boolean): void; extractCommon(basePath: IBestPath, newString: string, oldString: string, diagonalPath: number): number; equals(left: string, right: string): boolean; - join(left: string, right: string): string; + removeEmpty(array: any[]): any[]; + + castInput(value: any): any; + + join(chars: string[]): string; tokenize(value: string): any; // return types are string or string[] } - function diffChars(oldStr: string, newStr: string, options?: ICaseOptions): IDiffResult[]; + function diffChars(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; - function diffWords(oldStr: string, newStr: string, options?: ICaseOptions): IDiffResult[]; + function diffWords(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; - function diffWordsWithSpace(oldStr: string, newStr: string): IDiffResult[]; + function diffWordsWithSpace(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; - function diffJson(oldObj: object, newObj: object): IDiffResult[]; + function diffJson(oldObj: object, newObj: object, options?: IOptions): IDiffResult[]; function diffLines(oldStr: string, newStr: string, options?: ILinesOptions): IDiffResult[]; - function diffCss(oldStr: string, newStr: string): IDiffResult[]; + function diffCss(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; + + function diffTrimmedLines(oldStr: string, newStr: string, options?: ILinesOptions): IDiffResult[]; + + function diffSentences(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; + + function diffArrays(oldArr: T[], newArr: T[], options?: IArrayOptions): Array>; function createPatch(fileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): string; @@ -94,4 +113,8 @@ declare namespace JsDiff { function convertChangesToXML(changes: IDiffResult[]): string; function convertChangesToDMP(changes: IDiffResult[]): Array<{0: number; 1: string; }>; + + function merge(mine: string, theirs: string, base: string): IUniDiff; + + function canonicalize(obj: any, stack: any[], replacementStack: any[]): any; } diff --git a/types/dnssd/dnssd-tests.ts b/types/dnssd/dnssd-tests.ts new file mode 100644 index 0000000000..14b637d384 --- /dev/null +++ b/types/dnssd/dnssd-tests.ts @@ -0,0 +1,6 @@ +import * as dnssd from 'dnssd'; + +const serviceType = new dnssd.ServiceType(dnssd.tcp('_mqtt'), dnssd.udp('_mqtt')); + +const advertisement = new dnssd.Advertisement(serviceType, 1883, { name: 'broker' }); +const browser: dnssd.Browser = new dnssd.Browser(serviceType); diff --git a/types/dnssd/index.d.ts b/types/dnssd/index.d.ts new file mode 100644 index 0000000000..3f5617afcb --- /dev/null +++ b/types/dnssd/index.d.ts @@ -0,0 +1,58 @@ +// Type definitions for dnssd 0.3 +// Project: https://github.com/DeMille/dnssd.js#readme +// Definitions by: Angel Merino +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** Declaration file generated by dts-gen */ + +export class Advertisement { + constructor(type: any, port: any, ...args: any[]); + + start(): any; + + stop(forceImmediate: any, callback: any): void; + + updateTXT(txtObj: any): void; +} + +export class Browser { + constructor(type: any, ...args: any[]); + + list(): any; + + start(): any; + + stop(): any; +} + +export class ServiceType { + constructor(...args: any[]); + + toString(): any; + + static all(): any; + + static tcp(...args: any[]): any; + + static udp(...args: any[]): any; +} + +export const resolveA: any; + +export const resolveAAAA: any; + +export function all(): any; + +export function resolve(name: any, type: any, ...args: any[]): any; + +export function resolveSRV(name: any, opts: any): any; + +export function resolveService(name: any, ...args: any[]): any; + +export function resolveTXT(name: any, opts: any): any; + +export function tcp(...args: any[]): any; + +export function udp(...args: any[]): any; diff --git a/types/dnssd/tsconfig.json b/types/dnssd/tsconfig.json new file mode 100644 index 0000000000..88346a63fd --- /dev/null +++ b/types/dnssd/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", + "dnssd-tests.ts" + ] +} diff --git a/types/dnssd/tslint.json b/types/dnssd/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dnssd/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/document-promises/document-promises-tests.ts b/types/document-promises/document-promises-tests.ts new file mode 100644 index 0000000000..5e45dffd5f --- /dev/null +++ b/types/document-promises/document-promises-tests.ts @@ -0,0 +1,16 @@ +import { parsed, contentLoaded, loaded } from 'document-promises'; + +let promise: Promise; +promise = parsed; +promise = contentLoaded; +promise = loaded; + +parsed.then(() => { + // Document parsed +}); +contentLoaded.then(() => { + // Document is ready +}); +loaded.then(() => { + // Document loaded +}); diff --git a/types/document-promises/index.d.ts b/types/document-promises/index.d.ts new file mode 100644 index 0000000000..2202c0d7ab --- /dev/null +++ b/types/document-promises/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for document-promises 3.1 +// Project: https://github.com/jonathantneal/document-promises#readme +// Definitions by: Tiger Oakes +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * document.parsed is a promise that fulfills when the document is parsed + * and `readyState` is `interactive`, before deferred and async scripts have run. + */ +export const parsed: Promise; + +/** + * document.contentLoaded is a promise that fulfills when the document is + * parsed, blocking scripts have completed, and `DOMContentLoaded` fires. + */ +export const contentLoaded: Promise; + +/** + * document.loaded is a promise that fulfills when the document is parsed, + * blocking scripts have completed, images, scripts, links and sub-frames + * have finished loading, and `readyState` is `complete`. + */ +export const loaded: Promise; diff --git a/types/document-promises/tsconfig.json b/types/document-promises/tsconfig.json new file mode 100644 index 0000000000..6b1ddaaa6b --- /dev/null +++ b/types/document-promises/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", + "document-promises-tests.ts" + ] +} diff --git a/types/document-promises/tslint.json b/types/document-promises/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/document-promises/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/dotenv-webpack/dotenv-webpack-tests.ts b/types/dotenv-webpack/dotenv-webpack-tests.ts new file mode 100644 index 0000000000..6605550529 --- /dev/null +++ b/types/dotenv-webpack/dotenv-webpack-tests.ts @@ -0,0 +1,21 @@ +import * as webpack from 'webpack'; +import DotenvWebpackPlugin = require('dotenv-webpack'); + +new DotenvWebpackPlugin(); // $ExpectType DotenvWebpackPlugin + +const options: DotenvWebpackPlugin.Options = { + path: './some.other.env', + safe: true, + systemvars: true, + silent: true +}; + +const config: webpack.Configuration = { + plugins: [ + new DotenvWebpackPlugin(), + new DotenvWebpackPlugin({ + path: './some.other.env', + }), + new DotenvWebpackPlugin(options), + ] +}; diff --git a/types/dotenv-webpack/index.d.ts b/types/dotenv-webpack/index.d.ts new file mode 100644 index 0000000000..2d330ace45 --- /dev/null +++ b/types/dotenv-webpack/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for dotenv-webpack 1.5 +// Project: https://github.com/mrsteele/dotenv-webpack +// Definitions by: Karol Majewski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +import * as webpack from 'webpack'; + +declare class DotenvWebpackPlugin extends webpack.Plugin { + constructor(options?: DotenvWebpackPlugin.Options); +} + +declare namespace DotenvWebpackPlugin { + interface Options { + /** + * The path to your environment variables. Default: `'./.env'`. + */ + path?: string; + + /** + * If `false` ignore safe-mode, if `true` load `'./.env.example'`, if a `string` load that file as the sample. Default: `false`. + */ + safe?: boolean; + + /** + * Set to `true` if you would rather load all system variables as well (useful for CI purposes). Default: `false`. + */ + systemvars?: boolean; + + /** + * If `true`, all warnings will be surpressed. Default: `false`. + */ + silent?: boolean; + } +} + +export = DotenvWebpackPlugin; diff --git a/types/dotenv-webpack/tsconfig.json b/types/dotenv-webpack/tsconfig.json new file mode 100644 index 0000000000..f87dcd737b --- /dev/null +++ b/types/dotenv-webpack/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", + "dotenv-webpack-tests.ts" + ] +} diff --git a/types/dotenv-webpack/tslint.json b/types/dotenv-webpack/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dotenv-webpack/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/dotenv/dotenv-tests.ts b/types/dotenv/dotenv-tests.ts index df05475c17..613da3b056 100644 --- a/types/dotenv/dotenv-tests.ts +++ b/types/dotenv/dotenv-tests.ts @@ -11,6 +11,8 @@ dotenv.config({ encoding: 'utf8' }); +dotenv.load(); + const parsed = dotenv.parse("ENVIRONMENT=production\nDEBUG=no\n"); const debug: string = parsed['DEBUG']; diff --git a/types/dotenv/index.d.ts b/types/dotenv/index.d.ts index 831790138c..4dd67b15c0 100644 --- a/types/dotenv/index.d.ts +++ b/types/dotenv/index.d.ts @@ -20,6 +20,7 @@ export function parse(src: string | Buffer): {[name: string]: string}; * Example: 'KEY=value' becomes { parsed: { KEY: 'value' } } */ export function config(options?: DotenvOptions): DotenvResult; +export const load: typeof config; export interface DotenvOptions { /** diff --git a/types/draft-js/draft-js-tests.tsx b/types/draft-js/draft-js-tests.tsx index 63821eda98..857671d13d 100644 --- a/types/draft-js/draft-js-tests.tsx +++ b/types/draft-js/draft-js-tests.tsx @@ -22,7 +22,8 @@ import { DraftEntityMutability, DraftEntityType, convertFromHTML, - convertToRaw + convertToRaw, + CompositeDecorator, } from 'draft-js'; const SPLIT_HEADER_BLOCK = 'split-header-block'; @@ -38,6 +39,14 @@ export const KEYCODES: Record = { type SyntheticKeyboardEvent = React.KeyboardEvent<{}>; +const HANDLE_REGEX = /\@[\w]+/g; + +class HandleSpan extends React.Component { + render() { + return {this.props.children} + } +} + class RichEditorExample extends React.Component<{}, { editorState: EditorState }> { constructor() { super({}); @@ -51,8 +60,22 @@ class RichEditorExample extends React.Component<{}, { editorState: EditorState } blocksFromHTML.contentBlocks, blocksFromHTML.entityMap, ); - - this.state = { editorState: EditorState.createWithContent(state) }; + const decorator = new CompositeDecorator([{ + strategy: ( + block: ContentBlock, + callback: (start: number, end: number) => void, + contentState: ContentState + ) => { + const text = block.getText(); + let matchArr, start; + while ((matchArr = HANDLE_REGEX.exec(text)) !== null) { + start = matchArr.index; + callback(start, start + matchArr[0].length); + } + }, + component: HandleSpan, + }]); + this.state = { editorState: EditorState.createWithContent(state, decorator) }; } onChange: (editorState: EditorState) => void = (editorState: EditorState) => this.setState({ editorState }); diff --git a/types/draft-js/index.d.ts b/types/draft-js/index.d.ts index e545fa347d..e83de2b303 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.4 +// Type definitions for Draft.js v0.10.5 // Project: https://facebook.github.io/draft-js/ // Definitions by: Dmitry Rogozhny // Eelco Lempsink @@ -7,6 +7,7 @@ // Michael Wu // Willis Plummer // Santiago Vilar +// Ulf Schwekendiek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -398,7 +399,7 @@ declare namespace Draft { /** * Given a `ContentBlock`, return an immutable List of decorator keys. */ - getDecorations(block: ContentBlock): Immutable.List; + getDecorations(block: ContentBlock, contentState: ContentState): Immutable.List; /** * Given a decorator key, return the component to use when rendering @@ -456,7 +457,7 @@ declare namespace Draft { class CompositeDraftDecorator { constructor(decorators: Array); - getDecorations(block: ContentBlock): Immutable.List; + getDecorations(block: ContentBlock, contentState: ContentState): Immutable.List; getComponentForKey(key: string): Function; getPropsForKey(key: string): Object; } @@ -957,6 +958,7 @@ import ContentBlock = Draft.Model.ImmutableData.ContentBlock; import ContentState = Draft.Model.ImmutableData.ContentState; import SelectionState = Draft.Model.ImmutableData.SelectionState; import DraftInlineStyle = Draft.Model.ImmutableData.DraftInlineStyle; +import BlockMap = Draft.Model.ImmutableData.BlockMap; import AtomicBlockUtils = Draft.Model.Modifier.AtomicBlockUtils; import KeyBindingUtil = Draft.Component.Utils.KeyBindingUtil; @@ -1005,6 +1007,7 @@ export { ContentState, SelectionState, DraftInlineStyle, + BlockMap, AtomicBlockUtils, KeyBindingUtil, diff --git a/types/dwt/addon.pdf.d.ts b/types/dwt/addon.pdf.d.ts index 856291a647..87097471b0 100644 --- a/types/dwt/addon.pdf.d.ts +++ b/types/dwt/addon.pdf.d.ts @@ -1,4 +1,5 @@ /*! +* Dynamsoft WebTwain PDF Addon * Based on Dynamsoft WebTwain JavaScript Intellisense * Product: Dynamsoft Web Twain * Web Site: http://www.dynamsoft.com @@ -8,9 +9,9 @@ * Version: 13.4 */ -declare enum EnumDWT_ConverMode { +declare enum EnumDWT_ConvertMode { CM_DEFAULT = 0, - TWPT_CM_RENDERALLGRAY = 1 + CM_RENDERALL = 1 } /** @@ -42,10 +43,10 @@ interface PDF { /** * Set the image convert mode for PDF Rasterizer in Dynamic Web TWAIN. * @method Dynamsoft.WebTwain#SetConvertMode - * @param {EnumDWT_ConverMode} convertMode Specifies the image convert mode. + * @param {EnumDWT_ConvertMode} convertMode Specifies the image convert mode. * @return {boolean} */ - SetConvertMode(convertMode: EnumDWT_ConverMode): boolean; + SetConvertMode(convertMode: EnumDWT_ConvertMode): boolean; /** * Set the output resolution for the PDF Rasterizer in Dynamic Web TWAIN. diff --git a/types/dwt/index.d.ts b/types/dwt/index.d.ts index 69bd65bb9f..be362e680b 100644 --- a/types/dwt/index.d.ts +++ b/types/dwt/index.d.ts @@ -27,7 +27,19 @@ declare namespace Dynamsoft { Errors Events IntToColorStr LS OnGetImageByURL OnGetImageFromServer Path ProgressBar UI Uri addEventListener ajax all appendMessage appendRichMessage aryControlLoadImage attachAddon attachProperty base64 bio cancelFrome clearMessage closeAll closeProgress colorStrToInt config css currentStyle - debug detect detectButton dialog dialogShowStatus dlgProgress dlgRef drawBoxBorder drawImageWithHermite + debug*/ + + let detect: { + /*ignored + OnCreatWS OnDetectNext OnWebTwainPostExecute OnWebTwainPreExecute StartWSByIPTimeoutId StartWSTimeoutId + aryReconnectSTwains arySTwains arySTwainsByIP bFirst bNeedUpgradeEvent bNoControlEvent bOK bPromptJSOrServerOutdated + cUrlIndex dcpCallbackType dcpStatus detectType getVersionArray global_dlg hideMask isDWTVersionLatest onNoControl + onNotAllowedForChrome ports scriptLoaded showMask starting tryTimes*/ + ssl: boolean; + }; + + /*ignored + detectButton dialog dialogShowStatus dlgProgress dlgRef drawBoxBorder drawImageWithHermite each empty endsWith */ @@ -53,44 +65,47 @@ declare namespace Dynamsoft { */ } namespace WebTwainEnv { - let JSVersion: string; - let PluginVersion: string; - let ActiveXVersion: string; - let ServerVersionInfo: string; - - let Trial: boolean; - let AutoLoad: boolean; - let ProductKey: string; - let ResourcesPath: string; - - let IfUpdateService: boolean; - let IfUseActiveXForIE10Plus: boolean; - let UseDefaultInstallUI: string; let ActiveXInstallWithCAB: boolean; - let Debug: boolean; - + let ActiveXVersion: string; + let AutoLoad: boolean; + function CloseDialog(): void; let ContainerMap: {}; let Containers: Container[]; + function CreateDWTObject(newObjID: string, successFn: (dwtObject: WebTwain) => void, failurefn: (...args: any[]) => void): void; + function CreateDWTObject(newObjID: string, ip: number | string, port: number | string, portSSL: number | string, successFn: (dwtObject: WebTwain) => void, failurefn: (...args: any[]) => void): void; + let Debug: boolean; + function DeleteDWTObject(objID: string): void; let DynamicContainers: string[]; let DynamicDWTMap: {}; - - function CreateDWTObject(newObjID: string, successFn: (dwtObject: WebTwain) => void, failurefn: (...args: any[]) => void): void; function GetWebTwain(cid: string): WebTwain; - function DeleteDWTObject(objID: string): void; + let IfUpdateService: boolean; + let IfUseActiveXForIE10Plus: boolean; + let JSVersion: string; function Load(): void; - function Unload(): void; - function RegisterEvent(event: string, fn: (...args: any[]) => void): void; /*ignored - initQueue inited UseDefaultInstallUI - OnWebTwainInitMessage OnWebTwainNeedUpgrade OnWebTwainNeedUpgradeWebJavascript OnWebTwainNotFound OnWebTwainOldPluginNotAllowed OnWebTwainReady + OnWebTwainInitMessage OnWebTwainNeedUpgrade OnWebTwainNeedUpgradeWebJavascript OnWebTwainNotFound OnWebTwainOldPluginNotAllowed */ + function OnWebTwainPostExecute(): void; function OnWebTwainPreExecute(): void; + /*ignored + OnWebTwainReady + */ + + let PluginVersion: string; + let ProductKey: string; + function RegisterEvent(event: string, fn: (...args: any[]) => void): void; function RemoveAllAuthorizations(): void; + let ResourcesPath: string; + let ServerVersionInfo: string; function ShowDialog(_dialogWidth: number, _dialogHeight: number, _strDialogMessageWithHtmlFormat: string, _bChangeImage: boolean, bHideCloseButton: boolean): void; - function CloseDialog(): void; + let Trial: boolean; + function Unload(): void; + let UseDefaultInstallUI: string; + let initQueue: number[]; + let inited: boolean; } } @@ -2244,10 +2259,15 @@ interface WebTwain { */ Zoom: number; - /** ignored + /* ignored style _AutoCropMethod */ + + /* + *Methods + */ + /** * Displays the source's built-in interface to acquire image. * @method WebTwain#AcquireImage @@ -2916,7 +2936,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. * @return {boolean} */ - HTTPDownloadThroughPost(HTTPServer: string, HTTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPDownloadThroughPost(HTTPServer: string, HTTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads the images specified by the indices to the HTTP server. @@ -2929,7 +2949,7 @@ interface WebTwain { * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. * @return {boolean} */ - HTTPUpload(url: string, indices: number[], enumImageType: EnumDWT_ImageType, dataFormat: EnumDWT_UploadDataFormat, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUpload(url: string, indices: number[], enumImageType: EnumDWT_ImageType, dataFormat: EnumDWT_UploadDataFormat, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads all images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page TIFF. @@ -2941,7 +2961,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadAllThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadAllThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads all images in the buffer to the HTTP server through HTTP Post method as a Multi-Page PDF. @@ -2953,7 +2973,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadAllThroughPostAsPDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadAllThroughPostAsPDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * [Deprecated.] Uploads all images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page TIFF. @@ -2992,7 +3012,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadThroughPost(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadThroughPost(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads the selected images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page TIFF. @@ -3004,7 +3024,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads the selected images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page PDF. @@ -3016,7 +3036,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadThroughPostAsMultiPagePDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadThroughPostAsMultiPagePDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Directly upload a specific local file to the HTTP server through the HTTP POST method without loading it into Dynamic Web TWAIN. @@ -3029,7 +3049,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadThroughPostDirectly(HTTPServer: string, localFile: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadThroughPostDirectly(HTTPServer: string, localFile: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads the image of a specified index in the buffer to the HTTP server as a specified image format through the HTTP POST method. @@ -3043,7 +3063,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadThroughPostEx(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadThroughPostEx(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * [Deprecated.] Uploads the image of a specified index in the buffer to the HTTP server through the HTTP PUT method. @@ -3244,10 +3264,10 @@ interface WebTwain { * Binds a specified function to an event, so that the function gets called whenever the event fires. * @method WebTwain#RegisterEvent * @param {string} name the name of the event that the function is bound to. - * @param {object} evt specifies the function to call when event fires. + * @param {any} evt specifies the function to call when event fires. * @return {boolean} */ - RegisterEvent(name: string, evt: object): boolean; + RegisterEvent(name: string, evt: any): boolean; /** * Removes all images in buffer. @@ -3415,7 +3435,7 @@ interface WebTwain { /** * Saves the selected images in buffer to base64 string. * @method WebTwain#SaveSelectedImagesToBase64Binary - * @return {string|bool} + * @return {string|boolean} */ SaveSelectedImagesToBase64Binary(optionalAsyncSuccessFunc?: (result: string[]) => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): string | boolean; diff --git a/types/dynogels/dynogels-tests.ts b/types/dynogels/dynogels-tests.ts index ca16707256..a7634548e7 100644 --- a/types/dynogels/dynogels-tests.ts +++ b/types/dynogels/dynogels-tests.ts @@ -148,12 +148,14 @@ dynogels.dynamoDriver(dynamodb); // Saving Models To DynamoDB Account.create({ email: 'foo@example.com', name: 'Foo Bar', age: 21 }, (err, acc) => { - acc.get('email'); + const email = acc.get('email') as string; + console.log(`Created account ${email}`); }); const acc = new Account({ email: 'test@example.com', name: 'Test Example' }); acc.save((err) => { - acc.get('email'); + const email = acc.get('email') as string; + console.log(`Created account ${email}`); }); BlogPost.create({ diff --git a/types/dynogels/index.d.ts b/types/dynogels/index.d.ts index 4742af5a04..dd6aedf907 100644 --- a/types/dynogels/index.d.ts +++ b/types/dynogels/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for dynogels 8.0 +// Type definitions for dynogels 9.0 // Project: https://github.com/clarkie/dynogels#readme // Definitions by: Spartan Labs // Ramon de Klein +// Stephen Tuso // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -153,7 +154,8 @@ export interface ModelConfig { // Dynogels Item export interface Item { - get(key?: string): { [key: string]: any }; + get(): { [key: string]: any }; + get(key: string): any; set(params: {}): Item; save(callback?: DynogelsItemCallback): void; update(options: UpdateItemOptions, callback?: DynogelsItemCallback): void; diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index 03f6b12c24..e95fb94b2b 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -8,7 +8,7 @@ /*! * filename: ej.web.all.d.ts -* version : 16.1.0.24 +* version : 16.1.0.32 * Copyright Syncfusion Inc. 2001 - 2018. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing @@ -378,7 +378,7 @@ declare namespace ej { update(dm: ej.DataManager, keyField: string, value: any, tableName: string): any; } class ForeignKeyAdaptor extends ej.JsonAdaptor { - constructor(); + constructor(data: any, type: string); processQuery(ds: any, query: ej.Query): any; insert(dm: ej.DataManager, data: any, tableName: string): { url: string; data: any }; update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; data: any }; @@ -9567,8 +9567,8 @@ declare namespace ej { */ cssClass?: string; - /** Sets the separator when the multiSelectMode with delimiter option or checkbox is enabled.When you enter the delimiter value, the text after the delimiter is considered as a - * separateword or query. The delimiter string is a single character and must be a symbol. Mostly,the delimiter symbol is used as comma (,), semi-colon (;), or any other special + /** Sets the separator when the multiSelectMode with delimiter option or checkbox is enabled. When you enter the delimiter value, the text after the delimiter is considered as a + * separate word or query. The delimiter string is a single character and must be a symbol. Mostly, the delimiter symbol is used as comma (,), semi-colon (;), or any other special * character. * @Default {,} */ @@ -9628,12 +9628,12 @@ declare namespace ej { */ readOnly?: boolean; - /** The DropDownTree’s textbox is displayed with rounded corner style. + /** The DropDownTree's textbox is displayed with rounded corner style. * @Default {false} */ showRoundedCorner?: boolean; - /** Specifies the targetID for the DropDownTree’s items. + /** Specifies the targetID for the DropDownTree's items. * @Default {null} */ targetID?: string; @@ -9653,8 +9653,8 @@ declare namespace ej { */ validationRules?: any; - /** Specifies the value (text content) for the DropDownTree control. For the single selection mode, the selected item’s value will be returned in its data type, and for - * MultiSelectMode, returns the selected items’ values separated by delimiter in string type. + /** Specifies the value (text content) for the DropDownTree control. For the single selection mode, the selected item's value will be returned in its data type, and for + * MultiSelectMode, returns the selected items values separated by delimiter in string type. * @Default {null} */ value?: string; @@ -9678,7 +9678,7 @@ declare namespace ej { */ blur?(e: BlurEventArgs): void; - /** Fires the action when the DropDownTree control’s value is changed. + /** Fires the action when the DropDownTree control's value is changed. */ change?(e: ChangeEventArgs): void; @@ -9744,15 +9744,15 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ selectedText?: string; - /** Selected item’s text. + /** Selected item's text. */ text?: string; - /** Selected item’s value. + /** Selected item's value. */ value?: string; @@ -9779,11 +9779,11 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ text?: string; - /** Selected item’s value. + /** Selected item's value. */ value?: string; @@ -9810,11 +9810,11 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ text?: string; - /** Selected item’s value. + /** Selected item's value. */ value?: string; } @@ -9863,7 +9863,7 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ selectedText?: string; @@ -9905,11 +9905,11 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ text?: string; - /** Selected item’s value. + /** Selected item's value. */ value?: string; } @@ -9928,11 +9928,11 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ text?: string; - /** Selected item’s value. + /** Selected item's value. */ value?: string; @@ -9961,7 +9961,7 @@ declare namespace ej { } } enum Textmode { - //When TextMode property is set to none, only selected/checked node’s text is presented. + //When TextMode property is set to none, only selected/checked node's text is presented. None, //When FullPath option is selected, the full path of the selected node is shown in the control. FullPath, @@ -19622,6 +19622,11 @@ declare namespace ej { */ value?: string|Date; + /** Specifies the water mark text to be displayed in input text. + * @Default {select a time} + */ + watermarkText?: string; + /** Defines the width of the TimePicker textbox. */ width?: string|number; @@ -30758,6 +30763,11 @@ declare namespace ej { */ operationalMode?: ej.Pivot.OperationalMode|string; + /** To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. + * @Default {[]} + */ + axes?: any[]; + /** This is a horizontal axis that contains options to configure the axis and it is the primary x-axis for all series in the series array. To override x-axis for particular series, * create an axis object by providing a unique name by using the name property and add it to the axes array. Then, assign the name to the series’s xAxisName property to link both * the axis and the series. @@ -30818,10 +30828,6 @@ declare namespace ej { */ beforeServiceInvoke?(e: BeforeServiceInvokeEventArgs): void; - /** Triggers before the pivot engine starts to populate. - */ - beforePivotEnginePopulate?(e: BeforePivotEnginePopulateEventArgs): void; - /** Triggers when performing drill up/down operation in the pivot chart control. */ drillSuccess?(e: DrillSuccessEventArgs): void; @@ -30888,13 +30894,6 @@ declare namespace ej { element?: any; } - export interface BeforePivotEnginePopulateEventArgs { - - /** returns the current instance of PivotChart. - */ - chartObj?: any; - } - export interface DrillSuccessEventArgs { /** returns the current instance of PivotChart. @@ -33505,6 +33504,11 @@ declare namespace ej { */ allowInline?: boolean; + /** When set to false, disables the appointment delete option on the Scheduler. + * @Default {true} + */ + allowDelete?: boolean; + /** When set to true, Scheduler allows interaction through keyboard shortcut keys. * @Default {true} */ @@ -37077,6 +37081,11 @@ declare namespace ej { * @Default {0} */ weekStartDay?: number; + + /** Enable or disable the automatic timescale update on cell editing, dialog editing and taskbar editing. + * @Default {true} + */ + updateTimescaleView?: boolean; } export interface SelectedCellIndex { @@ -38114,6 +38123,14 @@ declare namespace ej { */ sortColumn(fieldName: string, columnSortDirection: string): void; + /** To move the TreeGrid rows programmatically with from index ,to index and position. + * @param {number} you can pass drag Index of the row + * @param {number} you can pass target Index of the row. + * @param {string} you can pass the drop position as above,below,child + * @returns {void} + */ + moveRow(fromIndex: number, toIndex: number, position: string): void; + /** To reorder the column with field name and target index values * @param {string} you can pass a name of column to reorder. * @param {string} you can pass a target column index to be inserted. @@ -38651,6 +38668,10 @@ declare namespace ej { */ rowDragStop?(e: RowDragStopEventArgs): void; + /** Triggered before row drop action begins. + */ + rowDropActionBegin?(e: RowDropActionBeginEventArgs): void; + /** Triggered before selecting a cell */ cellSelecting?(e: CellSelectingEventArgs): void; @@ -39378,6 +39399,45 @@ declare namespace ej { type?: string; } + export interface RowDropActionBeginEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the row which we start to drag. + */ + draggedRow?: any; + + /** Returns the row index which we start to drag. + */ + draggedRowIndex?: number; + + /** Returns the multiple dragged row collection for multiple reorder + */ + draggedRecords?: any[]; + + /** Returns the drop position. + */ + dropPosition?: string; + + /** Returns the row which we are dropped to row. + */ + targetRow?: any; + + /** Returns the row index which we are dropped to row. + */ + targetRowIndex?: number; + + /** Returns the TreeGrid model. + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; + } + export interface CellSelectingEventArgs { /** Returns the cancel option value. @@ -42693,6 +42753,8 @@ declare namespace ej { XLSort: Spreadsheet.XLSort; + XLSparkline: Spreadsheet.XLSparkline; + XLValidate: Spreadsheet.XLValidate; } export namespace Spreadsheet { @@ -43547,6 +43609,35 @@ declare namespace ej { sortByRange(range: any[]|string, columnName: string, direction: any): boolean; } + export interface XLSparkline { + + /** This method used for creating the sparkline chart for specified range in spreadsheet. + * @param {string} Pass the data range + * @param {string} Pass the location range + * @param {string} Pass the sparkline chart type + * @param {any} Pass the sparkline chart options + * @param {number} Pass the sheetIndex + * @returns {void} + */ + createSparkline(dataRange: string, locationRange: string, type: string, options: any, sheetIndex: number): void; + + /** This method used to change the sparkline color and marker point color in the spreadsheet. + * @param {string} Pass the sparkline ID + * @param {any} Pass the sparkline options + * @param {number} Optional. Pass the sheet index + * @returns {void} + */ + changePointColor(sparklineId: string, option: any, sheetIdx: number): void; + + /** This method used to change the sparkline type in the spreadsheet. + * @param {string} Pass the sparkline ID + * @param {string} Pass the sparkline type + * @param {number} Optional. Pass the sheet index + * @returns {void} + */ + changeType(sparklineId: string, type: string, sheetIdx: number): void; + } + export interface XLValidate { /** This method is used to apply data validation rules in a selected range of cells based on the defined condition in the Spreadsheet. @@ -43737,6 +43828,11 @@ declare namespace ej { */ allowSorting?: boolean; + /** Gets or sets a value that indicates whether to enable the sparkline feature in the Spreadsheet. + * @Default {false} + */ + allowSparkline?: boolean; + /** Gets or sets a value that indicates whether to enable or disable undo and redo feature in the Spreadsheet. * @Default {true} */ diff --git a/types/ejs/index.d.ts b/types/ejs/index.d.ts index e785f2c6ae..e56ad1a8ec 100644 --- a/types/ejs/index.d.ts +++ b/types/ejs/index.d.ts @@ -108,7 +108,7 @@ export function escapeRegexChars(s: string): string; export function escapeXML(markup: string): string; export interface Cache { set(key: string, val: TemplateFunction): void; - get(key: string): TemplateFunction; + get(key: string): TemplateFunction | undefined; } export let delimiter: string; diff --git a/types/electron-devtools-installer/electron-devtools-installer-tests.ts b/types/electron-devtools-installer/electron-devtools-installer-tests.ts index a453221698..798e6ad223 100644 --- a/types/electron-devtools-installer/electron-devtools-installer-tests.ts +++ b/types/electron-devtools-installer/electron-devtools-installer-tests.ts @@ -3,6 +3,8 @@ import installExtension, { BACKBONE_DEBUGGER, JQUERY_DEBUGGER, ANGULARJS_BATARANG, VUEJS_DEVTOOLS, REDUX_DEVTOOLS, REACT_PERF, + CYCLEJS_DEVTOOL, APOLLO_DEVELOPER_TOOLS, + MOBX_DEVTOOLS } from 'electron-devtools-installer'; @@ -14,4 +16,7 @@ installExtension(ANGULARJS_BATARANG); installExtension(VUEJS_DEVTOOLS); installExtension(REDUX_DEVTOOLS); installExtension(REACT_PERF); +installExtension(CYCLEJS_DEVTOOL); +installExtension(APOLLO_DEVELOPER_TOOLS); +installExtension(MOBX_DEVTOOLS); installExtension('abcdefghijkl'); \ No newline at end of file diff --git a/types/electron-devtools-installer/index.d.ts b/types/electron-devtools-installer/index.d.ts index 8a108c1d2f..88649cd0a8 100644 --- a/types/electron-devtools-installer/index.d.ts +++ b/types/electron-devtools-installer/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for electron-devtools-installer v2.0.1 // Project: https://github.com/MarshallOfSound/electron-devtools-installer // Definitions by: Robin Van den Broeck +// M. Fatih Mar // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "electron-devtools-installer" { @@ -21,4 +22,7 @@ declare module "electron-devtools-installer" { export const VUEJS_DEVTOOLS: ExtensionReference; export const REDUX_DEVTOOLS: ExtensionReference; export const REACT_PERF: ExtensionReference; + export const CYCLEJS_DEVTOOL: ExtensionReference; + export const APOLLO_DEVELOPER_TOOLS: ExtensionReference; + export const MOBX_DEVTOOLS: ExtensionReference; } \ No newline at end of file diff --git a/types/email-templates/email-templates-tests.ts b/types/email-templates/email-templates-tests.ts index a3311d6e81..3d828281af 100644 --- a/types/email-templates/email-templates-tests.ts +++ b/types/email-templates/email-templates-tests.ts @@ -2,13 +2,20 @@ import EmailTemplates = require('email-templates'); const email = new EmailTemplates({ message: { - from: 'Test@tesitng.com' + from: 'Test@testing.com' }, transport: { jsonTransport: true - }} -); + } +}); + +const emailNoTransporter = new EmailTemplates({ + message: { + from: 'test@testing.com' + }, +}); email.juiceResources('

bob

'); email.render('mars/html.pug', {name: 'elon'}); email.send({template: 'mars', message: {to: 'elon@spacex.com'}, locals: {name: 'Elon'}}); +emailNoTransporter.render('mars/html.pug', {name: 'elon'}); diff --git a/types/email-templates/index.d.ts b/types/email-templates/index.d.ts index 12dceb181d..1cdd43c36e 100644 --- a/types/email-templates/index.d.ts +++ b/types/email-templates/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for node-email-templates 3.1 +// Type definitions for node-email-templates 3.5 // Project: https://github.com/niftylettuce/node-email-templates // Definitions by: Cyril Schumacher // Matus Gura @@ -13,7 +13,7 @@ interface EmailConfig { /** * The nodemailer Transport created via nodemailer.createTransport */ - transport: any; + transport?: any; /** * The email template directory and engine information */ @@ -34,10 +34,19 @@ interface EmailConfig { * Pass a custom render function if necessary */ render?: { view: string, locals: any }; + /** + * force text-only rendering of template (disregards template folder) + */ + textOnly?: boolean; /** * */ htmlToText?: any; + /** + * You can pass an option to prefix subject lines with a string + * env === 'production' ? false : `[${env.toUpperCase()}] `; // <--- HERE + */ + subjectPrefix?: any; /** * */ diff --git a/types/ember-data/index.d.ts b/types/ember-data/index.d.ts index 9eec5ed467..ea3de94436 100644 --- a/types/ember-data/index.d.ts +++ b/types/ember-data/index.d.ts @@ -71,7 +71,7 @@ declare module 'ember-data' { inverse?: string | null; polymorphic?: boolean; } - ): Ember.ComputedProperty>; + ): Ember.ComputedProperty, ModelRegistry[K]>; /** * `DS.hasMany` is used to define One-To-Many and Many-To-Many * relationships on a [DS.Model](/api/data/classes/DS.Model.html). @@ -91,7 +91,7 @@ declare module 'ember-data' { inverse?: string | null; polymorphic?: boolean; } - ): Ember.ComputedProperty>; + ): Ember.ComputedProperty, Ember.Array>; /** * This method normalizes a modelName into the format Ember Data uses * internally. diff --git a/types/ember-data/test/belongs-to.ts b/types/ember-data/test/belongs-to.ts index bd1037a65e..31977c148c 100644 --- a/types/ember-data/test/belongs-to.ts +++ b/types/ember-data/test/belongs-to.ts @@ -1,6 +1,8 @@ import DS from 'ember-data'; import { assertType } from './lib/assert'; +declare const store: DS.Store; + class Folder extends DS.Model { name = DS.attr('string'); children = DS.hasMany('folder', { inverse: 'parent' }); @@ -19,4 +21,9 @@ assertType(folder.get('parent').get('name')); folder.get('parent').then(parent => { assertType(parent); assertType(parent.get('name')); + folder.set('parent', parent); }); + +folder.set('parent', folder); +folder.set('parent', folder.get('parent')); +folder.set('parent', store.findRecord('folder', 3)); diff --git a/types/ember-data/test/has-many.ts b/types/ember-data/test/has-many.ts index e24fb1b814..480a6bd56d 100644 --- a/types/ember-data/test/has-many.ts +++ b/types/ember-data/test/has-many.ts @@ -1,3 +1,4 @@ +import Ember from 'ember'; import DS from 'ember-data'; import { assertType } from './lib/assert'; @@ -44,6 +45,10 @@ blogPost.get('commentsAsync').then(comments => { assertType(comments.get('firstObject')!.get('text')); }); +blogPost.set('commentsAsync', blogPost.get('commentsAsync')); +blogPost.set('commentsAsync', Ember.A()); +blogPost.set('commentsAsync', Ember.A([ comment! ])); + class PaymentMethod extends DS.Model {} declare module 'ember-data' { interface ModelRegistry { diff --git a/types/ember-qunit/index.d.ts b/types/ember-qunit/index.d.ts index a669b977e1..9dc93b980b 100644 --- a/types/ember-qunit/index.d.ts +++ b/types/ember-qunit/index.d.ts @@ -44,6 +44,20 @@ declare module 'ember-qunit' { */ export function setResolver(resolver: Ember.Resolver): void; + /** + * Sets up acceptance tests. + * + * The `setupApplicationTest` function is used for all acceptance tests. It + * is invoked in the callback scope of a QUnit module (aka "nested module"). + * + * Once invoked, all subsequent hooks.beforeEach and test invocations will + * have access to the following: + * * `this.owner` - the owner object that been set on the test context. + * * `this.pauseTest` and `this.resumeTest` - allow easy pausing/resuming of tests. + * * `this.element` which returns the DOM element representing the application's root element. + */ + export function setupApplicationTest(hooks: NestedHooks): void; + /** * Sets up tests that need to render snippets of templates. * @@ -80,7 +94,7 @@ declare module 'ember-qunit' { */ export function setupTest(hooks: NestedHooks): void; - export class QUnitAdapter extends Ember.Test.Adapter {} + export class QUnitAdapter extends Ember.Test.Adapter { } export { module, test, skip, only, todo } from 'qunit'; } @@ -147,9 +161,10 @@ declare module 'qunit' { * ignoring the callback argument and the respective global and module's * hooks. * - * @param Title of unit being tested + * @param name Title of unit being tested + * @param callback Function to close over assertions */ - export const skip: typeof QUnit.skip; + export function skip(name: string, callback?: (this: TestContext, assert: Assert) => void): void; export default QUnit; } diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index dd3ed1ec64..c825647e49 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -6,6 +6,7 @@ // Chris Krycho // Theron Cross // Martin Feckie +// Alex LaFroscia // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -28,7 +29,8 @@ declare module 'ember' { /** * Deconstructs computed properties into the types which would be returned by `.get()`. */ - type ComputedProperties = { [K in keyof T]: Ember.ComputedProperty | ModuleComputed | T[K] }; + type ComputedPropertyGetters = { [K in keyof T]: Ember.ComputedProperty | ModuleComputed | T[K] }; + type ComputedPropertySetters = { [K in keyof T]: Ember.ComputedProperty | ModuleComputed | T[K] }; /** * Check that any arguments to `create()` match the type's properties. @@ -683,7 +685,7 @@ declare module 'ember' { 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 { + 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. @@ -812,7 +814,7 @@ declare module 'ember' { static create(this: EmberClassConstructor): Fix; static create>( - this: EmberClassConstructor>, + this: EmberClassConstructor>, arg1: T1 & ThisType> ): Fix; @@ -822,7 +824,7 @@ declare module 'ember' { T1 extends EmberInstanceArguments, T2 extends EmberInstanceArguments >( - this: EmberClassConstructor>, + this: EmberClassConstructor>, arg1: T1 & ThisType>, arg2: T2 & ThisType> ): Fix; @@ -834,7 +836,7 @@ declare module 'ember' { T2 extends EmberInstanceArguments, T3 extends EmberInstanceArguments >( - this: EmberClassConstructor>, + this: EmberClassConstructor>, arg1: T1 & ThisType>, arg2: T2 & ThisType>, arg3: T3 & ThisType> @@ -1641,27 +1643,27 @@ declare module 'ember' { /** * Retrieves the value of a property from the object. */ - get(this: ComputedProperties, key: K): T[K]; + get(this: ComputedPropertyGetters, 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: ComputedPropertyGetters, list: K[]): Pick; getProperties( - this: ComputedProperties, + this: ComputedPropertyGetters, ...list: K[] ): Pick; /** * Sets the provided key or path to the value. */ - set(this: ComputedProperties, key: K, value: T[K]): T[K]; + set(this: ComputedPropertySetters, 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, + this: ComputedPropertySetters, hash: Pick ): Pick; /** @@ -1692,7 +1694,7 @@ declare module 'ember' { * property returns `undefined`. */ getWithDefault( - this: ComputedProperties, + this: ComputedPropertyGetters, key: K, defaultValue: T[K] ): T[K]; @@ -1715,7 +1717,7 @@ declare module 'ember' { * without accidentally invoking it if it is intended to be * generated lazily. */ - cacheFor(this: ComputedProperties, key: K): T[K] | undefined; + cacheFor(this: ComputedPropertyGetters, key: K): T[K] | undefined; } const Observable: Mixin; /** @@ -2989,7 +2991,7 @@ declare module 'ember' { * it to be created. */ function cacheFor( - obj: ComputedProperties, + obj: ComputedPropertyGetters, key: K ): T[K] | undefined; /** @@ -3028,12 +3030,12 @@ declare module 'ember' { * with an object followed by a list of strings or an array: */ function getProperties( - obj: ComputedProperties, + obj: ComputedPropertyGetters, list: K[] ): Pick; function getProperties(obj: T, list: K[]): Pick; // for dynamic K function getProperties( - obj: ComputedProperties, + obj: ComputedPropertyGetters, ...list: K[] ): Pick; function getProperties(obj: T, ...list: K[]): Pick; // for dynamic K @@ -3120,14 +3122,14 @@ declare module 'ember' { * 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]; + function get(obj: ComputedPropertyGetters, key: K): T[K]; function get(obj: T, key: K): T[K]; // for dynamic 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, + obj: ComputedPropertyGetters, key: K, defaultValue: T[K] ): T[K]; @@ -3139,7 +3141,7 @@ declare module 'ember' { * method then that will be invoked as well. */ function set( - obj: ComputedProperties, + obj: ComputedPropertySetters, key: K, value: V ): V; @@ -3155,7 +3157,7 @@ declare module 'ember' { * observers will be buffered. */ function setProperties( - obj: ComputedProperties, + obj: ComputedPropertySetters, hash: Pick ): Pick; function setProperties(obj: T, hash: Pick): Pick; // for dynamic K @@ -3407,6 +3409,7 @@ declare module '@ember/application/resolver' { declare module '@ember/array' { import Ember from 'ember'; + type EmberArray = Ember.Array; const EmberArray: typeof Ember.Array; export default EmberArray; export const A: typeof Ember.A; @@ -3416,6 +3419,7 @@ declare module '@ember/array' { declare module '@ember/array/mutable' { import Ember from 'ember'; + type MutableArray = Ember.MutableArray; const MutableArray: typeof Ember.MutableArray; export default MutableArray; } @@ -3438,7 +3442,20 @@ declare module '@ember/component/checkbox' { declare module '@ember/component/helper' { import Ember from 'ember'; export default class Helper extends Ember.Helper { } - export const helper: typeof Ember.Helper.helper; + /** + * In many cases, the ceremony of a full `Helper` class is not required. + * The `helper` method create pure-function helpers without instances. For + * example: + * ```app/helpers/format-currency.js + * import { helper } from '@ember/component/helper'; + * export default helper(function(params, hash) { + * let cents = params[0]; + * let currency = hash.currency; + * return `${currency}${cents * 0.01}`; + * }); + * ``` + */ + export function helper(helperFn: (params: any[], hash?: any) => string): any; } declare module '@ember/component/text-area' { @@ -3495,10 +3512,17 @@ declare module '@ember/engine/instance' { declare module '@ember/enumerable' { import Ember from 'ember'; + type Enumerable = Ember.Enumerable; const Enumerable: typeof Ember.Enumerable; export default Enumerable; } +declare module '@ember/error' { + import Ember from 'ember'; + const Error: typeof Ember.Error; + export default Error; +} + declare module '@ember/instrumentation' { import Ember from 'ember'; export const instrument: typeof Ember.instrument; @@ -3534,7 +3558,7 @@ declare module '@ember/object' { declare module '@ember/object/computed' { import Ember from 'ember'; - export default class ComputedProperty extends Ember.ComputedProperty { } + export default class ComputedProperty extends Ember.ComputedProperty { } export const alias: typeof Ember.computed.alias; export const and: typeof Ember.computed.and; export const bool: typeof Ember.computed.bool; @@ -3577,6 +3601,7 @@ declare module '@ember/object/core' { declare module '@ember/object/evented' { import Ember from 'ember'; + type Evented = Ember.Evented; const Evented: typeof Ember.Evented; export default Evented; export const on: typeof Ember.on; @@ -3603,6 +3628,7 @@ declare module '@ember/object/mixin' { declare module '@ember/object/observable' { import Ember from 'ember'; + type Observable = Ember.Observable; const Observable: typeof Ember.Observable; export default Observable; } @@ -3615,6 +3641,7 @@ declare module '@ember/object/observers' { declare module '@ember/object/promise-proxy-mixin' { import Ember from 'ember'; + type PromiseProxyMixin = Ember.PromiseProxyMixin; const PromiseProxyMixin: typeof Ember.PromiseProxyMixin; export default PromiseProxyMixin; } diff --git a/types/ember/test/error.ts b/types/ember/test/error.ts new file mode 100644 index 0000000000..ad3c2ee8c3 --- /dev/null +++ b/types/ember/test/error.ts @@ -0,0 +1,6 @@ +import { assertType } from "./lib/assert"; + +import Ember from "ember"; +import EmberError from "@ember/error"; + +assertType(EmberError); diff --git a/types/ember/test/helper.ts b/types/ember/test/helper.ts index efe3ce33d7..cba5709b10 100755 --- a/types/ember/test/helper.ts +++ b/types/ember/test/helper.ts @@ -25,3 +25,11 @@ const CurrentUserEmailHelper = Ember.Helper.extend({ .get('email'); }, }); + +import { helper } from '@ember/component/helper'; + +function typedHelp(/*params, hash*/) { + return 'my type of help'; +} + +export default helper(typedHelp); diff --git a/types/ember/tsconfig.json b/types/ember/tsconfig.json index 19c8cf4b50..cbdb6b6afc 100755 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -23,6 +23,7 @@ "test/lib/assert.ts", "test/application.ts", "test/ember-tests.ts", + "test/error.ts", "test/event.ts", "test/extend.ts", "test/create.ts", @@ -49,4 +50,4 @@ "test/route.ts", "test/view-utils.ts" ] -} \ No newline at end of file +} diff --git a/types/enquire.js/enquire.js-tests.ts b/types/enquire.js/enquire.js-tests.ts new file mode 100644 index 0000000000..a11ba053c2 --- /dev/null +++ b/types/enquire.js/enquire.js-tests.ts @@ -0,0 +1,17 @@ +import enquire = require('enquire.js'); + +enquire + .register('(min-width: 300px) and (max-width: 600px)', { + deferSetup: true, + match: () => {}, + unmatch: () => {}, + setup: () => {}, + destroy: () => {} + }) + .register('(min-width: 300px) and (max-width: 600px)', {}); + +enquire.register('(min-width: 300px) and (max-width: 600px)', [{}, {}], true); + +enquire.register('(min-width: 300px) and (max-width: 600px)', () => {}, true); + +enquire.unregister('(min-width: 300px) and (max-width: 600px)'); diff --git a/types/enquire.js/index.d.ts b/types/enquire.js/index.d.ts new file mode 100644 index 0000000000..d7dcafdc30 --- /dev/null +++ b/types/enquire.js/index.d.ts @@ -0,0 +1,43 @@ +// Type definitions for enquire.js 2.1 +// Project: https://github.com/WickyNilliams/enquire.js/ +// Definitions by: Christian Rackerseder +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +interface Options { + /** + * If set to true, defers execution of the setup function until the first time the media query is matched + */ + deferSetup?: boolean; + /** + * If supplied, triggered when a media query matches. + */ + match?(): void; + /** + * If supplied, triggered when the media query transitions from a matched state to an unmatched state. + */ + unmatch?(): void; + /** + * If supplied, triggered once, when the handler is registered. + */ + setup?(): void; + + /** + * If supplied, triggered when handler is unregistered. Place cleanup code here + */ + destroy?(): void; +} + +type Callback = () => void; + +interface EnquireJs { + register( + mediaQuery: string, + options: Options | Options[] | Callback, + shouldDegrade?: boolean, + ): EnquireJs; + unregister(mediaQuery: string, handler?: Callback | Options): void; +} + +declare const enquire: EnquireJs; +export = enquire; diff --git a/types/enquire.js/tsconfig.json b/types/enquire.js/tsconfig.json new file mode 100644 index 0000000000..ffbd13d6e2 --- /dev/null +++ b/types/enquire.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", + "enquire.js-tests.ts" + ] +} diff --git a/types/enquire.js/tslint.json b/types/enquire.js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/enquire.js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/enzyme-redux/enzyme-redux-tests.tsx b/types/enzyme-redux/enzyme-redux-tests.tsx new file mode 100644 index 0000000000..ecd196dfd8 --- /dev/null +++ b/types/enzyme-redux/enzyme-redux-tests.tsx @@ -0,0 +1,9 @@ +import { mountWithState, mountWithStore, shallowWithState, shallowWithStore } from 'enzyme-redux'; +import * as React from 'react'; + +const Component = () =>
component
; +const shallowWithStateWrapper = shallowWithState(, {}); +const shallowWithStoreWrapper = shallowWithStore(, {}); + +const mountWithStateWrapper = mountWithState(, {}); +const mountWithStoreWrapper = mountWithStore(, {}); diff --git a/types/enzyme-redux/index.d.ts b/types/enzyme-redux/index.d.ts new file mode 100644 index 0000000000..ad312d6d1f --- /dev/null +++ b/types/enzyme-redux/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for enzyme-redux 0.2 +// Project: https://github.com/Knegusen/enzyme-redux#readme +// Definitions by: Dennis Axelsson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import { ReactWrapper, ShallowWrapper } from 'enzyme'; +import { ReactElement } from 'react'; + +export function shallowWithStore

( + Component: ReactElement

, + store: any +): ShallowWrapper

; +export function mountWithStore

( + Component: ReactElement

, + store: any +): ReactWrapper

; +export function shallowWithState

( + Component: ReactElement

, + state: any +): ShallowWrapper

; +export function mountWithState

( + Component: ReactElement

, + state: any +): ReactWrapper

; diff --git a/types/enzyme-redux/tsconfig.json b/types/enzyme-redux/tsconfig.json new file mode 100644 index 0000000000..7cc21814b3 --- /dev/null +++ b/types/enzyme-redux/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "enzyme-redux-tests.tsx" + ] +} diff --git a/types/enzyme-redux/tslint.json b/types/enzyme-redux/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/enzyme-redux/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/escape-regexp/escape-regexp-tests.ts b/types/escape-regexp/escape-regexp-tests.ts new file mode 100644 index 0000000000..086ff36348 --- /dev/null +++ b/types/escape-regexp/escape-regexp-tests.ts @@ -0,0 +1,22 @@ +import escapeRegExp = require('escape-regexp'); + +// $ExpectType string +escapeRegExp('aaa'); + +// $ExpectError +escapeRegExp(); + +// $ExpectError +escapeRegExp({}); + +// $ExpectError +escapeRegExp(1); + +// $ExpectError +escapeRegExp([]); + +// $ExpectError +escapeRegExp(null); + +// $ExpectError +escapeRegExp(undefined); diff --git a/types/escape-regexp/index.d.ts b/types/escape-regexp/index.d.ts new file mode 100644 index 0000000000..b1a0ff1edf --- /dev/null +++ b/types/escape-regexp/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for escape-regexp 0.0 +// Project: https://www.npmjs.com/package/escape-regexp +// Definitions by: Vilim Stubičan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +declare function escapeRegExp(str: string): string; + +export = escapeRegExp; diff --git a/types/escape-regexp/tsconfig.json b/types/escape-regexp/tsconfig.json new file mode 100644 index 0000000000..1037db1961 --- /dev/null +++ b/types/escape-regexp/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", + "escape-regexp-tests.ts" + ] +} diff --git a/types/escape-regexp/tslint.json b/types/escape-regexp/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/escape-regexp/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ethereumjs-util/index.d.ts b/types/ethereumjs-util/index.d.ts index 7a29b38ff5..eb47d3a6a9 100644 --- a/types/ethereumjs-util/index.d.ts +++ b/types/ethereumjs-util/index.d.ts @@ -20,64 +20,64 @@ export function addHexPrefix(str: string): string; export function arrayContainsArray(superset: any, subset: any, some: any): any; -export function baToJSON(ba: Buffer | string[]): Buffer | string[]; +export function baToJSON(ba: Buffer | Uint8Array | string[]): Buffer | Uint8Array | string[]; -export function bufferToHex(buf: Buffer): string; +export function bufferToHex(buf: Buffer | Uint8Array): string; -export function bufferToInt(buf: Buffer): string; +export function bufferToInt(buf: Buffer | Uint8Array): string; export function defineProperties(self: {[k: string]: any}, fields: string[], data: {[k: string]: any}): {[k: string]: any}; -export function ecrecover(msgHash: Buffer, v: number, r: Buffer, s: Buffer): Buffer; +export function ecrecover(msgHash: Buffer | Uint8Array, v: number, r: Buffer | Uint8Array, s: Buffer | Uint8Array): Buffer | Uint8Array; -export function ecsign(msgHash: Buffer, privateKey: Buffer): {[k: string]: any}; +export function ecsign(msgHash: Buffer | Uint8Array, privateKey: Buffer | Uint8Array): {[k: string]: any}; export function fromRpcSig(sig: string): {[k: string]: any}; -export function fromSigned(num: Buffer): any; +export function fromSigned(num: Buffer | Uint8Array): any; -export function generateAddress(from: Buffer, nonce: Buffer): Buffer; +export function generateAddress(from: Buffer | Uint8Array, nonce: Buffer | Uint8Array): Buffer | Uint8Array; -export function hashPersonalMessage(message: string): Buffer; +export function hashPersonalMessage(message: string): Buffer | Uint8Array; -export function importPublic(publicKey: Buffer): Buffer; +export function importPublic(publicKey: Buffer | Uint8Array): Buffer | Uint8Array; export function isValidAddress(address: string): boolean; -export function isValidChecksumAddress(address: Buffer): boolean; +export function isValidChecksumAddress(address: Buffer | Uint8Array): boolean; -export function isValidPrivate(privateKey: Buffer): boolean; +export function isValidPrivate(privateKey: Buffer | Uint8Array): boolean; -export function isValidPublic(publicKey: Buffer, sanitize?: boolean): any; +export function isValidPublic(publicKey: Buffer | Uint8Array, sanitize?: boolean): any; -export function isValidSignature(v: Buffer, r: Buffer, s: Buffer, homestead?: boolean): boolean; +export function isValidSignature(v: Buffer | Uint8Array, r: Buffer | Uint8Array, s: Buffer | Uint8Array, homestead?: boolean): boolean; -export function privateToAddress(privateKey: Buffer): Buffer; +export function privateToAddress(privateKey: Buffer | Uint8Array): Buffer | Uint8Array; -export function privateToPublic(privateKey: Buffer): Buffer; +export function privateToPublic(privateKey: Buffer | Uint8Array): Buffer | Uint8Array; -export function pubToAddress(pubKey: Buffer, sanitize: boolean): Buffer; +export function pubToAddress(pubKey: Buffer | Uint8Array, sanitize: boolean): Buffer | Uint8Array; -export function ripemd160(a: Buffer | any[] | string | number, padded: boolean): Buffer; +export function ripemd160(a: Buffer | Uint8Array | any[] | string | number, padded: boolean): Buffer | Uint8Array; -export function rlphash(a: Buffer | any[] | string | number): Buffer; +export function rlphash(a: Buffer | Uint8Array | any[] | string | number): Buffer | Uint8Array; -export function setLengthLeft(msg: Buffer | any[], length: number, right?: boolean): Buffer | any[]; +export function setLengthLeft(msg: Buffer | Uint8Array | any[], length: number, right?: boolean): Buffer | Uint8Array | any[]; -export function setLengthRight(msg: Buffer | any[], length: number): Buffer | any[]; +export function setLengthRight(msg: Buffer | Uint8Array | any[], length: number): Buffer | Uint8Array | any[]; -export function sha256(a: Buffer | any[] | string | number): Buffer; +export function sha256(a: Buffer | Uint8Array | any[] | string | number): Buffer | Uint8Array; -export function sha3(a: Buffer | any[] | string | number, bits?: number): Buffer; +export function sha3(a: Buffer | Uint8Array | any[] | string | number, bits?: number): Buffer | Uint8Array; -export function toBuffer(v: any): Buffer; +export function toBuffer(v: any): Buffer | Uint8Array; export function toChecksumAddress(address: string): string; -export function toRpcSig(v: number, r: Buffer, s: Buffer): string; +export function toRpcSig(v: number, r: Buffer | Uint8Array, s: Buffer | Uint8Array): string; -export function toUnsigned(num: any): Buffer; +export function toUnsigned(num: any): Buffer | Uint8Array; -export function unpad(a: T): T; +export function unpad(a: T): T; -export function zeros(bytes: number): Buffer; +export function zeros(bytes: number): Buffer | Uint8Array; diff --git a/types/eventsource/eventsource-tests.ts b/types/eventsource/eventsource-tests.ts new file mode 100644 index 0000000000..d081e87e42 --- /dev/null +++ b/types/eventsource/eventsource-tests.ts @@ -0,0 +1,15 @@ +import EventSource = require("eventsource"); + +const eventSource = new EventSource("http://foobar"); +eventSource.onmessage = (x: any) => {}; +eventSource.onerror = (x: any) => {}; +eventSource.onopen = (x: any) => {}; +eventSource.close(); + +import EventSourcePolyfill = require("eventsource/lib/eventsource-polyfill"); + +const eventSourcePolyfill = new EventSourcePolyfill("http://foobar"); +eventSourcePolyfill.onmessage = (x: any) => {}; +eventSourcePolyfill.onerror = (x: any) => {}; +eventSourcePolyfill.onopen = (x: any) => {}; +eventSourcePolyfill.close(); diff --git a/types/eventsource/index.d.ts b/types/eventsource/index.d.ts new file mode 100644 index 0000000000..3620b6116f --- /dev/null +++ b/types/eventsource/index.d.ts @@ -0,0 +1,35 @@ +// Type definitions for eventsource 1.0 +// Project: http://github.com/EventSource/eventsource +// Definitions by: Scott Lee Davis +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare class EventSource { + constructor(url: string, eventSourceInitDict?: EventSource.EventSourceInitDict); + + static CLOSED: EventSource.ReadyState; + static CONNECTING: EventSource.ReadyState; + static OPEN: EventSource.ReadyState; + + url: string; + readyState: EventSource.ReadyState; + onopen: EventListener; + onmessage: EventListener; + onerror: EventListener; + close(): void; +} + +declare namespace EventSource { + enum ReadyState {CONNECTING = 0, OPEN = 1, CLOSED = 2} + + interface EventSourceInitDict { + withCredentials?: boolean; + headers?: object; + proxy?: string; + https?: object; + rejectUnauthorized?: boolean; + } +} + +export = EventSource; +export as namespace EventSource; diff --git a/types/eventsource/lib/eventsource-polyfill/index.d.ts b/types/eventsource/lib/eventsource-polyfill/index.d.ts new file mode 100644 index 0000000000..6246355dfe --- /dev/null +++ b/types/eventsource/lib/eventsource-polyfill/index.d.ts @@ -0,0 +1,29 @@ +declare class EventSource { + constructor(url: string, eventSourceInitDict?: EventSource.EventSourceInitDict); + + static CLOSED: EventSource.ReadyState; + static CONNECTING: EventSource.ReadyState; + static OPEN: EventSource.ReadyState; + + url: string; + readyState: EventSource.ReadyState; + onopen: EventListener; + onmessage: EventListener; + onerror: EventListener; + close(): void; +} + +declare namespace EventSource { + enum ReadyState {CONNECTING = 0, OPEN = 1, CLOSED = 2} + + interface EventSourceInitDict { + withCredentials?: boolean; + headers?: object; + proxy?: string; + https?: object; + rejectUnauthorized?: boolean; + } +} + +export = EventSource; +export as namespace EventSource; diff --git a/types/eventsource/tsconfig.json b/types/eventsource/tsconfig.json new file mode 100644 index 0000000000..4a714cf00a --- /dev/null +++ b/types/eventsource/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "eventsource-tests.ts", + "lib/eventsource-polyfill/index.d.ts" + ] +} diff --git a/types/eventsource/tslint.json b/types/eventsource/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/eventsource/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/exenv/exenv-tests.ts b/types/exenv/exenv-tests.ts new file mode 100644 index 0000000000..d13633b4a6 --- /dev/null +++ b/types/exenv/exenv-tests.ts @@ -0,0 +1,6 @@ +import * as ExecutionEnvironment from 'exenv'; + +JSON.stringify(ExecutionEnvironment.canUseDOM); +JSON.stringify(ExecutionEnvironment.canUseEventListeners); +JSON.stringify(ExecutionEnvironment.canUseViewport); +JSON.stringify(ExecutionEnvironment.canUseWorkers); diff --git a/types/exenv/index.d.ts b/types/exenv/index.d.ts new file mode 100644 index 0000000000..701494f6d8 --- /dev/null +++ b/types/exenv/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for exenv 1.2 +// Project: https://github.com/JedWatson/exenv +// Definitions by: Christian Chown +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +export const canUseDOM: boolean; +export const canUseEventListeners: boolean; +export const canUseViewport: boolean; +export const canUseWorkers: boolean; diff --git a/types/colors/tsconfig.json b/types/exenv/tsconfig.json similarity index 87% rename from types/colors/tsconfig.json rename to types/exenv/tsconfig.json index 99d78ad72d..d8825637a1 100644 --- a/types/colors/tsconfig.json +++ b/types/exenv/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5" + "es6" ], "noImplicitAny": true, "noImplicitThis": true, @@ -18,7 +18,6 @@ }, "files": [ "index.d.ts", - "colors-tests.ts", - "safe.d.ts" + "exenv-tests.ts" ] } \ No newline at end of file diff --git a/types/exenv/tslint.json b/types/exenv/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/exenv/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/expect-puppeteer/expect-puppeteer-tests.ts b/types/expect-puppeteer/expect-puppeteer-tests.ts new file mode 100644 index 0000000000..84a7e65486 --- /dev/null +++ b/types/expect-puppeteer/expect-puppeteer-tests.ts @@ -0,0 +1,32 @@ +import { ElementHandle, Page } from "puppeteer"; + +const testGlobal = async (instance: ElementHandle | Page) => { + await expect(instance).toClick("selector"); + await expect(instance).toClick("selector", { polling: "mutation", text: "text" }); + await expect(instance).toClick("selector", { polling: "raf", timeout: 777 }); + + await expect(instance).toDisplayDialog(async () => {}); + + await expect(instance).toFill("selector", "value"); + await expect(instance).toFill("selector", "value", { polling: 777 }); + + await expect(instance).toMatch("selector"); + await expect(instance).toMatch("selector", { timeout: 777 }); + + await expect(instance).toMatchElement("selector", "value"); + await expect(instance).toMatchElement("selector", "value", { polling: "mutation" }); + + await expect(instance).toSelect("selector", "valueOrText"); + await expect(instance).toSelect("selector", "valueOrText", { polling: "raf" }); + + await expect(instance).toUploadFile("selector", "filePath"); + await expect(instance).toUploadFile("selector", "filePath", { timeout: 777 }); +}; + +const testImported = async (instance: ElementHandle | Page) => { + const expectPuppeteer = await import("expect-puppeteer"); + + await expectPuppeteer(instance).toClick("selector"); + await expect(instance).toClick("selector", { polling: "mutation", text: "text" }); + await expect(instance).toClick("selector", { polling: "raf", timeout: 777 }); +}; diff --git a/types/expect-puppeteer/index.d.ts b/types/expect-puppeteer/index.d.ts new file mode 100644 index 0000000000..ce20675d37 --- /dev/null +++ b/types/expect-puppeteer/index.d.ts @@ -0,0 +1,68 @@ +// Type definitions for expect-puppeteer 2.2 +// Project: https://github.com/smooth-code/jest-puppeteer/tree/master/packages/expect-puppeteer +// Definitions by: Josh Goldberg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +import { ElementHandle, Page } from "puppeteer"; + +/** + * Interval at which pageFunctions may be executed. + */ +type ExpectPolling = number | "mutation" | "raf"; + +/** + * Configures how to poll for an element. + */ +interface ExpectTimingActions { + /** + * An interval at which the pageFunction is executed. Defaults to "raf". + */ + polling?: ExpectPolling; + + /** + * Maximum time to wait for in milliseconds. Defaults to 500. + */ + timeout?: number; +} + +interface ExpectToClickOptions extends ExpectTimingActions { + /** + * A text or a RegExp to match in element textContent. + */ + text?: string | RegExp; +} + +interface ExpectPuppeteer { + // These must all match the ExpectPuppeteer interface above. + // We can't extend from it directly because some method names conflict in type-incompatible ways. + toClick(selector: string, options?: ExpectToClickOptions): Promise; + toDisplayDialog(block: () => Promise): Promise; + toFill(selector: string, value: string, options?: ExpectTimingActions): Promise; + toMatch(selector: string, options?: ExpectTimingActions): Promise; + toMatchElement(selector: string, value: string, options?: ExpectTimingActions): Promise; + toSelect(selector: string, valueOrText: string, options?: ExpectTimingActions): Promise; + toUploadFile(selector: string, filePath: string, options?: ExpectTimingActions): Promise; +} + +declare global { + namespace jest { + // tslint:disable-next-line no-empty-interface + interface Matchers { + // These must all match the ExpectPuppeteer interface above. + // We can't extend from it directly because some method names conflict in type-incompatible ways. + toClick(selector: string, options?: ExpectToClickOptions): Promise; + toDisplayDialog(block: () => Promise): Promise; + toFill(selector: string, value: string, options?: ExpectTimingActions): Promise; + toMatch(selector: string, options?: ExpectTimingActions): Promise; + toMatchElement(selector: string, value: string, options?: ExpectTimingActions): Promise; + toSelect(selector: string, valueOrText: string, options?: ExpectTimingActions): Promise; + toUploadFile(selector: string, filePath: string, options?: ExpectTimingActions): Promise; + } + } +} + +declare function expectPuppeteer(instance: ElementHandle | Page): ExpectPuppeteer; +export = expectPuppeteer; diff --git a/types/expect-puppeteer/tsconfig.json b/types/expect-puppeteer/tsconfig.json new file mode 100644 index 0000000000..7ca516e3c2 --- /dev/null +++ b/types/expect-puppeteer/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", + "expect-puppeteer-tests.ts" + ] +} diff --git a/types/expect-puppeteer/tslint.json b/types/expect-puppeteer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/expect-puppeteer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 8661cac727..8e35cb8631 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -1701,7 +1701,7 @@ export namespace Pedometer { */ export namespace Permissions { type PermissionType = 'remoteNotifications' | 'location' | - 'camera' | 'contacts' | 'audioRecording'; + 'camera' | 'contacts' | 'audioRecording' | 'calendar'; type PermissionStatus = 'undetermined' | 'granted' | 'denied'; type PermissionExpires = 'never'; @@ -1733,6 +1733,7 @@ export namespace Permissions { const NOTIFICATIONS: RemoteNotificationPermission; const CONTACTS: 'contacts'; const SYSTEM_BRIGHTNESS: 'systemBrightness'; + const CALENDAR: 'calendar'; } /** @@ -1872,6 +1873,7 @@ export namespace SQLite { export interface SvgCommonProps { fill?: string; fillOpacity?: number | string; + fillRule?: 'nonzero' | 'evenodd'; stroke?: string; strokeWidth?: number | string; strokeOpacity?: number | string; @@ -1882,6 +1884,7 @@ export interface SvgCommonProps { x?: number | string; y?: number | string; rotate?: number | string; + rotation?: number | string; scale?: number | string; origin?: number | string; originX?: number | string; diff --git a/types/express-flash/express-flash-tests.ts b/types/express-flash/express-flash-tests.ts new file mode 100644 index 0000000000..c6212c6906 --- /dev/null +++ b/types/express-flash/express-flash-tests.ts @@ -0,0 +1,12 @@ +import express = require('express'); +import flash = require('express-flash'); + +const app = express(); + +app.use(flash()); + +app.use((req) => { + req.flash(); + req.flash('message'); + req.flash('event', 'message'); +}); diff --git a/types/express-flash/index.d.ts b/types/express-flash/index.d.ts new file mode 100644 index 0000000000..e0b00b8d80 --- /dev/null +++ b/types/express-flash/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for express-flash 0.0 +// Project: https://github.com/RGBboy/express-flash +// Definitions by: Ian Mobley +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +import express = require('express'); +declare function flash(): express.RequestHandler; +export = flash; diff --git a/types/express-flash/tsconfig.json b/types/express-flash/tsconfig.json new file mode 100644 index 0000000000..5fbfc5aefd --- /dev/null +++ b/types/express-flash/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-flash-tests.ts" + ] +} diff --git a/types/express-flash/tslint.json b/types/express-flash/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-flash/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/express-formidable/index.d.ts b/types/express-formidable/index.d.ts index 75a34d0350..ee38be639e 100644 --- a/types/express-formidable/index.d.ts +++ b/types/express-formidable/index.d.ts @@ -22,6 +22,7 @@ interface ExpressFormidableOptions { uploadDir?: string; keepExtensions?: boolean; type?: "multipart" | "urlencoded"; + maxFileSize?: number; maxFieldsSize?: number; maxFields?: number; hash?: boolean | "sha1" | "md5"; diff --git a/types/express-graphql/express-graphql-tests.ts b/types/express-graphql/express-graphql-tests.ts index 6fdfc0d945..52071cea07 100644 --- a/types/express-graphql/express-graphql-tests.ts +++ b/types/express-graphql/express-graphql-tests.ts @@ -1,38 +1,42 @@ -import express = require('express'); -import 'express-session'; -import graphqlHTTP = require('express-graphql'); +import express = require("express"); +import "express-session"; +import graphqlHTTP = require("express-graphql"); +import { buildSchema } from "graphql"; const app = express(); -const schema = {}; +const schema = buildSchema(`type Query { hello: String }`); -const graphqlOption: graphqlHTTP.OptionsObj = { +const graphqlOption: graphqlHTTP.OptionsData = { graphiql: true, - schema: schema, + schema, formatError: (error: Error) => ({ - message: error.message + message: error.message, }), - extensions: (args) => { } + validationRules: [() => false, () => true], + extensions: ({ document, variables, operationName, result }) => ({ key: "value", key2: "value" }), }; -const graphqlOptionRequest = (request: express.Request, response: express.Response): graphqlHTTP.OptionsObj => ({ +const graphqlOptionRequest = (request: express.Request): graphqlHTTP.OptionsData => ({ graphiql: true, - schema: schema, - context: request.session + schema, + context: request.session, + validationRules: [() => false, () => true], }); -const graphqlOptionRequestAsync = async (request: express.Request, response: express.Response): Promise => { +const graphqlOptionRequestAsync = async (request: express.Request): Promise => { return { graphiql: true, schema: await Promise.resolve(schema), context: request.session, - extensions: async (args) => { } + extensions: async args => {}, + validationRules: [() => false, () => true], }; }; -app.use('/graphql1', graphqlHTTP(graphqlOption)); +app.use("/graphql1", graphqlHTTP(graphqlOption)); -app.use('/graphql2', graphqlHTTP(graphqlOptionRequest)); +app.use("/graphql2", graphqlHTTP(graphqlOptionRequest)); -app.use('/graphqlasync', graphqlHTTP(graphqlOptionRequestAsync)); +app.use("/graphqlasync", graphqlHTTP(graphqlOptionRequestAsync)); -app.listen(8080, () => console.log('GraphQL Server running on localhost:8080')); +app.listen(8080, () => console.log("GraphQL Server running on localhost:8080")); diff --git a/types/express-graphql/index.d.ts b/types/express-graphql/index.d.ts index ade08f1729..78c988204f 100644 --- a/types/express-graphql/index.d.ts +++ b/types/express-graphql/index.d.ts @@ -1,75 +1,119 @@ -// Type definitions for express-graphql -// Project: https://www.npmjs.org/package/express-graphql +// Type definitions for express-graphql 0.6 +// Project: https://github.com/graphql/express-graphql // Definitions by: Isman Usoh // Nitin Tutlani // Daniel Fader // Ehsan Ziya +// Margus Lamp +// Firede // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import { Request, Response } from "express"; - +import { DocumentNode, GraphQLSchema, GraphQLError } from "graphql"; export = graphqlHTTP; declare namespace graphqlHTTP { /** - * Used to configure the graphQLHTTP middleware by providing a schema + * Used to configure the graphqlHTTP middleware by providing a schema * and other configuration options. + * + * Options can be provided as an Object, a Promise for an Object, or a Function + * that returns an Object or a Promise for an Object. */ - export type Options = ((req: Request, res: Response) => OptionsObj) | ((req: Request, res: Response) => Promise) | OptionsObj - export type OptionsObj = { + export type Options = + | ((request: Request, response: Response, params?: GraphQLParams) => OptionsResult) + | OptionsResult; + export type OptionsResult = OptionsData | Promise; + export interface OptionsData { /** * A GraphQL schema from graphql-js. */ - schema: Object, + schema: GraphQLSchema; /** * A value to pass as the context to the graphql() function. */ - context?: Object, + context?: any; /** * An object to pass as the rootValue to the graphql() function. */ - rootValue?: Object, + rootValue?: any; /** * A boolean to configure whether the output should be pretty-printed. */ - pretty?: boolean, + pretty?: boolean | null; /** * An optional function which will be used to format any errors produced by * fulfilling a GraphQL operation. If no function is provided, GraphQL's * default spec-compliant `formatError` function will be used. */ - formatError?: Function, + formatError?: ((error: GraphQLError) => any) | null; + + /** + * An optional array of validation rules that will be applied on the document + * in additional to those defined by the GraphQL spec. + */ + validationRules?: any[] | null; + + /** + * An optional function for adding additional metadata to the GraphQL response + * as a key-value object. The result will be added to "extensions" field in + * the resulting JSON. This is often a useful place to add development time + * info such as the runtime of a query or the amount of resources consumed. + * + * Information about the request is provided to be used. + * + * This function may be async. + */ + extensions?: ((info: RequestInfo) => { [key: string]: any }) | null; /** * A boolean to optionally enable GraphiQL mode. */ - graphiql?: boolean, - - /** - * An optional function for adding additional metadata to the GraphQL response as a key-value object. - * The result will be added to "extensions" field in the resulting JSON. - */ - extensions?: ((args: ExtenstionsArgs) => any) | ((args: ExtenstionsArgs) => Promise); - - }; - - interface ExtenstionsArgs { - document: object, - variables: object, - operationName: any, - result: object + graphiql?: boolean | null; } - type Middleware = (request: Request, response: Response) => void; + /** + * All information about a GraphQL request. + */ + export interface RequestInfo { + /** + * The parsed GraphQL document. + */ + document: DocumentNode | null | undefined; + + /** + * The variable values used at runtime. + */ + variables: { [name: string]: any } | null | undefined; + + /** + * The (optional) operation name requested. + */ + operationName: string | null | undefined; + + /** + * The result of executing the operation. + */ + result: any; + } + + export interface GraphQLParams { + query: string | null | undefined; + variables: { [name: string]: any } | null | undefined; + operationName: string | null | undefined; + raw: boolean | null | undefined; + } + + type Middleware = (request: Request, response: Response) => Promise; } /** -* Middleware for express; takes an options object or function as input to -* configure behavior, and returns an express middleware. -*/ + * Middleware for express; takes an options object or function as input to + * configure behavior, and returns an express middleware. + */ declare function graphqlHTTP(options: graphqlHTTP.Options): graphqlHTTP.Middleware; diff --git a/types/express-graphql/tslint.json b/types/express-graphql/tslint.json index a41bf5d19a..4c4fc86ace 100644 --- a/types/express-graphql/tslint.json +++ b/types/express-graphql/tslint.json @@ -1,79 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "strict-export-declare-modifiers": false } } diff --git a/types/express-jwt/express-jwt-tests.ts b/types/express-jwt/express-jwt-tests.ts index 798818b728..a4d4d11845 100644 --- a/types/express-jwt/express-jwt-tests.ts +++ b/types/express-jwt/express-jwt-tests.ts @@ -13,6 +13,25 @@ app.use(jwt({ userProperty: 'auth' })); +app.use(jwt({ + secret: (req: express.Request, + payload: any, + done: (err: any, secret: string) => void) => { + done(null, 'shhhhhhared-secret'); + }, + userProperty: 'auth' +})); + +app.use(jwt({ + secret: (req: express.Request, + header: any, + payload: any, + done: (err: any, secret: string) => void) => { + done(null, 'shhhhhhared-secret'); + }, + userProperty: 'auth' +})); + var jwtCheck = jwt({ secret: 'shhhhhhared-secret' }); @@ -26,6 +45,6 @@ app.use(function (err: any, req: express.Request, res: express.Response, next: e res.end(); } } else { - next(err); + next(new jwt.UnauthorizedError('invalid_token', new Error('error-message'))); } -}); \ No newline at end of file +}); diff --git a/types/express-jwt/index.d.ts b/types/express-jwt/index.d.ts index de0a2dd337..1187f4fbca 100644 --- a/types/express-jwt/index.d.ts +++ b/types/express-jwt/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for express-jwt // Project: https://www.npmjs.org/package/express-jwt -// Definitions by: Wonshik Kim , Kacper Polak , Sl1MBoy +// Definitions by: Wonshik Kim +// Kacper Polak +// Sl1MBoy +// Milan Mimra // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -12,20 +15,27 @@ export = jwt; declare function jwt(options: jwt.Options): jwt.RequestHandler; declare namespace jwt { export type secretType = string | Buffer + export type ErrorCode = + "revoked_token" | + "invalid_token" | + "credentials_bad_scheme" | + "credentials_bad_format" | + "credentials_required" + + export interface SecretCallbackLong { + (req: express.Request, header: any, payload: any, done: (err: any, secret?: secretType) => void): void; + } export interface SecretCallback { - (req: express.Request, header: any, payload: any, done: (err: any, secret?: boolean) => void): void; (req: express.Request, payload: any, done: (err: any, secret?: secretType) => void): void; } - export interface IsRevokedCallback { (req: express.Request, payload: any, done: (err: any, revoked?: boolean) => void): void; } - export interface GetTokenCallback { (req: express.Request): any; } export interface Options { - secret: secretType | SecretCallback; + secret: secretType | SecretCallback | SecretCallbackLong; userProperty?: string; skip?: string[]; credentialsRequired?: boolean; @@ -39,11 +49,13 @@ declare namespace jwt { } export class UnauthorizedError extends Error { - name: string; - message: string; - code: string; status: number; - inner: Error + message: string; + name: 'UnauthorizedError'; + code: ErrorCode; + inner: { message: string }; + + constructor(code: ErrorCode, error: { message: string }); } } declare global { diff --git a/types/express-winston/express-winston-tests.ts b/types/express-winston/express-winston-tests.ts index 297b7afc49..7fd41cfd5c 100644 --- a/types/express-winston/express-winston-tests.ts +++ b/types/express-winston/express-winston-tests.ts @@ -7,18 +7,19 @@ const app = express(); // Logger with all options app.use(expressWinston.logger({ baseMeta: { foo: 'foo' }, - bodyBlacklist: [ 'foo' ], - bodyWhitelist: [ 'bar' ], + bodyBlacklist: ['foo'], + bodyWhitelist: ['bar'], colorize: true, dynamicMeta: (req, res, err) => ({ foo: 'bar' }), expressFormat: true, ignoreRoute: (req, res) => true, - ignoredRoutes: [ 'foo' ], - level: 'level', + ignoredRoutes: ['foo'], + level: (req, res) => 'level', + meta: true, metaField: 'metaField', msg: 'msg', requestFilter: (req, prop) => true, - requestWhitelist: [ 'foo', 'bar' ], + requestWhitelist: ['foo', 'bar'], skip: (req, res) => false, statusLevels: ({ error: 'error', success: 'success', warn: 'warn' }), transports: [ @@ -48,11 +49,11 @@ app.use(expressWinston.logger({ app.use(expressWinston.errorLogger({ baseMeta: { foo: 'foo' }, dynamicMeta: (req, res, err) => ({ foo: 'bar' }), - level: 'level', + level: (req, res) => 'level', metaField: 'metaField', msg: 'msg', requestFilter: (req, prop) => true, - requestWhitelist: [ 'foo', 'bar' ], + requestWhitelist: ['foo', 'bar'], transports: [ new winston.transports.Console({ json: true, @@ -87,8 +88,8 @@ expressWinston.responseWhitelist.push('body'); const router = express.Router(); router.post('/user/register', (req, res, next) => { - const expressWinstonReq = req as expressWinston.ExpressWinstonRequest; - expressWinstonReq._routeWhitelists.body = [ 'username', 'email', 'age' ]; - expressWinstonReq._routeWhitelists.req = [ 'userId' ]; - expressWinstonReq._routeWhitelists.res = [ '_headers' ]; + const expressWinstonReq = req as expressWinston.ExpressWinstonRequest; + expressWinstonReq._routeWhitelists.body = ['username', 'email', 'age']; + expressWinstonReq._routeWhitelists.req = ['userId']; + expressWinstonReq._routeWhitelists.res = ['_headers']; }); diff --git a/types/express-winston/index.d.ts b/types/express-winston/index.d.ts index 21e7ead653..6dac70c1b6 100644 --- a/types/express-winston/index.d.ts +++ b/types/express-winston/index.d.ts @@ -12,6 +12,7 @@ export interface MetaObject { } export type DynamicMetaFunction = (req: Request, res: Response, err: Error) => MetaObject | undefined; +export type DynamicLevelFunction = (req: Request, res: Response, err: Error) => string; export type RequestFilter = (req: Request, propName: string) => boolean; export type ResponseFilter = (res: Response, propName: string) => boolean; export type RouteFilter = (req: Request, res: Response) => boolean; @@ -25,7 +26,8 @@ export interface BaseLoggerOptions { expressFormat?: boolean; ignoreRoute?: RouteFilter; ignoredRoutes?: string[]; - level?: string; + level?: string | DynamicLevelFunction; + meta?: boolean; metaField?: string; msg?: string; requestFilter?: RequestFilter; @@ -55,7 +57,7 @@ export function logger(options: LoggerOptions): Handler; export interface BaseErrorLoggerOptions { baseMeta?: MetaObject; dynamicMeta?: DynamicMetaFunction; - level?: string; + level?: string | DynamicLevelFunction; metaField?: string; msg?: string; requestFilter?: RequestFilter; @@ -91,9 +93,9 @@ export let defaultResponseFilter: ResponseFilter; export function defaultSkip(): boolean; export interface ExpressWinstonRequest extends Request { - _routeWhitelists: { - body: string[]; - req: string[]; - res: string[]; - }; + _routeWhitelists: { + body: string[]; + req: string[]; + res: string[]; + }; } diff --git a/types/express-ws/express-ws-tests.ts b/types/express-ws/express-ws-tests.ts new file mode 100644 index 0000000000..a37f315dfb --- /dev/null +++ b/types/express-ws/express-ws-tests.ts @@ -0,0 +1,72 @@ +import http = require('http'); +import https = require('https'); +import express = require('express'); +import expressWs = require('express-ws'); + +const dummyApp = express(); +const httpServer = http.createServer(dummyApp); +const httpsServer = https.createServer({}, dummyApp); + +expressWs(dummyApp); // optional server argument +expressWs(dummyApp, httpsServer); // https server allowed +expressWs(dummyApp, httpServer, { + leaveRouterUntouched: false, + // ws server options + wsOptions: { + clientTracking: true + } +}); + +const { app, getWss, applyTo } = expressWs(express()); + +/** + * applyTo accepts router object + */ +applyTo(express.Router()); + +/** + * applyTo accepts router-like objects + */ +applyTo({ + get() { return this; } +}); + +/** + * getWss function returns ws server + */ +getWss().clients.forEach(ws => { + if (ws.readyState !== ws.OPEN) { + ws.terminate(); + return; + } + ws.ping(); +}); + +/** + * ws method is added to express app instance + */ +app.ws('/', (ws, req) => { + ws.on('message', msg => { + console.log(msg); + }); +}); + +/** + * ws method is added to express.Router prototype + */ +const router = express.Router(); + +router.ws( + '/:id', + (ws, req, next) => { next(); }, + (ws, req, next) => { + ws.send(req.params.id); + + ws.on('close', (code, reason) => { + console.log('code:', code); + console.log('reason:', reason); + }); + } +); + +app.use(router); diff --git a/types/express-ws/index.d.ts b/types/express-ws/index.d.ts new file mode 100644 index 0000000000..81cf85c6d3 --- /dev/null +++ b/types/express-ws/index.d.ts @@ -0,0 +1,47 @@ +// Type definitions for express-ws 3.0 +// Project: https://github.com/HenningM/express-ws +// Definitions by: AJ Livingston +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as core from 'express-serve-static-core'; +import * as express from 'express'; +import * as http from 'http'; +import * as https from 'https'; +import * as ws from 'ws'; + +declare module 'express' { + function Router(options?: RouterOptions): expressWs.Router; +} + +declare function expressWs(app: express.Application, server?: http.Server | https.Server, options?: expressWs.Options): expressWs.Instance; +declare namespace expressWs { + type Application = express.Application & WithWebsocketMethod; + type Router = express.Router & WithWebsocketMethod; + + interface Options { + leaveRouterUntouched?: boolean; + wsOptions?: ws.ServerOptions; + } + + interface RouterLike { + get: express.IRouterMatcher; + [key: string]: any; + [key: number]: any; + } + + interface Instance { + app: Application; + applyTo(target: RouterLike): void; + getWss(): ws.Server; + } + + type WebsocketRequestHandler = (ws: ws, req: express.Request, next: express.NextFunction) => void; + type WebsocketMethod = (route: core.PathParams, ...middlewares: WebsocketRequestHandler[]) => T; + + interface WithWebsocketMethod { + ws: WebsocketMethod; + } +} + +export = expressWs; diff --git a/types/express-ws/tsconfig.json b/types/express-ws/tsconfig.json new file mode 100644 index 0000000000..e2d5677145 --- /dev/null +++ b/types/express-ws/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "express-ws-tests.ts" + ] +} diff --git a/types/express-ws/tslint.json b/types/express-ws/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-ws/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/express-xml-bodyparser/express-xml-bodyparser-tests.ts b/types/express-xml-bodyparser/express-xml-bodyparser-tests.ts new file mode 100644 index 0000000000..e8deca25e3 --- /dev/null +++ b/types/express-xml-bodyparser/express-xml-bodyparser-tests.ts @@ -0,0 +1,10 @@ +import express = require('express'); +import xmlparser = require('express-xml-bodyparser'); + +const app: express.Express = express(); + +app.use(xmlparser()); + +app.post("/auth", xmlparser({explicitArray: false}), (req, res, next) => { + res.send("Success!"); +}); diff --git a/types/express-xml-bodyparser/index.d.ts b/types/express-xml-bodyparser/index.d.ts new file mode 100644 index 0000000000..1c674d71fb --- /dev/null +++ b/types/express-xml-bodyparser/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for express-xml-bodyparser 0.3 +// Project: https://github.com/macedigital/express-xml-bodyparser +// Definitions by: Notice Maker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Request, Response, NextFunction } from 'express'; + +declare function xmlparser(options?: xmlparser.XmlparserOptions): (req: Request, res: Response, next: NextFunction) => void; + +declare namespace xmlparser { + let regexp: RegExp; + + interface XmlparserOptions { + async?: boolean; + explicitArray?: boolean; + normalize?: boolean; + normalizeTags?: boolean; + trim?: boolean; + } +} + +export = xmlparser; diff --git a/types/express-xml-bodyparser/tsconfig.json b/types/express-xml-bodyparser/tsconfig.json new file mode 100644 index 0000000000..49f0ac53bc --- /dev/null +++ b/types/express-xml-bodyparser/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-xml-bodyparser-tests.ts" + ] +} \ No newline at end of file diff --git a/types/express-xml-bodyparser/tslint.json b/types/express-xml-bodyparser/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/express-xml-bodyparser/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index 397ea8984a..31509435a5 100644 --- a/types/fabric/fabric-impl.d.ts +++ b/types/fabric/fabric-impl.d.ts @@ -1427,6 +1427,11 @@ export class Canvas { * @return active object */ getActiveObject(): Object; + /** + * Returns an array with the current selected objects + * @return {Object[]} array of active objects + */ + getActiveObjects(): Object[]; /** * Returns pointer coordinates relative to canvas. * @return object with "x" and "y" number values diff --git a/types/fabric/index.d.ts b/types/fabric/index.d.ts index a0fa06629e..38277c5708 100644 --- a/types/fabric/index.d.ts +++ b/types/fabric/index.d.ts @@ -4,6 +4,7 @@ // Joseph Livecchi // Michael Randolph // Tiger Oakes +// Brian Martinson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 export import fabric = require("./fabric-impl"); diff --git a/types/fabric/test/index.ts b/types/fabric/test/index.ts index 0f51499c0b..dfdaafce06 100644 --- a/types/fabric/test/index.ts +++ b/types/fabric/test/index.ts @@ -1032,3 +1032,32 @@ function sample9() { canvas.setBackgroundImage('yolo.jpg', () => { "a"; }, { opacity: 45 }); canvas.setBackgroundImage('yolo.jpg', () => { "a"; }); } + +function sample10() { + const canvas = new fabric.Canvas('c'); + const objR = new fabric.Rect({ + top: 10, + left: 10, + width: 10, + height: 10, + fill: "#FF0000", + }); + const objG = new fabric.Rect({ + top: 15, + left: 15, + width: 10, + height: 10, + fill: "#00FF00", + }); + const objB = new fabric.Rect({ + top: 20, + left: 20, + width: 10, + height: 10, + fill: "#0000FF", + }); + canvas.add(objR); + canvas.add(objG); + canvas.add(objB); + const objArray = canvas.getActiveObjects(); +} diff --git a/types/facebook-instant-games/facebook-instant-games-tests.ts b/types/facebook-instant-games/facebook-instant-games-tests.ts new file mode 100644 index 0000000000..8d33e2c970 --- /dev/null +++ b/types/facebook-instant-games/facebook-instant-games-tests.ts @@ -0,0 +1,58 @@ +class FBInstantTest { + winStreak: number; + + init() { + FBInstant.initializeAsync().then(() => { + FBInstant.setLoadingProgress(100); + FBInstant.startGameAsync().then(() => { + this.startGame(); + }); + }); + } + + startGame() { + const contextId = FBInstant.context.getID(); + const contextType = FBInstant.context.getType(); + + const playerName = FBInstant.player.getName(); + const playerPic = FBInstant.player.getPhoto(); + const playerId = FBInstant.player.getID(); + } + + saveState() { + FBInstant.player.setDataAsync({ + score: this.winStreak + }); + } + + getState() { + FBInstant.player.getDataAsync(['score']) + .then((data) => { + if (typeof data['score'] !== 'undefined') { + this.winStreak = +data['score']; + } + }); + } + + update() { + FBInstant.updateAsync({ + action: 'CUSTOM', + cta: 'Play', + image: '', + text: { + default: 'Edgar played their move', + localizations: { + en_US: 'Edgar played their move', + es_LA: '\u00A1Edgar jug\u00F3 su jugada!' + } + }, + template: 'play_turn', + data: { myReplayData: '...' }, + strategy: 'IMMEDIATE', + notification: 'NO_PUSH' + }).then(() => { + // closes the game after the update is posted. + FBInstant.quit(); + }); + } +} diff --git a/types/facebook-instant-games/index.d.ts b/types/facebook-instant-games/index.d.ts new file mode 100644 index 0000000000..1e8a8d76fd --- /dev/null +++ b/types/facebook-instant-games/index.d.ts @@ -0,0 +1,221 @@ +// Type definitions for facebook-instant-games 6.1 +// Project: https://developers.facebook.com/docs/games/instant-games +// Definitions by: Menushka Weeratunga +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace FBInstant { + let player: Player; + let context: Context; + let payments: Payments; + + function getLocale(): string; + function getPlatform(): string; + function getSDKVersion(): string; + function initializeAsync(): Promise; + function setLoadingProgress(progress: number): void; + function getSupportedAPIs(): string[]; + function getEntryPointData(): any; + function getEntryPointAsync(): Promise; + function setSessionData(sessionData: any): void; + function startGameAsync(): Promise; + function shareAsync(payload: SharePayload): Promise; + function updateAsync(payload: UpdatePayload | LeaderboardUpdatePayload): Promise; + function switchGameAsync(appID: string, data?: string): Promise; + function canCreateShortcutAsync(): Promise; + function createShortcutAsync(): Promise; + function quit(): void; + function logEvent(eventName: string, valueToSum?: number, parameter?: any): APIError; + function onPause(func: () => void): void; + function getInterstitialAdAsync(placementID: string): Promise; + function getRewardedVideoAsync(placementID: string): Promise; + function matchPlayerAsync(matchTag?: string, switchContextWhenMatched?: boolean): Promise; + function checkCanPlayerMatchAsync(): Promise; + function getLeaderboardAsync(name: string): Promise; + + interface Player { + getID(): string; + getSignedPlayerInfoAsync(requestPayload: string): Promise; + canSubscribeBotAsync(): Promise; + subscribeBotAsync(): Promise; + getName(): string; + getPhoto(): string; + getDataAsync(keys?: string[]): Promise; + setDataAsync(data: DataObject): Promise; + flushDataAsync(): Promise; + getStatsAsync(keys?: string[]): Promise; + setStatsAsync(stats: StatsObject): Promise; + incrementStatsAsync(increments: IncrementObject): Promise; + getConnectedPlayersAsync(): Promise; + } + + interface Context { + getID(): string; + getType(): Type; + isSizeBetween(minSize: number, maxSize: number): ContextSizeResponse; + switchAsync(id: string): Promise; + chooseAsync(options: ContextOptions): Promise; + createAsync(playerID: string): Promise; + getPlayersAsync(): Promise; + } + + interface Leaderboard { + getName(): string; + getContextID(): string; + getEntryCountAsync(): Promise; + setScoreAsync(score: number, extraData: string): Promise; + getPlayerEntryAsync(): Promise; + getEntriesAsync(count: number, offset: number): Promise; + } + + interface LeaderboardEntry { + getScore(): number; + getFormattedScore(): string; + getTimestamp(): number; + getRank(): number; + getExtraData(): string; + getPlayer(): LeaderboardPlayer; + } + + interface LeaderboardPlayer { + getName(): string; + getPhoto(): string; + getID(): string; + } + + interface ConnectedPlayer { + getID(): string; + getName(): string; + getPhoto(): string; + } + + interface SignedPlayerInfo { + getPlayerID(): string; + getSignature(): string; + } + + interface ContextPlayer { + getID(): string; + getName(): string; + getPhoto(): string; + } + + interface AdInstance { + getPlacementID(): string; + loadAsync(): Promise; + showAsync(): Promise; + } + + interface Payments { + purchaseAsync(purchaseConfig: PurchaseConfig): Promise; + getPurchasesAsync(): Promise; + consumePurchaseAsync(purchaseToken: string): Promise; + onReady(callback: () => void): void; + } + + interface Product { + title: string; + productID: string; + description?: string; + imageURI?: string; + price: string; + priceCurrencyCode: string; + } + + interface ContextSizeResponse { + answer: boolean; + minSize?: number; + maxSize?: number; + } + + interface Purchase { + developerPayload?: string; + paymentID: string; + productID: string; + purchaseTime: string; + purchaseToken: string; + signedRequest: SignedPurchaseRequest; + } + + interface ContextOptions { + filters?: ContextFilter[]; + maxSize?: number; + minSize?: number; + } + + interface SharePayload { + intent?: Intent; + image?: string; + text?: string; + data?: any; + } + + interface APIError { + code: ErrorCodeType; + message: string; + } + + interface PurchaseConfig { + productID: string; + developerPayload?: string; + } + + interface UpdatePayload { + action?: UpdateAction; + template?: string; + cta?: (string | LocalizableContent); + image?: string; + text?: (string | LocalizableContent); + data?: any; + strategy?: string; + notification?: string; + } + + interface LeaderboardUpdatePayload { + action: UpdateAction; + name: string; + text?: string; + } + + interface LocalizableContent { + default: string; + localizations: LocalizationsDict; + } + + interface DataObject { [ key: string ]: string | number; } + + interface StatsObject { [ key: string ]: number; } + + interface IncrementObject { [ key: string ]: number; } + + type LocalizationsDict = any; + + type SignedPurchaseRequest = string; + + type ContextFilter = "NEW_CONTEXT_ONLY" | "INCLUDE_EXISTING_CHALLENGES" | "NEW_PLAYERS_ONLY"; + + type UpdateAction = "CUSTOM" | "LEADERBOARD"; + + type Platform = "IOS" | "ANDROID" | "WEB" | "MOBILE_WEB"; + + type Type = "POST" | "THREAD" | "GROUP" | "SOLO"; + + type Intent = "INVITE" | "REQUEST" | "CHALLENGE" | "SHARE"; + + type ErrorCodeType = "ADS_FREQUENT_LOAD" | + "ADS_NO_FILL" | + "ADS_NOT_LOADED" | + "ADS_TOO_MANY_INSTANCES" | + "ANALYTICS_POST_EXCEPTION" | + "CLIENT_REQUIRES_UPDATE" | + "CLIENT_UNSUPPORTED_OPERATION" | + "INVALID_OPERATION" | + "INVALID_PARAM" | + "LEADERBOARD_NOT_FOUND" | + "LEADERBOARD_WRONG_CONTEXT" | + "NETWORK_FAILURE" | + "PENDING_REQUEST" | + "RATE_LIMITED" | + "SAME_CONTEXT" | + "UNKNOWN" | + "USER_INPUT"; +} diff --git a/types/facebook-instant-games/tsconfig.json b/types/facebook-instant-games/tsconfig.json new file mode 100644 index 0000000000..5f1b7e6ccd --- /dev/null +++ b/types/facebook-instant-games/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", + "facebook-instant-games-tests.ts" + ] +} diff --git a/types/facebook-instant-games/tslint.json b/types/facebook-instant-games/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/facebook-instant-games/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/facebook-js-sdk/facebook-js-sdk-tests.ts b/types/facebook-js-sdk/facebook-js-sdk-tests.ts index f919e3290f..9652dbb86f 100644 --- a/types/facebook-js-sdk/facebook-js-sdk-tests.ts +++ b/types/facebook-js-sdk/facebook-js-sdk-tests.ts @@ -72,6 +72,15 @@ FB.ui({ console.log(data.payment_id); }); +FB.ui({ + method: 'pay', + action: 'purchaseiap', + product_id: 'com.fb.friendsmash.coins.10', + developer_payload: 'this_is_a_test_payload' +}, response => { + console.log(response); +}); + FB.ui({ method: 'pagetab', redirect_uri: 'YOUR_URL' diff --git a/types/facebook-js-sdk/index.d.ts b/types/facebook-js-sdk/index.d.ts index c380ee004d..be9f71f6c9 100644 --- a/types/facebook-js-sdk/index.d.ts +++ b/types/facebook-js-sdk/index.d.ts @@ -66,6 +66,11 @@ declare namespace facebook { */ ui(params: PayDialogParams, callback: (response: PayDialogResponse) => void): void; + /** + * @see https://developers.facebook.com/docs/games_payments/payments_lite + */ + ui(params: PaymentsLiteDialogParams, callback: (response: PaymentsLiteDialogResponse) => void): void; + /** * @see https://developers.facebook.com/docs/videos/live-video/exploring-live */ @@ -154,6 +159,14 @@ declare namespace facebook { request_id?: string; test_currency?: string; } + + interface PaymentsLiteDialogParams extends DialogParams { + method: 'pay'; + action: 'purchaseiap'; + product_id: string; + developer_payload?: string; + quantity?: number; + } interface LiveDialogParams extends DialogParams { method: 'live_broadcast'; @@ -173,7 +186,7 @@ declare namespace facebook { authResponse: { accessToken: string; expiresIn: number; - grantedScopes: string; + grantedScopes: string; signedRequest: string; userID: string; }; @@ -199,6 +212,17 @@ declare namespace facebook { signed_request: string; } + interface PaymentsLiteDialogResponse { + developer_payload?: string; + payment_id: number; + product_id?: string; + purchase_time?: number; + purchase_token?: string; + signed_request?: string; + error_code?: number; + error_message?: string; + } + interface LiveDialogResponse { id: string; stream_url: string; diff --git a/types/fb-watchman/fb-watchman-tests.ts b/types/fb-watchman/fb-watchman-tests.ts new file mode 100644 index 0000000000..9b1aeb387b --- /dev/null +++ b/types/fb-watchman/fb-watchman-tests.ts @@ -0,0 +1,14 @@ +import { Client } from "fb-watchman"; + +const client = new Client(); +const clientB = new Client({}); + +client.capabilityCheck({ optional: [], required: ['relative_root'] }, e => { + if (e) { + client.end(); + return; + } +}); +client.connect(); + +client.command(['watch-project', '/tmp'], () => {}); diff --git a/types/fb-watchman/index.d.ts b/types/fb-watchman/index.d.ts new file mode 100644 index 0000000000..a009cbe247 --- /dev/null +++ b/types/fb-watchman/index.d.ts @@ -0,0 +1,38 @@ +// Type definitions for fb-watchman 2.0 +// Project: https://facebook.github.io/watchman/ +// Definitions by: Wu Haotian +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { EventEmitter } from 'events'; + +// Emit the responses to these when they get sent down to us +export type UnilateralTags = 'unilateralTags' | 'log'; + +export interface ClientOptions { + /** + * Absolute path to the watchman binary. + * If not provided, the Client locates the binary using the PATH specified + * by the node child_process's default env. + */ + watchmanBinaryPath?: string; +} + +export interface Capabilities { + optional: any[]; + required: any[]; +} + +export type doneCallback = (error?: Error | null, resp?: any) => any; + +export class Client extends EventEmitter { + constructor(options?: ClientOptions) + sendNextCommand(): void; + cancelCommands(why: string): void; + connect(): void; + command(args: any, done: doneCallback): void; + capabilityCheck( + caps: Capabilities, + done: doneCallback, + ): void; + end(): void; +} diff --git a/types/fb-watchman/tsconfig.json b/types/fb-watchman/tsconfig.json new file mode 100644 index 0000000000..83ad2335ea --- /dev/null +++ b/types/fb-watchman/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", + "fb-watchman-tests.ts" + ] +} diff --git a/types/fb-watchman/tslint.json b/types/fb-watchman/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fb-watchman/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/feathersjs__authentication-client/index.d.ts b/types/feathersjs__authentication-client/index.d.ts index 04275eb93c..9d1972bebc 100644 --- a/types/feathersjs__authentication-client/index.d.ts +++ b/types/feathersjs__authentication-client/index.d.ts @@ -3,8 +3,10 @@ // Definitions by: Abraao Alves , Jan Lohage // Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript // TypeScript Version: 2.3 +import * as self from '@feathersjs/authentication-client'; -export default function feathersAuthClient(config?: FeathersAuthClientConfig): () => void; +declare const feathersAuthClient: ((config?: FeathersAuthClientConfig) => () => void) & typeof self; +export default feathersAuthClient; export interface FeathersAuthClientConfig { storage?: Storage; diff --git a/types/feathersjs__authentication-jwt/index.d.ts b/types/feathersjs__authentication-jwt/index.d.ts index b55adeed46..ab6a7f6dbe 100644 --- a/types/feathersjs__authentication-jwt/index.d.ts +++ b/types/feathersjs__authentication-jwt/index.d.ts @@ -6,8 +6,10 @@ import { Application } from '@feathersjs/feathers'; import { Request } from 'express'; +import * as self from '@feathersjs/authentication-jwt'; -export default function feathersAuthenticationJwt(options?: FeathersAuthenticationJWTOptions): () => void; +declare const feathersAuthenticationJwt: ((options?: FeathersAuthenticationJWTOptions) => () => void) & typeof self; +export default feathersAuthenticationJwt; export interface FeathersAuthenticationJWTOptions { /** diff --git a/types/feathersjs__authentication-local/index.d.ts b/types/feathersjs__authentication-local/index.d.ts index e935419263..e15b101258 100644 --- a/types/feathersjs__authentication-local/index.d.ts +++ b/types/feathersjs__authentication-local/index.d.ts @@ -10,8 +10,10 @@ import { Paginated } from '@feathersjs/feathers'; import { Request } from 'express'; +import * as self from '@feathersjs/authentication-local'; -export default function feathersAuthenticationLocal(options?: FeathersAuthenticationLocalOptions): () => void; +declare const feathersAuthenticationLocal: ((options?: FeathersAuthenticationLocalOptions) => () => void) & typeof self; +export default feathersAuthenticationLocal; export interface FeathersAuthenticationLocalOptions { /** diff --git a/types/feathersjs__authentication-oauth1/index.d.ts b/types/feathersjs__authentication-oauth1/index.d.ts index eee59fd64a..fa993c1cd0 100644 --- a/types/feathersjs__authentication-oauth1/index.d.ts +++ b/types/feathersjs__authentication-oauth1/index.d.ts @@ -9,8 +9,10 @@ import { Paginated } from '@feathersjs/feathers'; import { Request } from 'express'; +import * as self from '@feathersjs/authentication-oauth1'; -export default function feathersAuthenticationOAuth1(options?: FeathersAuthenticationOAuth1Options): () => void; +declare const feathersAuthenticationOAuth1: ((options?: FeathersAuthenticationOAuth1Options) => () => void) & typeof self; +export default feathersAuthenticationOAuth1; export interface FeathersAuthenticationOAuth1Options { /** diff --git a/types/feathersjs__authentication-oauth2/index.d.ts b/types/feathersjs__authentication-oauth2/index.d.ts index fbce7514cd..3037c1c47a 100644 --- a/types/feathersjs__authentication-oauth2/index.d.ts +++ b/types/feathersjs__authentication-oauth2/index.d.ts @@ -9,8 +9,10 @@ import { Paginated } from '@feathersjs/feathers'; import { Request } from 'express'; +import * as self from '@feathersjs/authentication-oauth2'; -export default function feathersAuthenticationOAuth2(options?: FeathersAuthenticationOAuth2Options): () => void; +declare const feathersAuthenticationOAuth2: ((options?: FeathersAuthenticationOAuth2Options) => () => void) & typeof self; +export default feathersAuthenticationOAuth2; export interface FeathersAuthenticationOAuth2Options { /** diff --git a/types/feathersjs__authentication/index.d.ts b/types/feathersjs__authentication/index.d.ts index 3a4722f12e..f451b0deda 100644 --- a/types/feathersjs__authentication/index.d.ts +++ b/types/feathersjs__authentication/index.d.ts @@ -4,8 +4,10 @@ // Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript import { Hook } from '@feathersjs/feathers'; +import * as self from '@feathersjs/authentication'; -export default function feathersAuthentication(config?: FeathersAuthenticationOptions): () => void; +declare const feathersAuthentication: ((config?: FeathersAuthenticationOptions) => () => void) & typeof self; +export default feathersAuthentication; export const hooks: AuthHooks.Hooks; diff --git a/types/feathersjs__express/feathersjs__express-tests.ts b/types/feathersjs__express/feathersjs__express-tests.ts index 687191d0c6..1bd1f5221a 100644 --- a/types/feathersjs__express/feathersjs__express-tests.ts +++ b/types/feathersjs__express/feathersjs__express-tests.ts @@ -1,8 +1,11 @@ import feathers, { Application } from '@feathersjs/feathers'; -import feathersExpress, { original, rest, notFound, errorHandler } from '@feathersjs/express'; +import feathersExpress, * as express from '@feathersjs/express'; const app = feathersExpress(feathers()); -app.configure(rest()); -app.use(notFound()); -app.use(errorHandler()); +app.use(express.json()); +app.use(express.urlencoded({ extended: true })); +app.use('/', express.static('./public')); +app.configure(express.rest()); +app.use(express.notFound()); +app.use(express.errorHandler({ logger: console })); diff --git a/types/feathersjs__express/index.d.ts b/types/feathersjs__express/index.d.ts index f50203432f..4dfaa0f8ee 100644 --- a/types/feathersjs__express/index.d.ts +++ b/types/feathersjs__express/index.d.ts @@ -1,19 +1,28 @@ // Type definitions for @feathersjs/express 1.1 // Project: http://feathersjs.com/ // Definitions by: Jan Lohage +// Aleksey Klimenko // Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript // TypeScript Version: 2.3 import { Application as FeathersApplication } from '@feathersjs/feathers'; import * as express from 'express'; +import * as self from '@feathersjs/express'; -export default function feathersExpress(app: FeathersApplication): Application; +declare const feathersExpress: ((app: FeathersApplication) => Application) & typeof self; +export default feathersExpress; export type Application = express.Application & FeathersApplication; -export function errorHandler(options?: any): express.ErrorRequestHandler; +export function errorHandler(options?: { + public?: string, + logger?: { error?: (msg: string) => void }, + html?: any, + json?: any, +}): express.ErrorRequestHandler; export function notFound(): express.RequestHandler; + export const rest: { - (): () => void; + (handler?: express.RequestHandler): () => void; formatter: express.RequestHandler; }; diff --git a/types/feathersjs__feathers/index.d.ts b/types/feathersjs__feathers/index.d.ts index 6ae7b22238..c0fa3d9946 100644 --- a/types/feathersjs__feathers/index.d.ts +++ b/types/feathersjs__feathers/index.d.ts @@ -8,8 +8,10 @@ /// import { EventEmitter } from 'events'; +import * as self from '@feathersjs/feathers'; -export default function feathers(): Application; +declare const feathers: (() => Application) & typeof self; +export default feathers; export const version: string; diff --git a/types/find-root/index.d.ts b/types/find-root/index.d.ts index b2fe6f572a..050781eacf 100644 --- a/types/find-root/index.d.ts +++ b/types/find-root/index.d.ts @@ -10,7 +10,7 @@ type FindRootCheckFn = (dir: string) => boolean; /** * Returns the path for the nearest directory to startingPath containing a package.json file. If a check function is * provided, then this will return the nearest directory for which the function returns true. - * @param startingPath The path to start searching form, e.g. __dirname + * @param startingPath The path to start searching from, e.g. __dirname * @param check The check predicate * @throws {Error} if package.json cannot be found or if the function never returns true */ diff --git a/types/focus-within/index.d.ts b/types/focus-within/index.d.ts new file mode 100644 index 0000000000..4a8778fe05 --- /dev/null +++ b/types/focus-within/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for focus-within 1.0 +// Project: https://github.com/jonathantneal/focus-within#readme +// Definitions by: Damien Erambert +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace focusWithin { + interface FocusWithinOpts { + attr?: boolean; + className?: string; + } +} + +declare function focusWithin(document: HTMLDocument, opts?: focusWithin.FocusWithinOpts): void; + +export as namespace focusWithin; +export = focusWithin; diff --git a/types/focus-within/test/focus-within-global-tests.ts b/types/focus-within/test/focus-within-global-tests.ts new file mode 100644 index 0000000000..51ddc6aad5 --- /dev/null +++ b/types/focus-within/test/focus-within-global-tests.ts @@ -0,0 +1,10 @@ +/* + * This file tests the typings of the global export of `focus-within` + */ + +focusWithin(document); + +focusWithin(document, { + attr: false, + className: 'foo' +}); diff --git a/types/focus-within/test/focus-within-import-default-tests.ts b/types/focus-within/test/focus-within-import-default-tests.ts new file mode 100644 index 0000000000..627dce9660 --- /dev/null +++ b/types/focus-within/test/focus-within-import-default-tests.ts @@ -0,0 +1,11 @@ +/* + * This file tests the typings of the default export of `focus-within` + */ +import focusWithin = require("focus-within"); + +focusWithin(document); + +focusWithin(document, { + attr: false, + className: 'foo' +}); diff --git a/types/focus-within/tsconfig.json b/types/focus-within/tsconfig.json new file mode 100644 index 0000000000..976335025f --- /dev/null +++ b/types/focus-within/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "test/focus-within-global-tests.ts", + "test/focus-within-import-default-tests.ts" + ] +} diff --git a/types/focus-within/tslint.json b/types/focus-within/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/focus-within/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/formidable/index.d.ts b/types/formidable/index.d.ts index 8163fa5894..da5c730ae8 100644 --- a/types/formidable/index.d.ts +++ b/types/formidable/index.d.ts @@ -14,6 +14,7 @@ export declare class IncomingForm extends events.EventEmitter { encoding: string; uploadDir: string; keepExtensions: boolean; + maxFileSize: number; maxFieldsSize: number; maxFields: number; hash: string | boolean; diff --git a/types/fs-extra/fs-extra-tests.ts b/types/fs-extra/fs-extra-tests.ts index 50d594e1a4..dbe48cf971 100644 --- a/types/fs-extra/fs-extra-tests.ts +++ b/types/fs-extra/fs-extra-tests.ts @@ -48,7 +48,7 @@ fs.copy(src, dest, { overwrite: true, preserveTimestamps: true, - filter: (src: string, dest: string) => false + filter: (src: string, dest: string) => Promise.resolve(false) }, errorCallback ); diff --git a/types/fs-extra/index.d.ts b/types/fs-extra/index.d.ts index 6183dce393..adf236955b 100644 --- a/types/fs-extra/index.d.ts +++ b/types/fs-extra/index.d.ts @@ -3,7 +3,8 @@ // Definitions by: Alan Agius , // midknight41 , // Brendan Forster , -// Mees van Dijk +// Mees van Dijk , +// Justin Rockwood // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -16,7 +17,7 @@ export * from "fs"; export function copy(src: string, dest: string, options?: CopyOptions): Promise; 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 copySync(src: string, dest: string, options?: CopyOptionsSync): void; export function move(src: string, dest: string, options?: MoveOptions): Promise; export function move(src: string, dest: string, callback: (err: Error) => void): void; @@ -254,7 +255,8 @@ export interface PathEntryStream { read(): PathEntry | null; } -export type CopyFilter = (src: string, dest: string) => boolean; +export type CopyFilterSync = (src: string, dest: string) => boolean; +export type CopyFilterAsync = (src: string, dest: string) => Promise; export type SymlinkType = "dir" | "file"; @@ -263,10 +265,14 @@ export interface CopyOptions { overwrite?: boolean; preserveTimestamps?: boolean; errorOnExist?: boolean; - filter?: CopyFilter; + filter?: CopyFilterSync | CopyFilterAsync; recursive?: boolean; } +export interface CopyOptionsSync extends CopyOptions { + filter?: CopyFilterSync; +} + export interface MoveOptions { overwrite?: boolean; limit?: number; diff --git a/types/gapi.client.drive/gapi.client.drive-tests.ts b/types/gapi.client.drive/gapi.client.drive-tests.ts index f9fa0ce332..002b5e7eb6 100644 --- a/types/gapi.client.drive/gapi.client.drive-tests.ts +++ b/types/gapi.client.drive/gapi.client.drive-tests.ts @@ -43,15 +43,15 @@ gapi.load('client', () => { async function run() { /** Gets information about the user, the user's Drive, and system capabilities. */ - await gapi.client.about.get({ + await gapi.client.drive.about.get({ }); /** Gets the starting pageToken for listing future changes. */ - await gapi.client.changes.getStartPageToken({ + await gapi.client.drive.changes.getStartPageToken({ supportsTeamDrives: true, teamDriveId: "teamDriveId", }); /** Lists the changes for a user or Team Drive. */ - await gapi.client.changes.list({ + await gapi.client.drive.changes.list({ includeCorpusRemovals: true, includeRemoved: true, includeTeamDriveItems: true, @@ -63,7 +63,7 @@ gapi.load('client', () => { teamDriveId: "teamDriveId", }); /** Subscribes to changes for a user. */ - await gapi.client.changes.watch({ + await gapi.client.drive.changes.watch({ includeCorpusRemovals: true, includeRemoved: true, includeTeamDriveItems: true, @@ -75,25 +75,25 @@ gapi.load('client', () => { teamDriveId: "teamDriveId", }); /** Stop watching resources through this channel */ - await gapi.client.channels.stop({ + await gapi.client.drive.channels.stop({ }); /** Creates a new comment on a file. */ - await gapi.client.comments.create({ + await gapi.client.drive.comments.create({ fileId: "fileId", }); /** Deletes a comment. */ - await gapi.client.comments.delete({ + await gapi.client.drive.comments.delete({ commentId: "commentId", fileId: "fileId", }); /** Gets a comment by ID. */ - await gapi.client.comments.get({ + await gapi.client.drive.comments.get({ commentId: "commentId", fileId: "fileId", includeDeleted: true, }); /** Lists a file's comments. */ - await gapi.client.comments.list({ + await gapi.client.drive.comments.list({ fileId: "fileId", includeDeleted: true, pageSize: 3, @@ -101,12 +101,12 @@ gapi.load('client', () => { startModifiedTime: "startModifiedTime", }); /** Updates a comment with patch semantics. */ - await gapi.client.comments.update({ + await gapi.client.drive.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({ + await gapi.client.drive.files.copy({ fileId: "fileId", ignoreDefaultVisibility: true, keepRevisionForever: true, @@ -114,7 +114,7 @@ gapi.load('client', () => { supportsTeamDrives: true, }); /** Creates a new file. */ - await gapi.client.files.create({ + await gapi.client.drive.files.create({ ignoreDefaultVisibility: true, keepRevisionForever: true, ocrLanguage: "ocrLanguage", @@ -125,31 +125,31 @@ gapi.load('client', () => { * 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({ + await gapi.client.drive.files.delete({ fileId: "fileId", supportsTeamDrives: true, }); /** Permanently deletes all of the user's trashed files. */ - await gapi.client.files.emptyTrash({ + await gapi.client.drive.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({ + await gapi.client.drive.files.export({ fileId: "fileId", mimeType: "mimeType", }); /** Generates a set of file IDs which can be provided in create requests. */ - await gapi.client.files.generateIds({ + await gapi.client.drive.files.generateIds({ count: 1, space: "space", }); /** Gets a file's metadata or content by ID. */ - await gapi.client.files.get({ + await gapi.client.drive.files.get({ acknowledgeAbuse: true, fileId: "fileId", supportsTeamDrives: true, }); /** Lists or searches files. */ - await gapi.client.files.list({ + await gapi.client.drive.files.list({ corpora: "corpora", corpus: "corpus", includeTeamDriveItems: true, @@ -162,7 +162,7 @@ gapi.load('client', () => { teamDriveId: "teamDriveId", }); /** Updates a file's metadata and/or content with patch semantics. */ - await gapi.client.files.update({ + await gapi.client.drive.files.update({ addParents: "addParents", fileId: "fileId", keepRevisionForever: true, @@ -172,66 +172,71 @@ gapi.load('client', () => { useContentAsIndexableText: true, }); /** Subscribes to changes to a file */ - await gapi.client.files.watch({ + await gapi.client.drive.files.watch({ acknowledgeAbuse: true, fileId: "fileId", supportsTeamDrives: true, }); /** Creates a permission for a file or Team Drive. */ - await gapi.client.permissions.create({ + await gapi.client.drive.permissions.create({ emailMessage: "emailMessage", fileId: "fileId", sendNotificationEmail: true, supportsTeamDrives: true, transferOwnership: true, + useDomainAdminAccess: true, }); /** Deletes a permission. */ - await gapi.client.permissions.delete({ + await gapi.client.drive.permissions.delete({ fileId: "fileId", permissionId: "permissionId", supportsTeamDrives: true, + useDomainAdminAccess: true, }); /** Gets a permission by ID. */ - await gapi.client.permissions.get({ + await gapi.client.drive.permissions.get({ fileId: "fileId", permissionId: "permissionId", supportsTeamDrives: true, + useDomainAdminAccess: true, }); /** Lists a file's or Team Drive's permissions. */ - await gapi.client.permissions.list({ + await gapi.client.drive.permissions.list({ fileId: "fileId", pageSize: 2, pageToken: "pageToken", supportsTeamDrives: true, + useDomainAdminAccess: true, }); /** Updates a permission with patch semantics. */ - await gapi.client.permissions.update({ + await gapi.client.drive.permissions.update({ fileId: "fileId", permissionId: "permissionId", removeExpiration: true, supportsTeamDrives: true, transferOwnership: true, + useDomainAdminAccess: true, }); /** Creates a new reply to a comment. */ - await gapi.client.replies.create({ + await gapi.client.drive.replies.create({ commentId: "commentId", fileId: "fileId", }); /** Deletes a reply. */ - await gapi.client.replies.delete({ + await gapi.client.drive.replies.delete({ commentId: "commentId", fileId: "fileId", replyId: "replyId", }); /** Gets a reply by ID. */ - await gapi.client.replies.get({ + await gapi.client.drive.replies.get({ commentId: "commentId", fileId: "fileId", includeDeleted: true, replyId: "replyId", }); /** Lists a comment's replies. */ - await gapi.client.replies.list({ + await gapi.client.drive.replies.list({ commentId: "commentId", fileId: "fileId", includeDeleted: true, @@ -239,52 +244,55 @@ gapi.load('client', () => { pageToken: "pageToken", }); /** Updates a reply with patch semantics. */ - await gapi.client.replies.update({ + await gapi.client.drive.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({ + await gapi.client.drive.revisions.delete({ fileId: "fileId", revisionId: "revisionId", }); /** Gets a revision's metadata or content by ID. */ - await gapi.client.revisions.get({ + await gapi.client.drive.revisions.get({ acknowledgeAbuse: true, fileId: "fileId", revisionId: "revisionId", }); /** Lists a file's revisions. */ - await gapi.client.revisions.list({ + await gapi.client.drive.revisions.list({ fileId: "fileId", pageSize: 2, pageToken: "pageToken", }); /** Updates a revision with patch semantics. */ - await gapi.client.revisions.update({ + await gapi.client.drive.revisions.update({ fileId: "fileId", revisionId: "revisionId", }); /** Creates a new Team Drive. */ - await gapi.client.teamdrives.create({ + await gapi.client.drive.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({ + await gapi.client.drive.teamdrives.delete({ teamDriveId: "teamDriveId", }); /** Gets a Team Drive's metadata by ID. */ - await gapi.client.teamdrives.get({ + await gapi.client.drive.teamdrives.get({ teamDriveId: "teamDriveId", + useDomainAdminAccess: true, }); /** Lists the user's Team Drives. */ - await gapi.client.teamdrives.list({ + await gapi.client.drive.teamdrives.list({ pageSize: 1, pageToken: "pageToken", + q: "q", + useDomainAdminAccess: true, }); /** Updates a Team Drive's metadata */ - await gapi.client.teamdrives.update({ + await gapi.client.drive.teamdrives.update({ teamDriveId: "teamDriveId", }); } diff --git a/types/gapi.client.drive/index.d.ts b/types/gapi.client.drive/index.d.ts index 7004e2c0bb..1b2a939a7d 100644 --- a/types/gapi.client.drive/index.d.ts +++ b/types/gapi.client.drive/index.d.ts @@ -16,28 +16,12 @@ declare namespace gapi.client { 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; + /** Whether the user can create Team Drives. */ + canCreateTeamDrives?: 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. */ @@ -363,8 +347,9 @@ declare namespace gapi.client { 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. + * If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy + * request, the file will inherit any discoverable parents of the source file. Update requests must use the addParents and removeParents parameters to + * modify the parents list. */ parents?: string[]; /** List of permission IDs for users with access to this file. */ @@ -683,6 +668,8 @@ declare namespace gapi.client { }; /** 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 time at which the Team Drive was created (RFC 3339 date-time). */ + createdTime?: 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". */ @@ -1322,7 +1309,7 @@ declare namespace gapi.client { create(request: { /** Data format for the response. */ alt?: string; - /** A custom message to include in the notification email. */ + /** A plain text custom message to include in the notification email. */ emailMessage?: string; /** Selector specifying which fields to include in a partial response. */ fields?: string; @@ -1351,6 +1338,11 @@ declare namespace gapi.client { * the side effect. */ transferOwnership?: boolean; + /** + * Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they + * are an administrator of the domain to which the item belongs. + */ + useDomainAdminAccess?: boolean; /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ userIp?: string; }): Request; @@ -1377,6 +1369,11 @@ declare namespace gapi.client { quotaUser?: string; /** Whether the requesting application supports Team Drives. */ supportsTeamDrives?: boolean; + /** + * Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they + * are an administrator of the domain to which the item belongs. + */ + useDomainAdminAccess?: boolean; /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ userIp?: string; }): Request; @@ -1403,6 +1400,11 @@ declare namespace gapi.client { quotaUser?: string; /** Whether the requesting application supports Team Drives. */ supportsTeamDrives?: boolean; + /** + * Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they + * are an administrator of the domain to which the item belongs. + */ + useDomainAdminAccess?: boolean; /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ userIp?: string; }): Request; @@ -1434,6 +1436,11 @@ declare namespace gapi.client { quotaUser?: string; /** Whether the requesting application supports Team Drives. */ supportsTeamDrives?: boolean; + /** + * Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they + * are an administrator of the domain to which the item belongs. + */ + useDomainAdminAccess?: boolean; /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ userIp?: string; }): Request; @@ -1467,6 +1474,11 @@ declare namespace gapi.client { * the side effect. */ transferOwnership?: boolean; + /** + * Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they + * are an administrator of the domain to which the item belongs. + */ + useDomainAdminAccess?: boolean; /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ userIp?: string; }): Request; @@ -1777,6 +1789,11 @@ declare namespace gapi.client { quotaUser?: string; /** The ID of the Team Drive */ teamDriveId: string; + /** + * Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they + * are an administrator of the domain to which the Team Drive belongs. + */ + useDomainAdminAccess?: boolean; /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ userIp?: string; }): Request; @@ -1796,11 +1813,18 @@ declare namespace gapi.client { pageToken?: string; /** Returns response with indentations and line breaks. */ prettyPrint?: boolean; + /** Query string for searching Team Drives. */ + 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; + /** + * Whether the request should be treated as if it was issued by a domain administrator; if set to true, then all Team Drives of the domain in which the + * requester is an administrator are returned. + */ + useDomainAdminAccess?: boolean; /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ userIp?: string; }): Request; @@ -1827,5 +1851,23 @@ declare namespace gapi.client { userIp?: string; }): Request; } + + const about: AboutResource; + + const changes: ChangesResource; + + const channels: ChannelsResource; + + const comments: CommentsResource; + + const files: FilesResource; + + const permissions: PermissionsResource; + + const replies: RepliesResource; + + const revisions: RevisionsResource; + + const teamdrives: TeamdrivesResource; } } diff --git a/types/gapi.client.drive/tsconfig.json b/types/gapi.client.drive/tsconfig.json index 0cdc6f7fab..6d5901b410 100644 --- a/types/gapi.client.drive/tsconfig.json +++ b/types/gapi.client.drive/tsconfig.json @@ -14,7 +14,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gitlab/ApiBase.d.ts b/types/gitlab/ApiBase.d.ts new file mode 100644 index 0000000000..7187ce4352 --- /dev/null +++ b/types/gitlab/ApiBase.d.ts @@ -0,0 +1,31 @@ +import { ApiBaseOptions } from './ApiBase'; +import { Labels } from './Models/Labels'; +import { Users } from './Models/Users'; +import { Notes } from './Models/Notes'; +import { Issues } from './Models/Issues'; +import { Projects } from './Models/Projects'; +import { Groups } from './Models/Groups'; + +export interface ApiBaseOptions { + url?: string; + token?: string; + oauth_token?: string; + base_url?: string; + auth?: any; + [key: string]: any; +} + +export class ApiBase { + constructor(options: ApiBaseOptions); + readonly client: this; + readonly groups: Groups + readonly projects: Projects + readonly issues: Issues + readonly notes: Notes + readonly users: Users + readonly labels: Labels + options: ApiBaseOptions; + + handleOptions(): void; + init(): object; +} diff --git a/types/gitlab/ApiBaseHTTP.d.ts b/types/gitlab/ApiBaseHTTP.d.ts new file mode 100644 index 0000000000..7ed5fb0d69 --- /dev/null +++ b/types/gitlab/ApiBaseHTTP.d.ts @@ -0,0 +1,12 @@ +import { ApiBase } from './ApiBase'; + +export class ApiBaseHTTP extends ApiBase { + prepare_opts(opts: T): T; + fn_wrapper(fn: T): T; + get(path: string, fn?: Function): any; + get(path: string, query?: object, fn?: Function): any; + delete(path: string, fn?: Function): any; + post(path: string, data?: object, fn?: Function): any; + put(path: string, data?: object, fn?: Function): any; + patch(path: string, data?: object, fn?: Function): any; +} diff --git a/types/gitlab/ApiV3.d.ts b/types/gitlab/ApiV3.d.ts new file mode 100644 index 0000000000..bd3d02557b --- /dev/null +++ b/types/gitlab/ApiV3.d.ts @@ -0,0 +1,5 @@ +import { ApiBaseHTTP } from './ApiBaseHTTP'; + +export class ApiV3 extends ApiBaseHTTP { + +} diff --git a/types/gitlab/BaseModel.d.ts b/types/gitlab/BaseModel.d.ts new file mode 100644 index 0000000000..ca6eb4e7c6 --- /dev/null +++ b/types/gitlab/BaseModel.d.ts @@ -0,0 +1,17 @@ +export class BaseModel { + load(model: string): object; + get(path: string, fn?: Function): any; + get(path: string, query?: object, fn?: Function): any; + delete(path: string, fn?: Function): any; + post(path: string, data?: object, fn?: Function): any; + put(path: string, data?: object, fn?: Function): any; + patch(path: string, data?: object, fn?: Function): any; +} + +export interface DefParams { + page?: number; + per_page?: number; + [key: string]: any; +} + +export type TId = number | string; diff --git a/types/gitlab/Models/Groups.d.ts b/types/gitlab/Models/Groups.d.ts new file mode 100644 index 0000000000..1b528039f0 --- /dev/null +++ b/types/gitlab/Models/Groups.d.ts @@ -0,0 +1,27 @@ +import { BaseModel, DefParams } from "../BaseModel"; + +interface IAccessLevels { + GUEST: number + REPORTER: number + DEVELOPER: number + MASTER: number + OWNER: number +} + +export class Groups extends BaseModel { + readonly access_levels: IAccessLevels; + + init(): object; + all(fn?: Function): any; + all(params?: DefParams, fn?: Function): any; + show(groupId: number, fn?: Function): any; + listProjects(groupId: number, fn?: Function): any; + listMembers(groupId: number, fn?: Function): any; + addMember(groupId: number, userId: number, accessLevel: IAccessLevels[keyof IAccessLevels], fn?: Function): any; + editMember(groupId: number, userId: number, accessLevel: IAccessLevels[keyof IAccessLevels], fn?: Function): any; + removeMember(groupId: number, userId: number, fn?: Function): any; + create(params?: object, fn?: Function): any; + addProject(groupId: number, projectId: number, fn?: Function): any; + deleteGroup(groupId: number, fn?: Function): any; + search(nameOrPath: string, fn?: Function): any; +} diff --git a/types/gitlab/Models/IssueNotes.d.ts b/types/gitlab/Models/IssueNotes.d.ts new file mode 100644 index 0000000000..de1821b1df --- /dev/null +++ b/types/gitlab/Models/IssueNotes.d.ts @@ -0,0 +1,6 @@ +import { BaseModel, TId, DefParams } from '../BaseModel'; + +export class IssueNotes extends BaseModel{ + all(projectId: TId, issueId: number, fn?: Function): any + all(projectId: TId, issueId: number, params?: DefParams, fn?: Function): any +} diff --git a/types/gitlab/Models/Issues.d.ts b/types/gitlab/Models/Issues.d.ts new file mode 100644 index 0000000000..e751b6a002 --- /dev/null +++ b/types/gitlab/Models/Issues.d.ts @@ -0,0 +1,12 @@ +import { BaseModel, TId } from '../BaseModel'; + +export class Issues extends BaseModel { + all(fn?: Function): any; + all(params?: object, fn?: Function): any; + show(projectId: TId, issueId: TId, fn?: Function): any; + create(projectId: TId, params?: object, fn?: Function): any; + edit(projectId: TId, issueId: TId, params?: object, fn?: Function): any; + remove(projectId: TId, issueId: TId, fn?: Function): any; + subscribe(projectId: TId, issueId: TId, params?: object, fn?: Function): any; + unsubscribe(projectId: TId, issueId: TId, fn?: Function): any; +} diff --git a/types/gitlab/Models/Labels.d.ts b/types/gitlab/Models/Labels.d.ts new file mode 100644 index 0000000000..63f1110b4d --- /dev/null +++ b/types/gitlab/Models/Labels.d.ts @@ -0,0 +1,5 @@ +import { BaseModel, TId } from '../BaseModel'; + +export class Labels extends BaseModel { + create(projectId: TId, params?: object, fn?: Function): any; +} diff --git a/types/gitlab/Models/Notes.d.ts b/types/gitlab/Models/Notes.d.ts new file mode 100644 index 0000000000..95b9cd623e --- /dev/null +++ b/types/gitlab/Models/Notes.d.ts @@ -0,0 +1,5 @@ +import { BaseModel, TId } from '../BaseModel'; + +export class Notes extends BaseModel { + create(projectId: TId, issueId: number, params?: object, fn?: Function): any; +} diff --git a/types/gitlab/Models/Pipelines.d.ts b/types/gitlab/Models/Pipelines.d.ts new file mode 100644 index 0000000000..f65a9e7d25 --- /dev/null +++ b/types/gitlab/Models/Pipelines.d.ts @@ -0,0 +1,5 @@ +import { BaseModel, TId } from '../BaseModel'; + +export class Pipelines extends BaseModel { + all(projectId: TId, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectBuilds.d.ts b/types/gitlab/Models/ProjectBuilds.d.ts new file mode 100644 index 0000000000..df7c33c32a --- /dev/null +++ b/types/gitlab/Models/ProjectBuilds.d.ts @@ -0,0 +1,13 @@ +import { BaseModel, TId, DefParams } from '../BaseModel'; + +interface IShowBuildParam { + projectId: TId; + [key: string]: any; +} + +export class ProjectBuilds extends BaseModel { + listBuilds(projectId: TId, fn?: Function): any; + listBuilds(projectId: TId, params?: DefParams, fn?: Function): any; + showBuild(projectId: TId, buildId: string, fn?: Function): any; + triggerBuild(params?: IShowBuildParam, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectDeployKeys.d.ts b/types/gitlab/Models/ProjectDeployKeys.d.ts new file mode 100644 index 0000000000..3be9d66bc4 --- /dev/null +++ b/types/gitlab/Models/ProjectDeployKeys.d.ts @@ -0,0 +1,7 @@ +import { BaseModel, TId } from '../BaseModel'; + +export class ProjectKeys extends BaseModel { + listKeys(projectId: TId, fn?: Function): any; + getKey(projectId: TId, keyId: number, fn?: Function): any; + addKey(projectId: TId, params?: object, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectHooks.d.ts b/types/gitlab/Models/ProjectHooks.d.ts new file mode 100644 index 0000000000..ce0878eec9 --- /dev/null +++ b/types/gitlab/Models/ProjectHooks.d.ts @@ -0,0 +1,16 @@ +import { BaseModel, TId } from '../BaseModel'; + +interface IAddParam { + url: string; + [key: string]: any; +} + +type HooksCb = (hooks: any[]) => any; + +export class ProjectHooks extends BaseModel { + list(projectId: TId, fn?: HooksCb): any; + show(projectId: TId, hookId: number, fn?: Function): any; + add(projectId: TId, params: IAddParam | string, fn?: Function): any; + update(projectId: TId, hookId: number, url: string, fn?: Function): any; + remove(projectId: TId, hookId: number, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectIssues.d.ts b/types/gitlab/Models/ProjectIssues.d.ts new file mode 100644 index 0000000000..8f7fc439a6 --- /dev/null +++ b/types/gitlab/Models/ProjectIssues.d.ts @@ -0,0 +1,9 @@ +import { IssueNotes } from './IssueNotes'; +import { BaseModel, TId, DefParams } from '../BaseModel'; + +export class ProjectIssues extends BaseModel { + readonly notes: IssueNotes; + + list(projectId: TId, fn?: Function): any; + list(projectId: TId, params?: DefParams, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectLabels.d.ts b/types/gitlab/Models/ProjectLabels.d.ts new file mode 100644 index 0000000000..2f6ca1dabc --- /dev/null +++ b/types/gitlab/Models/ProjectLabels.d.ts @@ -0,0 +1,6 @@ +import { BaseModel, TId, DefParams } from '../BaseModel'; + +export class ProjectLabels extends BaseModel { + all(projectId: TId, fn?: Function): any; + all(projectId: TId, params?: DefParams, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectMembers.d.ts b/types/gitlab/Models/ProjectMembers.d.ts new file mode 100644 index 0000000000..25aa87332a --- /dev/null +++ b/types/gitlab/Models/ProjectMembers.d.ts @@ -0,0 +1,12 @@ +import { BaseModel, TId } from '../BaseModel'; + +type MenberCb = (menber: any) => any; +type MenbersCb = (menbers: any[]) => any; + +export class ProjectMembers extends BaseModel { + list(projectId: TId, fn?: MenbersCb): any; + show(projectId: TId, userId: number, fn?: MenberCb): any; + add(projectId: TId, userId: number, accessLevel: number,fn?: Function): any; + update(projectId: TId, userId: number, accessLevel: number, fn?: Function): any; + remove(projectId: TId, userId: number, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectMergeRequests.d.ts b/types/gitlab/Models/ProjectMergeRequests.d.ts new file mode 100644 index 0000000000..37b2ab33e6 --- /dev/null +++ b/types/gitlab/Models/ProjectMergeRequests.d.ts @@ -0,0 +1,11 @@ +import { BaseModel, TId, DefParams } from '../BaseModel'; + +export class ProjectMergeRequests extends BaseModel { + list(projectId: TId, fn?: Function): any; + list(projectId: TId, params?: DefParams, fn?: Function): any; + show(projectId: TId, mergerequestId: number, fn?: Function): any; + add(projectId: TId, sourceBranch: string, targetBranch: string, assigneeId: number, title: string, fn?: Function): any; + update(projectId: TId, mergerequestId: number, params: object, fn?: Function): any; + comment(projectId: TId, mergerequestId: number, note: any, fn?: Function): any; + merge(projectId: TId, mergerequestId: number, params: object, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectMilestones.d.ts b/types/gitlab/Models/ProjectMilestones.d.ts new file mode 100644 index 0000000000..d36d1c016a --- /dev/null +++ b/types/gitlab/Models/ProjectMilestones.d.ts @@ -0,0 +1,12 @@ +import { BaseModel, TId } from '../BaseModel'; + +type MilestonesCb = (milestones: any[]) => any; +type MilestoneCb = (milestones: any) => any; + +export class ProjectMilestones extends BaseModel { + list(projectId: TId, fn?: MilestonesCb): any; + all(projectId: TId, fn?: MilestonesCb): any; + show(projectId: TId, milestoneId: number, fn?: MilestoneCb): any; + add(projectId: TId, title: string, description: string, due_date: any, fn?: Function): any; + update(projectId: TId, milestoneId: number, title: string, description: string, due_date: any, state_event: any, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectRepository.d.ts b/types/gitlab/Models/ProjectRepository.d.ts new file mode 100644 index 0000000000..7bef1b6212 --- /dev/null +++ b/types/gitlab/Models/ProjectRepository.d.ts @@ -0,0 +1,39 @@ +import { BaseModel, TId } from '../BaseModel'; + +interface ShowFileParams { + file_path: string; + ref?: any; + file_id?: any; + [key: string]: any; +} + +interface AddTagParams { + id: TId; + tag_name: string; + ref: string; + message?: string; + release_description?: string; +} + +export class ProjectRepository extends BaseModel { + listBranches(projectId: TId, fn?: Function): any; + showBranch(projectId: TId, branchId: string, fn?: Function): any; + protectBranch(projectId: TId, branchId: string, params: object, fn?: Function): any; + unprotectBranch(projectId: TId, branchId: string, fn?: Function): any; + createBranch(params: object, fn?: Function): any; + deleteBranch(projectId: TId, branchId: string, fn?: Function): any; + addTag(params: AddTagParams, fn?: Function): any; + deleteTag(projectId: TId, tagName: string, fn?: Function): any; + showTag(projectId: TId, tagName: string, fn?: Function): any; + listTags(projectId: TId, fn?: Function): any; + listCommits(projectId: TId, fn?: Function): any; + showCommit(projectId: TId, sha: string, fn?: Function): any; + diffCommit(projectId: TId, sha: string, fn?: Function): any; + listTree(projectId: TId, fn?: Function): any; + listTree(projectId: TId, params?: object, fn?: Function): any; + showFile(projectId: TId, fn?: Function): any; + showFile(projectId: TId, params?: ShowFileParams, fn?: Function): any; + createFile(params?: object, fn?: Function): any; + updateFile(params?: object, fn?: Function): any; + compare(params?: object, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectServices.d.ts b/types/gitlab/Models/ProjectServices.d.ts new file mode 100644 index 0000000000..25c59ae400 --- /dev/null +++ b/types/gitlab/Models/ProjectServices.d.ts @@ -0,0 +1,9 @@ +import { BaseModel, TId } from './../BaseModel'; + +type ServiceCb = (service: any) => any; + +export class ProjectServices extends BaseModel { + show(projectId: TId, serviceName: string, fn?: ServiceCb): any; + update(projectId: TId, serviceName: string, params: object, fn?: ServiceCb): any; + remove(projectId: TId, serviceName: string, fn?: ServiceCb): any; +} diff --git a/types/gitlab/Models/Projects.d.ts b/types/gitlab/Models/Projects.d.ts new file mode 100644 index 0000000000..9ba8faa551 --- /dev/null +++ b/types/gitlab/Models/Projects.d.ts @@ -0,0 +1,55 @@ +import { Runners } from './Runners'; +import { Pipelines } from './Pipelines'; +import { ProjectBuilds } from './ProjectBuilds'; +import { ProjectMergeRequests } from './ProjectMergeRequests'; +import { ProjectKeys } from './ProjectDeployKeys'; +import { ProjectMilestones } from './ProjectMilestones'; +import { ProjectRepository } from './ProjectRepository'; +import { ProjectLabels } from './ProjectLabels'; +import { ProjectIssues } from './ProjectIssues'; +import { ProjectHooks } from './ProjectHooks'; +import { ProjectMembers } from './ProjectMembers'; +import { BaseModel, DefParams, TId } from '../BaseModel'; +import { ProjectServices } from './ProjectServices'; + +type ProjectsCb = (projects: any[]) => any; + +export class Projects extends BaseModel { + + readonly members: ProjectMembers; + readonly hooks: ProjectHooks; + readonly issues: ProjectIssues; + readonly labels: ProjectLabels; + readonly repository: ProjectRepository; + readonly milestones: ProjectMilestones; + readonly deploy_keys: ProjectKeys; + readonly merge_requests: ProjectMergeRequests; + readonly services: ProjectServices; + readonly builds: ProjectBuilds; + readonly pipelines: Pipelines; + readonly runners: Runners; + + + all(fn?: ProjectsCb): any; + all(params?: DefParams, fn?: ProjectsCb): any; + allAdmin(fn?: Function): any; + allAdmin(params?: DefParams, fn?: Function): any; + show(projectId: TId, fn?: Function): any; + create(params: object, fn?: Function): any; + create_for_user(params: object, fn?: Function): any; + edit(projectId: TId, params: object, fn?: Function): any; + addMember(params?: object, fn?: Function): any; + editMember(params?: object, fn?: Function): any; + listMembers(params?: object, fn?: Function): any; + listCommits(params?: object, fn?: Function): any; + listTags(params?: object, fn?: Function): any; + remove(projectId: TId, fn?: Function): any; + fork(params?: object, fn?: Function): any; + share(params?: object, fn?: Function): any; + search(projectName: string, fn?: Function): any; + search(projectName: string, params?: object, fn?: Function): any; + listTriggers(projectId: TId, fn?: Function): any; + showTrigger(projectId: TId, token: string, fn?: Function): any; + createTrigger(params?: object, fn?: Function): any; + removeTrigger(projectId: TId, token: string, fn?: Function): any; +} diff --git a/types/gitlab/Models/Runners.d.ts b/types/gitlab/Models/Runners.d.ts new file mode 100644 index 0000000000..1656fe0c5d --- /dev/null +++ b/types/gitlab/Models/Runners.d.ts @@ -0,0 +1,11 @@ +import { BaseModel, DefParams, TId } from '../BaseModel'; + +export class Runners extends BaseModel { + all(projectId?: TId, fn?: Function): any; + all(projectId?: TId, params?: object, fn?: Function): any; + show(runnerId: number, fn?: Function): any; + update(runnerId: number, attributes: any, fn?: Function): any; + remove(runnerId: number, projectId: any, enable: any, fn?: Function): any; + enable(projectId: TId, runnerId: number, fn?: Function): any; + disable(projectId: TId, runnerId: number, fn?: Function): any; +} diff --git a/types/gitlab/Models/UserKeys.d.ts b/types/gitlab/Models/UserKeys.d.ts new file mode 100644 index 0000000000..5182b5a2d1 --- /dev/null +++ b/types/gitlab/Models/UserKeys.d.ts @@ -0,0 +1,6 @@ +import { BaseModel, DefParams, TId } from '../BaseModel'; + +export class UserKeys extends BaseModel { + all(userId?: TId, fn?: Function): any; + addKey(userId: string, title: string, key: any, fn?: Function): any; +} diff --git a/types/gitlab/Models/Users.d.ts b/types/gitlab/Models/Users.d.ts new file mode 100644 index 0000000000..e4572ac659 --- /dev/null +++ b/types/gitlab/Models/Users.d.ts @@ -0,0 +1,17 @@ +import { BaseModel, DefParams, TId } from '../BaseModel'; +import { UserKeys } from './UserKeys'; + +type UsersCb = (users: any[]) => any; +type UserCb = (user: any) => any; + +export class Users extends BaseModel { + readonly keys: UserKeys; + + all(fn?: UsersCb): any; + all(params?: DefParams, fn?: UsersCb): any; + current(fn?: Function): any; + show(userId: number, fn?: UserCb): any; + create(params?: DefParams, fn?: Function): any; + session(email: string, password: string, fn?: Function): any; + search(emailOrUsername: string, fn?: Function): any; +} diff --git a/types/gitlab/gitlab-tests.ts b/types/gitlab/gitlab-tests.ts new file mode 100644 index 0000000000..00ab2c761e --- /dev/null +++ b/types/gitlab/gitlab-tests.ts @@ -0,0 +1,20 @@ +import * as lib from "gitlab"; + +const gitlab = lib({ + url: 'http://example.com', + token: 'abcdefghij123456' +}); + +const v3 = new lib.ApiV3({ }); + +// From README + +// Listing users +gitlab.users.all((users) => { }); + +// Listing projects +gitlab.projects.all((projects) => { }); + +// From examples/delet-service + +gitlab.projects.services.remove("pid", "name", (service) => { }); diff --git a/types/gitlab/index.d.ts b/types/gitlab/index.d.ts new file mode 100644 index 0000000000..1ff52505ee --- /dev/null +++ b/types/gitlab/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for gitlab 1.8 +// Project: https://github.com/node-gitlab/node-gitlab#readme +// Definitions by: sam +// AryloYeung +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { ApiV3 } from "./ApiV3"; +import { ApiBaseOptions } from "./ApiBase"; + +declare namespace Gitlib { + const ApiV3: new(options: ApiBaseOptions) => ApiV3; +} + +declare function Gitlib(options: ApiBaseOptions): ApiV3; + +export = Gitlib; diff --git a/types/gitlab/tsconfig.json b/types/gitlab/tsconfig.json new file mode 100644 index 0000000000..f1297faf67 --- /dev/null +++ b/types/gitlab/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", + "gitlab-tests.ts" + ] +} diff --git a/types/gitlab/tslint.json b/types/gitlab/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gitlab/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/glue/hapi-glue-test.ts b/types/glue/glue-tests.ts similarity index 90% rename from glue/hapi-glue-test.ts rename to types/glue/glue-tests.ts index 2d34fdb489..7ac309352c 100644 --- a/glue/hapi-glue-test.ts +++ b/types/glue/glue-tests.ts @@ -15,6 +15,6 @@ const manifest: Glue.Manifest = { } ] } -} +}; -Glue.compose(manifest); \ No newline at end of file +Glue.compose(manifest); diff --git a/types/glue/index.d.ts b/types/glue/index.d.ts new file mode 100644 index 0000000000..8e710d233a --- /dev/null +++ b/types/glue/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for glue 5.0 +// Project: https://github.com/hapijs/glue +// Definitions by: Gareth Parker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import { Server, ServerOptions } from "hapi"; + +export interface Options { + relativeTo: string; + preConnections?: (Server: Server, next: (err: any) => void) => void; + preRegister?: (Server: Server, next: (err: any) => void) => void; +} + +export interface Plugin { + plugin: string | { + register: string; + options?: any; + }; + options?: any; + routes?: any; +} + +export interface Manifest { + server: ServerOptions; + register?: { + plugins: Plugin[] + }; +} + +export function compose(manifest: Manifest, options?: Options): Server; diff --git a/glue/tsconfig.json b/types/glue/tsconfig.json similarity index 95% rename from glue/tsconfig.json rename to types/glue/tsconfig.json index f2d4fcee28..2d9b76b8f7 100644 --- a/glue/tsconfig.json +++ b/types/glue/tsconfig.json @@ -21,6 +21,6 @@ }, "files": [ "index.d.ts", - "hapi-glue-test.ts" + "glue-tests.ts" ] } \ No newline at end of file diff --git a/glue/tslint.json b/types/glue/tslint.json similarity index 100% rename from glue/tslint.json rename to types/glue/tslint.json diff --git a/types/google-map-react/index.d.ts b/types/google-map-react/index.d.ts index d0606f76fd..7f34a68cc4 100644 --- a/types/google-map-react/index.d.ts +++ b/types/google-map-react/index.d.ts @@ -47,10 +47,10 @@ export interface Maps { } export interface Bounds { - nw: number; - ne: number; - sw: number; - se: number; + nw: Coords; + ne: Coords; + sw: Coords; + se: Coords; } export interface Point { @@ -63,6 +63,11 @@ export interface Coords { lng: number; } +export interface Size { + width: number; + height: number; +} + export interface ClickEventValue extends Point, Coords { event: any; } @@ -72,6 +77,7 @@ export interface ChangeEventValue { zoom: number; bounds: Bounds; marginBounds: Bounds; + size: Size; } export interface Props { diff --git a/types/google.analytics/index.d.ts b/types/google.analytics/index.d.ts index b71fdef286..9f522b3b9b 100644 --- a/types/google.analytics/index.d.ts +++ b/types/google.analytics/index.d.ts @@ -525,6 +525,8 @@ declare namespace UniversalAnalytics { socialTarget?: string; some?: string; step?: boolean | number; + storage?: string; + storeGac?: boolean; tax?: string; timingCategory?: string; timingLabel?: string; diff --git a/types/google.picker/index.d.ts b/types/google.picker/index.d.ts index 851697cb32..b5fc91404d 100644 --- a/types/google.picker/index.d.ts +++ b/types/google.picker/index.d.ts @@ -47,6 +47,9 @@ declare namespace google { // ISO 639 language code. If the language is not supported, en-US is used. This method provides an alternative to setting the locale at google.load() time. See the Developer's Guide for a list of supported locales. setLocale(locale:string):PickerBuilder; + // Sets the maximum number of items a user can pick. + setMaxItems(max: number):PickerBuilder; + // Sets an OAuth token to use for authenticating the current user. Depending on the scope of the token, only certain views will display data. Valid scopes are Google Docs, Drive, Photos, YouTube. setOAuthToken(token:string):PickerBuilder; diff --git a/types/googlepay/googlepay-tests.ts b/types/googlepay/googlepay-tests.ts new file mode 100644 index 0000000000..ea97c2a586 --- /dev/null +++ b/types/googlepay/googlepay-tests.ts @@ -0,0 +1,68 @@ +const allowedPaymentMethods = new Array('CARD', 'TOKENIZED_CARD'); + +const allowedCardNetworks = new Array('AMEX', 'DISCOVER', 'JCB', 'MASTERCARD', 'VISA'); + +const tokenizationParameters: google.payments.api.PaymentMethodTokenizationParameters = { + tokenizationType: 'PAYMENT_GATEWAY', + parameters: { + gateway: 'example', + gatewayMerchantId: 'abc123' + } +}; + +const getGooglePaymentsClient = (env?: google.payments.api.EnvironmentType) => new google.payments.api.PaymentsClient({environment: env}); + +function onGooglePayLoaded() { + const client = getGooglePaymentsClient(); + + client.isReadyToPay({allowedPaymentMethods}).then(response => { + if (response.result) { + addGooglePayButton(); + prefetchGooglePaymentData(); + } + }).catch(err => { + console.error(err); + }); +} + +function addGooglePayButton() { + const button = document.createElement('button'); + button.className = 'google-pay'; + button.appendChild(document.createTextNode('Google Pay')); + button.addEventListener('click', onGooglePaymentButtonClick); + document.appendChild(document.createElement('div').appendChild(button)); +} + +function getGooglePaymentDataConfiguration(): google.payments.api.PaymentDataRequest { + return { + merchantId: '01234567890123456789', + transactionInfo: { + totalPriceStatus: 'FINAL', + totalPrice: '123.45', + currencyCode: 'USD' + }, + paymentMethodTokenizationParameters: tokenizationParameters, + allowedPaymentMethods, + cardRequirements: { + allowedCardNetworks, + billingAddressRequired: true, + billingAddressFormat: 'FULL' + }, + phoneNumberRequired: false, + shippingAddressRequired: true + }; +} + +function prefetchGooglePaymentData() { + const client = getGooglePaymentsClient(); + client.prefetchPaymentData(getGooglePaymentDataConfiguration()); +} + +function onGooglePaymentButtonClick() { + const request = getGooglePaymentDataConfiguration(); + const client = getGooglePaymentsClient(); + + client.loadPaymentData(request) + .then(data => console.log(data)) + .catch(err => console.error(err)); +} diff --git a/types/googlepay/index.d.ts b/types/googlepay/index.d.ts new file mode 100644 index 0000000000..524c277691 --- /dev/null +++ b/types/googlepay/index.d.ts @@ -0,0 +1,160 @@ +// Type definitions for Google Pay API 0.0 +// Project: https://developers.google.com/pay/api/web/setup/ +// Definitions by: Florian Luccioni +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace google.payments.api { + type AddressFormat = 'FULL' | 'MIN'; + type AllowedCardNetwork = 'AMEX' | 'DISCOVER' | 'JCB' | 'MASTERCARD' | 'VISA'; + type AllowedPaymentMethod = 'CARD' | 'TOKENIZED_CARD'; + type CardClass = 'CREDIT' | 'DEBIT'; + type CardInfo = CardInfoMin | CardInfoFull; + type CardRequirements = CardRequirementsMin | CardRequirementsFull; + type EnvironmentType = 'PRODUCTION' | 'TEST'; + type ErrorStatusCode = 'BUYER_ACCOUNT_ERROR' | 'CANCELED' | 'DEVELOPER_ERROR' | 'INTERNAL_ERROR'; + type PaymentMethodTokenizationParameters = PaymentMethodDirectTokenizationParameters | PaymentMethodGatewayTokenizationParameters; + type TokenizationType = 'DIRECT' | 'PAYMENT_GATEWAY'; + type TotalPriceStatus = 'ESTIMATED' | 'FINAL' | 'NOT_CURRENTLY_KNOWN'; + type UserAddress = UserAddressFull | UserAddressMin; + type PaymentDataRequest = PaymentDataRequestMin | PaymentDataRequestFull; + type PaymentData = PaymentDataMin | PaymentDataFull; + + interface PaymentOptions { + environment?: EnvironmentType; + } + + interface IsReadyToPayRequest { + allowedPaymentMethods: AllowedPaymentMethod[]; + } + + interface BasePaymentDataRequest { + merchantId: string; + transactionInfo: TransactionInfo; + cardRequirements: CardRequirements; + paymentMethodTokenizationParameters: PaymentMethodTokenizationParameters; + allowedPaymentMethods: AllowedPaymentMethod[]; + phoneNumberRequired?: boolean; + emailRequired?: boolean; + shippingAddressRequired?: boolean; + shippingAddressRequirements?: ShippingAddressRequirements; + } + + interface PaymentDataRequestMin extends BasePaymentDataRequest { + cardRequirements: CardRequirementsMin; + } + + interface PaymentDataRequestFull extends BasePaymentDataRequest { + cardRequirements: CardRequirementsFull; + } + + interface BasePaymentMethodTokenizationParameters { + tokenizationType: TokenizationType; + } + + interface PaymentMethodGatewayTokenizationParameters extends BasePaymentMethodTokenizationParameters { + tokenizationType: 'PAYMENT_GATEWAY'; + parameters: { + [parameter: string]: string; + }; + } + + interface PaymentMethodDirectTokenizationParameters extends BasePaymentMethodTokenizationParameters { + tokenizationType: 'DIRECT'; + parameters: { + publicKey: string; + }; + } + + interface BaseCardRequirements { + allowedCardNetworks: AllowedCardNetwork[]; + billingAddressRequired?: boolean; + billingAddressFormat?: AddressFormat; + } + + interface CardRequirementsMin extends BaseCardRequirements { + billingAddressFormat?: 'MIN'; + } + + interface CardRequirementsFull extends BaseCardRequirements { + billingAddressFormat?: 'FULL'; + } + + interface ShippingAddressRequirements { + allowedCountryCodes?: string[]; + } + + interface TransactionInfo { + totalPriceStatus: TotalPriceStatus; + totalPrice?: string; + currencyCode?: string; + } + + interface BasePaymentData { + cardInfo: CardInfo; + paymentMethodToken: PaymentMethodToken; + shippingAddress?: UserAddressFull; + email?: string; + } + + interface PaymentDataMin extends BasePaymentData { + cardInfo: CardInfoMin; + } + + interface PaymentDataFull extends BasePaymentData { + cardInfo: CardInfoFull; + } + + interface BaseCardInfo { + cardDescription: string; + cardClass: CardClass; + cardDetails: string; + cardNetwork: AllowedCardNetwork; + billingAddress?: UserAddress; + } + + interface CardInfoMin extends BaseCardInfo { + billingAddress?: UserAddressMin; + } + + interface CardInfoFull extends BaseCardInfo { + billingAddress?: UserAddressFull; + } + + interface UserAddressMin { + name: string; + postalCode: string; + countryCode: string; + phoneNumber?: string; + } + + interface UserAddressFull extends UserAddressMin { + companyName: string; + address1: string; + address2: string; + address3: string; + address4: string; + address5: string; + locality: string; + administrativeArea: string; + sortingCode: string; + } + + interface PaymentMethodToken { + tokenizationType: TokenizationType; + token: string; + } + + interface PaymentsError { + statusCode: ErrorStatusCode; + statusMessage: string; + } + + class PaymentsClient { + constructor(paymentOptions: PaymentOptions); + isReadyToPay(request: IsReadyToPayRequest): Promise<{result: boolean}>; + loadPaymentData(request: PaymentDataRequestMin): Promise; + loadPaymentData(request: PaymentDataRequestFull): Promise; + loadPaymentData(request: PaymentDataRequest): Promise; + prefetchPaymentData(request: PaymentDataRequest): void; + } +} diff --git a/types/googlepay/tsconfig.json b/types/googlepay/tsconfig.json new file mode 100644 index 0000000000..38fba1d6c8 --- /dev/null +++ b/types/googlepay/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", + "googlepay-tests.ts" + ] +} diff --git a/types/googlepay/tslint.json b/types/googlepay/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/googlepay/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/graceful-fs/graceful-fs-tests.ts b/types/graceful-fs/graceful-fs-tests.ts index 233eb7124a..17f20c786a 100644 --- a/types/graceful-fs/graceful-fs-tests.ts +++ b/types/graceful-fs/graceful-fs-tests.ts @@ -14,7 +14,7 @@ gfs.renameSync(str, str); gfs2.chmodSync(buf, 1); const gracefulified = gfs.gracefulify(fs); -gracefulified; // $ExpectType typeof "fs" & Lutimes +const _fs: typeof fs = gracefulified; gracefulified.lutimes; // $ExpectType typeof lutimes promisify(gracefulified.lutimes); // $ExpectType (path: PathLike, atime: string | number | Date, mtime: string | number | Date) => Promise diff --git a/types/graphql-list-fields/graphql-list-fields-tests.ts b/types/graphql-list-fields/graphql-list-fields-tests.ts index 7624a3cbd8..e90d609f1d 100644 --- a/types/graphql-list-fields/graphql-list-fields-tests.ts +++ b/types/graphql-list-fields/graphql-list-fields-tests.ts @@ -1,42 +1,31 @@ import getFieldNames = require("graphql-list-fields"); -import { - GraphQLID, - GraphQLInterfaceType, - GraphQLObjectType, - GraphQLResolveInfo, - GraphQLSchema, - GraphQLString -} from "graphql"; +import { GraphQLID, GraphQLObjectType, GraphQLSchema, GraphQLString } from "graphql"; -const sampleGraphQLResolveInfo: GraphQLResolveInfo = { - fieldName: "", - fieldNodes: [], - returnType: GraphQLString, - parentType: new GraphQLInterfaceType({ - name: "Sample", +const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: "SampleType", fields: { - name: { type: GraphQLString } - } + scalarField: { + type: GraphQLString, + resolve(source, args, context, info) { + const fieldNames: string[] = getFieldNames(info); + }, + }, + someType: { + type: new GraphQLObjectType({ + name: "SomeType", + fields: { + a: { type: GraphQLID }, + b: { type: GraphQLString }, + c: { type: GraphQLString }, + d: { type: GraphQLString }, + }, + }), + resolve(source, args, context, info) { + const fieldNames: string[] = getFieldNames(info); + }, + }, + }, }), - path: undefined, - schema: new GraphQLSchema({ - query: new GraphQLObjectType({ - name: "SampleType", - fields: {} - }) - }), - fragments: {}, - rootValue: null, - operation: { - kind: "OperationDefinition", - operation: "query", - selectionSet: { - kind: "SelectionSet", - selections: [] - } - }, - variableValues: {} -}; - -const fieldNames: string[] = getFieldNames(sampleGraphQLResolveInfo); +}); diff --git a/types/graphql-relay/graphql-relay-tests.ts b/types/graphql-relay/graphql-relay-tests.ts index 6cc1f0f5ce..cebc90e2ca 100644 --- a/types/graphql-relay/graphql-relay-tests.ts +++ b/types/graphql-relay/graphql-relay-tests.ts @@ -44,7 +44,7 @@ backwardConnectionArgs.before = "b"; backwardConnectionArgs.last = 10; // connectionDefinitions returns a connectionType and its associated edgeType, given a node type. const resolve: GraphQLFieldResolver = (source, args, context, info) => { - info.fieldName = "f"; + context.flag = "f"; }; const fields: GraphQLFieldConfigMap = {}; let t: GraphQLObjectType; @@ -118,10 +118,10 @@ const resolver: GraphQLTypeResolver = () => { fields: {}, }); }; -const idFetcher = (id: string, context: number, info: GraphQLResolveInfo) => { - info.fieldName = "f"; +const idFetcher = (id: string, context: any, info: GraphQLResolveInfo) => { + context.flag = "f"; }; -const nodeDef = nodeDefinitions(idFetcher, resolver); +const nodeDef = nodeDefinitions(idFetcher, resolver); const nodeFieldConfig: GraphQLFieldConfig = nodeDef.nodeField; const nodesFieldConfig: GraphQLFieldConfig = nodeDef.nodesField; const interfaceType: GraphQLInterfaceType = nodeDef.nodeInterface; @@ -183,10 +183,10 @@ mutationWithClientMutationId({ inputFields: gifcm, mutateAndGetPayload: ( object: any, - ctx: any, + context: any, info: GraphQLResolveInfo) => { return new Promise((resolve) => { - resolve(info.fieldName); + resolve(context.flag); }); }, outputFields: gfcm, diff --git a/types/graphql/error/GraphQLError.d.ts b/types/graphql/error/GraphQLError.d.ts index abcc6be5b9..0be931bee0 100644 --- a/types/graphql/error/GraphQLError.d.ts +++ b/types/graphql/error/GraphQLError.d.ts @@ -1,6 +1,7 @@ -import { getLocation } from '../language'; -import { ASTNode } from '../language/ast'; -import { Source } from '../language/source'; +import { getLocation } from "../language"; +import { ASTNode } from "../language/ast"; +import { Source } from "../language/source"; +import { SourceLocation } from "../language/location"; /** * A GraphQLError describes an Error found during the parse, validate, or @@ -9,66 +10,68 @@ import { Source } from '../language/source'; * GraphQL document and/or execution result that correspond to the Error. */ export class GraphQLError extends Error { - /** - * A message describing the Error for debugging purposes. - * - * Enumerable, and appears in the result of JSON.stringify(). - */ - message: string; + /** + * A message describing the Error for debugging purposes. + * + * Enumerable, and appears in the result of JSON.stringify(). + * + * Note: should be treated as readonly, despite invariant usage. + */ + message: string; - /** - * An array of { line, column } locations within the source GraphQL document - * which correspond to this error. - * - * Errors during validation often contain multiple locations, for example to - * point out two things with the same name. Errors during execution include a - * single location, the field which produced the error. - * - * Enumerable, and appears in the result of JSON.stringify(). - */ - locations?: Array<{ line: number; column: number }> | undefined; + /** + * An array of { line, column } locations within the source GraphQL document + * which correspond to this error. + * + * Errors during validation often contain multiple locations, for example to + * point out two things with the same name. Errors during execution include a + * single location, the field which produced the error. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + readonly locations: ReadonlyArray | undefined; - /** - * An array describing the JSON-path into the execution response which - * corresponds to this error. Only included for errors during execution. - * - * Enumerable, and appears in the result of JSON.stringify(). - */ - path?: Array | undefined; + /** + * An array describing the JSON-path into the execution response which + * corresponds to this error. Only included for errors during execution. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + readonly path: ReadonlyArray | undefined; - /** - * An array of GraphQL AST Nodes corresponding to this error. - */ - nodes?: ASTNode[] | undefined; + /** + * An array of GraphQL AST Nodes corresponding to this error. + */ + readonly nodes: ReadonlyArray | undefined; - /** - * The source GraphQL document corresponding to this error. - */ - source?: Source | undefined; + /** + * The source GraphQL document corresponding to this error. + */ + readonly source: Source | undefined; - /** - * An array of character offsets within the source GraphQL document - * which correspond to this error. - */ - positions?: number[] | undefined; + /** + * An array of character offsets within the source GraphQL document + * which correspond to this error. + */ + readonly positions: ReadonlyArray | undefined; - /** - * The original error thrown from a field resolver during execution. - */ - originalError?: Error; - - /** - * Extension fields to add to the formatted error. - */ - extensions?: { [key: string]: any } | undefined; + /** + * The original error thrown from a field resolver during execution. + */ + readonly originalError: Error | void; - constructor( - message: string, - nodes?: any[], - source?: Source, - positions?: number[], - path?: Array, - originalError?: Error, - extensions?: { [key: string]: any }, - ); + /** + * Extension fields to add to the formatted error. + */ + readonly extensions: { [key: string]: any } | void; + + constructor( + message: string, + nodes?: ReadonlyArray | ASTNode | undefined, + source?: Source | void, + positions?: ReadonlyArray | void, + path?: ReadonlyArray | void, + originalError?: Error | void, + extensions?: { [key: string]: any } | void + ); } diff --git a/types/graphql/error/formatError.d.ts b/types/graphql/error/formatError.d.ts index 26dbe0f743..7f13117cf0 100644 --- a/types/graphql/error/formatError.d.ts +++ b/types/graphql/error/formatError.d.ts @@ -1,4 +1,5 @@ -import { GraphQLError } from './GraphQLError'; +import { GraphQLError } from "./GraphQLError"; +import { SourceLocation } from "../language/location"; /** * Given a GraphQLError, format it according to the rules described by the @@ -7,12 +8,9 @@ import { GraphQLError } from './GraphQLError'; export function formatError(error: GraphQLError): GraphQLFormattedError; export interface GraphQLFormattedError { - message: string; - locations?: GraphQLErrorLocation[]; - path?: Array; -} - -export interface GraphQLErrorLocation { - line: number; - column: number; + readonly message: string; + readonly locations: ReadonlyArray | undefined; + readonly path: ReadonlyArray | undefined; + // Extensions + readonly [key: string]: any; } diff --git a/types/graphql/error/index.d.ts b/types/graphql/error/index.d.ts index 0e9a557794..bed0763ed3 100644 --- a/types/graphql/error/index.d.ts +++ b/types/graphql/error/index.d.ts @@ -1,8 +1,5 @@ -export { GraphQLError } from './GraphQLError'; -export { syntaxError } from './syntaxError'; -export { locatedError } from './locatedError'; -export { - formatError, - GraphQLFormattedError, - GraphQLErrorLocation, -} from './formatError'; +export { GraphQLError } from "./GraphQLError"; +export { syntaxError } from "./syntaxError"; +export { locatedError } from "./locatedError"; +export { printError } from "./printError"; +export { formatError, GraphQLFormattedError } from "./formatError"; diff --git a/types/graphql/error/locatedError.d.ts b/types/graphql/error/locatedError.d.ts index 64fadf49f4..77dd470c63 100644 --- a/types/graphql/error/locatedError.d.ts +++ b/types/graphql/error/locatedError.d.ts @@ -1,12 +1,13 @@ -import { GraphQLError } from './GraphQLError'; +import { GraphQLError } from "./GraphQLError"; +import { ASTNode } from "../language/ast"; /** * Given an arbitrary Error, presumably thrown while attempting to execute a * GraphQL operation, produce a new GraphQLError aware of the location in the * document responsible for the original Error. */ -export function locatedError( - originalError: Error, - nodes: T[], - path: Array, +export function locatedError( + originalError: Error, + nodes: ReadonlyArray, + path: ReadonlyArray ): GraphQLError; diff --git a/types/graphql/error/printError.d.ts b/types/graphql/error/printError.d.ts new file mode 100644 index 0000000000..924682f471 --- /dev/null +++ b/types/graphql/error/printError.d.ts @@ -0,0 +1,7 @@ +import { GraphQLError } from "./GraphQLError"; + +/** + * Prints a GraphQLError to a string, representing useful location information + * about the error's position in the source. + */ +export function printError(error: GraphQLError): string; diff --git a/types/graphql/error/syntaxError.d.ts b/types/graphql/error/syntaxError.d.ts index ccf84044ca..bc33cd8107 100644 --- a/types/graphql/error/syntaxError.d.ts +++ b/types/graphql/error/syntaxError.d.ts @@ -1,12 +1,8 @@ -import { Source } from '../language/source'; -import { GraphQLError } from './GraphQLError'; +import { Source } from "../language/source"; +import { GraphQLError } from "./GraphQLError"; /** * Produces a GraphQLError representing a syntax error, containing useful * descriptive information about the syntax error's position in the source. */ -export function syntaxError( - source: Source, - position: number, - description: string, -): GraphQLError; +export function syntaxError(source: Source, position: number, description: string): GraphQLError; diff --git a/types/graphql/execution/execute.d.ts b/types/graphql/execution/execute.d.ts index ea6ab8ed39..424bb62b5a 100644 --- a/types/graphql/execution/execute.d.ts +++ b/types/graphql/execution/execute.d.ts @@ -1,19 +1,23 @@ -import { GraphQLError, locatedError } from '../error'; -import { GraphQLSchema } from '../type/schema'; +import { GraphQLError, locatedError } from "../error"; +import { GraphQLSchema } from "../type/schema"; import { - GraphQLField, - GraphQLFieldResolver, - ResponsePath, -} from '../type/definition'; + GraphQLField, + GraphQLFieldResolver, + ResponsePath, + GraphQLObjectType, + GraphQLResolveInfo, +} from "../type/definition"; import { - DirectiveNode, - DocumentNode, - OperationDefinitionNode, - SelectionSetNode, - FieldNode, - InlineFragmentNode, - FragmentDefinitionNode, -} from '../language/ast'; + DirectiveNode, + DocumentNode, + OperationDefinitionNode, + SelectionSetNode, + FieldNode, + InlineFragmentNode, + FragmentDefinitionNode, +} from "../language/ast"; +import { MaybePromise } from "../jsutils/MaybePromise"; + /** * Data that must be available at all points during query execution. * @@ -21,67 +25,140 @@ import { * and the fragments defined in the query document */ export interface ExecutionContext { - schema: GraphQLSchema; - fragments: { [key: string]: FragmentDefinitionNode }; - rootValue: any; - operation: OperationDefinitionNode; - variableValues: { [key: string]: any }; - fieldResolver: GraphQLFieldResolver; - errors: GraphQLError[]; + schema: GraphQLSchema; + fragments: { [key: string]: FragmentDefinitionNode }; + rootValue: any; + contextValue: any; + operation: OperationDefinitionNode; + variableValues: { [key: string]: any }; + fieldResolver: GraphQLFieldResolver; + errors: GraphQLError[]; } /** - * The result of execution. `data` is the result of executing the - * query, `extensions` represents additional metadata, `errors` is - * null if no errors occurred, and is a - * non-empty array if an error occurred. + * The result of GraphQL execution. + * + * - `errors` is included when any errors occurred as a non-empty array. + * - `data` is the result of a successful execution of the query. */ export interface ExecutionResult { - data?: { [key: string]: any }; - extensions?: { [key: string]: any }; - errors?: GraphQLError[]; + errors?: ReadonlyArray; + data?: { [key: string]: any }; } export type ExecutionArgs = { - schema: GraphQLSchema; - document: DocumentNode; - rootValue?: any; - contextValue?: any; - variableValues?: { [key: string]: any }; - operationName?: string; - fieldResolver?: GraphQLFieldResolver; + schema: GraphQLSchema; + document: DocumentNode; + rootValue?: any; + contextValue?: any; + variableValues?: { [key: string]: any } | void; + operationName?: string | void; + fieldResolver?: GraphQLFieldResolver | void; }; /** * Implements the "Evaluating requests" section of the GraphQL specification. * - * Returns a Promise that will eventually be resolved and never rejected. + * Returns either a synchronous ExecutionResult (if all encountered resolvers + * are synchronous), or a Promise of an ExecutionResult that will eventually be + * resolved and never rejected. * * If the arguments to this function do not result in a legal execution context, * a GraphQLError will be thrown immediately explaining the invalid input. * * Accepts either an object with named arguments, or individual arguments. */ -export function execute(args: ExecutionArgs): Promise; +export function execute(args: ExecutionArgs): MaybePromise; export function execute( - schema: GraphQLSchema, - document: DocumentNode, - rootValue?: any, - contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver, -): Promise; + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: any, + contextValue?: any, + variableValues?: { [key: string]: any } | void, + operationName?: string | void, + fieldResolver?: GraphQLFieldResolver | void +): MaybePromise; /** * Given a ResponsePath (found in the `path` entry in the information provided * as the last argument to a field resolver), return an Array of the path keys. */ -export function responsePathAsArray(path: ResponsePath): Array; +export function responsePathAsArray(path: ResponsePath): ReadonlyArray; -export function addPath(prev: ResponsePath, key: string | number): any; +/** + * Given a ResponsePath and a key, return a new ResponsePath containing the + * new key. + */ +export function addPath( + prev: ResponsePath | undefined, + key: string | number +): { prev: ResponsePath | undefined; key: string | number }; + +/** + * Essential assertions before executing to provide developer feedback for + * improper use of the GraphQL library. + */ +export function assertValidExecutionArguments( + schema: GraphQLSchema, + document: DocumentNode, + rawVariableValues: { [key: string]: any } | void +): void; + +/** + * Constructs a ExecutionContext object from the arguments passed to + * execute, which we will pass throughout the other execution methods. + * + * Throws a GraphQLError if a valid execution context cannot be created. + */ +export function buildExecutionContext( + schema: GraphQLSchema, + document: DocumentNode, + rootValue: any, + contextValue: any, + rawVariableValues: { [key: string]: any } | void, + operationName: string | void, + fieldResolver: GraphQLFieldResolver | void +): ReadonlyArray | ExecutionContext; + +/** + * Extracts the root type of the operation from the schema. + */ +export function getOperationRootType(schema: GraphQLSchema, operation: OperationDefinitionNode): GraphQLObjectType; + +/** + * Given a selectionSet, adds all of the fields in that selection to + * the passed in map of fields, and returns it at the end. + * + * CollectFields requires the "runtime type" of an object. For a field which + * returns an Interface or Union type, the "runtime type" will be the actual + * Object type returned by that field. + */ +export function collectFields( + exeContext: ExecutionContext, + runtimeType: GraphQLObjectType, + selectionSet: SelectionSetNode, + fields: { [key: string]: Array }, + visitedFragmentNames: { [key: string]: boolean } +): { [key: string]: Array }; + +export function buildResolveInfo( + exeContext: ExecutionContext, + fieldDef: GraphQLField, + fieldNodes: ReadonlyArray, + parentType: GraphQLObjectType, + path: ResponsePath +): GraphQLResolveInfo; + +// Isolates the "ReturnOrAbrupt" behavior to not de-opt the `resolveField` +// function. Returns the result of resolveFn or the abrupt-return Error object. +export function resolveFieldValueOrError( + exeContext: ExecutionContext, + fieldDef: GraphQLField, + fieldNodes: ReadonlyArray, + resolveFn: GraphQLFieldResolver, + source: TSource, + info: GraphQLResolveInfo +): Error | any; /** * If a resolve function is not given, then a default resolve behavior is used @@ -90,3 +167,18 @@ export function addPath(prev: ResponsePath, key: string | number): any; * of calling that function while passing along args and context. */ export const defaultFieldResolver: GraphQLFieldResolver; + +/** + * This method looks up the field on the given type defintion. + * It has special casing for the two introspection fields, __schema + * and __typename. __typename is special because it can always be + * queried as a field, even in situations where no other fields + * are allowed, like on a Union. __schema could get automatically + * added to the query type, but that would require mutating type + * definitions, which would cause issues. + */ +export function getFieldDef( + schema: GraphQLSchema, + parentType: GraphQLObjectType, + fieldName: string +): GraphQLField | void; diff --git a/types/graphql/execution/index.d.ts b/types/graphql/execution/index.d.ts index a5c4980c0a..74aef224ce 100644 --- a/types/graphql/execution/index.d.ts +++ b/types/graphql/execution/index.d.ts @@ -1,9 +1,3 @@ -export { - execute, - defaultFieldResolver, - responsePathAsArray, - ExecutionArgs, - ExecutionResult, -} from './execute'; +export { execute, defaultFieldResolver, responsePathAsArray, ExecutionArgs, ExecutionResult } from "./execute"; -export { getDirectiveValues } from './values'; +export { getDirectiveValues } from "./values"; diff --git a/types/graphql/execution/values.d.ts b/types/graphql/execution/values.d.ts index 08e6041aa2..fb629325e8 100644 --- a/types/graphql/execution/values.d.ts +++ b/types/graphql/execution/values.d.ts @@ -1,35 +1,41 @@ -import { - GraphQLInputType, - GraphQLField, - GraphQLArgument, -} from '../type/definition'; -import { GraphQLDirective } from '../type/directives'; -import { GraphQLSchema } from '../type/schema'; -import { - FieldNode, - DirectiveNode, - VariableDefinitionNode, -} from '../language/ast'; +import { GraphQLError } from "../error"; +import { GraphQLInputType, GraphQLField, GraphQLArgument } from "../type/definition"; +import { GraphQLDirective } from "../type/directives"; +import { GraphQLSchema } from "../type/schema"; +import { FieldNode, DirectiveNode, VariableDefinitionNode } from "../language/ast"; + +interface CoercedVariableValues { + errors: ReadonlyArray | undefined; + coerced: { [key: string]: any } | undefined; +} /** * Prepares an object map of variableValues of the correct type based on the * provided variable definitions and arbitrary input. If the input cannot be * parsed to match the variable definitions, a GraphQLError will be thrown. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. */ export function getVariableValues( - schema: GraphQLSchema, - varDefNodes: VariableDefinitionNode[], - inputs: { [key: string]: any }, -): { [key: string]: any }; + schema: GraphQLSchema, + varDefNodes: VariableDefinitionNode[], + inputs: { [key: string]: any } +): CoercedVariableValues; /** * Prepares an object map of argument values given a list of argument * definitions and list of argument AST nodes. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. */ export function getArgumentValues( - def: GraphQLField | GraphQLDirective, - node: FieldNode | DirectiveNode, - variableValues?: { [key: string]: any }, + def: GraphQLField | GraphQLDirective, + node: FieldNode | DirectiveNode, + variableValues?: { [key: string]: any } | void ): { [key: string]: any }; /** @@ -38,9 +44,15 @@ export function getArgumentValues( * of variable values. * * If the directive does not exist on the node, returns undefined. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. */ export function getDirectiveValues( - directiveDef: GraphQLDirective, - node: { directives?: Array }, - variableValues?: { [key: string]: any }, -): void | { [key: string]: any }; + directiveDef: GraphQLDirective, + node: { + readonly directives?: ReadonlyArray; + }, + variableValues?: { [key: string]: any } | void +): undefined | { [key: string]: any }; diff --git a/types/graphql/graphql.d.ts b/types/graphql/graphql.d.ts index f5469d7d8c..7282ea80f2 100644 --- a/types/graphql/graphql.d.ts +++ b/types/graphql/graphql.d.ts @@ -1,7 +1,7 @@ -import { Source } from './language/source'; -import { GraphQLFieldResolver } from './type/definition'; -import { GraphQLSchema } from './type/schema'; -import { ExecutionResult } from './execution/execute'; +import { Source } from "./language/source"; +import { GraphQLFieldResolver } from "./type/definition"; +import { GraphQLSchema } from "./type/schema"; +import { ExecutionResult } from "./execution/execute"; /** * This is the primary entry point function for fulfilling GraphQL operations @@ -33,25 +33,40 @@ import { ExecutionResult } from './execution/execute'; * If not provided, the default field resolver is used (which looks for a * value or method on the source value with the field's name). */ -export function graphql(args: { - schema: GraphQLSchema, - source: string | Source, - rootValue?: any, - contextValue?: any, - variableValues?: { - [key: string]: any - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver -}): Promise; +export interface GraphQLArgs { + schema: GraphQLSchema; + source: Source | string; + rootValue?: any; + contextValue?: any; + variableValues?: { [key: string]: any } | void; + operationName?: string | void; + fieldResolver?: GraphQLFieldResolver | void; +} + +export function graphql(args: GraphQLArgs): Promise; export function graphql( schema: GraphQLSchema, - source: string | Source, + source: Source | string, rootValue?: any, contextValue?: any, - variableValues?: { - [key: string]: any - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver + variableValues?: { [key: string]: any } | void, + operationName?: string | void, + fieldResolver?: GraphQLFieldResolver | void ): Promise; + +/** + * The graphqlSync function also fulfills GraphQL operations by parsing, + * validating, and executing a GraphQL document along side a GraphQL schema. + * However, it guarantees to complete synchronously (or throw an error) assuming + * that all field resolvers are also synchronous. + */ +export function graphqlSync(args: GraphQLArgs): ExecutionResult; +export function graphqlSync( + schema: GraphQLSchema, + source: Source | string, + rootValue?: any, + contextValue?: any, + variableValues?: { [key: string]: any } | void, + operationName?: string | void, + fieldResolver?: GraphQLFieldResolver | void +): ExecutionResult; diff --git a/types/graphql/index.d.ts b/types/graphql/index.d.ts index 49185e11a1..68e04d104d 100644 --- a/types/graphql/index.d.ts +++ b/types/graphql/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for graphql 0.12 +// Type definitions for graphql 0.13 // Project: https://www.npmjs.com/package/graphql // Definitions by: TonyYang // Caleb Meredith @@ -17,17 +17,221 @@ // TypeScript Version: 2.3 // The primary entry point into fulfilling a GraphQL request. -export { - graphql -} from './graphql'; +export { graphql, graphqlSync, GraphQLArgs } from "./graphql"; // Create and operate on GraphQL type definitions and schema. -export * from './type'; +export { + GraphQLSchema, + // Definitions + GraphQLScalarType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLList, + GraphQLNonNull, + GraphQLDirective, + // "Enum" of Type Kinds + TypeKind, + // Scalars + specifiedScalarTypes, + GraphQLInt, + GraphQLFloat, + GraphQLString, + GraphQLBoolean, + GraphQLID, + // Built-in Directives defined by the Spec + specifiedDirectives, + GraphQLIncludeDirective, + GraphQLSkipDirective, + GraphQLDeprecatedDirective, + // Constant Deprecation Reason + DEFAULT_DEPRECATION_REASON, + // Meta-field definitions. + SchemaMetaFieldDef, + TypeMetaFieldDef, + TypeNameMetaFieldDef, + // GraphQL Types for introspection. + introspectionTypes, + __Schema, + __Directive, + __DirectiveLocation, + __Type, + __Field, + __InputValue, + __EnumValue, + __TypeKind, + // Predicates + isSchema, + isDirective, + isType, + isScalarType, + isObjectType, + isInterfaceType, + isUnionType, + isEnumType, + isInputObjectType, + isListType, + isNonNullType, + isInputType, + isOutputType, + isLeafType, + isCompositeType, + isAbstractType, + isWrappingType, + isNullableType, + isNamedType, + isSpecifiedScalarType, + isIntrospectionType, + isSpecifiedDirective, + // Assertions + assertType, + assertScalarType, + assertObjectType, + assertInterfaceType, + assertUnionType, + assertEnumType, + assertInputObjectType, + assertListType, + assertNonNullType, + assertInputType, + assertOutputType, + assertLeafType, + assertCompositeType, + assertAbstractType, + assertWrappingType, + assertNullableType, + assertNamedType, + // Un-modifiers + getNullableType, + getNamedType, + // Validate GraphQL schema. + validateSchema, + assertValidSchema, + // type + GraphQLType, + GraphQLInputType, + GraphQLOutputType, + GraphQLLeafType, + GraphQLCompositeType, + GraphQLAbstractType, + GraphQLWrappingType, + GraphQLNullableType, + GraphQLNamedType, + Thunk, + GraphQLSchemaConfig, + GraphQLArgument, + GraphQLArgumentConfig, + GraphQLEnumTypeConfig, + GraphQLEnumValue, + GraphQLEnumValueConfig, + GraphQLEnumValueConfigMap, + GraphQLField, + GraphQLFieldConfig, + GraphQLFieldConfigArgumentMap, + GraphQLFieldConfigMap, + GraphQLFieldMap, + GraphQLFieldResolver, + GraphQLInputField, + GraphQLInputFieldConfig, + GraphQLInputFieldConfigMap, + GraphQLInputFieldMap, + GraphQLInputObjectTypeConfig, + GraphQLInterfaceTypeConfig, + GraphQLIsTypeOfFn, + GraphQLObjectTypeConfig, + GraphQLResolveInfo, + ResponsePath, + GraphQLScalarTypeConfig, + GraphQLTypeResolver, + GraphQLUnionTypeConfig, + GraphQLDirectiveConfig, +} from "./type"; // Parse and operate on GraphQL language source files. -export * from './language'; - -export * from './subscription'; +export { + Source, + getLocation, + // Parse + parse, + parseValue, + parseType, + // Print + print, + // Visit + visit, + visitInParallel, + visitWithTypeInfo, + getVisitFn, + Kind, + TokenKind, + DirectiveLocation, + BREAK, + // type + Lexer, + ParseOptions, + SourceLocation, + // Visitor utilities + ASTVisitor, + Visitor, + VisitFn, + VisitorKeyMap, + // AST nodes + Location, + Token, + ASTNode, + ASTKindToNode, + NameNode, + DocumentNode, + DefinitionNode, + ExecutableDefinitionNode, + OperationDefinitionNode, + OperationTypeNode, + VariableDefinitionNode, + VariableNode, + SelectionSetNode, + SelectionNode, + FieldNode, + ArgumentNode, + FragmentSpreadNode, + InlineFragmentNode, + FragmentDefinitionNode, + ValueNode, + IntValueNode, + FloatValueNode, + StringValueNode, + BooleanValueNode, + NullValueNode, + EnumValueNode, + ListValueNode, + ObjectValueNode, + ObjectFieldNode, + DirectiveNode, + TypeNode, + NamedTypeNode, + ListTypeNode, + NonNullTypeNode, + TypeSystemDefinitionNode, + SchemaDefinitionNode, + OperationTypeDefinitionNode, + TypeDefinitionNode, + ScalarTypeDefinitionNode, + ObjectTypeDefinitionNode, + FieldDefinitionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + UnionTypeDefinitionNode, + EnumTypeDefinitionNode, + EnumValueDefinitionNode, + InputObjectTypeDefinitionNode, + TypeExtensionNode, + ObjectTypeExtensionNode, + DirectiveDefinitionNode, + KindEnum, + TokenKindEnum, + DirectiveLocationEnum, +} from "./language"; // Execute GraphQL queries. export { @@ -35,21 +239,20 @@ export { defaultFieldResolver, responsePathAsArray, getDirectiveValues, + // type ExecutionArgs, ExecutionResult, -} from './execution'; +} from "./execution"; + +export { subscribe, createSourceEventStream } from "./subscription"; // Validate GraphQL queries. export { validate, ValidationContext, - // All validation rules in the GraphQL Specification. specifiedRules, - // Individual validation rules. - ArgumentsOfCorrectTypeRule, - DefaultValuesOfCorrectTypeRule, FieldsOnCorrectTypeRule, FragmentsOnCompositeTypesRule, KnownArgumentNamesRule, @@ -72,104 +275,106 @@ export { UniqueInputFieldNamesRule, UniqueOperationNamesRule, UniqueVariableNamesRule, + ValuesOfCorrectTypeRule, VariablesAreInputTypesRule, + VariablesDefaultValueAllowedRule, VariablesInAllowedPositionRule, -} from './validation'; +} from "./validation"; // Create and format GraphQL errors. -export { - GraphQLError, - formatError, - GraphQLFormattedError, - GraphQLErrorLocation, -} from './error'; +export { GraphQLError, formatError, printError, GraphQLFormattedError } from "./error"; // Utilities for operating on GraphQL type schema and parsed sources. export { - // The GraphQL query recommended for a full schema introspection. + // Produce the GraphQL query recommended for a full schema introspection. + // Accepts optional IntrospectionOptions. + getIntrospectionQuery, + // Deprecated: use getIntrospectionQuery introspectionQuery, - // Gets the target Operation from a Document getOperationAST, - + // Convert a GraphQLSchema to an IntrospectionQuery + introspectionFromSchema, // Build a GraphQLSchema from an introspection result. buildClientSchema, - // Build a GraphQLSchema from a parsed GraphQL Schema language AST. buildASTSchema, - // Build a GraphQLSchema from a GraphQL schema language document. buildSchema, - - // Get the description of an AST node + // Get the description from a schema AST node. getDescription, - // Extends an existing GraphQLSchema from a parsed GraphQL Schema // language AST. extendSchema, - + // Sort a GraphQLSchema. + lexicographicSortSchema, // Print a GraphQLSchema to GraphQL Schema language. printSchema, - + // Prints the built-in introspection schema in the Schema Language + // format. + printIntrospectionSchema, // Print a GraphQLType to GraphQL Schema language. printType, - // Create a GraphQLType from a GraphQL language AST. typeFromAST, - - // Create a JavaScript value from a GraphQL language AST. + // Create a JavaScript value from a GraphQL language AST with a Type. valueFromAST, - + // Create a JavaScript value from a GraphQL language AST without a Type. + valueFromASTUntyped, // Create a GraphQL language AST from a JavaScript value. astFromValue, - // A helper to use within recursive-descent visitors which need to be aware of // the GraphQL type system. TypeInfo, - - // Determine if JavaScript values adhere to a GraphQL type. + // Coerces a JavaScript value to a GraphQL type, or produces errors. + coerceValue, + // @deprecated use coerceValue isValidJSValue, - // Determine if AST values adhere to a GraphQL type. isValidLiteralValue, - // Concatenates multiple AST together. concatAST, - // Separates an AST into an AST per Operation. separateOperations, - // Comparators for types isEqualType, isTypeSubTypeOf, doTypesOverlap, - // Asserts a string is a valid GraphQL name. assertValidName, - + // Determine if a string is a valid GraphQL name. + isValidNameError, // Compares two GraphQLSchemas and detects breaking changes. findBreakingChanges, - + findDangerousChanges, + BreakingChangeType, + DangerousChangeType, // Report all deprecated usage within a GraphQL document. findDeprecatedUsages, - + // type + BuildSchemaOptions, BreakingChange, - + DangerousChange, + IntrospectionOptions, IntrospectionDirective, IntrospectionEnumType, IntrospectionEnumValue, IntrospectionField, IntrospectionInputObjectType, + IntrospectionInputType, + IntrospectionInputTypeRef, IntrospectionInputValue, IntrospectionInterfaceType, IntrospectionListTypeRef, IntrospectionNamedTypeRef, IntrospectionNonNullTypeRef, IntrospectionObjectType, + IntrospectionOutputType, + IntrospectionOutputTypeRef, IntrospectionQuery, IntrospectionScalarType, IntrospectionSchema, IntrospectionType, IntrospectionTypeRef, IntrospectionUnionType, -} from './utilities'; +} from "./utilities"; diff --git a/types/graphql/jsutils/MaybePromise.d.ts b/types/graphql/jsutils/MaybePromise.d.ts new file mode 100644 index 0000000000..5eb85a3f92 --- /dev/null +++ b/types/graphql/jsutils/MaybePromise.d.ts @@ -0,0 +1 @@ +export type MaybePromise = Promise | T; diff --git a/types/graphql/language/ast.d.ts b/types/graphql/language/ast.d.ts index 1873caeb1f..21601385ff 100644 --- a/types/graphql/language/ast.d.ts +++ b/types/graphql/language/ast.d.ts @@ -1,382 +1,351 @@ -import { Source } from './source'; +import { Source } from "./source"; +import { TokenKindEnum } from "./lexer"; /** * Contains a range of UTF-8 character offsets and token references that * identify the region of the source from which the AST derived. */ export interface Location { - /** - * The character offset at which this Node begins. - */ - start: number; + /** + * The character offset at which this Node begins. + */ + readonly start: number; - /** - * The character offset at which this Node ends. - */ - end: number; + /** + * The character offset at which this Node ends. + */ + readonly end: number; - /** - * The Token at which this Node begins. - */ - startToken: Token; + /** + * The Token at which this Node begins. + */ + readonly startToken: Token; - /** - * The Token at which this Node ends. - */ - endToken: Token; + /** + * The Token at which this Node ends. + */ + readonly endToken: Token; - /** - * The Source document the AST represents. - */ - source: Source; + /** + * The Source document the AST represents. + */ + readonly source: Source; } -/** - * Represents the different kinds of tokens in a GraphQL document. - * This type is not inlined in `Token` to fix syntax highlighting on GitHub - * *only*. - */ -type TokenKind = - | '' - | '' - | '!' - | '$' - | '(' - | ')' - | '...' - | ':' - | '=' - | '@' - | '[' - | ']' - | '{' - | '|' - | '}' - | 'Name' - | 'Int' - | 'Float' - | 'String' - | 'BlockString' - | 'Comment'; - /** * Represents a range of characters represented by a lexical token * within a Source. */ export interface Token { - /** - * The kind of Token. - */ - kind: TokenKind; + /** + * The kind of Token. + */ + readonly kind: TokenKindEnum; - /** - * The character offset at which this Node begins. - */ - start: number; + /** + * The character offset at which this Node begins. + */ + readonly start: number; - /** - * The character offset at which this Node ends. - */ - end: number; + /** + * The character offset at which this Node ends. + */ + readonly end: number; - /** - * The 1-indexed line number on which this Token appears. - */ - line: number; + /** + * The 1-indexed line number on which this Token appears. + */ + readonly line: number; - /** - * The 1-indexed column number at which this Token begins. - */ - column: number; + /** + * The 1-indexed column number at which this Token begins. + */ + readonly column: number; - /** - * For non-punctuation tokens, represents the interpreted value of the token. - */ - value: string | undefined; + /** + * For non-punctuation tokens, represents the interpreted value of the token. + */ + readonly value: string | undefined; - /** - * Tokens exist as nodes in a double-linked-list amongst all tokens - * including ignored tokens. is always the first node and - * the last. - */ - prev?: Token; - next?: Token; + /** + * Tokens exist as nodes in a double-linked-list amongst all tokens + * including ignored tokens. is always the first node and + * the last. + */ + readonly prev: Token | null; + readonly next: Token | null; } /** * The list of all possible AST node types. */ export type ASTNode = - | NameNode - | DocumentNode - | OperationDefinitionNode - | VariableDefinitionNode - | VariableNode - | SelectionSetNode - | FieldNode - | ArgumentNode - | FragmentSpreadNode - | InlineFragmentNode - | FragmentDefinitionNode - | IntValueNode - | FloatValueNode - | StringValueNode - | BooleanValueNode - | NullValueNode - | EnumValueNode - | ListValueNode - | ObjectValueNode - | ObjectFieldNode - | DirectiveNode - | NamedTypeNode - | ListTypeNode - | NonNullTypeNode - | SchemaDefinitionNode - | OperationTypeDefinitionNode - | ScalarTypeDefinitionNode - | ObjectTypeDefinitionNode - | FieldDefinitionNode - | InputValueDefinitionNode - | InterfaceTypeDefinitionNode - | UnionTypeDefinitionNode - | EnumTypeDefinitionNode - | EnumValueDefinitionNode - | InputObjectTypeDefinitionNode - | ScalarTypeExtensionNode - | ObjectTypeExtensionNode - | InterfaceTypeExtensionNode - | UnionTypeExtensionNode - | EnumTypeExtensionNode - | InputObjectTypeExtensionNode - | DirectiveDefinitionNode; + | NameNode + | DocumentNode + | OperationDefinitionNode + | VariableDefinitionNode + | VariableNode + | SelectionSetNode + | FieldNode + | ArgumentNode + | FragmentSpreadNode + | InlineFragmentNode + | FragmentDefinitionNode + | IntValueNode + | FloatValueNode + | StringValueNode + | BooleanValueNode + | NullValueNode + | EnumValueNode + | ListValueNode + | ObjectValueNode + | ObjectFieldNode + | DirectiveNode + | NamedTypeNode + | ListTypeNode + | NonNullTypeNode + | SchemaDefinitionNode + | OperationTypeDefinitionNode + | ScalarTypeDefinitionNode + | ObjectTypeDefinitionNode + | FieldDefinitionNode + | InputValueDefinitionNode + | InterfaceTypeDefinitionNode + | UnionTypeDefinitionNode + | EnumTypeDefinitionNode + | EnumValueDefinitionNode + | InputObjectTypeDefinitionNode + | ScalarTypeExtensionNode + | ObjectTypeExtensionNode + | InterfaceTypeExtensionNode + | UnionTypeExtensionNode + | EnumTypeExtensionNode + | InputObjectTypeExtensionNode + | DirectiveDefinitionNode; /** * Utility type listing all nodes indexed by their kind. */ export interface ASTKindToNode { - Name: NameNode; - Document: DocumentNode; - OperationDefinition: OperationDefinitionNode; - VariableDefinition: VariableDefinitionNode; - Variable: VariableNode; - SelectionSet: SelectionSetNode; - Field: FieldNode; - Argument: ArgumentNode; - FragmentSpread: FragmentSpreadNode; - InlineFragment: InlineFragmentNode; - FragmentDefinition: FragmentDefinitionNode; - IntValue: IntValueNode; - FloatValue: FloatValueNode; - StringValue: StringValueNode; - BooleanValue: BooleanValueNode; - NullValue: NullValueNode; - EnumValue: EnumValueNode; - ListValue: ListValueNode; - ObjectValue: ObjectValueNode; - ObjectField: ObjectFieldNode; - Directive: DirectiveNode; - NamedType: NamedTypeNode; - ListType: ListTypeNode; - NonNullType: NonNullTypeNode; - SchemaDefinition: SchemaDefinitionNode; - OperationTypeDefinition: OperationTypeDefinitionNode; - ScalarTypeDefinition: ScalarTypeDefinitionNode; - ObjectTypeDefinition: ObjectTypeDefinitionNode; - FieldDefinition: FieldDefinitionNode; - InputValueDefinition: InputValueDefinitionNode; - InterfaceTypeDefinition: InterfaceTypeDefinitionNode; - UnionTypeDefinition: UnionTypeDefinitionNode; - EnumTypeDefinition: EnumTypeDefinitionNode; - EnumValueDefinition: EnumValueDefinitionNode; - InputObjectTypeDefinition: InputObjectTypeDefinitionNode; - ScalarTypeExtension: ScalarTypeExtensionNode; - ObjectTypeExtension: ObjectTypeExtensionNode; - InterfaceTypeExtension: InterfaceTypeExtensionNode; - UnionTypeExtension: UnionTypeExtensionNode; - EnumTypeExtension: EnumTypeExtensionNode; - InputObjectTypeExtension: InputObjectTypeExtensionNode; - DirectiveDefinition: DirectiveDefinitionNode; + Name: NameNode; + Document: DocumentNode; + OperationDefinition: OperationDefinitionNode; + VariableDefinition: VariableDefinitionNode; + Variable: VariableNode; + SelectionSet: SelectionSetNode; + Field: FieldNode; + Argument: ArgumentNode; + FragmentSpread: FragmentSpreadNode; + InlineFragment: InlineFragmentNode; + FragmentDefinition: FragmentDefinitionNode; + IntValue: IntValueNode; + FloatValue: FloatValueNode; + StringValue: StringValueNode; + BooleanValue: BooleanValueNode; + NullValue: NullValueNode; + EnumValue: EnumValueNode; + ListValue: ListValueNode; + ObjectValue: ObjectValueNode; + ObjectField: ObjectFieldNode; + Directive: DirectiveNode; + NamedType: NamedTypeNode; + ListType: ListTypeNode; + NonNullType: NonNullTypeNode; + SchemaDefinition: SchemaDefinitionNode; + OperationTypeDefinition: OperationTypeDefinitionNode; + ScalarTypeDefinition: ScalarTypeDefinitionNode; + ObjectTypeDefinition: ObjectTypeDefinitionNode; + FieldDefinition: FieldDefinitionNode; + InputValueDefinition: InputValueDefinitionNode; + InterfaceTypeDefinition: InterfaceTypeDefinitionNode; + UnionTypeDefinition: UnionTypeDefinitionNode; + EnumTypeDefinition: EnumTypeDefinitionNode; + EnumValueDefinition: EnumValueDefinitionNode; + InputObjectTypeDefinition: InputObjectTypeDefinitionNode; + ScalarTypeExtension: ScalarTypeExtensionNode; + ObjectTypeExtension: ObjectTypeExtensionNode; + InterfaceTypeExtension: InterfaceTypeExtensionNode; + UnionTypeExtension: UnionTypeExtensionNode; + EnumTypeExtension: EnumTypeExtensionNode; + InputObjectTypeExtension: InputObjectTypeExtensionNode; + DirectiveDefinition: DirectiveDefinitionNode; } // Name export interface NameNode { - kind: 'Name'; - loc?: Location; - value: string; + readonly kind: "Name"; + readonly loc?: Location; + readonly value: string; } // Document export interface DocumentNode { - kind: 'Document'; - loc?: Location; - definitions: DefinitionNode[]; + readonly kind: "Document"; + readonly loc?: Location; + readonly definitions: ReadonlyArray; } -export type DefinitionNode = - | ExecutableDefinitionNode - | TypeSystemDefinitionNode; // experimental non-spec addition. +export type DefinitionNode = ExecutableDefinitionNode | TypeSystemDefinitionNode; // experimental non-spec addition. -export type ExecutableDefinitionNode = - | OperationDefinitionNode - | FragmentDefinitionNode; +export type ExecutableDefinitionNode = OperationDefinitionNode | FragmentDefinitionNode; export interface OperationDefinitionNode { - kind: 'OperationDefinition'; - loc?: Location; - operation: OperationTypeNode; - name?: NameNode; - variableDefinitions?: VariableDefinitionNode[]; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + readonly kind: "OperationDefinition"; + readonly loc?: Location; + readonly operation: OperationTypeNode; + readonly name?: NameNode; + readonly variableDefinitions?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly selectionSet: SelectionSetNode; } -// Note: subscription is an experimental non-spec addition. -export type OperationTypeNode = 'query' | 'mutation' | 'subscription'; +export type OperationTypeNode = "query" | "mutation" | "subscription"; export interface VariableDefinitionNode { - kind: 'VariableDefinition'; - loc?: Location; - variable: VariableNode; - type: TypeNode; - defaultValue?: ValueNode; + readonly kind: "VariableDefinition"; + readonly loc?: Location; + readonly variable: VariableNode; + readonly type: TypeNode; + readonly defaultValue?: ValueNode; } export interface VariableNode { - kind: 'Variable'; - loc?: Location; - name: NameNode; + readonly kind: "Variable"; + readonly loc?: Location; + readonly name: NameNode; } export interface SelectionSetNode { - kind: 'SelectionSet'; - loc?: Location; - selections: SelectionNode[]; + kind: "SelectionSet"; + loc?: Location; + selections: ReadonlyArray; } export type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode; export interface FieldNode { - kind: 'Field'; - loc?: Location; - alias?: NameNode; - name: NameNode; - arguments?: ArgumentNode[]; - directives?: DirectiveNode[]; - selectionSet?: SelectionSetNode; + readonly kind: "Field"; + readonly loc?: Location; + readonly alias?: NameNode; + readonly name: NameNode; + readonly arguments?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly selectionSet?: SelectionSetNode; } export interface ArgumentNode { - kind: 'Argument'; - loc?: Location; - name: NameNode; - value: ValueNode; + readonly kind: "Argument"; + readonly loc?: Location; + readonly name: NameNode; + readonly value: ValueNode; } // Fragments export interface FragmentSpreadNode { - kind: 'FragmentSpread'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; + readonly kind: "FragmentSpread"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; } export interface InlineFragmentNode { - kind: 'InlineFragment'; - loc?: Location; - typeCondition?: NamedTypeNode; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + readonly kind: "InlineFragment"; + readonly loc?: Location; + readonly typeCondition?: NamedTypeNode; + readonly directives?: ReadonlyArray; + readonly selectionSet: SelectionSetNode; } export interface FragmentDefinitionNode { - kind: 'FragmentDefinition'; - loc?: Location; - name: NameNode; - // Note: fragment variable definitions are experimental and may be changed - // or removed in the future. - variableDefinitions?: VariableDefinitionNode[]; - typeCondition: NamedTypeNode; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + readonly kind: "FragmentDefinition"; + readonly loc?: Location; + readonly name: NameNode; + // Note: fragment variable definitions are experimental and may be changed + // or removed in the future. + readonly variableDefinitions?: ReadonlyArray; + readonly typeCondition: NamedTypeNode; + readonly directives?: ReadonlyArray; + readonly selectionSet: SelectionSetNode; } // Values export type ValueNode = - | VariableNode - | IntValueNode - | FloatValueNode - | StringValueNode - | BooleanValueNode - | NullValueNode - | EnumValueNode - | ListValueNode - | ObjectValueNode; + | VariableNode + | IntValueNode + | FloatValueNode + | StringValueNode + | BooleanValueNode + | NullValueNode + | EnumValueNode + | ListValueNode + | ObjectValueNode; export interface IntValueNode { - kind: 'IntValue'; - loc?: Location; - value: string; + readonly kind: "IntValue"; + readonly loc?: Location; + readonly value: string; } export interface FloatValueNode { - kind: 'FloatValue'; - loc?: Location; - value: string; + readonly kind: "FloatValue"; + readonly loc?: Location; + readonly value: string; } export interface StringValueNode { - kind: 'StringValue'; - loc?: Location; - value: string; + readonly kind: "StringValue"; + readonly loc?: Location; + readonly value: string; + readonly block?: boolean; } export interface BooleanValueNode { - kind: 'BooleanValue'; - loc?: Location; - value: boolean; + readonly kind: "BooleanValue"; + readonly loc?: Location; + readonly value: boolean; } export interface NullValueNode { - kind: 'NullValue'; - loc?: Location; + readonly kind: "NullValue"; + readonly loc?: Location; } export interface EnumValueNode { - kind: 'EnumValue'; - loc?: Location; - value: string; + readonly kind: "EnumValue"; + readonly loc?: Location; + readonly value: string; } export interface ListValueNode { - kind: 'ListValue'; - loc?: Location; - values: ValueNode[]; + readonly kind: "ListValue"; + readonly loc?: Location; + readonly values: ReadonlyArray; } export interface ObjectValueNode { - kind: 'ObjectValue'; - loc?: Location; - fields: ObjectFieldNode[]; + readonly kind: "ObjectValue"; + readonly loc?: Location; + readonly fields: ReadonlyArray; } export interface ObjectFieldNode { - kind: 'ObjectField'; - loc?: Location; - name: NameNode; - value: ValueNode; + readonly kind: "ObjectField"; + readonly loc?: Location; + readonly name: NameNode; + readonly value: ValueNode; } // Directives export interface DirectiveNode { - kind: 'Directive'; - loc?: Location; - name: NameNode; - arguments?: ArgumentNode[]; + readonly kind: "Directive"; + readonly loc?: Location; + readonly name: NameNode; + readonly arguments?: ReadonlyArray; } // Type Reference @@ -384,198 +353,202 @@ export interface DirectiveNode { export type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode; export interface NamedTypeNode { - kind: 'NamedType'; - loc?: Location; - name: NameNode; + readonly kind: "NamedType"; + readonly loc?: Location; + readonly name: NameNode; } export interface ListTypeNode { - kind: 'ListType'; - loc?: Location; - type: TypeNode; + readonly kind: "ListType"; + readonly loc?: Location; + readonly type: TypeNode; } export interface NonNullTypeNode { - kind: 'NonNullType'; - loc?: Location; - type: NamedTypeNode | ListTypeNode; + readonly kind: "NonNullType"; + readonly loc?: Location; + readonly type: NamedTypeNode | ListTypeNode; } // Type System Definition export type TypeSystemDefinitionNode = - | SchemaDefinitionNode - | TypeDefinitionNode - | TypeExtensionNode - | DirectiveDefinitionNode; + | SchemaDefinitionNode + | TypeDefinitionNode + | TypeExtensionNode + | DirectiveDefinitionNode; export interface SchemaDefinitionNode { - kind: 'SchemaDefinition'; - loc?: Location; - directives: DirectiveNode[]; - operationTypes: OperationTypeDefinitionNode[]; + readonly kind: "SchemaDefinition"; + readonly loc?: Location; + readonly directives: ReadonlyArray; + readonly operationTypes: ReadonlyArray; } export interface OperationTypeDefinitionNode { - kind: 'OperationTypeDefinition'; - loc?: Location; - operation: OperationTypeNode; - type: NamedTypeNode; + readonly kind: "OperationTypeDefinition"; + readonly loc?: Location; + readonly operation: OperationTypeNode; + readonly type: NamedTypeNode; } +// Type Definition + export type TypeDefinitionNode = - | ScalarTypeDefinitionNode - | ObjectTypeDefinitionNode - | InterfaceTypeDefinitionNode - | UnionTypeDefinitionNode - | EnumTypeDefinitionNode - | InputObjectTypeDefinitionNode; + | ScalarTypeDefinitionNode + | ObjectTypeDefinitionNode + | InterfaceTypeDefinitionNode + | UnionTypeDefinitionNode + | EnumTypeDefinitionNode + | InputObjectTypeDefinitionNode; export interface ScalarTypeDefinitionNode { - kind: 'ScalarTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; + readonly kind: "ScalarTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; } export interface ObjectTypeDefinitionNode { - kind: 'ObjectTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - interfaces?: NamedTypeNode[]; - directives?: DirectiveNode[]; - fields: FieldDefinitionNode[]; + readonly kind: "ObjectTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly interfaces?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; } export interface FieldDefinitionNode { - kind: 'FieldDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - arguments: InputValueDefinitionNode[]; - type: TypeNode; - directives?: DirectiveNode[]; + readonly kind: "FieldDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly arguments?: ReadonlyArray; + readonly type: TypeNode; + readonly directives?: ReadonlyArray; } export interface InputValueDefinitionNode { - kind: 'InputValueDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - type: TypeNode; - defaultValue?: ValueNode; - directives?: DirectiveNode[]; + readonly kind: "InputValueDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly type: TypeNode; + readonly defaultValue?: ValueNode; + readonly directives?: ReadonlyArray; } export interface InterfaceTypeDefinitionNode { - kind: 'InterfaceTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - fields: FieldDefinitionNode[]; + readonly kind: "InterfaceTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; } export interface UnionTypeDefinitionNode { - kind: 'UnionTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - types: NamedTypeNode[]; + readonly kind: "UnionTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly types?: ReadonlyArray; } export interface EnumTypeDefinitionNode { - kind: 'EnumTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - values: EnumValueDefinitionNode[]; + readonly kind: "EnumTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly values?: ReadonlyArray; } export interface EnumValueDefinitionNode { - kind: 'EnumValueDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; + readonly kind: "EnumValueDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; } export interface InputObjectTypeDefinitionNode { - kind: 'InputObjectTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - fields: InputValueDefinitionNode[]; + readonly kind: "InputObjectTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; } +// Type Extensions + export type TypeExtensionNode = - | ScalarTypeExtensionNode - | ObjectTypeExtensionNode - | InterfaceTypeExtensionNode - | UnionTypeExtensionNode - | EnumTypeExtensionNode - | InputObjectTypeExtensionNode; + | ScalarTypeExtensionNode + | ObjectTypeExtensionNode + | InterfaceTypeExtensionNode + | UnionTypeExtensionNode + | EnumTypeExtensionNode + | InputObjectTypeExtensionNode; -export type ScalarTypeExtensionNode = { - kind: 'ScalarTypeExtension'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; -}; +export interface ScalarTypeExtensionNode { + readonly kind: "ScalarTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; +} -export type ObjectTypeExtensionNode = { - kind: 'ObjectTypeExtension'; - loc?: Location; - name: NameNode; - interfaces?: NamedTypeNode[]; - directives?: DirectiveNode[]; - fields?: FieldDefinitionNode[]; -}; +export interface ObjectTypeExtensionNode { + readonly kind: "ObjectTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly interfaces?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; +} -export type InterfaceTypeExtensionNode = { - kind: 'InterfaceTypeExtension'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - fields?: FieldDefinitionNode[]; -}; +export interface InterfaceTypeExtensionNode { + readonly kind: "InterfaceTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; +} -export type UnionTypeExtensionNode = { - kind: 'UnionTypeExtension'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - types?: NamedTypeNode[]; -}; +export interface UnionTypeExtensionNode { + readonly kind: "UnionTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly types?: ReadonlyArray; +} -export type EnumTypeExtensionNode = { - kind: 'EnumTypeExtension'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - values?: EnumValueDefinitionNode[]; -}; +export interface EnumTypeExtensionNode { + readonly kind: "EnumTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly values?: ReadonlyArray; +} -export type InputObjectTypeExtensionNode = { - kind: 'InputObjectTypeExtension'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - fields?: InputValueDefinitionNode[]; -}; +export interface InputObjectTypeExtensionNode { + readonly kind: "InputObjectTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; +} // Directive Definitions export interface DirectiveDefinitionNode { - kind: 'DirectiveDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - arguments?: InputValueDefinitionNode[]; - locations: NameNode[]; + readonly kind: "DirectiveDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly arguments?: ReadonlyArray; + readonly locations: ReadonlyArray; } diff --git a/types/graphql/language/blockStringValue.d.ts b/types/graphql/language/blockStringValue.d.ts new file mode 100644 index 0000000000..64fb87dafd --- /dev/null +++ b/types/graphql/language/blockStringValue.d.ts @@ -0,0 +1,7 @@ +/** + * Produces the value of a block string from its parsed raw value, similar to + * Coffeescript's block string, Python's docstring trim or Ruby's strip_heredoc. + * + * This implements the GraphQL spec's BlockStringValue() static algorithm. + */ +export default function blockStringValue(rawString: string): string; diff --git a/types/graphql/language/directiveLocation.d.ts b/types/graphql/language/directiveLocation.d.ts new file mode 100644 index 0000000000..16c42d7877 --- /dev/null +++ b/types/graphql/language/directiveLocation.d.ts @@ -0,0 +1,34 @@ +/** + * The set of allowed directive location values. + */ +export const DirectiveLocation: _DirectiveLocation; + +// @internal +type _DirectiveLocation = { + // Request Definitions + QUERY: "QUERY"; + MUTATION: "MUTATION"; + SUBSCRIPTION: "SUBSCRIPTION"; + FIELD: "FIELD"; + FRAGMENT_DEFINITION: "FRAGMENT_DEFINITION"; + FRAGMENT_SPREAD: "FRAGMENT_SPREAD"; + INLINE_FRAGMENT: "INLINE_FRAGMENT"; + + // Type System Definitions + SCHEMA: "SCHEMA"; + SCALAR: "SCALAR"; + OBJECT: "OBJECT"; + FIELD_DEFINITION: "FIELD_DEFINITION"; + ARGUMENT_DEFINITION: "ARGUMENT_DEFINITION"; + INTERFACE: "INTERFACE"; + UNION: "UNION"; + ENUM: "ENUM"; + ENUM_VALUE: "ENUM_VALUE"; + INPUT_OBJECT: "INPUT_OBJECT"; + INPUT_FIELD_DEFINITION: "INPUT_FIELD_DEFINITION"; +}; + +/** + * The enum type representing the directive location values. + */ +export type DirectiveLocationEnum = _DirectiveLocation[keyof _DirectiveLocation]; diff --git a/types/graphql/language/index.d.ts b/types/graphql/language/index.d.ts index c8fe4b13ec..e36dcbbb91 100644 --- a/types/graphql/language/index.d.ts +++ b/types/graphql/language/index.d.ts @@ -1,15 +1,74 @@ -export * from './ast'; -export { getLocation } from './location'; -import * as Kind from './kinds'; -export { Kind }; -export { createLexer, TokenKind, Lexer } from './lexer'; -export { parse, parseValue, parseType, ParseOptions } from './parser'; -export { print } from './printer'; -export { Source } from './source'; +export { getLocation, SourceLocation } from "./location"; +export { Kind, KindEnum } from "./kinds"; +export { createLexer, TokenKind, Lexer, TokenKindEnum } from "./lexer"; +export { parse, parseValue, parseType, ParseOptions } from "./parser"; +export { print } from "./printer"; +export { Source } from "./source"; export { - visit, - visitInParallel, - visitWithTypeInfo, - getVisitFn, - BREAK, -} from './visitor'; + visit, + visitInParallel, + visitWithTypeInfo, + getVisitFn, + BREAK, + // type + ASTVisitor, + Visitor, + VisitFn, + VisitorKeyMap, +} from "./visitor"; + +export { + Location, + Token, + ASTNode, + ASTKindToNode, + // Each kind of AST node + NameNode, + DocumentNode, + DefinitionNode, + ExecutableDefinitionNode, + OperationDefinitionNode, + OperationTypeNode, + VariableDefinitionNode, + VariableNode, + SelectionSetNode, + SelectionNode, + FieldNode, + ArgumentNode, + FragmentSpreadNode, + InlineFragmentNode, + FragmentDefinitionNode, + ValueNode, + IntValueNode, + FloatValueNode, + StringValueNode, + BooleanValueNode, + NullValueNode, + EnumValueNode, + ListValueNode, + ObjectValueNode, + ObjectFieldNode, + DirectiveNode, + TypeNode, + NamedTypeNode, + ListTypeNode, + NonNullTypeNode, + TypeSystemDefinitionNode, + SchemaDefinitionNode, + OperationTypeDefinitionNode, + TypeDefinitionNode, + ScalarTypeDefinitionNode, + ObjectTypeDefinitionNode, + FieldDefinitionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + UnionTypeDefinitionNode, + EnumTypeDefinitionNode, + EnumValueDefinitionNode, + InputObjectTypeDefinitionNode, + TypeExtensionNode, + ObjectTypeExtensionNode, + DirectiveDefinitionNode, +} from "./ast"; + +export { DirectiveLocation, DirectiveLocationEnum } from "./directiveLocation"; diff --git a/types/graphql/language/kinds.d.ts b/types/graphql/language/kinds.d.ts index f92826f891..768f00addd 100644 --- a/types/graphql/language/kinds.d.ts +++ b/types/graphql/language/kinds.d.ts @@ -1,72 +1,74 @@ -// Name +/** + * The set of allowed kind values for AST nodes. + */ +export const Kind: _Kind; -export const NAME: 'Name'; +// @internal +type _Kind = { + // Name + NAME: "Name"; -// Document + // Document + DOCUMENT: "Document"; + OPERATION_DEFINITION: "OperationDefinition"; + VARIABLE_DEFINITION: "VariableDefinition"; + VARIABLE: "Variable"; + SELECTION_SET: "SelectionSet"; + FIELD: "Field"; + ARGUMENT: "Argument"; -export const DOCUMENT: 'Document'; -export const OPERATION_DEFINITION: 'OperationDefinition'; -export const VARIABLE_DEFINITION: 'VariableDefinition'; -export const VARIABLE: 'Variable'; -export const SELECTION_SET: 'SelectionSet'; -export const FIELD: 'Field'; -export const ARGUMENT: 'Argument'; + // Fragments + FRAGMENT_SPREAD: "FragmentSpread"; + INLINE_FRAGMENT: "InlineFragment"; + FRAGMENT_DEFINITION: "FragmentDefinition"; -// Fragments + // Values + INT: "IntValue"; + FLOAT: "FloatValue"; + STRING: "StringValue"; + BOOLEAN: "BooleanValue"; + NULL: "NullValue"; + ENUM: "EnumValue"; + LIST: "ListValue"; + OBJECT: "ObjectValue"; + OBJECT_FIELD: "ObjectField"; -export const FRAGMENT_SPREAD: 'FragmentSpread'; -export const INLINE_FRAGMENT: 'InlineFragment'; -export const FRAGMENT_DEFINITION: 'FragmentDefinition'; + // Directives + DIRECTIVE: "Directive"; -// Values + // Types + NAMED_TYPE: "NamedType"; + LIST_TYPE: "ListType"; + NON_NULL_TYPE: "NonNullType"; -export const INT: 'IntValue'; -export const FLOAT: 'FloatValue'; -export const STRING: 'StringValue'; -export const BOOLEAN: 'BooleanValue'; -export const NULL: 'NullValue'; -export const ENUM: 'EnumValue'; -export const LIST: 'ListValue'; -export const OBJECT: 'ObjectValue'; -export const OBJECT_FIELD: 'ObjectField'; + // Type System Definitions + SCHEMA_DEFINITION: "SchemaDefinition"; + OPERATION_TYPE_DEFINITION: "OperationTypeDefinition"; -// Directives + // Type Definitions + SCALAR_TYPE_DEFINITION: "ScalarTypeDefinition"; + OBJECT_TYPE_DEFINITION: "ObjectTypeDefinition"; + FIELD_DEFINITION: "FieldDefinition"; + INPUT_VALUE_DEFINITION: "InputValueDefinition"; + INTERFACE_TYPE_DEFINITION: "InterfaceTypeDefinition"; + UNION_TYPE_DEFINITION: "UnionTypeDefinition"; + ENUM_TYPE_DEFINITION: "EnumTypeDefinition"; + ENUM_VALUE_DEFINITION: "EnumValueDefinition"; + INPUT_OBJECT_TYPE_DEFINITION: "InputObjectTypeDefinition"; -export const DIRECTIVE: 'Directive'; + // Type Extensions + SCALAR_TYPE_EXTENSION: "ScalarTypeExtension"; + OBJECT_TYPE_EXTENSION: "ObjectTypeExtension"; + INTERFACE_TYPE_EXTENSION: "InterfaceTypeExtension"; + UNION_TYPE_EXTENSION: "UnionTypeExtension"; + ENUM_TYPE_EXTENSION: "EnumTypeExtension"; + INPUT_OBJECT_TYPE_EXTENSION: "InputObjectTypeExtension"; -// Types + // Directive Definitions + DIRECTIVE_DEFINITION: "DirectiveDefinition"; +}; -export const NAMED_TYPE: 'NamedType'; -export const LIST_TYPE: 'ListType'; -export const NON_NULL_TYPE: 'NonNullType'; - -// Type System Definitions - -export const SCHEMA_DEFINITION: 'SchemaDefinition'; -export const OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition'; - -// Type Definitions - -export const SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition'; -export const OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition'; -export const FIELD_DEFINITION: 'FieldDefinition'; -export const INPUT_VALUE_DEFINITION: 'InputValueDefinition'; -export const INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition'; -export const UNION_TYPE_DEFINITION: 'UnionTypeDefinition'; -export const ENUM_TYPE_DEFINITION: 'EnumTypeDefinition'; -export const ENUM_VALUE_DEFINITION: 'EnumValueDefinition'; -export const INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition'; - -// Type Extensions - -export const TYPE_EXTENSION_DEFINITION: 'TypeExtensionDefinition'; -export const SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension'; -export const OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension'; -export const INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension'; -export const UNION_TYPE_EXTENSION: 'UnionTypeExtension'; -export const ENUM_TYPE_EXTENSION: 'EnumTypeExtension'; -export const INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension'; - -// Directive Definitions - -export const DIRECTIVE_DEFINITION: 'DirectiveDefinition'; +/** + * The enum type representing the possible kind values of AST nodes. + */ +export type KindEnum = _Kind[keyof _Kind]; diff --git a/types/graphql/language/lexer.d.ts b/types/graphql/language/lexer.d.ts index 0db85434e2..19a57d3a11 100644 --- a/types/graphql/language/lexer.d.ts +++ b/types/graphql/language/lexer.d.ts @@ -1,6 +1,6 @@ -import { Token } from './ast'; -import { Source } from './source'; -import { syntaxError } from '../error'; +import { Token } from "./ast"; +import { Source } from "./source"; +import { syntaxError } from "../error"; /** * Given a Source object, this returns a Lexer for that source. @@ -10,71 +10,84 @@ import { syntaxError } from '../error'; * EOF, after which the lexer will repeatedly return the same EOF token * whenever called. */ -export function createLexer( - source: Source, - options: TOptions, -): Lexer; +export function createLexer(source: Source, options: TOptions): Lexer; /** * The return type of createLexer. */ export interface Lexer { - source: Source; - options: TOptions; + source: Source; + options: TOptions; - /** - * The previously focused non-ignored token. - */ - lastToken: Token; + /** + * The previously focused non-ignored token. + */ + lastToken: Token; - /** - * The currently focused non-ignored token. - */ - token: Token; + /** + * The currently focused non-ignored token. + */ + token: Token; - /** - * The (1-indexed) line containing the current token. - */ - line: number; + /** + * The (1-indexed) line containing the current token. + */ + line: number; - /** - * The character offset at which the current line begins. - */ - lineStart: number; + /** + * The character offset at which the current line begins. + */ + lineStart: number; - /** - * Advances the token stream to the next non-ignored token. - */ - advance(): Token; + /** + * Advances the token stream to the next non-ignored token. + */ + advance(): Token; + + /** + * Looks ahead and returns the next non-ignored token, but does not change + * the Lexer's state. + */ + lookahead(): Token; } /** * An exported enum describing the different kinds of tokens that the * lexer emits. */ -export const TokenKind: { - SOF: ''; - EOF: ''; - BANG: '!'; - DOLLAR: '$'; - PAREN_L: '('; - PAREN_R: ')'; - SPREAD: '...'; - COLON: ':'; - EQUALS: '='; - AT: '@'; - BRACKET_L: '['; - BRACKET_R: ']'; - BRACE_L: '{'; - PIPE: '|'; - BRACE_R: '}'; - NAME: 'Name'; - INT: 'Int'; - FLOAT: 'Float'; - STRING: 'String'; - COMMENT: 'Comment'; +export const TokenKind: _TokenKind; + +// @internal +type _TokenKind = { + SOF: ""; + EOF: ""; + BANG: "!"; + DOLLAR: "$"; + AMP: "&"; + PAREN_L: "("; + PAREN_R: ")"; + SPREAD: "..."; + COLON: ":"; + EQUALS: "="; + AT: "@"; + BRACKET_L: "["; + BRACKET_R: "]"; + BRACE_L: "{"; + PIPE: "|"; + BRACE_R: "}"; + NAME: "Name"; + INT: "Int"; + FLOAT: "Float"; + STRING: "String"; + BLOCK_STRING: "BlockString"; + COMMENT: "Comment"; }; +/** + * The enum type representing the token kinds values. + */ +export type TokenKindEnum = _TokenKind[keyof _TokenKind]; + /** * A helper function to describe a token as a string for debugging */ diff --git a/types/graphql/language/location.d.ts b/types/graphql/language/location.d.ts index cb9744e0d5..6090531718 100644 --- a/types/graphql/language/location.d.ts +++ b/types/graphql/language/location.d.ts @@ -1,8 +1,15 @@ -import { Source } from './source'; +import { Source } from "./source"; +/** + * Represents a location in a Source. + */ export interface SourceLocation { - line: number; - column: number; + readonly line: number; + readonly column: number; } +/** + * Takes a Source and a UTF-8 character offset, and returns the corresponding + * line and column as a SourceLocation. + */ export function getLocation(source: Source, position: number): SourceLocation; diff --git a/types/graphql/language/parser.d.ts b/types/graphql/language/parser.d.ts index ffafaae7fb..b07db1ff38 100644 --- a/types/graphql/language/parser.d.ts +++ b/types/graphql/language/parser.d.ts @@ -1,66 +1,62 @@ -import { NamedTypeNode, TypeNode, ValueNode, DocumentNode } from './ast'; -import { Source } from './source'; -import { Lexer } from './lexer'; +import { NamedTypeNode, TypeNode, ValueNode, DocumentNode } from "./ast"; +import { Source } from "./source"; +import { Lexer } from "./lexer"; /** * Configuration options to control parser behavior */ export interface ParseOptions { + /** + * By default, the parser creates AST nodes that know the location + * in the source that they correspond to. This configuration flag + * disables that behavior for performance or testing. + */ + noLocation?: boolean; - /** - * By default, the parser creates AST nodes that know the location - * in the source that they correspond to. This configuration flag - * disables that behavior for performance or testing. - */ - noLocation?: boolean, + /** + * If enabled, the parser will parse empty fields sets in the Schema + * Definition Language. Otherwise, the parser will follow the current + * specification. + * + * This option is provided to ease adoption of the final SDL specification + * and will be removed in a future major release. + */ + allowLegacySDLEmptyFields?: boolean; - /** - * If enabled, the parser will parse empty fields sets in the Schema - * Definition Language. Otherwise, the parser will follow the current - * specification. - * - * This option is provided to ease adoption of the final SDL specification - * and will be removed in a future major release. - */ - allowLegacySDLEmptyFields?: boolean, + /** + * If enabled, the parser will parse implemented interfaces with no `&` + * character between each interface. Otherwise, the parser will follow the + * current specification. + * + * This option is provided to ease adoption of the final SDL specification + * and will be removed in a future major release. + */ + allowLegacySDLImplementsInterfaces?: boolean; - /** - * If enabled, the parser will parse implemented interfaces with no `&` - * character between each interface. Otherwise, the parser will follow the - * current specification. - * - * This option is provided to ease adoption of the final SDL specification - * and will be removed in a future major release. - */ - allowLegacySDLImplementsInterfaces?: boolean, - - /** - * EXPERIMENTAL: - * - * If enabled, the parser will understand and parse variable definitions - * contained in a fragment definition. They'll be represented in the - * `variableDefinitions` field of the FragmentDefinitionNode. - * - * The syntax is identical to normal, query-defined variables. For example: - * - * fragment A($var: Boolean = false) on T { - * ... - * } - * - * Note: this feature is experimental and may change or be removed in the - * future. - */ - experimentalFragmentVariables?: boolean, + /** + * EXPERIMENTAL: + * + * If enabled, the parser will understand and parse variable definitions + * contained in a fragment definition. They'll be represented in the + * `variableDefinitions` field of the FragmentDefinitionNode. + * + * The syntax is identical to normal, query-defined variables. For example: + * + * fragment A($var: Boolean = false) on T { + * ... + * } + * + * Note: this feature is experimental and may change or be removed in the + * future. + */ + experimentalFragmentVariables?: boolean; } /** * Given a GraphQL source, parses it into a Document. * Throws GraphQLError if a syntax error is encountered. */ -export function parse( - source: string | Source, - options?: ParseOptions, -): DocumentNode; +export function parse(source: string | Source, options?: ParseOptions): DocumentNode; /** * Given a string containing a GraphQL value, parse the AST for that value. @@ -69,10 +65,7 @@ export function parse( * This is useful within tools that operate upon GraphQL Values directly and * in isolation of complete GraphQL documents. */ -export function parseValue( - source: Source | string, - options?: ParseOptions, -): ValueNode; +export function parseValue(source: string | Source, options?: ParseOptions): ValueNode; /** * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for @@ -84,10 +77,7 @@ export function parseValue( * * Consider providing the results to the utility function: typeFromAST(). */ -export function parseType( - source: Source | string, - options?: ParseOptions, -): TypeNode; +export function parseType(source: string | Source, options?: ParseOptions): TypeNode; export function parseConstValue(lexer: Lexer): ValueNode; diff --git a/types/graphql/language/source.d.ts b/types/graphql/language/source.d.ts index 236028b7df..26d89640c3 100644 --- a/types/graphql/language/source.d.ts +++ b/types/graphql/language/source.d.ts @@ -1,5 +1,19 @@ +interface Location { + line: number; + column: number; +} + +/** + * A representation of source input to GraphQL. + * `name` and `locationOffset` are optional. They are useful for clients who + * store GraphQL documents in source files; for example, if the GraphQL input + * starts at line 40 in a file named Foo.graphql, it might be useful for name to + * be "Foo.graphql" and location to be `{ line: 40, column: 0 }`. + * line and column in locationOffset are 1-indexed + */ export class Source { - body: string; - name: string; - constructor(body: string, name?: string); + body: string; + name: string; + locationOffset: Location; + constructor(body: string, name?: string, locationOffset?: Location); } diff --git a/types/graphql/language/visitor.d.ts b/types/graphql/language/visitor.d.ts index e7e9d67da0..a137fa318e 100644 --- a/types/graphql/language/visitor.d.ts +++ b/types/graphql/language/visitor.d.ts @@ -1,55 +1,160 @@ -export const QueryDocumentKeys: { - Name: any[]; - Document: string[]; - OperationDefinition: string[]; - VariableDefinition: string[]; - Variable: string[]; - SelectionSet: string[]; - Field: string[]; - Argument: string[]; +import { ASTNode, ASTKindToNode } from "./ast"; +import { TypeInfo } from "../utilities/TypeInfo"; - FragmentSpread: string[]; - InlineFragment: string[]; - FragmentDefinition: string[]; +interface EnterLeave { + readonly enter?: T; + readonly leave?: T; +} - IntValue: number[]; - FloatValue: number[]; - StringValue: string[]; - BooleanValue: boolean[]; - NullValue: null[]; - EnumValue: any[]; - ListValue: string[]; - ObjectValue: string[]; - ObjectField: string[]; +type EnterLeaveVisitor = EnterLeave< + VisitFn | { [K in keyof KindToNode]?: VisitFn } +>; - Directive: string[]; - - NamedType: string[]; - ListType: string[]; - NonNullType: string[]; - - ObjectTypeDefinition: string[]; - FieldDefinition: string[]; - InputValueDefinition: string[]; - InterfaceTypeDefinition: string[]; - UnionTypeDefinition: string[]; - ScalarTypeDefinition: string[]; - EnumTypeDefinition: string[]; - EnumValueDefinition: string[]; - InputObjectTypeDefinition: string[]; - TypeExtensionDefinition: string[]; +type ShapeMapVisitor = { + [K in keyof KindToNode]?: VisitFn | EnterLeave> }; +export type ASTVisitor = Visitor; +export type Visitor = + | EnterLeaveVisitor + | ShapeMapVisitor; + +/** + * A visitor is comprised of visit functions, which are called on each node + * during the visitor's traversal. + */ +export type VisitFn = ( + // The current node being visiting. + node: TVisitedNode, + // The index or key to this node from the parent node or Array. + key: string | number | undefined, + // The parent immediately above this node, which may be an Array. + parent: TAnyNode | ReadonlyArray | undefined, + // The key path to get to this node from the root node. + path: ReadonlyArray, + // All nodes and Arrays visited before reaching this node. + // These correspond to array indices in `path`. + // Note: ancestors includes arrays which contain the visited node. + ancestors: ReadonlyArray> +) => any; + +/** + * A KeyMap describes each the traversable properties of each kind of node. + */ +export type VisitorKeyMap = { [P in keyof T]: ReadonlyArray }; + +export const QueryDocumentKeys: { [key: string]: string[] }; + export const BREAK: any; -export function visit(root: any, visitor: any, keyMap?: any): any; +/** + * visit() will walk through an AST using a depth first traversal, calling + * the visitor's enter function at each node in the traversal, and calling the + * leave function after visiting that node and all of its child nodes. + * + * By returning different values from the enter and leave functions, the + * behavior of the visitor can be altered, including skipping over a sub-tree of + * the AST (by returning false), editing the AST by returning a value or null + * to remove the value, or to stop the whole traversal by returning BREAK. + * + * When using visit() to edit an AST, the original AST will not be modified, and + * a new version of the AST with the changes applied will be returned from the + * visit function. + * + * const editedAST = visit(ast, { + * enter(node, key, parent, path, ancestors) { + * // @return + * // undefined: no action + * // false: skip visiting this node + * // visitor.BREAK: stop visiting altogether + * // null: delete this node + * // any value: replace this node with the returned value + * }, + * leave(node, key, parent, path, ancestors) { + * // @return + * // undefined: no action + * // false: no action + * // visitor.BREAK: stop visiting altogether + * // null: delete this node + * // any value: replace this node with the returned value + * } + * }); + * + * Alternatively to providing enter() and leave() functions, a visitor can + * instead provide functions named the same as the kinds of AST nodes, or + * enter/leave visitors at a named key, leading to four permutations of + * visitor API: + * + * 1) Named visitors triggered when entering a node a specific kind. + * + * visit(ast, { + * Kind(node) { + * // enter the "Kind" node + * } + * }) + * + * 2) Named visitors that trigger upon entering and leaving a node of + * a specific kind. + * + * visit(ast, { + * Kind: { + * enter(node) { + * // enter the "Kind" node + * } + * leave(node) { + * // leave the "Kind" node + * } + * } + * }) + * + * 3) Generic visitors that trigger upon entering and leaving any node. + * + * visit(ast, { + * enter(node) { + * // enter any node + * }, + * leave(node) { + * // leave any node + * } + * }) + * + * 4) Parallel visitors for entering and leaving nodes of a specific kind. + * + * visit(ast, { + * enter: { + * Kind(node) { + * // enter the "Kind" node + * } + * }, + * leave: { + * Kind(node) { + * // leave the "Kind" node + * } + * } + * }) + */ +export function visit( + root: ASTNode, + visitor: Visitor, + visitorKeys?: VisitorKeyMap // default: QueryDocumentKeys +): any; -export function visitInParallel(visitors: any): any; +/** + * Creates a new visitor instance which delegates to many visitors to run in + * parallel. Each visitor will be visited for each node before moving on. + * + * If a prior visitor edits a node, no following visitors will see that node. + */ +export function visitInParallel(visitors: Array>): Visitor; -export function visitWithTypeInfo(typeInfo: any, visitor: any): any; +/** + * Creates a new visitor instance which maintains a provided TypeInfo instance + * along with visiting visitor. + */ +export function visitWithTypeInfo(typeInfo: TypeInfo, visitor: Visitor): Visitor; /** * Given a visitor instance, if it is leaving or not, and a node kind, return * the function the visitor runtime should call. */ -export function getVisitFn(visitor: any, kind: any, isLeaving: any): any; +export function getVisitFn(visitor: Visitor, kind: string, isLeaving: boolean): VisitFn | void; diff --git a/types/graphql/subscription/index.d.ts b/types/graphql/subscription/index.d.ts index 11b0a7f26d..71583e7ff3 100644 --- a/types/graphql/subscription/index.d.ts +++ b/types/graphql/subscription/index.d.ts @@ -1 +1 @@ -export { subscribe, createSourceEventStream } from './subscribe'; +export { subscribe, createSourceEventStream } from "./subscribe"; diff --git a/types/graphql/subscription/subscribe.d.ts b/types/graphql/subscription/subscribe.d.ts index dc2c096b86..a9fe6b565e 100644 --- a/types/graphql/subscription/subscribe.d.ts +++ b/types/graphql/subscription/subscribe.d.ts @@ -1,29 +1,74 @@ -import { GraphQLSchema } from '../type/schema'; -import { DocumentNode } from '../language/ast'; -import { GraphQLFieldResolver } from '../type/definition'; -import { ExecutionResult } from '../execution/execute'; +import { GraphQLSchema } from "../type/schema"; +import { DocumentNode } from "../language/ast"; +import { GraphQLFieldResolver } from "../type/definition"; +import { ExecutionResult } from "../execution/execute"; + +/** + * Implements the "Subscribe" algorithm described in the GraphQL specification. + * + * Returns a Promise which resolves to either an AsyncIterator (if successful) + * or an ExecutionResult (client error). The promise will be rejected if a + * server error occurs. + * + * If the client-provided arguments to this function do not result in a + * compliant subscription, a GraphQL Response (ExecutionResult) with + * descriptive errors and no data will be returned. + * + * If the the source stream could not be created due to faulty subscription + * resolver logic or underlying systems, the promise will resolve to a single + * ExecutionResult containing `errors` and no `data`. + * + * If the operation succeeded, the promise resolves to an AsyncIterator, which + * yields a stream of ExecutionResults representing the response stream. + * + * Accepts either an object with named arguments, or individual arguments. + */ +export function subscribe(args: { + schema: GraphQLSchema; + document: DocumentNode; + rootValue?: any; + contextValue?: any; + variableValues?: { [key: string]: any } | void; + operationName?: string | void; + fieldResolver?: GraphQLFieldResolver | void; + subscribeFieldResolver?: GraphQLFieldResolver | void; +}): Promise | ExecutionResult>; export function subscribe( - schema: GraphQLSchema, - document: DocumentNode, - rootValue?: any, - contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver, - subscribeFieldResolver?: GraphQLFieldResolver, + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: any, + contextValue?: any, + variableValues?: { [key: string]: any } | void, + operationName?: string | void, + fieldResolver?: GraphQLFieldResolver | void, + subscribeFieldResolver?: GraphQLFieldResolver | void ): Promise | ExecutionResult>; +/** + * Implements the "CreateSourceEventStream" algorithm described in the + * GraphQL specification, resolving the subscription source event stream. + * + * Returns a Promise. + * + * If the client-provided invalid arguments, the source stream could not be + * created, or the resolver did not return an AsyncIterable, this function will + * will throw an error, which should be caught and handled by the caller. + * + * A Source Event Stream represents a sequence of events, each of which triggers + * a GraphQL execution for that event. + * + * This may be useful when hosting the stateful subscription service in a + * different process or machine than the stateless GraphQL execution engine, + * or otherwise separating these two steps. For more on this, see the + * "Supporting Subscriptions at Scale" information in the GraphQL specification. + */ export function createSourceEventStream( - schema: GraphQLSchema, - document: DocumentNode, - rootValue?: any, - contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver, -): Promise>; + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: any, + contextValue?: any, + variableValues?: { [key: string]: any }, + operationName?: string | void, + fieldResolver?: GraphQLFieldResolver | void +): Promise | ExecutionResult>; diff --git a/types/graphql/type/definition.d.ts b/types/graphql/type/definition.d.ts index 098f7376ef..ed87af50ad 100644 --- a/types/graphql/type/definition.d.ts +++ b/types/graphql/type/definition.d.ts @@ -1,52 +1,81 @@ +import { MaybePromise } from "../jsutils/MaybePromise"; import { - ScalarTypeDefinitionNode, - ObjectTypeDefinitionNode, - FieldDefinitionNode, - InputValueDefinitionNode, - InterfaceTypeDefinitionNode, - UnionTypeDefinitionNode, - EnumTypeDefinitionNode, - EnumValueDefinitionNode, - InputObjectTypeDefinitionNode, - TypeExtensionNode, - OperationDefinitionNode, - FieldNode, - FragmentDefinitionNode, - ValueNode, -} from '../language/ast'; -import { GraphQLSchema } from './schema'; + ScalarTypeDefinitionNode, + ObjectTypeDefinitionNode, + FieldDefinitionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + UnionTypeDefinitionNode, + EnumTypeDefinitionNode, + EnumValueDefinitionNode, + InputObjectTypeDefinitionNode, + ObjectTypeExtensionNode, + InterfaceTypeExtensionNode, + OperationDefinitionNode, + FieldNode, + FragmentDefinitionNode, + ValueNode, +} from "../language/ast"; +import { GraphQLSchema } from "./schema"; /** * These are all of the possible kinds of types. */ export type GraphQLType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList - | GraphQLNonNull; + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList + | GraphQLNonNull; export function isType(type: any): type is GraphQLType; export function assertType(type: any): GraphQLType; +export function isScalarType(type: GraphQLType): type is GraphQLScalarType; + +export function assertScalarType(type: GraphQLType): GraphQLScalarType; + +export function isObjectType(type: GraphQLType): type is GraphQLObjectType; + +export function assertObjectType(type: GraphQLType): GraphQLObjectType; + +export function isInterfaceType(type: GraphQLType): type is GraphQLInterfaceType; + +export function assertInterfaceType(type: GraphQLType): GraphQLInterfaceType; + +export function isUnionType(type: GraphQLType): type is GraphQLUnionType; + +export function assertUnionType(type: GraphQLType): GraphQLUnionType; + +export function isEnumType(type: GraphQLType): type is GraphQLEnumType; + +export function assertEnumType(type: GraphQLType): GraphQLEnumType; + +export function isInputObjectType(type: GraphQLType): type is GraphQLInputObjectType; + +export function assertInputObjectType(type: GraphQLType): GraphQLInputObjectType; + +export function isListType(type: GraphQLType): type is GraphQLList; + +export function assertListType(type: GraphQLType): GraphQLList; + +export function isNonNullType(type: GraphQLType): type is GraphQLNonNull; + +export function assertNonNullType(type: GraphQLType): GraphQLNonNull; + /** * These types may be used as input types for arguments and directives. */ export type GraphQLInputType = - | GraphQLScalarType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList - | GraphQLNonNull< - | GraphQLScalarType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList - >; + | GraphQLScalarType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList + | GraphQLNonNull>; export function isInputType(type: GraphQLType): type is GraphQLInputType; @@ -56,20 +85,20 @@ export function assertInputType(type: GraphQLType): GraphQLInputType; * These types may be used as output types as the result of fields. */ export type GraphQLOutputType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLList - | GraphQLNonNull< - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLList - >; + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLList + | GraphQLNonNull< + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLList + >; export function isOutputType(type: GraphQLType): type is GraphQLOutputType; @@ -87,14 +116,9 @@ export function assertLeafType(type: GraphQLType): GraphQLLeafType; /** * These types may describe the parent context of a selection set. */ -export type GraphQLCompositeType = - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType; +export type GraphQLCompositeType = GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType; -export function isCompositeType( - type: GraphQLType, -): type is GraphQLCompositeType; +export function isCompositeType(type: GraphQLType): type is GraphQLCompositeType; export function assertCompositeType(type: GraphQLType): GraphQLCompositeType; @@ -107,37 +131,102 @@ export function isAbstractType(type: GraphQLType): type is GraphQLAbstractType; export function assertAbstractType(type: GraphQLType): GraphQLAbstractType; +/** + * List Modifier + * + * A list is a kind of type marker, a wrapping type which points to another + * type. Lists are often created within the context of defining the fields of + * an object type. + * + * Example: + * + * const PersonType = new GraphQLObjectType({ + * name: 'Person', + * fields: () => ({ + * parents: { type: new GraphQLList(Person) }, + * children: { type: new GraphQLList(Person) }, + * }) + * }) + * + */ +export class GraphQLList { + readonly ofType: T; + constructor(type: T); + toString(): string; + toJSON(): string; + inspect(): string; +} + +/** + * Non-Null Modifier + * + * A non-null is a kind of type marker, a wrapping type which points to another + * type. Non-null types enforce that their values are never null and can ensure + * an error is raised if this ever occurs during a request. It is useful for + * fields which you can make a strong guarantee on non-nullability, for example + * usually the id field of a database row will never be null. + * + * Example: + * + * const RowType = new GraphQLObjectType({ + * name: 'Row', + * fields: () => ({ + * id: { type: new GraphQLNonNull(GraphQLString) }, + * }) + * }) + * + * Note: the enforcement of non-nullability occurs within the executor. + */ +export class GraphQLNonNull { + readonly ofType: T; + constructor(type: T); + toString(): string; + toJSON(): string; + inspect(): string; +} + +export type GraphQLWrappingType = GraphQLList | GraphQLNonNull; + +export function isWrappingType(type: GraphQLType): type is GraphQLWrappingType; + +export function assertWrappingType(type: GraphQLType): GraphQLWrappingType; + /** * These types can all accept null as a value. */ export type GraphQLNullableType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList; + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList; -export function getNullableType( - type: T, -): T & GraphQLNullableType; +export function isNullableType(type: GraphQLType): type is GraphQLNullableType; + +export function assertNullableType(type: GraphQLType): GraphQLNullableType; + +export function getNullableType(type: void): undefined; +export function getNullableType(type: T): T; +export function getNullableType(type: GraphQLNonNull): T; /** * These named types do not include modifiers like List or NonNull. */ export type GraphQLNamedType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType; + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType; -export function isNamedType(type: GraphQLType): boolean; +export function isNamedType(type: GraphQLType): type is GraphQLNamedType; export function assertNamedType(type: GraphQLType): GraphQLNamedType; +export function getNamedType(type: void): undefined; export function getNamedType(type: GraphQLType): GraphQLNamedType; /** @@ -164,30 +253,32 @@ export type Thunk = (() => T) | T; * */ export class GraphQLScalarType { - name: string; - description: string; - astNode?: ScalarTypeDefinitionNode; - constructor(config: GraphQLScalarTypeConfig); + name: string; + description: string | void; + astNode?: ScalarTypeDefinitionNode | void; + constructor(config: GraphQLScalarTypeConfig); - // Serializes an internal value to include in a response. - serialize(value: any): any; + // Serializes an internal value to include in a response. + serialize(value: any): any; - // Parses an externally provided value to use as an input. - parseValue(value: any): any; + // Parses an externally provided value to use as an input. + parseValue(value: any): any; - // Parses an externally provided literal value to use as an input. - parseLiteral(valueNode: ValueNode): any; + // Parses an externally provided literal value to use as an input. + parseLiteral(valueNode: ValueNode, variables?: { [key: string]: any } | void): any; - toString(): string; + toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLScalarTypeConfig { - name: string; - description?: string; - astNode?: ScalarTypeDefinitionNode; - serialize(value: any): TExternal | null | undefined; - parseValue?(value: any): TInternal | null | undefined; - parseLiteral?(valueNode: ValueNode): TInternal | null | undefined; + name: string; + description?: string | void; + astNode?: ScalarTypeDefinitionNode | void; + serialize(value: any): TExternal | void; + parseValue?(value: any): TInternal | void; + parseLiteral?(valueNode: ValueNode, variables: { [key: string]: any } | void): TInternal | void; } /** @@ -228,124 +319,113 @@ export interface GraphQLScalarTypeConfig { * */ export class GraphQLObjectType { - name: string; - description: string; - astNode?: ObjectTypeDefinitionNode; - extensionASTNodes: Array; - isTypeOf: GraphQLIsTypeOfFn; + name: string; + description: string | void; + astNode: ObjectTypeDefinitionNode | void; + extensionASTNodes: ReadonlyArray | void; + isTypeOf: GraphQLIsTypeOfFn | void; - constructor(config: GraphQLObjectTypeConfig); - getFields(): GraphQLFieldMap; - getInterfaces(): GraphQLInterfaceType[]; - toString(): string; + constructor(config: GraphQLObjectTypeConfig); + getFields(): GraphQLFieldMap; + getInterfaces(): GraphQLInterfaceType[]; + toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLObjectTypeConfig { - name: string; - interfaces?: Thunk; - fields: Thunk>; - isTypeOf?: GraphQLIsTypeOfFn; - description?: string; - astNode?: ObjectTypeDefinitionNode; - extensionASTNodes?: Array; + name: string; + interfaces?: Thunk; + fields: Thunk>; + isTypeOf?: GraphQLIsTypeOfFn | void; + description?: string | void; + astNode?: ObjectTypeDefinitionNode | void; + extensionASTNodes?: ReadonlyArray | void; } export type GraphQLTypeResolver = ( - value: TSource, - context: TContext, - info: GraphQLResolveInfo, -) => GraphQLObjectType | string | Promise; + value: TSource, + context: TContext, + info: GraphQLResolveInfo +) => MaybePromise; export type GraphQLIsTypeOfFn = ( - source: TSource, - context: TContext, - info: GraphQLResolveInfo, -) => boolean | Promise; + source: TSource, + context: TContext, + info: GraphQLResolveInfo +) => MaybePromise; -export type GraphQLFieldResolver< - TSource, - TContext, - TArgs = { [argName: string]: any } -> = ( - source: TSource, - args: TArgs, - context: TContext, - info: GraphQLResolveInfo, +export type GraphQLFieldResolver = ( + source: TSource, + args: TArgs, + context: TContext, + info: GraphQLResolveInfo ) => any; export interface GraphQLResolveInfo { - fieldName: string; - fieldNodes: FieldNode[]; - returnType: GraphQLOutputType; - parentType: GraphQLCompositeType; - path: ResponsePath; - schema: GraphQLSchema; - fragments: { [fragmentName: string]: FragmentDefinitionNode }; - rootValue: any; - operation: OperationDefinitionNode; - variableValues: { [variableName: string]: any }; + readonly fieldName: string; + readonly fieldNodes: ReadonlyArray; + readonly returnType: GraphQLOutputType; + readonly parentType: GraphQLObjectType; + readonly path: ResponsePath; + readonly schema: GraphQLSchema; + readonly fragments: { [key: string]: FragmentDefinitionNode }; + readonly rootValue: any; + readonly operation: OperationDefinitionNode; + readonly variableValues: { [variableName: string]: any }; } -export type ResponsePath = - | { prev: ResponsePath; key: string | number } - | undefined; +export type ResponsePath = { + readonly prev: ResponsePath | undefined; + readonly key: string | number; +}; -export interface GraphQLFieldConfig< - TSource, - TContext, - TArgs = { [argName: string]: any } -> { - type: GraphQLOutputType; - args?: GraphQLFieldConfigArgumentMap; - resolve?: GraphQLFieldResolver; - subscribe?: GraphQLFieldResolver; - deprecationReason?: string; - description?: string; - astNode?: FieldDefinitionNode; +export interface GraphQLFieldConfig { + type: GraphQLOutputType; + args?: GraphQLFieldConfigArgumentMap; + resolve?: GraphQLFieldResolver; + subscribe?: GraphQLFieldResolver; + deprecationReason?: string | void; + description?: string | void; + astNode?: FieldDefinitionNode | void; } -export interface GraphQLFieldConfigArgumentMap { - [argName: string]: GraphQLArgumentConfig; -} +export type GraphQLFieldConfigArgumentMap = { [key: string]: GraphQLArgumentConfig }; export interface GraphQLArgumentConfig { - type: GraphQLInputType; - defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + type: GraphQLInputType; + defaultValue?: any; + description?: string | void; + astNode?: InputValueDefinitionNode | void; } -export interface GraphQLFieldConfigMap { - [fieldName: string]: GraphQLFieldConfig; -} +export type GraphQLFieldConfigMap = { + [key: string]: GraphQLFieldConfig; +}; -export interface GraphQLField< - TSource, - TContext, - TArgs = { [argName: string]: any } -> { - name: string; - description: string; - type: GraphQLOutputType; - args: GraphQLArgument[]; - resolve?: GraphQLFieldResolver; - subscribe?: GraphQLFieldResolver; - isDeprecated?: boolean; - deprecationReason?: string; - astNode?: FieldDefinitionNode; +export interface GraphQLField { + name: string; + description: string | void; + type: GraphQLOutputType; + args: GraphQLArgument[]; + resolve?: GraphQLFieldResolver; + subscribe?: GraphQLFieldResolver; + isDeprecated?: boolean; + deprecationReason?: string | void; + astNode?: FieldDefinitionNode | void; } export interface GraphQLArgument { - name: string; - type: GraphQLInputType; - defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + name: string; + type: GraphQLInputType; + defaultValue?: any; + description?: string | void; + astNode?: InputValueDefinitionNode | void; } -export interface GraphQLFieldMap { - [fieldName: string]: GraphQLField; -} +export type GraphQLFieldMap = { + [key: string]: GraphQLField; +}; /** * Interface Type Definition @@ -366,29 +446,33 @@ export interface GraphQLFieldMap { * */ export class GraphQLInterfaceType { - name: string; - description: string; - astNode?: InterfaceTypeDefinitionNode; - resolveType: GraphQLTypeResolver; + name: string; + description: string | void; + astNode?: InterfaceTypeDefinitionNode | void; + extensionASTNodes: ReadonlyArray | void; + resolveType: GraphQLTypeResolver | void; - constructor(config: GraphQLInterfaceTypeConfig); + constructor(config: GraphQLInterfaceTypeConfig); - getFields(): GraphQLFieldMap; + getFields(): GraphQLFieldMap; - toString(): string; + toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLInterfaceTypeConfig { - name: string; - fields: Thunk>; - /** - * Optionally provide a custom type resolver function. If one is not provided, - * the default implementation will call `isTypeOf` on each implementing - * Object type. - */ - resolveType?: GraphQLTypeResolver; - description?: string; - astNode?: InterfaceTypeDefinitionNode; + name: string; + fields: Thunk>; + /** + * Optionally provide a custom type resolver function. If one is not provided, + * the default implementation will call `isTypeOf` on each implementing + * Object type. + */ + resolveType?: GraphQLTypeResolver | void; + description?: string | void; + astNode?: InterfaceTypeDefinitionNode | void; + extensionASTNodes?: ReadonlyArray | void; } /** @@ -415,29 +499,31 @@ export interface GraphQLInterfaceTypeConfig { * */ export class GraphQLUnionType { - name: string; - description: string; - astNode?: UnionTypeDefinitionNode; - resolveType: GraphQLTypeResolver; + name: string; + description: string | void; + astNode?: UnionTypeDefinitionNode | void; + resolveType: GraphQLTypeResolver | void; - constructor(config: GraphQLUnionTypeConfig); + constructor(config: GraphQLUnionTypeConfig); - getTypes(): GraphQLObjectType[]; + getTypes(): GraphQLObjectType[]; - toString(): string; + toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLUnionTypeConfig { - name: string; - types: Thunk; - /** - * Optionally provide a custom type resolver function. If one is not provided, - * the default implementation will call `isTypeOf` on each implementing - * Object type. - */ - resolveType?: GraphQLTypeResolver; - description?: string; - astNode?: UnionTypeDefinitionNode; + name: string; + types: Thunk; + /** + * Optionally provide a custom type resolver function. If one is not provided, + * the default implementation will call `isTypeOf` on each implementing + * Object type. + */ + resolveType?: GraphQLTypeResolver | void; + description?: string | void; + astNode?: UnionTypeDefinitionNode | void; } /** @@ -462,45 +548,44 @@ export interface GraphQLUnionTypeConfig { * will be used as its internal value. */ export class GraphQLEnumType { - name: string; - description: string; - astNode?: EnumTypeDefinitionNode; + name: string; + description: string | void; + astNode: EnumTypeDefinitionNode | void; - constructor(config: GraphQLEnumTypeConfig); - getValues(): GraphQLEnumValue[]; - getValue(name: string): GraphQLEnumValue; - isValidValue(value: any): boolean; - serialize(value: any): string; - parseValue(value: any): any; - parseLiteral(valueNode: ValueNode): any; - toString(): string; + constructor(config: GraphQLEnumTypeConfig); + getValues(): GraphQLEnumValue[]; + getValue(name: string): GraphQLEnumValue | void; + serialize(value: any): string | void; + parseValue(value: any): any; + parseLiteral(valueNode: ValueNode, _variables: { [key: string]: any } | void): any; + toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLEnumTypeConfig { - name: string; - values: GraphQLEnumValueConfigMap; - description?: string; - astNode?: EnumTypeDefinitionNode; + name: string; + values: GraphQLEnumValueConfigMap; + description?: string | void; + astNode?: EnumTypeDefinitionNode | void; } -export interface GraphQLEnumValueConfigMap { - [valueName: string]: GraphQLEnumValueConfig; -} +export type GraphQLEnumValueConfigMap = { [key: string]: GraphQLEnumValueConfig }; export interface GraphQLEnumValueConfig { - value?: any; - deprecationReason?: string; - description?: string; - astNode?: EnumValueDefinitionNode; + value?: any; + deprecationReason?: string | void; + description?: string | void; + astNode?: EnumValueDefinitionNode | void; } export interface GraphQLEnumValue { - name: string; - description: string; - isDeprecated?: boolean; - deprecationReason: string; - astNode?: EnumValueDefinitionNode; - value: any; + name: string; + description: string | void; + isDeprecated?: boolean; + deprecationReason: string | void; + astNode?: EnumValueDefinitionNode | void; + value: any; } /** @@ -524,92 +609,40 @@ export interface GraphQLEnumValue { * */ export class GraphQLInputObjectType { - name: string; - description: string; - astNode?: InputObjectTypeDefinitionNode; - constructor(config: GraphQLInputObjectTypeConfig); - getFields(): GraphQLInputFieldMap; - toString(): string; + name: string; + description: string | void; + astNode: InputObjectTypeDefinitionNode | void; + constructor(config: GraphQLInputObjectTypeConfig); + getFields(): GraphQLInputFieldMap; + toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLInputObjectTypeConfig { - name: string; - fields: Thunk; - description?: string; - astNode?: InputObjectTypeDefinitionNode; + name: string; + fields: Thunk; + description?: string | void; + astNode?: InputObjectTypeDefinitionNode | void; } export interface GraphQLInputFieldConfig { - type: GraphQLInputType; - defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + type: GraphQLInputType; + defaultValue?: any; + description?: string | void; + astNode?: InputValueDefinitionNode | void; } -export interface GraphQLInputFieldConfigMap { - [fieldName: string]: GraphQLInputFieldConfig; -} +export type GraphQLInputFieldConfigMap = { + [key: string]: GraphQLInputFieldConfig; +}; export interface GraphQLInputField { - name: string; - type: GraphQLInputType; - defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + name: string; + type: GraphQLInputType; + defaultValue?: any; + description?: string | void; + astNode?: InputValueDefinitionNode | void; } -export interface GraphQLInputFieldMap { - [fieldName: string]: GraphQLInputField; -} - -/** - * List Modifier - * - * A list is a kind of type marker, a wrapping type which points to another - * type. Lists are often created within the context of defining the fields of - * an object type. - * - * Example: - * - * const PersonType = new GraphQLObjectType({ - * name: 'Person', - * fields: () => ({ - * parents: { type: new GraphQLList(Person) }, - * children: { type: new GraphQLList(Person) }, - * }) - * }) - * - */ -export class GraphQLList { - ofType: T; - constructor(type: T); - toString(): string; -} - -/** - * Non-Null Modifier - * - * A non-null is a kind of type marker, a wrapping type which points to another - * type. Non-null types enforce that their values are never null and can ensure - * an error is raised if this ever occurs during a request. It is useful for - * fields which you can make a strong guarantee on non-nullability, for example - * usually the id field of a database row will never be null. - * - * Example: - * - * const RowType = new GraphQLObjectType({ - * name: 'Row', - * fields: () => ({ - * id: { type: new GraphQLNonNull(GraphQLString) }, - * }) - * }) - * - * Note: the enforcement of non-nullability occurs within the executor. - */ -export class GraphQLNonNull { - ofType: T; - - constructor(type: T); - - toString(): string; -} +export type GraphQLInputFieldMap = { [key: string]: GraphQLInputField }; diff --git a/types/graphql/type/directives.d.ts b/types/graphql/type/directives.d.ts index b6962bc4ae..f6e19f674d 100644 --- a/types/graphql/type/directives.d.ts +++ b/types/graphql/type/directives.d.ts @@ -1,51 +1,32 @@ -import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from './definition'; -import { DirectiveDefinitionNode } from '../language/ast'; +import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from "./definition"; +import { DirectiveDefinitionNode } from "../language/ast"; +import { DirectiveLocationEnum } from "../language/directiveLocation"; -export const DirectiveLocation: { - // Operations - QUERY: 'QUERY'; - MUTATION: 'MUTATION'; - SUBSCRIPTION: 'SUBSCRIPTION'; - FIELD: 'FIELD'; - FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION'; - FRAGMENT_SPREAD: 'FRAGMENT_SPREAD'; - INLINE_FRAGMENT: 'INLINE_FRAGMENT'; - // Schema Definitions - SCHEMA: 'SCHEMA'; - SCALAR: 'SCALAR'; - OBJECT: 'OBJECT'; - FIELD_DEFINITION: 'FIELD_DEFINITION'; - ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION'; - INTERFACE: 'INTERFACE'; - UNION: 'UNION'; - ENUM: 'ENUM'; - ENUM_VALUE: 'ENUM_VALUE'; - INPUT_OBJECT: 'INPUT_OBJECT'; - INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'; -}; - -export type DirectiveLocationEnum = keyof typeof DirectiveLocation; +/** + * Test if the given value is a GraphQL directive. + */ +export function isDirective(directive: any): directive is GraphQLDirective; /** * Directives are used by the GraphQL runtime as a way of modifying execution * behavior. Type system creators will usually not create these directly. */ export class GraphQLDirective { - name: string; - description?: string; - locations: DirectiveLocationEnum[]; - args: GraphQLArgument[]; - astNode?: DirectiveDefinitionNode; + name: string; + description: string | void; + locations: DirectiveLocationEnum[]; + args: GraphQLArgument[]; + astNode: DirectiveDefinitionNode | void; - constructor(config: GraphQLDirectiveConfig); + constructor(config: GraphQLDirectiveConfig); } export interface GraphQLDirectiveConfig { - name: string; - description?: string; - locations: DirectiveLocationEnum[]; - args?: GraphQLFieldConfigArgumentMap; - astNode?: DirectiveDefinitionNode; + name: string; + description?: string | void; + locations: DirectiveLocationEnum[]; + args?: GraphQLFieldConfigArgumentMap | void; + astNode?: DirectiveDefinitionNode | void; } /** @@ -61,7 +42,7 @@ export const GraphQLSkipDirective: GraphQLDirective; /** * Constant string used for default reason for a deprecation. */ -export const DEFAULT_DEPRECATION_REASON: 'No longer supported'; +export const DEFAULT_DEPRECATION_REASON: "No longer supported"; /** * Used to declare element of a GraphQL schema as deprecated. @@ -71,4 +52,6 @@ export const GraphQLDeprecatedDirective: GraphQLDirective; /** * The full list of specified directives. */ -export const specifiedDirectives: GraphQLDirective[]; +export const specifiedDirectives: ReadonlyArray; + +export function isSpecifiedDirective(directive: GraphQLDirective): boolean; diff --git a/types/graphql/type/index.d.ts b/types/graphql/type/index.d.ts index 5fdfb1190a..c498f648e4 100644 --- a/types/graphql/type/index.d.ts +++ b/types/graphql/type/index.d.ts @@ -1,47 +1,145 @@ -// GraphQL Schema definition -export { GraphQLSchema } from './schema'; - -export * from './definition'; +export { + // Predicate + isSchema, + // GraphQL Schema definition + GraphQLSchema, + GraphQLSchemaConfig, +} from "./schema"; export { - // "Enum" of Directive Locations - DirectiveLocation, - // Directives Definition - GraphQLDirective, - // Built-in Directives defined by the Spec - specifiedDirectives, - GraphQLIncludeDirective, - GraphQLSkipDirective, - GraphQLDeprecatedDirective, - // Constant Deprecation Reason - DEFAULT_DEPRECATION_REASON, -} from './directives'; + // Predicates + isType, + isScalarType, + isObjectType, + isInterfaceType, + isUnionType, + isEnumType, + isInputObjectType, + isListType, + isNonNullType, + isInputType, + isOutputType, + isLeafType, + isCompositeType, + isAbstractType, + isWrappingType, + isNullableType, + isNamedType, + // Assertions + assertType, + assertScalarType, + assertObjectType, + assertInterfaceType, + assertUnionType, + assertEnumType, + assertInputObjectType, + assertListType, + assertNonNullType, + assertInputType, + assertOutputType, + assertLeafType, + assertCompositeType, + assertAbstractType, + assertWrappingType, + assertNullableType, + assertNamedType, + // Un-modifiers + getNullableType, + getNamedType, + // Definitions + GraphQLScalarType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + // Type Wrappers + GraphQLList, + GraphQLNonNull, + // type + GraphQLType, + GraphQLInputType, + GraphQLOutputType, + GraphQLLeafType, + GraphQLCompositeType, + GraphQLAbstractType, + GraphQLWrappingType, + GraphQLNullableType, + GraphQLNamedType, + Thunk, + GraphQLArgument, + GraphQLArgumentConfig, + GraphQLEnumTypeConfig, + GraphQLEnumValue, + GraphQLEnumValueConfig, + GraphQLEnumValueConfigMap, + GraphQLField, + GraphQLFieldConfig, + GraphQLFieldConfigArgumentMap, + GraphQLFieldConfigMap, + GraphQLFieldMap, + GraphQLFieldResolver, + GraphQLInputField, + GraphQLInputFieldConfig, + GraphQLInputFieldConfigMap, + GraphQLInputFieldMap, + GraphQLInputObjectTypeConfig, + GraphQLInterfaceTypeConfig, + GraphQLIsTypeOfFn, + GraphQLObjectTypeConfig, + GraphQLResolveInfo, + ResponsePath, + GraphQLScalarTypeConfig, + GraphQLTypeResolver, + GraphQLUnionTypeConfig, +} from "./definition"; + +export { + // Predicate + isDirective, + // Directives Definition + GraphQLDirective, + // Built-in Directives defined by the Spec + isSpecifiedDirective, + specifiedDirectives, + GraphQLIncludeDirective, + GraphQLSkipDirective, + GraphQLDeprecatedDirective, + // Constant Deprecation Reason + DEFAULT_DEPRECATION_REASON, + // type + GraphQLDirectiveConfig, +} from "./directives"; // Common built-in scalar instances. export { - GraphQLInt, - GraphQLFloat, - GraphQLString, - GraphQLBoolean, - GraphQLID, -} from './scalars'; + isSpecifiedScalarType, + specifiedScalarTypes, + GraphQLInt, + GraphQLFloat, + GraphQLString, + GraphQLBoolean, + GraphQLID, +} from "./scalars"; export { - // "Enum" of Type Kinds - TypeKind, - // GraphQL Types for introspection. - __Schema, - __Directive, - __DirectiveLocation, - __Type, - __Field, - __InputValue, - __EnumValue, - __TypeKind, - // Meta-field definitions. - SchemaMetaFieldDef, - TypeMetaFieldDef, - TypeNameMetaFieldDef, -} from './introspection'; + // "Enum" of Type Kinds + TypeKind, + // GraphQL Types for introspection. + isIntrospectionType, + introspectionTypes, + __Schema, + __Directive, + __DirectiveLocation, + __Type, + __Field, + __InputValue, + __EnumValue, + __TypeKind, + // Meta-field definitions. + SchemaMetaFieldDef, + TypeMetaFieldDef, + TypeNameMetaFieldDef, +} from "./introspection"; -export { DirectiveLocationEnum } from './directives'; +export { validateSchema, assertValidSchema } from "./validate"; diff --git a/types/graphql/type/introspection.d.ts b/types/graphql/type/introspection.d.ts index 48ac468ed0..beed0ebeb2 100644 --- a/types/graphql/type/introspection.d.ts +++ b/types/graphql/type/introspection.d.ts @@ -1,14 +1,14 @@ import { - GraphQLScalarType, - GraphQLObjectType, - GraphQLInterfaceType, - GraphQLUnionType, - GraphQLEnumType, - GraphQLInputObjectType, - GraphQLList, - GraphQLNonNull, -} from './definition'; -import { GraphQLField } from './definition'; + GraphQLScalarType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLList, + GraphQLNonNull, +} from "./definition"; +import { GraphQLField } from "./definition"; export const __Schema: GraphQLObjectType; export const __Directive: GraphQLObjectType; @@ -19,14 +19,14 @@ export const __InputValue: GraphQLObjectType; export const __EnumValue: GraphQLObjectType; export const TypeKind: { - SCALAR: 'SCALAR'; - OBJECT: 'OBJECT'; - INTERFACE: 'INTERFACE'; - UNION: 'UNION'; - ENUM: 'ENUM'; - INPUT_OBJECT: 'INPUT_OBJECT'; - LIST: 'LIST'; - NON_NULL: 'NON_NULL'; + SCALAR: "SCALAR"; + OBJECT: "OBJECT"; + INTERFACE: "INTERFACE"; + UNION: "UNION"; + ENUM: "ENUM"; + INPUT_OBJECT: "INPUT_OBJECT"; + LIST: "LIST"; + NON_NULL: "NON_NULL"; }; export const __TypeKind: GraphQLEnumType; @@ -35,6 +35,11 @@ export const __TypeKind: GraphQLEnumType; * Note that these are GraphQLField and not GraphQLFieldConfig, * so the format for args is different. */ + export const SchemaMetaFieldDef: GraphQLField; export const TypeMetaFieldDef: GraphQLField; export const TypeNameMetaFieldDef: GraphQLField; + +export const introspectionTypes: ReadonlyArray; + +export function isIntrospectionType(type: any): boolean; diff --git a/types/graphql/type/scalars.d.ts b/types/graphql/type/scalars.d.ts index 31a33aafad..1476bf7ab8 100644 --- a/types/graphql/type/scalars.d.ts +++ b/types/graphql/type/scalars.d.ts @@ -1,7 +1,11 @@ -import { GraphQLScalarType } from './definition'; +import { GraphQLScalarType } from "./definition"; export const GraphQLInt: GraphQLScalarType; export const GraphQLFloat: GraphQLScalarType; export const GraphQLString: GraphQLScalarType; export const GraphQLBoolean: GraphQLScalarType; export const GraphQLID: GraphQLScalarType; + +export const specifiedScalarTypes: ReadonlyArray; + +export function isSpecifiedScalarType(type: GraphQLScalarType): boolean; diff --git a/types/graphql/type/schema.d.ts b/types/graphql/type/schema.d.ts index 26500c6ed3..a7bb94f5c5 100644 --- a/types/graphql/type/schema.d.ts +++ b/types/graphql/type/schema.d.ts @@ -1,11 +1,12 @@ -import { GraphQLObjectType } from './definition'; -import { - GraphQLType, - GraphQLNamedType, - GraphQLAbstractType, -} from './definition'; -import { SchemaDefinitionNode } from '../language/ast'; -import { GraphQLDirective } from './directives'; +import { GraphQLObjectType } from "./definition"; +import { GraphQLType, GraphQLNamedType, GraphQLAbstractType } from "./definition"; +import { SchemaDefinitionNode } from "../language/ast"; +import { GraphQLDirective } from "./directives"; + +/** + * Test if the given value is a GraphQL schema. + */ +export function isSchema(schema: any): schema is GraphQLSchema; /** * Schema Definition @@ -34,59 +35,51 @@ import { GraphQLDirective } from './directives'; * */ export class GraphQLSchema { - astNode?: SchemaDefinitionNode; - // private _queryType: GraphQLObjectType; - // private _mutationType: GraphQLObjectType; - // private _subscriptionType: GraphQLObjectType; - // private _directives: Array; - // private _typeMap: TypeMap; - // private _implementations: { [interfaceName: string]: Array }; - // private _possibleTypeMap: { [abstractName: string]: { [possibleName: string]: boolean } }; + astNode: SchemaDefinitionNode | void; - constructor(config: GraphQLSchemaConfig); + constructor(config: GraphQLSchemaConfig); - getQueryType(): GraphQLObjectType; - getMutationType(): GraphQLObjectType | null | undefined; - getSubscriptionType(): GraphQLObjectType | null | undefined; - getTypeMap(): { [typeName: string]: GraphQLNamedType }; - getType(name: string): GraphQLNamedType; - getPossibleTypes(abstractType: GraphQLAbstractType): GraphQLObjectType[]; + getQueryType(): GraphQLObjectType | void; + getMutationType(): GraphQLObjectType | void; + getSubscriptionType(): GraphQLObjectType | void; + getTypeMap(): TypeMap; + getType(name: string): GraphQLNamedType | void; + getPossibleTypes(abstractType: GraphQLAbstractType): ReadonlyArray; - isPossibleType( - abstractType: GraphQLAbstractType, - possibleType: GraphQLObjectType, - ): boolean; + isPossibleType(abstractType: GraphQLAbstractType, possibleType: GraphQLObjectType): boolean; - getDirectives(): GraphQLDirective[]; - getDirective(name: string): GraphQLDirective; + getDirectives(): ReadonlyArray; + getDirective(name: string): GraphQLDirective | void; } -export type GraphQLSchemaValidationOptions = { - /** - * When building a schema from a GraphQL service's introspection result, it - * might be safe to assume the schema is valid. Set to true to assume the - * produced schema is valid. - * - * Default: false - */ - assumeValid?: boolean; +type TypeMap = { [key: string]: GraphQLNamedType }; - /** - * If provided, the schema will consider fields or types with names included - * in this list valid, even if they do not adhere to the specification's - * schema validation rules. - * - * This option is provided to ease adoption and may be removed in a future - * major release. - */ - allowedLegacyNames?: ReadonlyArray; -}; +export interface GraphQLSchemaValidationOptions { + /** + * When building a schema from a GraphQL service's introspection result, it + * might be safe to assume the schema is valid. Set to true to assume the + * produced schema is valid. + * + * Default: false + */ + assumeValid?: boolean; -export interface GraphQLSchemaConfig { - query: GraphQLObjectType; - mutation?: GraphQLObjectType; - subscription?: GraphQLObjectType; - types?: GraphQLNamedType[]; - directives?: GraphQLDirective[]; - astNode?: SchemaDefinitionNode; + /** + * If provided, the schema will consider fields or types with names included + * in this list valid, even if they do not adhere to the specification's + * schema validation rules. + * + * This option is provided to ease adoption and may be removed in a future + * major release. + */ + allowedLegacyNames?: ReadonlyArray | void; +} + +export interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions { + query: GraphQLObjectType | void; + mutation?: GraphQLObjectType | void; + subscription?: GraphQLObjectType | void; + types?: GraphQLNamedType[] | void; + directives?: GraphQLDirective[] | void; + astNode?: SchemaDefinitionNode | void; } diff --git a/types/graphql/type/validate.d.ts b/types/graphql/type/validate.d.ts new file mode 100644 index 0000000000..e23f9e6386 --- /dev/null +++ b/types/graphql/type/validate.d.ts @@ -0,0 +1,17 @@ +import { GraphQLSchema } from "./schema"; +import { GraphQLError } from "../error/GraphQLError"; + +/** + * Implements the "Type Validation" sub-sections of the specification's + * "Type System" section. + * + * Validation runs synchronously, returning an array of encountered errors, or + * an empty array if no errors were encountered and the Schema is valid. + */ +export function validateSchema(schema: GraphQLSchema): ReadonlyArray; + +/** + * Utility function which asserts a schema is valid by throwing an error if + * it is invalid. + */ +export function assertValidSchema(schema: GraphQLSchema): void; diff --git a/types/graphql/utilities/TypeInfo.d.ts b/types/graphql/utilities/TypeInfo.d.ts index a04a24a1a7..1c2f139642 100644 --- a/types/graphql/utilities/TypeInfo.d.ts +++ b/types/graphql/utilities/TypeInfo.d.ts @@ -1,15 +1,15 @@ -import { GraphQLSchema } from '../type/schema'; +import { GraphQLSchema } from "../type/schema"; import { - GraphQLOutputType, - GraphQLCompositeType, - GraphQLInputType, - GraphQLField, - GraphQLArgument, - GraphQLEnumValue, - GraphQLType, -} from '../type/definition'; -import { GraphQLDirective } from '../type/directives'; -import { ASTNode, FieldNode } from '../language/ast'; + GraphQLOutputType, + GraphQLCompositeType, + GraphQLInputType, + GraphQLField, + GraphQLArgument, + GraphQLEnumValue, + GraphQLType, +} from "../type/definition"; +import { GraphQLDirective } from "../type/directives"; +import { ASTNode, FieldNode } from "../language/ast"; /** * TypeInfo is a utility class which, given a GraphQL schema, can keep track @@ -17,27 +17,31 @@ import { ASTNode, FieldNode } from '../language/ast'; * AST during a recursive descent by calling `enter(node)` and `leave(node)`. */ export class TypeInfo { - constructor( - schema: GraphQLSchema, - // NOTE: this experimental optional second parameter is only needed in order - // to support non-spec-compliant codebases. You should never need to use it. - // It may disappear in the future. - getFieldDefFn?: getFieldDef, - ); + constructor( + schema: GraphQLSchema, + // NOTE: this experimental optional second parameter is only needed in order + // to support non-spec-compliant codebases. You should never need to use it. + // It may disappear in the future. + getFieldDefFn?: getFieldDef, + // Initial type may be provided in rare cases to facilitate traversals + // beginning somewhere other than documents. + initialType?: GraphQLType + ); - getType(): GraphQLOutputType; - getParentType(): GraphQLCompositeType; - getInputType(): GraphQLInputType; - getFieldDef(): GraphQLField; - getDirective(): GraphQLDirective; - getArgument(): GraphQLArgument; - getEnumValue(): GraphQLEnumValue; - enter(node: ASTNode): any; - leave(node: ASTNode): any; + getType(): GraphQLOutputType | void; + getParentType(): GraphQLCompositeType | void; + getInputType(): GraphQLInputType | void; + getParentInputType(): GraphQLInputType | void; + getFieldDef(): GraphQLField | void; + getDirective(): GraphQLDirective | void; + getArgument(): GraphQLArgument | void; + getEnumValue(): GraphQLEnumValue | void; + enter(node: ASTNode): any; + leave(node: ASTNode): any; } -export type getFieldDef = ( - schema: GraphQLSchema, - parentType: GraphQLType, - fieldNode: FieldNode, -) => GraphQLField; +type getFieldDef = ( + schema: GraphQLSchema, + parentType: GraphQLType, + fieldNode: FieldNode +) => GraphQLField | void; diff --git a/types/graphql/utilities/assertValidName.d.ts b/types/graphql/utilities/assertValidName.d.ts index 5ca2310a26..19f81e3991 100644 --- a/types/graphql/utilities/assertValidName.d.ts +++ b/types/graphql/utilities/assertValidName.d.ts @@ -1,2 +1,12 @@ -// Helper to assert that provided names are valid. -export function assertValidName(name: string): void; +import { GraphQLError } from "../error/GraphQLError"; +import { ASTNode } from "../language/ast"; + +/** + * Upholds the spec rules about naming. + */ +export function assertValidName(name: string): string; + +/** + * Returns an Error if a name is invalid. + */ +export function isValidNameError(name: string, node?: ASTNode | undefined): GraphQLError | undefined; diff --git a/types/graphql/utilities/astFromValue.d.ts b/types/graphql/utilities/astFromValue.d.ts index 557a07dd9d..9c2198e6d6 100644 --- a/types/graphql/utilities/astFromValue.d.ts +++ b/types/graphql/utilities/astFromValue.d.ts @@ -1,17 +1,5 @@ -import { - ValueNode, - /* - TODO: - IntValueNode, - FloatValueNode, - StringValueNode, - BooleanValueNode, - EnumValueNode, - ListValueNode, - ObjectValueNode, - */ -} from '../language/ast'; -import { GraphQLInputType } from '../type/definition'; +import { ValueNode } from "../language/ast"; +import { GraphQLInputType } from "../type/definition"; /** * Produces a GraphQL Value AST given a JavaScript value. @@ -27,7 +15,7 @@ import { GraphQLInputType } from '../type/definition'; * | String | String / Enum Value | * | Number | Int / Float | * | Mixed | Enum Value | + * | null | NullValue | * */ -// TODO: this should set overloads according to above the table -export function astFromValue(value: any, type: GraphQLInputType): ValueNode; // Warning: there is a code in bottom: throw new TypeError +export function astFromValue(value: any, type: GraphQLInputType): ValueNode | void; diff --git a/types/graphql/utilities/buildASTSchema.d.ts b/types/graphql/utilities/buildASTSchema.d.ts index 6b8aa56327..ebff50b4f7 100644 --- a/types/graphql/utilities/buildASTSchema.d.ts +++ b/types/graphql/utilities/buildASTSchema.d.ts @@ -1,16 +1,28 @@ -import { DocumentNode, Location, StringValueNode } from '../language/ast'; -import { Source } from '../language/source'; -import { GraphQLSchema, GraphQLSchemaValidationOptions } from '../type/schema'; +import { + DocumentNode, + Location, + StringValueNode, + TypeDefinitionNode, + NamedTypeNode, + DirectiveDefinitionNode, + FieldDefinitionNode, +} from "../language/ast"; +import { GraphQLNamedType, GraphQLFieldConfig } from "../type/definition"; +import { GraphQLDirective } from "../type/directives"; +import { Source } from "../language/source"; +import { GraphQLSchema, GraphQLSchemaValidationOptions } from "../type/schema"; +import { ParseOptions } from "../language/parser"; +import blockStringValue from "../language/blockStringValue"; interface BuildSchemaOptions extends GraphQLSchemaValidationOptions { - /** - * Descriptions are defined as preceding string literals, however an older - * experimental version of the SDL supported preceding comments as - * descriptions. Set to true to enable this deprecated behavior. - * - * Default: false - */ - commentDescriptions?: boolean; + /** + * Descriptions are defined as preceding string literals, however an older + * experimental version of the SDL supported preceding comments as + * descriptions. Set to true to enable this deprecated behavior. + * + * Default: false + */ + commentDescriptions?: boolean; } /** @@ -22,8 +34,29 @@ interface BuildSchemaOptions extends GraphQLSchemaValidationOptions { * * Given that AST it constructs a GraphQLSchema. The resulting schema * has no resolve methods, so execution will use default resolvers. + * + * Accepts options as a second argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * */ -export function buildASTSchema(ast: DocumentNode): GraphQLSchema; +export function buildASTSchema(ast: DocumentNode, options?: BuildSchemaOptions): GraphQLSchema; + +type TypeDefinitionsMap = { [key: string]: TypeDefinitionNode }; +type TypeResolver = (typeRef: NamedTypeNode) => GraphQLNamedType; + +export class ASTDefinitionBuilder { + constructor(typeDefinitionsMap: TypeDefinitionsMap, options: BuildSchemaOptions | void, resolveType: TypeResolver); + + buildTypes(nodes: ReadonlyArray): Array; + + buildType(node: NamedTypeNode | TypeDefinitionNode): GraphQLNamedType; + + buildDirective(directiveNode: DirectiveDefinitionNode): GraphQLDirective; + + buildField(field: FieldDefinitionNode): GraphQLFieldConfig; +} /** * Given an ast node, returns its string description. @@ -35,12 +68,12 @@ export function buildASTSchema(ast: DocumentNode): GraphQLSchema; * */ export function getDescription( - node: { description?: StringValueNode; loc?: Location }, - options: BuildSchemaOptions -): string; + node: { readonly description?: StringValueNode; readonly loc?: Location }, + options: BuildSchemaOptions | void +): string | undefined; /** * A helper function to build a GraphQLSchema directly from a source * document. */ -export function buildSchema(source: string | Source): GraphQLSchema; +export function buildSchema(source: string | Source, options?: BuildSchemaOptions & ParseOptions): GraphQLSchema; diff --git a/types/graphql/utilities/buildClientSchema.d.ts b/types/graphql/utilities/buildClientSchema.d.ts index 26b0b3cdd5..128c34ca48 100644 --- a/types/graphql/utilities/buildClientSchema.d.ts +++ b/types/graphql/utilities/buildClientSchema.d.ts @@ -1,5 +1,5 @@ -import { IntrospectionQuery } from './introspectionQuery'; -import { GraphQLSchema, GraphQLSchemaValidationOptions } from '../type/schema'; +import { IntrospectionQuery } from "./introspectionQuery"; +import { GraphQLSchema, GraphQLSchemaValidationOptions } from "../type/schema"; interface Options extends GraphQLSchemaValidationOptions {} @@ -11,8 +11,8 @@ interface Options extends GraphQLSchemaValidationOptions {} * tools, but cannot be used to execute a query, as introspection does not * represent the "resolver", "parse" or "serialize" functions or any other * server-internal mechanisms. + * + * This function expects a complete introspection result. Don't forget to check + * the "errors" field of a server response before calling this function. */ -export function buildClientSchema( - introspection: IntrospectionQuery, - options?: Options, -): GraphQLSchema; +export function buildClientSchema(introspection: IntrospectionQuery, options?: Options): GraphQLSchema; diff --git a/types/graphql/utilities/coerceValue.d.ts b/types/graphql/utilities/coerceValue.d.ts new file mode 100644 index 0000000000..081eea4a32 --- /dev/null +++ b/types/graphql/utilities/coerceValue.d.ts @@ -0,0 +1,22 @@ +import { GraphQLError } from "../error"; +import { ASTNode } from "../language/ast"; +import { GraphQLInputType } from "../type/definition"; + +interface CoercedValue { + readonly errors: ReadonlyArray | undefined; + readonly value: any; +} + +interface Path { + readonly prev: Path | undefined; + readonly key: string | number; +} + +/** + * Coerces a JavaScript value given a GraphQL Type. + * + * Returns either a value which is valid for the provided type or a list of + * encountered coercion errors. + * + */ +export function coerceValue(value: any, type: GraphQLInputType, blameNode?: ASTNode, path?: Path): CoercedValue; diff --git a/types/graphql/utilities/concatAST.d.ts b/types/graphql/utilities/concatAST.d.ts index 405ac69936..08c5104076 100644 --- a/types/graphql/utilities/concatAST.d.ts +++ b/types/graphql/utilities/concatAST.d.ts @@ -1,8 +1,8 @@ -import { DocumentNode } from '../language/ast'; +import { DocumentNode } from "../language/ast"; /** * Provided a collection of ASTs, presumably each from different files, * concatenate the ASTs together into batched AST, useful for validating many * GraphQL source files which together represent one conceptual application. */ -export function concatAST(asts: DocumentNode[]): DocumentNode; +export function concatAST(asts: ReadonlyArray): DocumentNode; diff --git a/types/graphql/utilities/extendSchema.d.ts b/types/graphql/utilities/extendSchema.d.ts index 389bd02d8b..7cde767ed7 100644 --- a/types/graphql/utilities/extendSchema.d.ts +++ b/types/graphql/utilities/extendSchema.d.ts @@ -1,5 +1,17 @@ -import { DocumentNode } from '../language/ast'; -import { GraphQLSchema } from '../type/schema'; +import { DocumentNode } from "../language/ast"; +import { GraphQLSchema } from "../type/schema"; +import { GraphQLSchemaValidationOptions } from "../type/schema"; + +interface Options extends GraphQLSchemaValidationOptions { + /** + * Descriptions are defined as preceding string literals, however an older + * experimental version of the SDL supported preceding comments as + * descriptions. Set to true to enable this deprecated behavior. + * + * Default: false + */ + commentDescriptions?: boolean; +} /** * Produces a new schema given an existing schema and a document which may @@ -12,8 +24,11 @@ import { GraphQLSchema } from '../type/schema'; * * This algorithm copies the provided schema, applying extensions while * producing the copy. The original schema remains unaltered. + * + * Accepts options as a third argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * */ -export function extendSchema( - schema: GraphQLSchema, - documentAST: DocumentNode, -): GraphQLSchema; +export function extendSchema(schema: GraphQLSchema, documentAST: DocumentNode, options?: Options): GraphQLSchema; diff --git a/types/graphql/utilities/findBreakingChanges.d.ts b/types/graphql/utilities/findBreakingChanges.d.ts index 0d5fc0041a..84f1bea158 100644 --- a/types/graphql/utilities/findBreakingChanges.d.ts +++ b/types/graphql/utilities/findBreakingChanges.d.ts @@ -1,88 +1,160 @@ import { - getNamedType, - GraphQLScalarType, - GraphQLEnumType, - GraphQLInputObjectType, - GraphQLInterfaceType, - GraphQLObjectType, - GraphQLUnionType, - GraphQLNamedType, -} from '../type/definition'; -import { GraphQLSchema } from '../type/schema'; + getNamedType, + GraphQLScalarType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLInterfaceType, + GraphQLObjectType, + GraphQLUnionType, + GraphQLNamedType, +} from "../type/definition"; +import { GraphQLDirective } from "../type/directives"; +import { GraphQLSchema } from "../type/schema"; +import { DirectiveLocationEnum } from "../language/directiveLocation"; -export const BreakingChangeType: { - FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND'; - FIELD_REMOVED: 'FIELD_REMOVED'; - TYPE_CHANGED_KIND: 'TYPE_CHANGED_KIND'; - TYPE_REMOVED: 'TYPE_REMOVED'; - TYPE_REMOVED_FROM_UNION: 'TYPE_REMOVED_FROM_UNION'; - VALUE_REMOVED_FROM_ENUM: 'VALUE_REMOVED_FROM_ENUM'; +export const BreakingChangeType : _BreakingChangeType; + +// @internal +type _BreakingChangeType = { + FIELD_CHANGED_KIND: "FIELD_CHANGED_KIND"; + FIELD_REMOVED: "FIELD_REMOVED"; + TYPE_CHANGED_KIND: "TYPE_CHANGED_KIND"; + TYPE_REMOVED: "TYPE_REMOVED"; + TYPE_REMOVED_FROM_UNION: "TYPE_REMOVED_FROM_UNION"; + VALUE_REMOVED_FROM_ENUM: "VALUE_REMOVED_FROM_ENUM"; + ARG_REMOVED: "ARG_REMOVED"; + ARG_CHANGED_KIND: "ARG_CHANGED_KIND"; + NON_NULL_ARG_ADDED: "NON_NULL_ARG_ADDED"; + NON_NULL_INPUT_FIELD_ADDED: "NON_NULL_INPUT_FIELD_ADDED"; + INTERFACE_REMOVED_FROM_OBJECT: "INTERFACE_REMOVED_FROM_OBJECT"; + DIRECTIVE_REMOVED: "DIRECTIVE_REMOVED"; + DIRECTIVE_ARG_REMOVED: "DIRECTIVE_ARG_REMOVED"; + DIRECTIVE_LOCATION_REMOVED: "DIRECTIVE_LOCATION_REMOVED"; + NON_NULL_DIRECTIVE_ARG_ADDED: "NON_NULL_DIRECTIVE_ARG_ADDED"; }; -export type BreakingChangeKey = - | 'FIELD_CHANGED_KIND' - | 'FIELD_REMOVED' - | 'TYPE_CHANGED_KIND' - | 'TYPE_REMOVED' - | 'TYPE_REMOVED_FROM_UNION' - | 'VALUE_REMOVED_FROM_ENUM'; +export const DangerousChangeType: _DangerousChangeType; + +// @internal +type _DangerousChangeType = { + ARG_DEFAULT_VALUE_CHANGE: "ARG_DEFAULT_VALUE_CHANGE"; + VALUE_ADDED_TO_ENUM: "VALUE_ADDED_TO_ENUM"; + INTERFACE_ADDED_TO_OBJECT: "INTERFACE_ADDED_TO_OBJECT"; + TYPE_ADDED_TO_UNION: "TYPE_ADDED_TO_UNION"; + NULLABLE_INPUT_FIELD_ADDED: "NULLABLE_INPUT_FIELD_ADDED"; + NULLABLE_ARG_ADDED: "NULLABLE_ARG_ADDED"; +}; export interface BreakingChange { - type: BreakingChangeKey; - description: string; + type: keyof _BreakingChangeType; + description: string; +} + +export interface DangerousChange { + type: keyof _DangerousChangeType; + description: string; } /** * Given two schemas, returns an Array containing descriptions of all the types * of breaking changes covered by the other functions down below. */ -export function findBreakingChanges( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema, -): BreakingChange[]; +export function findBreakingChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +/** + * Given two schemas, returns an Array containing descriptions of all the types + * of potentially dangerous changes covered by the other functions down below. + */ +export function findDangerousChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; /** * Given two schemas, returns an Array containing descriptions of any breaking * changes in the newSchema related to removing an entire type. */ -export function findRemovedTypes( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema, -): BreakingChange[]; +export function findRemovedTypes(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; /** * Given two schemas, returns an Array containing descriptions of any breaking * changes in the newSchema related to changing the type of a type. */ -export function findTypesThatChangedKind( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema, -): BreakingChange[]; +export function findTypesThatChangedKind(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; /** - * Given two schemas, returns an Array containing descriptions of any breaking - * changes in the newSchema related to the fields on a type. This includes if - * a field has been removed from a type or if a field has changed type. + * Given two schemas, returns an Array containing descriptions of any + * breaking or dangerous changes in the newSchema related to arguments + * (such as removal or change of type of an argument, or a change in an + * argument's default value). */ -export function findFieldsThatChangedType( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema, -): BreakingChange[]; +export function findArgChanges( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): { + breakingChanges: Array; + dangerousChanges: Array; +}; + +export function findFieldsThatChangedTypeOnObjectOrInterfaceTypes( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): Array; + +export function findFieldsThatChangedTypeOnInputObjectTypes( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): { + breakingChanges: Array; + dangerousChanges: Array; +}; /** * Given two schemas, returns an Array containing descriptions of any breaking * changes in the newSchema related to removing types from a union type. */ -export function findTypesRemovedFromUnions( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema, -): BreakingChange[]; +export function findTypesRemovedFromUnions(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +/** + * Given two schemas, returns an Array containing descriptions of any dangerous + * changes in the newSchema related to adding types to a union type. + */ +export function findTypesAddedToUnions(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; /** * Given two schemas, returns an Array containing descriptions of any breaking * changes in the newSchema related to removing values from an enum type. */ -export function findValuesRemovedFromEnums( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema, -): BreakingChange[]; +export function findValuesRemovedFromEnums(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +/** + * Given two schemas, returns an Array containing descriptions of any dangerous + * changes in the newSchema related to adding values to an enum type. + */ +export function findValuesAddedToEnums(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +export function findInterfacesRemovedFromObjectTypes( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): Array; + +export function findInterfacesAddedToObjectTypes( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): Array; + +export function findRemovedDirectives(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +export function findRemovedDirectiveArgs(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +export function findAddedNonNullDirectiveArgs( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): Array; + +export function findRemovedLocationsForDirective( + oldDirective: GraphQLDirective, + newDirective: GraphQLDirective +): Array; + +export function findRemovedDirectiveLocations( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): Array; diff --git a/types/graphql/utilities/findDeprecatedUsages.d.ts b/types/graphql/utilities/findDeprecatedUsages.d.ts index 8cd844e15f..da99c98269 100644 --- a/types/graphql/utilities/findDeprecatedUsages.d.ts +++ b/types/graphql/utilities/findDeprecatedUsages.d.ts @@ -1,13 +1,10 @@ -import { GraphQLSchema } from '../type/schema'; -import { DocumentNode } from '../language/ast'; -import { GraphQLError } from '../error/GraphQLError'; +import { GraphQLSchema } from "../type/schema"; +import { DocumentNode } from "../language/ast"; +import { GraphQLError } from "../error/GraphQLError"; /** * A validation rule which reports deprecated usages. * * Returns a list of GraphQLError instances describing each deprecated use. */ -export function findDeprecatedUsages( - schema: GraphQLSchema, - ast: DocumentNode, -): GraphQLError[]; +export function findDeprecatedUsages(schema: GraphQLSchema, ast: DocumentNode): GraphQLError[]; diff --git a/types/graphql/utilities/getOperationAST.d.ts b/types/graphql/utilities/getOperationAST.d.ts index 0d5064d48d..81e9bd4cbe 100644 --- a/types/graphql/utilities/getOperationAST.d.ts +++ b/types/graphql/utilities/getOperationAST.d.ts @@ -1,4 +1,4 @@ -import { DocumentNode, OperationDefinitionNode } from '../language/ast'; +import { DocumentNode, OperationDefinitionNode } from "../language/ast"; /** * Returns an operation AST given a document AST and optionally an operation @@ -6,6 +6,6 @@ import { DocumentNode, OperationDefinitionNode } from '../language/ast'; * provided in the document. */ export function getOperationAST( - documentAST: DocumentNode, - operationName?: string, -): OperationDefinitionNode; + documentAST: DocumentNode, + operationName: string | void +): OperationDefinitionNode | void; diff --git a/types/graphql/utilities/index.d.ts b/types/graphql/utilities/index.d.ts index c2b2c182ff..f571c3ab76 100644 --- a/types/graphql/utilities/index.d.ts +++ b/types/graphql/utilities/index.d.ts @@ -1,82 +1,102 @@ // The GraphQL query recommended for a full schema introspection. -export { introspectionQuery } from './introspectionQuery'; export { - IntrospectionQuery, - IntrospectionSchema, - IntrospectionType, - IntrospectionScalarType, - IntrospectionObjectType, - IntrospectionInterfaceType, - IntrospectionUnionType, - IntrospectionEnumType, - IntrospectionInputObjectType, - IntrospectionTypeRef, - IntrospectionNamedTypeRef, - IntrospectionListTypeRef, - IntrospectionNonNullTypeRef, - IntrospectionField, - IntrospectionInputValue, - IntrospectionEnumValue, - IntrospectionDirective, -} from './introspectionQuery'; + getIntrospectionQuery, + // Deprecated, use getIntrospectionQuery() + introspectionQuery, +} from "./introspectionQuery"; + +export { + IntrospectionOptions, + IntrospectionQuery, + IntrospectionSchema, + IntrospectionType, + IntrospectionInputType, + IntrospectionOutputType, + IntrospectionScalarType, + IntrospectionObjectType, + IntrospectionInterfaceType, + IntrospectionUnionType, + IntrospectionEnumType, + IntrospectionInputObjectType, + IntrospectionTypeRef, + IntrospectionInputTypeRef, + IntrospectionOutputTypeRef, + IntrospectionNamedTypeRef, + IntrospectionListTypeRef, + IntrospectionNonNullTypeRef, + IntrospectionField, + IntrospectionInputValue, + IntrospectionEnumValue, + IntrospectionDirective, +} from "./introspectionQuery"; // Gets the target Operation from a Document -export { getOperationAST } from './getOperationAST'; +export { getOperationAST } from "./getOperationAST"; + +// Convert a GraphQLSchema to an IntrospectionQuery +export { introspectionFromSchema } from "./introspectionFromSchema"; // Build a GraphQLSchema from an introspection result. -export { buildClientSchema } from './buildClientSchema'; +export { buildClientSchema } from "./buildClientSchema"; // Build a GraphQLSchema from GraphQL Schema language. -export { buildASTSchema, buildSchema, getDescription } from './buildASTSchema'; +export { buildASTSchema, buildSchema, getDescription, BuildSchemaOptions } from "./buildASTSchema"; // Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. -export { extendSchema } from './extendSchema'; +export { extendSchema } from "./extendSchema"; + +// Sort a GraphQLSchema. +export { lexicographicSortSchema } from "./lexicographicSortSchema"; // Print a GraphQLSchema to GraphQL Schema language. -export { - printSchema, - printType, - printIntrospectionSchema, -} from './schemaPrinter'; +export { printSchema, printType, printIntrospectionSchema } from "./schemaPrinter"; // Create a GraphQLType from a GraphQL language AST. -export { typeFromAST } from './typeFromAST'; +export { typeFromAST } from "./typeFromAST"; -// Create a JavaScript value from a GraphQL language AST. -export { valueFromAST } from './valueFromAST'; +// Create a JavaScript value from a GraphQL language AST with a type. +export { valueFromAST } from "./valueFromAST"; + +// Create a JavaScript value from a GraphQL language AST without a type. +export { valueFromASTUntyped } from "./valueFromASTUntyped"; // Create a GraphQL language AST from a JavaScript value. -export { astFromValue } from './astFromValue'; +export { astFromValue } from "./astFromValue"; // A helper to use within recursive-descent visitors which need to be aware of // the GraphQL type system. -export { TypeInfo } from './TypeInfo'; +export { TypeInfo } from "./TypeInfo"; -// Determine if JavaScript values adhere to a GraphQL type. -export { isValidJSValue } from './isValidJSValue'; +// Coerces a JavaScript value to a GraphQL type, or produces errors. +export { coerceValue } from "./coerceValue"; + +// @deprecated use coerceValue +export { isValidJSValue } from "./isValidJSValue"; // Determine if AST values adhere to a GraphQL type. -export { isValidLiteralValue } from './isValidLiteralValue'; +export { isValidLiteralValue } from "./isValidLiteralValue"; // Concatenates multiple AST together. -export { concatAST } from './concatAST'; +export { concatAST } from "./concatAST"; // Separates an AST into an AST per Operation. -export { separateOperations } from './separateOperations'; +export { separateOperations } from "./separateOperations"; // Comparators for types -export { - isEqualType, - isTypeSubTypeOf, - doTypesOverlap, -} from './typeComparators'; +export { isEqualType, isTypeSubTypeOf, doTypesOverlap } from "./typeComparators"; // Asserts that a string is a valid GraphQL name -export { assertValidName } from './assertValidName'; +export { assertValidName, isValidNameError } from "./assertValidName"; // Compares two GraphQLSchemas and detects breaking changes. -export { findBreakingChanges } from './findBreakingChanges'; -export { BreakingChange } from './findBreakingChanges'; +export { + BreakingChangeType, + DangerousChangeType, + findBreakingChanges, + findDangerousChanges, + BreakingChange, + DangerousChange, +} from "./findBreakingChanges"; // Report all deprecated usage within a GraphQL document. -export { findDeprecatedUsages } from './findDeprecatedUsages'; +export { findDeprecatedUsages } from "./findDeprecatedUsages"; diff --git a/types/graphql/utilities/introspectionFromSchema.d.ts b/types/graphql/utilities/introspectionFromSchema.d.ts new file mode 100644 index 0000000000..8733a35087 --- /dev/null +++ b/types/graphql/utilities/introspectionFromSchema.d.ts @@ -0,0 +1,13 @@ +import { GraphQLSchema } from "../type/schema"; +import { IntrospectionQuery, IntrospectionOptions } from "./introspectionQuery"; + +/** + * Build an IntrospectionQuery from a GraphQLSchema + * + * IntrospectionQuery is useful for utilities that care about type and field + * relationships, but do not need to traverse through those relationships. + * + * This is the inverse of buildClientSchema. The primary use case is outside + * of the server context, for instance when doing schema comparisons. + */ +export function introspectionFromSchema(schema: GraphQLSchema, options: IntrospectionOptions): IntrospectionQuery; diff --git a/types/graphql/utilities/introspectionQuery.d.ts b/types/graphql/utilities/introspectionQuery.d.ts index f16b873a3a..750fe0d99c 100644 --- a/types/graphql/utilities/introspectionQuery.d.ts +++ b/types/graphql/utilities/introspectionQuery.d.ts @@ -1,209 +1,143 @@ -import { DirectiveLocationEnum } from '../type/directives'; +import { DirectiveLocationEnum } from "../language/directiveLocation"; -/* -query IntrospectionQuery { - __schema { - queryType { name } - mutationType { name } - subscriptionType { name } - types { - ...FullType - } - directives { - name - description - locations - args { - ...InputValue - } - } - } +export interface IntrospectionOptions { + // Whether to include descriptions in the introspection result. + // Default: true + descriptions: boolean; } -fragment FullType on __Type { - kind - name - description - fields(includeDeprecated: true) { - name - description - args { - ...InputValue - } - type { - ...TypeRef - } - isDeprecated - deprecationReason - } - inputFields { - ...InputValue - } - interfaces { - ...TypeRef - } - enumValues(includeDeprecated: true) { - name - description - isDeprecated - deprecationReason - } - possibleTypes { - ...TypeRef - } -} +export function getIntrospectionQuery(options?: IntrospectionOptions): string; -fragment InputValue on __InputValue { - name - description - type { ...TypeRef } - defaultValue -} - -fragment TypeRef on __Type { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - } - } - } - } - } - } - } -} -*/ export const introspectionQuery: string; export interface IntrospectionQuery { - __schema: IntrospectionSchema; + readonly __schema: IntrospectionSchema; } export interface IntrospectionSchema { - queryType: IntrospectionNamedTypeRef; - mutationType?: IntrospectionNamedTypeRef; - subscriptionType?: IntrospectionNamedTypeRef; - types: IntrospectionType[]; - directives: IntrospectionDirective[]; + readonly queryType: IntrospectionNamedTypeRef; + readonly mutationType: IntrospectionNamedTypeRef | void; + readonly subscriptionType: IntrospectionNamedTypeRef | void; + readonly types: ReadonlyArray; + readonly directives: ReadonlyArray; } export type IntrospectionType = - | IntrospectionScalarType - | IntrospectionObjectType - | IntrospectionInterfaceType - | IntrospectionUnionType - | IntrospectionEnumType - | IntrospectionInputObjectType; + | IntrospectionScalarType + | IntrospectionObjectType + | IntrospectionInterfaceType + | IntrospectionUnionType + | IntrospectionEnumType + | IntrospectionInputObjectType; + +export type IntrospectionOutputType = + | IntrospectionScalarType + | IntrospectionObjectType + | IntrospectionInterfaceType + | IntrospectionUnionType + | IntrospectionEnumType; + +export type IntrospectionInputType = IntrospectionScalarType | IntrospectionEnumType | IntrospectionInputObjectType; export interface IntrospectionScalarType { - kind: 'SCALAR'; - name: string; - description?: string; + readonly kind: "SCALAR"; + readonly name: string; + readonly description?: string | void; } export interface IntrospectionObjectType { - kind: 'OBJECT'; - name: string; - description?: string; - fields: IntrospectionField[]; - interfaces: IntrospectionNamedTypeRef[]; + readonly kind: "OBJECT"; + readonly name: string; + readonly description?: string | void; + readonly fields: ReadonlyArray; + readonly interfaces: ReadonlyArray>; } export interface IntrospectionInterfaceType { - kind: 'INTERFACE'; - name: string; - description?: string; - fields: IntrospectionField[]; - possibleTypes: IntrospectionNamedTypeRef[]; + readonly kind: "INTERFACE"; + readonly name: string; + readonly description?: string | void; + readonly fields: ReadonlyArray; + readonly possibleTypes: ReadonlyArray>; } export interface IntrospectionUnionType { - kind: 'UNION'; - name: string; - description?: string; - possibleTypes: IntrospectionNamedTypeRef[]; + readonly kind: "UNION"; + readonly name: string; + readonly description?: string | void; + readonly possibleTypes: ReadonlyArray>; } export interface IntrospectionEnumType { - kind: 'ENUM'; - name: string; - description?: string; - enumValues: IntrospectionEnumValue[]; + readonly kind: "ENUM"; + readonly name: string; + readonly description?: string | void; + readonly enumValues: ReadonlyArray; } export interface IntrospectionInputObjectType { - kind: 'INPUT_OBJECT'; - name: string; - description?: string; - inputFields: IntrospectionInputValue[]; + readonly kind: "INPUT_OBJECT"; + readonly name: string; + readonly description?: string | void; + readonly inputFields: ReadonlyArray; +} + +export interface IntrospectionListTypeRef { + readonly kind: "LIST"; + readonly ofType: T; +} + +export interface IntrospectionNonNullTypeRef { + readonly kind: "NON_NULL"; + readonly ofType: T; } export type IntrospectionTypeRef = - | IntrospectionNamedTypeRef - | IntrospectionListTypeRef - | IntrospectionNonNullTypeRef; + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + | IntrospectionNonNullTypeRef | IntrospectionListTypeRef>; -export interface IntrospectionNamedTypeRef { - kind: string; - name: string; -} +export type IntrospectionOutputTypeRef = + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + | IntrospectionNonNullTypeRef | IntrospectionListTypeRef>; -export interface IntrospectionListTypeRef { - kind: 'LIST'; - ofType?: IntrospectionTypeRef; -} +export type IntrospectionInputTypeRef = + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + | IntrospectionNonNullTypeRef | IntrospectionListTypeRef>; -export interface IntrospectionNonNullTypeRef { - kind: 'NON_NULL'; - ofType?: IntrospectionTypeRef; +export interface IntrospectionNamedTypeRef { + readonly kind: T["kind"]; + readonly name: string; } export interface IntrospectionField { - name: string; - description?: string; - args: IntrospectionInputValue[]; - type: IntrospectionTypeRef; - isDeprecated: boolean; - deprecationReason?: string; + readonly name: string; + readonly description?: string | void; + readonly args: ReadonlyArray; + readonly type: IntrospectionOutputTypeRef; + readonly isDeprecated: boolean; + readonly deprecationReason?: string | void; } export interface IntrospectionInputValue { - name: string; - description?: string; - type: IntrospectionTypeRef; - defaultValue?: string; + readonly name: string; + readonly description?: string | void; + readonly type: IntrospectionInputTypeRef; + readonly defaultValue?: string | void; } export interface IntrospectionEnumValue { - name: string; - description?: string; - isDeprecated: boolean; - deprecationReason?: string; + readonly name: string; + readonly description?: string | void; + readonly isDeprecated: boolean; + readonly deprecationReason?: string | void; } export interface IntrospectionDirective { - name: string; - description?: string; - locations: DirectiveLocationEnum[]; - args: IntrospectionInputValue[]; + readonly name: string; + readonly description?: string | void; + readonly locations: ReadonlyArray; + readonly args: ReadonlyArray; } diff --git a/types/graphql/utilities/isValidJSValue.d.ts b/types/graphql/utilities/isValidJSValue.d.ts index 911d8fea67..d45d104ffd 100644 --- a/types/graphql/utilities/isValidJSValue.d.ts +++ b/types/graphql/utilities/isValidJSValue.d.ts @@ -1,8 +1,6 @@ -import { GraphQLInputType } from '../type/definition'; +import { GraphQLInputType } from "../type/definition"; /** - * Given a JavaScript value and a GraphQL type, determine if the value will be - * accepted for that type. This is primarily useful for validating the - * runtime values of query variables. + * Deprecated. Use coerceValue() directly for richer information. */ export function isValidJSValue(value: any, type: GraphQLInputType): string[]; diff --git a/types/graphql/utilities/isValidLiteralValue.d.ts b/types/graphql/utilities/isValidLiteralValue.d.ts index 4ad03d1013..6a9275bce9 100644 --- a/types/graphql/utilities/isValidLiteralValue.d.ts +++ b/types/graphql/utilities/isValidLiteralValue.d.ts @@ -1,14 +1,10 @@ -import { ValueNode } from '../language/ast'; -import { GraphQLInputType } from '../type/definition'; +import { GraphQLError } from "../error/GraphQLError"; +import { ValueNode } from "../language/ast"; +import { GraphQLInputType } from "../type/definition"; /** - * Utility for validators which determines if a value literal AST is valid given - * an input type. + * Utility which determines if a value literal node is valid for an input type. * - * Note that this only validates literal values, variables are assumed to - * provide values of the correct type. + * Deprecated. Rely on validation for documents containing literal values. */ -export function isValidLiteralValue( - type: GraphQLInputType, - valueNode: ValueNode, -): string[]; +export function isValidLiteralValue(type: GraphQLInputType, valueNode: ValueNode): ReadonlyArray; diff --git a/types/graphql/utilities/lexicographicSortSchema.d.ts b/types/graphql/utilities/lexicographicSortSchema.d.ts new file mode 100644 index 0000000000..24ec208bba --- /dev/null +++ b/types/graphql/utilities/lexicographicSortSchema.d.ts @@ -0,0 +1,6 @@ +import { GraphQLSchema } from "../type/schema"; + +/** + * Sort GraphQLSchema. + */ +export function lexicographicSortSchema(schema: GraphQLSchema): GraphQLSchema; diff --git a/types/graphql/utilities/schemaPrinter.d.ts b/types/graphql/utilities/schemaPrinter.d.ts index f9cf9ad209..8e3aefe7fc 100644 --- a/types/graphql/utilities/schemaPrinter.d.ts +++ b/types/graphql/utilities/schemaPrinter.d.ts @@ -1,12 +1,19 @@ -import { GraphQLSchema } from '../type/schema'; -import { GraphQLType } from '../type/definition'; +import { GraphQLSchema } from "../type/schema"; +import { GraphQLType, GraphQLNamedType } from "../type/definition"; -export interface PrinterOptions { - commentDescriptions?: boolean; +export interface Options { + commentDescriptions?: boolean; } -export function printSchema(schema: GraphQLSchema, options?: PrinterOptions): string; +/** + * Accepts options as a second argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * + */ +export function printSchema(schema: GraphQLSchema, options?: Options): string; -export function printIntrospectionSchema(schema: GraphQLSchema, options?: PrinterOptions): string; +export function printIntrospectionSchema(schema: GraphQLSchema, options?: Options): string; -export function printType(type: GraphQLType, options?: PrinterOptions): string; +export function printType(type: GraphQLNamedType, options?: Options): string; diff --git a/types/graphql/utilities/separateOperations.d.ts b/types/graphql/utilities/separateOperations.d.ts index a10ad0a29e..6035084860 100644 --- a/types/graphql/utilities/separateOperations.d.ts +++ b/types/graphql/utilities/separateOperations.d.ts @@ -1,5 +1,9 @@ -import { DocumentNode, OperationDefinitionNode } from '../language/ast'; +import { DocumentNode, OperationDefinitionNode } from "../language/ast"; -export function separateOperations( - documentAST: DocumentNode, -): { [operationName: string]: DocumentNode }; +/** + * separateOperations accepts a single AST document which may contain many + * operations and fragments and returns a collection of AST documents each of + * which contains a single operation as well the fragment definitions it + * refers to. + */ +export function separateOperations(documentAST: DocumentNode): { [key: string]: DocumentNode }; diff --git a/types/graphql/utilities/typeComparators.d.ts b/types/graphql/utilities/typeComparators.d.ts index ca0cdaf6c2..7bf0b9ebdf 100644 --- a/types/graphql/utilities/typeComparators.d.ts +++ b/types/graphql/utilities/typeComparators.d.ts @@ -1,9 +1,5 @@ -import { - GraphQLType, - GraphQLCompositeType, - GraphQLAbstractType, -} from '../type/definition'; -import { GraphQLSchema } from '../type/schema'; +import { GraphQLType, GraphQLCompositeType, GraphQLAbstractType } from "../type/definition"; +import { GraphQLSchema } from "../type/schema"; /** * Provided two types, return true if the types are equal (invariant). @@ -14,11 +10,7 @@ export function isEqualType(typeA: GraphQLType, typeB: GraphQLType): boolean; * Provided a type and a super type, return true if the first type is either * equal or a subset of the second super type (covariant). */ -export function isTypeSubTypeOf( - schema: GraphQLSchema, - maybeSubType: GraphQLType, - superType: GraphQLType, -): boolean; +export function isTypeSubTypeOf(schema: GraphQLSchema, maybeSubType: GraphQLType, superType: GraphQLType): boolean; /** * Provided two composite types, determine if they "overlap". Two composite @@ -30,7 +22,7 @@ export function isTypeSubTypeOf( * This function is commutative. */ export function doTypesOverlap( - schema: GraphQLSchema, - typeA: GraphQLCompositeType, - typeB: GraphQLCompositeType, + schema: GraphQLSchema, + typeA: GraphQLCompositeType, + typeB: GraphQLCompositeType ): boolean; diff --git a/types/graphql/utilities/typeFromAST.d.ts b/types/graphql/utilities/typeFromAST.d.ts index 415cbd2636..f2adaa7762 100644 --- a/types/graphql/utilities/typeFromAST.d.ts +++ b/types/graphql/utilities/typeFromAST.d.ts @@ -1,8 +1,16 @@ -import { TypeNode } from '../language/ast'; -import { GraphQLType, GraphQLNullableType } from '../type/definition'; -import { GraphQLSchema } from '../type/schema'; +import { TypeNode, NamedTypeNode, ListTypeNode, NonNullTypeNode } from "../language/ast"; +import { GraphQLType, GraphQLNullableType, GraphQLNamedType, GraphQLList, GraphQLNonNull } from "../type/definition"; +import { GraphQLSchema } from "../type/schema"; -export function typeFromAST( - schema: GraphQLSchema, - typeNode: TypeNode, -): GraphQLType; +/** + * Given a Schema and an AST node describing a type, return a GraphQLType + * definition which applies to that type. For example, if provided the parsed + * AST node for `[User]`, a GraphQLList instance will be returned, containing + * the type called "User" found in the schema. If a type called "User" is not + * found in the schema, then undefined will be returned. + */ +export function typeFromAST(schema: GraphQLSchema, typeNode: NamedTypeNode): GraphQLNamedType | undefined; + +export function typeFromAST(schema: GraphQLSchema, typeNode: ListTypeNode): GraphQLList | undefined; + +export function typeFromAST(schema: GraphQLSchema, typeNode: NonNullTypeNode): GraphQLNonNull | undefined; diff --git a/types/graphql/utilities/valueFromAST.d.ts b/types/graphql/utilities/valueFromAST.d.ts index 0bfbf04981..cd67108aad 100644 --- a/types/graphql/utilities/valueFromAST.d.ts +++ b/types/graphql/utilities/valueFromAST.d.ts @@ -1,15 +1,28 @@ -import { GraphQLInputType } from '../type/definition'; -import { - ValueNode, - VariableNode, - ListValueNode, - ObjectValueNode, -} from '../language/ast'; +import { GraphQLInputType } from "../type/definition"; +import { ValueNode, VariableNode, ListValueNode, ObjectValueNode } from "../language/ast"; +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * A GraphQL type must be provided, which will be used to interpret different + * GraphQL Value literals. + * + * Returns `undefined` when the value could not be validly coerced according to + * the provided type. + * + * | GraphQL Value | JSON Value | + * | -------------------- | ------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String | String | + * | Int / Float | Number | + * | Enum Value | Mixed | + * | NullValue | null | + * + */ export function valueFromAST( - valueNode: ValueNode, - type: GraphQLInputType, - variables?: { - [key: string]: any; - }, + valueNode: ValueNode | void, + type: GraphQLInputType, + variables?: { [key: string]: any } | void ): any; diff --git a/types/graphql/utilities/valueFromASTUntyped.d.ts b/types/graphql/utilities/valueFromASTUntyped.d.ts new file mode 100644 index 0000000000..98d3137694 --- /dev/null +++ b/types/graphql/utilities/valueFromASTUntyped.d.ts @@ -0,0 +1,19 @@ +import { ValueNode } from "../language/ast"; + +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value + * will reflect the provided GraphQL value AST. + * + * | GraphQL Value | JavaScript Value | + * | -------------------- | ---------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String / Enum | String | + * | Int / Float | Number | + * | Null | null | + * + */ +export function valueFromASTUntyped(valueNode: ValueNode, variables?: { [key: string]: any } | void): any; diff --git a/types/graphql/validation/ValidationContext.d.ts b/types/graphql/validation/ValidationContext.d.ts new file mode 100644 index 0000000000..0f8a4ea8f7 --- /dev/null +++ b/types/graphql/validation/ValidationContext.d.ts @@ -0,0 +1,63 @@ +import { GraphQLError } from "../error"; +import { + DocumentNode, + OperationDefinitionNode, + VariableNode, + SelectionSetNode, + FragmentSpreadNode, + FragmentDefinitionNode, +} from "../language/ast"; +import { GraphQLSchema } from "../type/schema"; +import { + GraphQLInputType, + GraphQLOutputType, + GraphQLCompositeType, + GraphQLField, + GraphQLArgument, +} from "../type/definition"; +import { GraphQLDirective } from "../type/directives"; +import { TypeInfo } from "../utilities/TypeInfo"; + +type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode; +type VariableUsage = { node: VariableNode; type: GraphQLInputType | void }; + +/** + * An instance of this class is passed as the "this" context to all validators, + * allowing access to commonly useful contextual information from within a + * validation rule. + */ +export default class ValidationContext { + constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo); + + reportError(error: GraphQLError): undefined; + + getErrors(): ReadonlyArray; + + getSchema(): GraphQLSchema; + + getDocument(): DocumentNode; + + getFragment(name: string): FragmentDefinitionNode | void; + + getFragmentSpreads(node: SelectionSetNode): ReadonlyArray; + + getRecursivelyReferencedFragments(operation: OperationDefinitionNode): ReadonlyArray; + + getVariableUsages(node: NodeWithSelectionSet): ReadonlyArray; + + getRecursiveVariableUsages(operation: OperationDefinitionNode): ReadonlyArray; + + getType(): GraphQLOutputType | void; + + getParentType(): GraphQLCompositeType | void; + + getInputType(): GraphQLInputType | void; + + getParentInputType(): GraphQLInputType | void; + + getFieldDef(): GraphQLField | void; + + getDirective(): GraphQLDirective | void; + + getArgument(): GraphQLArgument | void; +} diff --git a/types/graphql/validation/index.d.ts b/types/graphql/validation/index.d.ts index b8cb9ddd00..911c592432 100644 --- a/types/graphql/validation/index.d.ts +++ b/types/graphql/validation/index.d.ts @@ -1,128 +1,84 @@ -export { validate, ValidationContext } from './validate'; -export { specifiedRules } from './specifiedRules'; +export { validate } from "./validate"; -// Spec Section: "Argument Values Type Correctness" -export { - ArgumentsOfCorrectType as ArgumentsOfCorrectTypeRule, -} from './rules/ArgumentsOfCorrectType'; +import ValidationContext from "./ValidationContext"; +export { ValidationContext }; -// Spec Section: "Variable Default Values Are Correctly Typed" -export { - DefaultValuesOfCorrectType as DefaultValuesOfCorrectTypeRule, -} from './rules/DefaultValuesOfCorrectType'; +export { specifiedRules } from "./specifiedRules"; // Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" -export { - FieldsOnCorrectType as FieldsOnCorrectTypeRule, -} from './rules/FieldsOnCorrectType'; +export { FieldsOnCorrectType as FieldsOnCorrectTypeRule } from "./rules/FieldsOnCorrectType"; // Spec Section: "Fragments on Composite Types" -export { - FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule, -} from './rules/FragmentsOnCompositeTypes'; +export { FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule } from "./rules/FragmentsOnCompositeTypes"; // Spec Section: "Argument Names" -export { - KnownArgumentNames as KnownArgumentNamesRule, -} from './rules/KnownArgumentNames'; +export { KnownArgumentNames as KnownArgumentNamesRule } from "./rules/KnownArgumentNames"; // Spec Section: "Directives Are Defined" -export { - KnownDirectives as KnownDirectivesRule, -} from './rules/KnownDirectives'; +export { KnownDirectives as KnownDirectivesRule } from "./rules/KnownDirectives"; // Spec Section: "Fragment spread target defined" -export { - KnownFragmentNames as KnownFragmentNamesRule, -} from './rules/KnownFragmentNames'; +export { KnownFragmentNames as KnownFragmentNamesRule } from "./rules/KnownFragmentNames"; // Spec Section: "Fragment Spread Type Existence" -export { KnownTypeNames as KnownTypeNamesRule } from './rules/KnownTypeNames'; +export { KnownTypeNames as KnownTypeNamesRule } from "./rules/KnownTypeNames"; // Spec Section: "Lone Anonymous Operation" -export { - LoneAnonymousOperation as LoneAnonymousOperationRule, -} from './rules/LoneAnonymousOperation'; +export { LoneAnonymousOperation as LoneAnonymousOperationRule } from "./rules/LoneAnonymousOperation"; // Spec Section: "Fragments must not form cycles" -export { - NoFragmentCycles as NoFragmentCyclesRule, -} from './rules/NoFragmentCycles'; +export { NoFragmentCycles as NoFragmentCyclesRule } from "./rules/NoFragmentCycles"; // Spec Section: "All Variable Used Defined" -export { - NoUndefinedVariables as NoUndefinedVariablesRule, -} from './rules/NoUndefinedVariables'; +export { NoUndefinedVariables as NoUndefinedVariablesRule } from "./rules/NoUndefinedVariables"; // Spec Section: "Fragments must be used" -export { - NoUnusedFragments as NoUnusedFragmentsRule, -} from './rules/NoUnusedFragments'; +export { NoUnusedFragments as NoUnusedFragmentsRule } from "./rules/NoUnusedFragments"; // Spec Section: "All Variables Used" -export { - NoUnusedVariables as NoUnusedVariablesRule, -} from './rules/NoUnusedVariables'; +export { NoUnusedVariables as NoUnusedVariablesRule } from "./rules/NoUnusedVariables"; // Spec Section: "Field Selection Merging" -export { - OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule, -} from './rules/OverlappingFieldsCanBeMerged'; +export { OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule } from "./rules/OverlappingFieldsCanBeMerged"; // Spec Section: "Fragment spread is possible" -export { - PossibleFragmentSpreads as PossibleFragmentSpreadsRule, -} from './rules/PossibleFragmentSpreads'; +export { PossibleFragmentSpreads as PossibleFragmentSpreadsRule } from "./rules/PossibleFragmentSpreads"; // Spec Section: "Argument Optionality" -export { - ProvidedNonNullArguments as ProvidedNonNullArgumentsRule, -} from './rules/ProvidedNonNullArguments'; +export { ProvidedNonNullArguments as ProvidedNonNullArgumentsRule } from "./rules/ProvidedNonNullArguments"; // Spec Section: "Leaf Field Selections" -export { ScalarLeafs as ScalarLeafsRule } from './rules/ScalarLeafs'; +export { ScalarLeafs as ScalarLeafsRule } from "./rules/ScalarLeafs"; // Spec Section: "Subscriptions with Single Root Field" -export { - SingleFieldSubscriptions as SingleFieldSubscriptionsRule, -} from './rules/SingleFieldSubscriptions'; +export { SingleFieldSubscriptions as SingleFieldSubscriptionsRule } from "./rules/SingleFieldSubscriptions"; // Spec Section: "Argument Uniqueness" -export { - UniqueArgumentNames as UniqueArgumentNamesRule, -} from './rules/UniqueArgumentNames'; +export { UniqueArgumentNames as UniqueArgumentNamesRule } from "./rules/UniqueArgumentNames"; // Spec Section: "Directives Are Unique Per Location" -export { - UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule, -} from './rules/UniqueDirectivesPerLocation'; +export { UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule } from "./rules/UniqueDirectivesPerLocation"; // Spec Section: "Fragment Name Uniqueness" -export { - UniqueFragmentNames as UniqueFragmentNamesRule, -} from './rules/UniqueFragmentNames'; +export { UniqueFragmentNames as UniqueFragmentNamesRule } from "./rules/UniqueFragmentNames"; // Spec Section: "Input Object Field Uniqueness" -export { - UniqueInputFieldNames as UniqueInputFieldNamesRule, -} from './rules/UniqueInputFieldNames'; +export { UniqueInputFieldNames as UniqueInputFieldNamesRule } from "./rules/UniqueInputFieldNames"; // Spec Section: "Operation Name Uniqueness" -export { - UniqueOperationNames as UniqueOperationNamesRule, -} from './rules/UniqueOperationNames'; +export { UniqueOperationNames as UniqueOperationNamesRule } from "./rules/UniqueOperationNames"; // Spec Section: "Variable Uniqueness" -export { - UniqueVariableNames as UniqueVariableNamesRule, -} from './rules/UniqueVariableNames'; +export { UniqueVariableNames as UniqueVariableNamesRule } from "./rules/UniqueVariableNames"; + +// Spec Section: "Values Type Correctness" +export { ValuesOfCorrectType as ValuesOfCorrectTypeRule } from "./rules/ValuesOfCorrectType"; // Spec Section: "Variables are Input Types" -export { - VariablesAreInputTypes as VariablesAreInputTypesRule, -} from './rules/VariablesAreInputTypes'; +export { VariablesAreInputTypes as VariablesAreInputTypesRule } from "./rules/VariablesAreInputTypes"; + +// Spec Section: "Variables Default Value Is Allowed" +export { VariablesDefaultValueAllowed as VariablesDefaultValueAllowedRule } from "./rules/VariablesDefaultValueAllowed"; // Spec Section: "All Variable Usages Are Allowed" -export { - VariablesInAllowedPosition as VariablesInAllowedPositionRule, -} from './rules/VariablesInAllowedPosition'; +export { VariablesInAllowedPosition as VariablesInAllowedPositionRule } from "./rules/VariablesInAllowedPosition"; diff --git a/types/graphql/validation/rules/ArgumentsOfCorrectType.d.ts b/types/graphql/validation/rules/ArgumentsOfCorrectType.d.ts deleted file mode 100644 index f7247d0a9c..0000000000 --- a/types/graphql/validation/rules/ArgumentsOfCorrectType.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ValidationContext } from '../index'; - -/** - * Argument values of correct type - * - * A GraphQL document is only valid if all field argument literal values are - * of the type expected by their position. - */ -export function ArgumentsOfCorrectType(context: ValidationContext): any; diff --git a/types/graphql/validation/rules/DefaultValuesOfCorrectType.d.ts b/types/graphql/validation/rules/DefaultValuesOfCorrectType.d.ts deleted file mode 100644 index 88b3a824f2..0000000000 --- a/types/graphql/validation/rules/DefaultValuesOfCorrectType.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ValidationContext } from '../index'; - -/** - * Variable default values of correct type - * - * A GraphQL document is only valid if all variable default values are of the - * type expected by their definition. - */ -export function DefaultValuesOfCorrectType(context: ValidationContext): any; diff --git a/types/graphql/validation/rules/ExecutableDefinitions.d.ts b/types/graphql/validation/rules/ExecutableDefinitions.d.ts new file mode 100644 index 0000000000..423e0dcad2 --- /dev/null +++ b/types/graphql/validation/rules/ExecutableDefinitions.d.ts @@ -0,0 +1,12 @@ +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function nonExecutableDefinitionMessage(defName: string): string; + +/** + * Executable definitions + * + * A GraphQL document is only valid for execution if all definitions are either + * operation or fragment definitions. + */ +export function ExecutableDefinitions(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/FieldsOnCorrectType.d.ts b/types/graphql/validation/rules/FieldsOnCorrectType.d.ts index 19609b2b65..c5c7f053c2 100644 --- a/types/graphql/validation/rules/FieldsOnCorrectType.d.ts +++ b/types/graphql/validation/rules/FieldsOnCorrectType.d.ts @@ -1,4 +1,5 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; /** * Fields on correct type @@ -6,4 +7,4 @@ import { ValidationContext } from '../index'; * A GraphQL document is only valid if all fields selected are defined by the * parent type, or are an allowed meta field such as __typename. */ -export function FieldsOnCorrectType(context: ValidationContext): any; +export function FieldsOnCorrectType(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts b/types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts index d6fffd4337..7c760e331f 100644 --- a/types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts +++ b/types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts @@ -1,4 +1,10 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function inlineFragmentOnNonCompositeErrorMessage(type: GraphQLType): string; + +export function fragmentOnNonCompositeErrorMessage(fragName: string, type: GraphQLType): string; /** * Fragments on composite type @@ -7,4 +13,4 @@ import { ValidationContext } from '../index'; * can only be spread into a composite type (object, interface, or union), the * type condition must also be a composite type. */ -export function FragmentsOnCompositeTypes(context: ValidationContext): any; +export function FragmentsOnCompositeTypes(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/KnownArgumentNames.d.ts b/types/graphql/validation/rules/KnownArgumentNames.d.ts index 4477b62a75..9602c34c43 100644 --- a/types/graphql/validation/rules/KnownArgumentNames.d.ts +++ b/types/graphql/validation/rules/KnownArgumentNames.d.ts @@ -1,4 +1,18 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unknownArgMessage( + argName: string, + fieldName: string, + typeName: string, + suggestedArgs: Array +): string; + +export function unknownDirectiveArgMessage( + argName: string, + directiveName: string, + suggestedArgs: Array +): string; /** * Known argument names @@ -6,4 +20,4 @@ import { ValidationContext } from '../index'; * A GraphQL field is only valid if all supplied arguments are defined by * that field. */ -export function KnownArgumentNames(context: ValidationContext): any; +export function KnownArgumentNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/KnownDirectives.d.ts b/types/graphql/validation/rules/KnownDirectives.d.ts index 68c6acf549..179e65b9f7 100644 --- a/types/graphql/validation/rules/KnownDirectives.d.ts +++ b/types/graphql/validation/rules/KnownDirectives.d.ts @@ -1,4 +1,9 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unknownDirectiveMessage(directiveName: string): string; + +export function misplacedDirectiveMessage(directiveName: string, location: string): string; /** * Known directives @@ -6,4 +11,4 @@ import { ValidationContext } from '../index'; * A GraphQL document is only valid if all `@directives` are known by the * schema and legally positioned. */ -export function KnownDirectives(context: ValidationContext): any; +export function KnownDirectives(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/KnownFragmentNames.d.ts b/types/graphql/validation/rules/KnownFragmentNames.d.ts index b904f22d89..40405f67dd 100644 --- a/types/graphql/validation/rules/KnownFragmentNames.d.ts +++ b/types/graphql/validation/rules/KnownFragmentNames.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unknownFragmentMessage(fragName: string): string; /** * Known fragment names @@ -6,4 +9,4 @@ import { ValidationContext } from '../index'; * A GraphQL document is only valid if all `...Fragment` fragment spreads refer * to fragments defined in the same document. */ -export function KnownFragmentNames(context: ValidationContext): any; +export function KnownFragmentNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/KnownTypeNames.d.ts b/types/graphql/validation/rules/KnownTypeNames.d.ts index 48b15318da..6bef3661f9 100644 --- a/types/graphql/validation/rules/KnownTypeNames.d.ts +++ b/types/graphql/validation/rules/KnownTypeNames.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unknownTypeMessage(typeName: string, suggestedTypes: Array): string; /** * Known type names @@ -6,4 +9,4 @@ import { ValidationContext } from '../index'; * A GraphQL document is only valid if referenced types (specifically * variable definitions and fragment conditions) are defined by the type schema. */ -export function KnownTypeNames(context: ValidationContext): any; +export function KnownTypeNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/LoneAnonymousOperation.d.ts b/types/graphql/validation/rules/LoneAnonymousOperation.d.ts index 4ce6abcba9..881814c4d2 100644 --- a/types/graphql/validation/rules/LoneAnonymousOperation.d.ts +++ b/types/graphql/validation/rules/LoneAnonymousOperation.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function anonOperationNotAloneMessage(): string; /** * Lone anonymous operation @@ -6,4 +9,4 @@ import { ValidationContext } from '../index'; * A GraphQL document is only valid if when it contains an anonymous operation * (the query short-hand) that it contains only that one operation definition. */ -export function LoneAnonymousOperation(context: ValidationContext): any; +export function LoneAnonymousOperation(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/NoFragmentCycles.d.ts b/types/graphql/validation/rules/NoFragmentCycles.d.ts index fed5982fc8..f119c5a487 100644 --- a/types/graphql/validation/rules/NoFragmentCycles.d.ts +++ b/types/graphql/validation/rules/NoFragmentCycles.d.ts @@ -1,3 +1,6 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; -export function NoFragmentCycles(context: ValidationContext): any; +export function cycleErrorMessage(fragName: string, spreadNames: Array): string; + +export function NoFragmentCycles(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/NoUndefinedVariables.d.ts b/types/graphql/validation/rules/NoUndefinedVariables.d.ts index 51d30b8fd1..611ad01a9b 100644 --- a/types/graphql/validation/rules/NoUndefinedVariables.d.ts +++ b/types/graphql/validation/rules/NoUndefinedVariables.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function undefinedVarMessage(varName: string, opName: string | void): string; /** * No undefined variables @@ -6,4 +9,4 @@ import { ValidationContext } from '../index'; * A GraphQL operation is only valid if all variables encountered, both directly * and via fragment spreads, are defined by that operation. */ -export function NoUndefinedVariables(context: ValidationContext): any; +export function NoUndefinedVariables(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/NoUnusedFragments.d.ts b/types/graphql/validation/rules/NoUnusedFragments.d.ts index 7f4d431299..6f757c16c2 100644 --- a/types/graphql/validation/rules/NoUnusedFragments.d.ts +++ b/types/graphql/validation/rules/NoUnusedFragments.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unusedFragMessage(fragName: string): string; /** * No unused fragments @@ -6,4 +9,4 @@ import { ValidationContext } from '../index'; * A GraphQL document is only valid if all fragment definitions are spread * within operations, or spread within other fragments spread within operations. */ -export function NoUnusedFragments(context: ValidationContext): any; +export function NoUnusedFragments(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/NoUnusedVariables.d.ts b/types/graphql/validation/rules/NoUnusedVariables.d.ts index 6eb2d984aa..10282cdacd 100644 --- a/types/graphql/validation/rules/NoUnusedVariables.d.ts +++ b/types/graphql/validation/rules/NoUnusedVariables.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unusedVariableMessage(varName: string, opName: string | void): string; /** * No unused variables @@ -6,4 +9,4 @@ import { ValidationContext } from '../index'; * A GraphQL operation is only valid if all variables defined by an operation * are used, either directly or within a spread fragment. */ -export function NoUnusedVariables(context: ValidationContext): any; +export function NoUnusedVariables(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts b/types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts index f21edbd2cb..1dfa62a089 100644 --- a/types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts +++ b/types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function fieldsConflictMessage(responseName: string, reason: ConflictReasonMessage): string; /** * Overlapping fields can be merged @@ -7,4 +10,10 @@ import { ValidationContext } from '../index'; * fragments) either correspond to distinct response names or can be merged * without ambiguity. */ -export function OverlappingFieldsCanBeMerged(context: ValidationContext): any; +export function OverlappingFieldsCanBeMerged(context: ValidationContext): ASTVisitor; + +// Field name and reason. +type ConflictReason = [string, string]; + +// Reason is a string, or a nested list of conflicts. +type ConflictReasonMessage = string | Array; diff --git a/types/graphql/validation/rules/PossibleFragmentSpreads.d.ts b/types/graphql/validation/rules/PossibleFragmentSpreads.d.ts index 8defb47721..f318cb189e 100644 --- a/types/graphql/validation/rules/PossibleFragmentSpreads.d.ts +++ b/types/graphql/validation/rules/PossibleFragmentSpreads.d.ts @@ -1,4 +1,10 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function typeIncompatibleSpreadMessage(fragName: string, parentType: GraphQLType, fragType: GraphQLType): string; + +export function typeIncompatibleAnonSpreadMessage(parentType: GraphQLType, fragType: GraphQLType): string; /** * Possible fragment spread @@ -7,4 +13,4 @@ import { ValidationContext } from '../index'; * be true: if there is a non-empty intersection of the possible parent types, * and possible types which pass the type condition. */ -export function PossibleFragmentSpreads(context: ValidationContext): any; +export function PossibleFragmentSpreads(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/ProvidedNonNullArguments.d.ts b/types/graphql/validation/rules/ProvidedNonNullArguments.d.ts index 4d5334b9fb..e442b47f83 100644 --- a/types/graphql/validation/rules/ProvidedNonNullArguments.d.ts +++ b/types/graphql/validation/rules/ProvidedNonNullArguments.d.ts @@ -1,4 +1,10 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function missingFieldArgMessage(fieldName: string, argName: string, type: GraphQLType): string; + +export function missingDirectiveArgMessage(directiveName: string, argName: string, type: GraphQLType): string; /** * Provided required arguments @@ -6,4 +12,4 @@ import { ValidationContext } from '../index'; * A field or directive is only valid if all required (non-null) field arguments * have been provided. */ -export function ProvidedNonNullArguments(context: ValidationContext): any; +export function ProvidedNonNullArguments(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/ScalarLeafs.d.ts b/types/graphql/validation/rules/ScalarLeafs.d.ts index afdc575671..5bbf85043a 100644 --- a/types/graphql/validation/rules/ScalarLeafs.d.ts +++ b/types/graphql/validation/rules/ScalarLeafs.d.ts @@ -1,4 +1,10 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function noSubselectionAllowedMessage(fieldName: string, type: GraphQLType): string; + +export function requiredSubselectionMessage(fieldName: string, type: GraphQLType): string; /** * Scalar leafs @@ -6,4 +12,4 @@ import { ValidationContext } from '../index'; * A GraphQL document is valid only if all leaf fields (fields without * sub selections) are of scalar or enum types. */ -export function ScalarLeafs(context: ValidationContext): any; +export function ScalarLeafs(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/SingleFieldSubscriptions.d.ts b/types/graphql/validation/rules/SingleFieldSubscriptions.d.ts index 01a2654a16..fef0869710 100644 --- a/types/graphql/validation/rules/SingleFieldSubscriptions.d.ts +++ b/types/graphql/validation/rules/SingleFieldSubscriptions.d.ts @@ -1,8 +1,11 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function singleFieldOnlyMessage(name: string | void): string; /** * Subscriptions must only include one field. * * A GraphQL subscription is valid only if it contains a single root field. */ -export function SingleFieldSubscriptions(context: ValidationContext): any; +export function SingleFieldSubscriptions(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueArgumentNames.d.ts b/types/graphql/validation/rules/UniqueArgumentNames.d.ts index 8cc166d07a..47a59c3362 100644 --- a/types/graphql/validation/rules/UniqueArgumentNames.d.ts +++ b/types/graphql/validation/rules/UniqueArgumentNames.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateArgMessage(argName: string): string; /** * Unique argument names @@ -6,4 +9,4 @@ import { ValidationContext } from '../index'; * A GraphQL field or directive is only valid if all supplied arguments are * uniquely named. */ -export function UniqueArgumentNames(context: ValidationContext): any; +export function UniqueArgumentNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts b/types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts index 70ea02cd9c..f3d6327c23 100644 --- a/types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts +++ b/types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateDirectiveMessage(directiveName: string): string; /** * Unique directive names per location @@ -6,4 +9,4 @@ import { ValidationContext } from '../index'; * A GraphQL document is only valid if all directives at a given location * are uniquely named. */ -export function UniqueDirectivesPerLocation(context: ValidationContext): any; +export function UniqueDirectivesPerLocation(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueFragmentNames.d.ts b/types/graphql/validation/rules/UniqueFragmentNames.d.ts index c505968f6a..9a2554200c 100644 --- a/types/graphql/validation/rules/UniqueFragmentNames.d.ts +++ b/types/graphql/validation/rules/UniqueFragmentNames.d.ts @@ -1,8 +1,11 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateFragmentNameMessage(fragName: string): string; /** * Unique fragment names * * A GraphQL document is only valid if all defined fragments have unique names. */ -export function UniqueFragmentNames(context: ValidationContext): any; +export function UniqueFragmentNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueInputFieldNames.d.ts b/types/graphql/validation/rules/UniqueInputFieldNames.d.ts index cebd71b79b..34d5b9845a 100644 --- a/types/graphql/validation/rules/UniqueInputFieldNames.d.ts +++ b/types/graphql/validation/rules/UniqueInputFieldNames.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateInputFieldMessage(fieldName: string): string; /** * Unique input field names @@ -6,4 +9,4 @@ import { ValidationContext } from '../index'; * A GraphQL input object value is only valid if all supplied fields are * uniquely named. */ -export function UniqueInputFieldNames(context: ValidationContext): any; +export function UniqueInputFieldNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueOperationNames.d.ts b/types/graphql/validation/rules/UniqueOperationNames.d.ts index 5b12cc0eed..221b1187c2 100644 --- a/types/graphql/validation/rules/UniqueOperationNames.d.ts +++ b/types/graphql/validation/rules/UniqueOperationNames.d.ts @@ -1,8 +1,11 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateOperationNameMessage(operationName: string): string; /** * Unique operation names * * A GraphQL document is only valid if all defined operations have unique names. */ -export function UniqueOperationNames(context: ValidationContext): any; +export function UniqueOperationNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueVariableNames.d.ts b/types/graphql/validation/rules/UniqueVariableNames.d.ts index ef8712fbc1..d0aaf0404e 100644 --- a/types/graphql/validation/rules/UniqueVariableNames.d.ts +++ b/types/graphql/validation/rules/UniqueVariableNames.d.ts @@ -1,8 +1,11 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateVariableMessage(variableName: string): string; /** * Unique variable names * * A GraphQL operation is only valid if all its variables are uniquely named. */ -export function UniqueVariableNames(context: ValidationContext): any; +export function UniqueVariableNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/ValuesOfCorrectType.d.ts b/types/graphql/validation/rules/ValuesOfCorrectType.d.ts new file mode 100644 index 0000000000..09314835ad --- /dev/null +++ b/types/graphql/validation/rules/ValuesOfCorrectType.d.ts @@ -0,0 +1,16 @@ +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function badValueMessage(typeName: string, valueName: string, message?: string): string; + +export function requiredFieldMessage(typeName: string, fieldName: string, fieldTypeName: string): string; + +export function unknownFieldMessage(typeName: string, fieldName: string, message?: string): string; + +/** + * Value literals of correct type + * + * A GraphQL document is only valid if all value literals are of the type + * expected at their position. + */ +export function ValuesOfCorrectType(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/VariablesAreInputTypes.d.ts b/types/graphql/validation/rules/VariablesAreInputTypes.d.ts index df079e52f9..32472e15fd 100644 --- a/types/graphql/validation/rules/VariablesAreInputTypes.d.ts +++ b/types/graphql/validation/rules/VariablesAreInputTypes.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function nonInputTypeOnVarMessage(variableName: string, typeName: string): string; /** * Variables are input types @@ -6,4 +9,4 @@ import { ValidationContext } from '../index'; * A GraphQL operation is only valid if all the variables it defines are of * input types (scalar, enum, or input object). */ -export function VariablesAreInputTypes(context: ValidationContext): any; +export function VariablesAreInputTypes(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/VariablesDefaultValueAllowed.d.ts b/types/graphql/validation/rules/VariablesDefaultValueAllowed.d.ts new file mode 100644 index 0000000000..1961eb645e --- /dev/null +++ b/types/graphql/validation/rules/VariablesDefaultValueAllowed.d.ts @@ -0,0 +1,13 @@ +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function defaultForRequiredVarMessage(varName: string, type: GraphQLType, guessType: GraphQLType): string; + +/** + * Variable's default value is allowed + * + * A GraphQL document is only valid if all variable default values are allowed + * due to a variable not being required. + */ +export function VariablesDefaultValueAllowed(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/VariablesInAllowedPosition.d.ts b/types/graphql/validation/rules/VariablesInAllowedPosition.d.ts index 6d3e513876..f21ed5c7fb 100644 --- a/types/graphql/validation/rules/VariablesInAllowedPosition.d.ts +++ b/types/graphql/validation/rules/VariablesInAllowedPosition.d.ts @@ -1,6 +1,10 @@ -import { ValidationContext } from '../index'; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function badVarPosMessage(varName: string, varType: GraphQLType, expectedType: GraphQLType): string; /** * Variables passed to field arguments conform to type */ -export function VariablesInAllowedPosition(context: ValidationContext): any; +export function VariablesInAllowedPosition(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/specifiedRules.d.ts b/types/graphql/validation/specifiedRules.d.ts index c09c358cb1..8e9815377f 100644 --- a/types/graphql/validation/specifiedRules.d.ts +++ b/types/graphql/validation/specifiedRules.d.ts @@ -1,6 +1,90 @@ -import { ValidationContext } from './validate'; // It needs to check. +// Spec Section: "Executable Definitions" +import { ExecutableDefinitions } from "./rules/ExecutableDefinitions"; + +// Spec Section: "Operation Name Uniqueness" +import { UniqueOperationNames } from "./rules/UniqueOperationNames"; + +// Spec Section: "Lone Anonymous Operation" +import { LoneAnonymousOperation } from "./rules/LoneAnonymousOperation"; + +// Spec Section: "Subscriptions with Single Root Field" +import { SingleFieldSubscriptions } from "./rules/SingleFieldSubscriptions"; + +// Spec Section: "Fragment Spread Type Existence" +import { KnownTypeNames } from "./rules/KnownTypeNames"; + +// Spec Section: "Fragments on Composite Types" +import { FragmentsOnCompositeTypes } from "./rules/FragmentsOnCompositeTypes"; + +// Spec Section: "Variables are Input Types" +import { VariablesAreInputTypes } from "./rules/VariablesAreInputTypes"; + +// Spec Section: "Leaf Field Selections" +import { ScalarLeafs } from "./rules/ScalarLeafs"; + +// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" +import { FieldsOnCorrectType } from "./rules/FieldsOnCorrectType"; + +// Spec Section: "Fragment Name Uniqueness" +import { UniqueFragmentNames } from "./rules/UniqueFragmentNames"; + +// Spec Section: "Fragment spread target defined" +import { KnownFragmentNames } from "./rules/KnownFragmentNames"; + +// Spec Section: "Fragments must be used" +import { NoUnusedFragments } from "./rules/NoUnusedFragments"; + +// Spec Section: "Fragment spread is possible" +import { PossibleFragmentSpreads } from "./rules/PossibleFragmentSpreads"; + +// Spec Section: "Fragments must not form cycles" +import { NoFragmentCycles } from "./rules/NoFragmentCycles"; + +// Spec Section: "Variable Uniqueness" +import { UniqueVariableNames } from "./rules/UniqueVariableNames"; + +// Spec Section: "All Variable Used Defined" +import { NoUndefinedVariables } from "./rules/NoUndefinedVariables"; + +// Spec Section: "All Variables Used" +import { NoUnusedVariables } from "./rules/NoUnusedVariables"; + +// Spec Section: "Directives Are Defined" +import { KnownDirectives } from "./rules/KnownDirectives"; + +// Spec Section: "Directives Are Unique Per Location" +import { UniqueDirectivesPerLocation } from "./rules/UniqueDirectivesPerLocation"; + +// Spec Section: "Argument Names" +import { KnownArgumentNames } from "./rules/KnownArgumentNames"; + +// Spec Section: "Argument Uniqueness" +import { UniqueArgumentNames } from "./rules/UniqueArgumentNames"; + +// Spec Section: "Value Type Correctness" +import { ValuesOfCorrectType } from "./rules/ValuesOfCorrectType"; + +// Spec Section: "Argument Optionality" +import { ProvidedNonNullArguments } from "./rules/ProvidedNonNullArguments"; + +// Spec Section: "Variables Default Value Is Allowed" +import { VariablesDefaultValueAllowed } from "./rules/VariablesDefaultValueAllowed"; + +// Spec Section: "All Variable Usages Are Allowed" +import { VariablesInAllowedPosition } from "./rules/VariablesInAllowedPosition"; + +// Spec Section: "Field Selection Merging" +import { OverlappingFieldsCanBeMerged } from "./rules/OverlappingFieldsCanBeMerged"; + +// Spec Section: "Input Object Field Uniqueness" +import { UniqueInputFieldNames } from "./rules/UniqueInputFieldNames"; + +import ValidationContext from "./ValidationContext"; /** * This set includes all validation rules defined by the GraphQL spec. + * + * The order of the rules in this list has been adjusted to lead to the + * most clear output when encountering multiple validation errors. */ export const specifiedRules: Array<(context: ValidationContext) => any>; diff --git a/types/graphql/validation/validate.d.ts b/types/graphql/validation/validate.d.ts index 9e2fd479f1..9a5092d258 100644 --- a/types/graphql/validation/validate.d.ts +++ b/types/graphql/validation/validate.d.ts @@ -1,23 +1,7 @@ -import { GraphQLError } from '../error'; -import { - DocumentNode, - OperationDefinitionNode, - VariableNode, - SelectionSetNode, - FragmentSpreadNode, - FragmentDefinitionNode, -} from '../language/ast'; -import { GraphQLSchema } from '../type/schema'; -import { - GraphQLInputType, - GraphQLOutputType, - GraphQLCompositeType, - GraphQLField, - GraphQLArgument, -} from '../type/definition'; -import { GraphQLDirective } from '../type/directives'; -import { TypeInfo } from '../utilities/TypeInfo'; -import { specifiedRules } from './specifiedRules'; +import { GraphQLError } from "../error"; +import { DocumentNode } from "../language/ast"; +import { GraphQLSchema } from "../type/schema"; +import { TypeInfo } from "../utilities/TypeInfo"; /** * Implements the "Validation" section of the spec. @@ -31,72 +15,13 @@ import { specifiedRules } from './specifiedRules'; * Each validation rules is a function which returns a visitor * (see the language/visitor API). Visitor methods are expected to return * GraphQLErrors, or Arrays of GraphQLErrors when invalid. + * + * Optionally a custom TypeInfo instance may be provided. If not provided, one + * will be created from the provided schema. */ export function validate( - schema: GraphQLSchema, - ast: DocumentNode, - rules?: any[], -): GraphQLError[]; - -/** - * This uses a specialized visitor which runs multiple visitors in parallel, - * while maintaining the visitor skip and break API. - * - * @internal - */ -export function visitUsingRules( - schema: GraphQLSchema, - typeInfo: TypeInfo, - documentAST: DocumentNode, - rules: any[], -): GraphQLError[]; - -export type NodeWithSelectionSet = - | OperationDefinitionNode - | FragmentDefinitionNode; -export interface VariableUsage { - node: VariableNode; - type: GraphQLInputType; -} - -/** - * An instance of this class is passed as the "this" context to all validators, - * allowing access to commonly useful contextual information from within a - * validation rule. - */ -export class ValidationContext { - constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo); - reportError(error: GraphQLError): void; - - getErrors(): GraphQLError[]; - - getSchema(): GraphQLSchema; - - getDocument(): DocumentNode; - - getFragment(name: string): FragmentDefinitionNode; - - getFragmentSpreads(node: SelectionSetNode): FragmentSpreadNode[]; - - getRecursivelyReferencedFragments( - operation: OperationDefinitionNode, - ): FragmentDefinitionNode[]; - - getVariableUsages(node: NodeWithSelectionSet): VariableUsage[]; - - getRecursiveVariableUsages( - operation: OperationDefinitionNode, - ): VariableUsage[]; - - getType(): GraphQLOutputType; - - getParentType(): GraphQLCompositeType; - - getInputType(): GraphQLInputType; - - getFieldDef(): GraphQLField; - - getDirective(): GraphQLDirective; - - getArgument(): GraphQLArgument; -} + schema: GraphQLSchema, + ast: DocumentNode, + rules?: ReadonlyArray, + typeInfo?: TypeInfo +): ReadonlyArray; diff --git a/types/gulp-change/gulp-change-tests.ts b/types/gulp-change/gulp-change-tests.ts new file mode 100644 index 0000000000..5a52062951 --- /dev/null +++ b/types/gulp-change/gulp-change-tests.ts @@ -0,0 +1,17 @@ +import change = require('gulp-change'); + +change(); // $ExpectError +change(1); // $ExpectError + +function performChange(content: string): string { + return content.replace(/foo/g, 'FOO'); +} + +change(performChange); // $ExpectType MapStream + +function performChangeAsync(content: string, done: (err: any, content: string) => any): void { + content.replace(/foo/g, 'FOO'); + done(null, content); +} + +change(performChangeAsync); // $ExpectType MapStream diff --git a/types/gulp-change/index.d.ts b/types/gulp-change/index.d.ts new file mode 100644 index 0000000000..2220100fd9 --- /dev/null +++ b/types/gulp-change/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for gulp-change 1.0 +// Project: https://github.com/PoliteJS/gulp-change +// Definitions by: Aankhen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as eventStream from "event-stream"; + +export = GulpChange; + +declare function GulpChange(transformer: GulpChange.ChangeFunction): eventStream.MapStream; + +declare namespace GulpChange { + type Callback = (err: any, content: string) => any; + + type ChangeFunction = (content: string, callback: Callback) => string | void; +} diff --git a/types/gulp-change/tsconfig.json b/types/gulp-change/tsconfig.json new file mode 100644 index 0000000000..1b736a1975 --- /dev/null +++ b/types/gulp-change/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", + "gulp-change-tests.ts" + ] +} diff --git a/types/gulp-change/tslint.json b/types/gulp-change/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gulp-change/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/gulp-image-resize/gulp-image-resize-tests.ts b/types/gulp-image-resize/gulp-image-resize-tests.ts new file mode 100644 index 0000000000..46360827c1 --- /dev/null +++ b/types/gulp-image-resize/gulp-image-resize-tests.ts @@ -0,0 +1,40 @@ +import resize = require('gulp-image-resize'); + +resize(); // $ExpectType Transform +resize(undefined); +resize("1"); // $ExpectError + +resize({ // $ExpectType Transform + width: 100, + height: 100, + crop: true, + upscale: false +}); + +resize({ + widt: 5 // $ExpectError +}); + +resize({ + width: undefined, + height: undefined, + upscale: undefined, + crop: undefined, + gravity: undefined, + quality: undefined, + format: undefined, + filter: undefined, + sharpen: undefined, + samplingFactor: undefined, + noProfile: undefined, + interlace: undefined, + imageMagick: undefined, + background: undefined, + flatten: undefined, + percentage: undefined, + cover: undefined +}); + +resize({ format: 'jpeg' }); +resize({ width: 100 }); +resize({ percentage: 50 }); diff --git a/types/gulp-image-resize/index.d.ts b/types/gulp-image-resize/index.d.ts new file mode 100644 index 0000000000..3166b0d9b9 --- /dev/null +++ b/types/gulp-image-resize/index.d.ts @@ -0,0 +1,38 @@ +// Type definitions for gulp-image-resize 0.13 +// Project: https://github.com/scalableminds/gulp-image-resize +// Definitions by: Aankhen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +import * as stream from "stream"; +import * as gm from "gm"; + +export = GulpImageResize; + +declare function GulpImageResize(options?: GulpImageResize.Options): stream.Transform; + +declare namespace GulpImageResize { + type SamplingFactor = [number, number]; + + interface Options { + width?: number; + height?: number; + upscale?: boolean; + crop?: boolean; + gravity?: gm.GravityDirection; + quality?: number; + format?: string; + filter?: gm.FilterType; + sharpen?: boolean | string; + samplingFactor?: SamplingFactor; + noProfile?: boolean; + interlace?: boolean; + imageMagick?: boolean; + background?: string; + flatten?: boolean; + percentage?: number; + cover?: boolean; + } +} diff --git a/types/gulp-image-resize/tsconfig.json b/types/gulp-image-resize/tsconfig.json new file mode 100644 index 0000000000..7f26af6c84 --- /dev/null +++ b/types/gulp-image-resize/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", + "gulp-image-resize-tests.ts" + ] +} diff --git a/types/gulp-image-resize/tslint.json b/types/gulp-image-resize/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gulp-image-resize/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/gulp-image/gulp-image-tests.ts b/types/gulp-image/gulp-image-tests.ts new file mode 100644 index 0000000000..6d94c46921 --- /dev/null +++ b/types/gulp-image/gulp-image-tests.ts @@ -0,0 +1,28 @@ +import image = require('gulp-image'); + +image(false); // $ExpectError + +image(); // $ExpectType Transform +image({}); +image({ + pngquant: true, + optipng: false, + zopflipng: true, + jpegRecompress: false, + mozjpeg: true, + guetzli: false, + gifsicle: true, + svgo: true, + concurrent: 10, + quiet: true // defaults to false +}); +image({ + optipng: ['-i 1', '-strip all', '-fix', '-o7', '-force'], + pngquant: ['--speed=1', '--force', 256], + zopflipng: ['-y', '--lossy_8bit', '--lossy_transparent'], + jpegRecompress: ['--strip', '--quality', 'medium', '--min', 40, '--max', 80], + mozjpeg: ['-optimize', '-progressive'], + guetzli: ['--quality', 85], + gifsicle: ['--optimize'], + svgo: ['--enable', 'cleanupIDs', '--disable', 'convertColors'] +}); diff --git a/types/gulp-image/index.d.ts b/types/gulp-image/index.d.ts new file mode 100644 index 0000000000..d46d68f3ab --- /dev/null +++ b/types/gulp-image/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for gulp-image 4.3 +// Project: https://github.com/1000ch/gulp-image#readme +// Definitions by: Aankhen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +import stream = require("stream"); + +export = GulpImage; + +declare function GulpImage(options?: GulpImage.Options): stream.Transform; + +declare namespace GulpImage { + type OptimizerSetting = boolean + | any[]; + + interface Options { + pngquant?: OptimizerSetting; + optipng?: OptimizerSetting; + zopflipng?: OptimizerSetting; + jpegRecompress?: OptimizerSetting; + mozjpeg?: OptimizerSetting; + guetzli?: OptimizerSetting; + gifsicle?: OptimizerSetting; + svgo?: OptimizerSetting; + concurrent?: number; + quiet?: boolean; + } +} diff --git a/types/gulp-image/tsconfig.json b/types/gulp-image/tsconfig.json new file mode 100644 index 0000000000..a9d788e360 --- /dev/null +++ b/types/gulp-image/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", + "gulp-image-tests.ts" + ] +} diff --git a/types/gulp-image/tslint.json b/types/gulp-image/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gulp-image/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/gulp-responsive-images/gulp-responsive-images-tests.ts b/types/gulp-responsive-images/gulp-responsive-images-tests.ts new file mode 100644 index 0000000000..63957ec047 --- /dev/null +++ b/types/gulp-responsive-images/gulp-responsive-images-tests.ts @@ -0,0 +1,63 @@ +import gulpResponsiveImages = require('gulp-responsive-images'); + +gulpResponsiveImages(); // $ExpectError + +gulpResponsiveImages({}); // $ExpectType Transform + +gulpResponsiveImages({ 1: "abcd" }); // $ExpectError + +gulpResponsiveImages({ + 'hero.png': [ + { + } + ] +} +); + +gulpResponsiveImages({ + 'hero.png': [ + { + crop: false, + gravity: 'Center', + height: 100, + overwrite: true, + quality: 100, + sharpen: false, + suffix: '-100', + upscale: false, + width: 100 + } + ] +} +); + +gulpResponsiveImages({ + 'hero.png': [ + { + format: "jpeg", + rename: "image.jpg", + percentage: 50 + } + ] +} +); + +gulpResponsiveImages({ + 'hero.png': [ + { + crop: undefined, + gravity: undefined, + height: undefined, + overwrite: undefined, + quality: undefined, + sharpen: undefined, + suffix: undefined, + upscale: undefined, + width: undefined, + format: undefined, + rename: undefined, + percentage: undefined + } + ] +} +); diff --git a/types/gulp-responsive-images/index.d.ts b/types/gulp-responsive-images/index.d.ts new file mode 100644 index 0000000000..3b3707f024 --- /dev/null +++ b/types/gulp-responsive-images/index.d.ts @@ -0,0 +1,43 @@ +// Type definitions for gulp-responsive-images 0.0 +// Project: https://github.com/dcgauld/gulp-responsive-images#readme +// Definitions by: Aankhen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as stream from "stream"; +import * as gm from "gm"; +import { ParsedPath, Options as RenameOptions } from "gulp-rename"; + +export = GulpResponsiveImage; + +declare function GulpResponsiveImage(configs: GulpResponsiveImage.Matchers): stream.Transform; + +declare namespace GulpResponsiveImage { + type SamplingFactor = [number, number]; + + type Rename = string + | ((path: ParsedPath) => any) + | RenameOptions; + + interface Settings { + crop?: boolean; + format?: string; + gravity?: gm.GravityDirection; + overwrite?: boolean; + quality?: number; + rename?: Rename; + percentage?: number; + sharpen?: boolean; + upscale?: boolean; + filter?: gm.FilterType; + height?: number; + width?: number; + samplingFactor?: SamplingFactor; + suffix?: string; + } + + interface Matchers { + [index: string]: ReadonlyArray; + } +} diff --git a/types/gulp-responsive-images/tsconfig.json b/types/gulp-responsive-images/tsconfig.json new file mode 100644 index 0000000000..2c4c0aa75b --- /dev/null +++ b/types/gulp-responsive-images/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", + "gulp-responsive-images-tests.ts" + ] +} diff --git a/types/gulp-responsive-images/tslint.json b/types/gulp-responsive-images/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gulp-responsive-images/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/handlebars/handlebars-tests.ts b/types/handlebars/handlebars-tests.ts index 95342c2e63..1ec2528db3 100644 --- a/types/handlebars/handlebars-tests.ts +++ b/types/handlebars/handlebars-tests.ts @@ -1,8 +1,8 @@ -import Handlebars = require('handlebars'); +//import Handlebars = require('handlebars'); +import * as Handlerbars from 'handlebars'; - -var context = { +const context = { author: { firstName: 'Alan', lastName: 'Johnson' }, body: 'I Love Handlebars', comments: [{ @@ -20,65 +20,61 @@ Handlebars.registerHelper('agree_button', function() { ); }); -var source = '

Hello, my name is {{name}}. I am from {{hometown}}. I have ' + +const source1 = '

Hello, my name is {{name}}. I am from {{hometown}}. I have ' + '{{kids.length}} kids:

' + '
    {{#kids}}
  • {{name}} is {{age}}
  • {{/kids}}
'; -var template = Handlebars.compile(source); -var data = { 'name': 'Alan', 'hometown': 'Somewhere, TX', - 'kids': [{'name': 'Jimmy', 'age': '12'}, {'name': 'Sally', 'age': '4'}]}; -var result = template(data); +const template1 = Handlebars.compile(source1); +template1({ name: "Alan", hometown: "Somewhere, TX", kids: [{name: "Jimmy", age: 12}, {name: "Sally", age: 4}]}); Handlebars.registerHelper('link_to', (context: typeof post) => { return '' + context.body + ''; }); - -var post = { url: '/hello-world', body: 'Hello World!' }; -var context2 = { posts: [post] }; -var source2 = '
    {{#posts}}
  • {{{link_to this}}}
  • {{/posts}}
'; - -var template2: HandlebarsTemplateDelegate<{ posts: { url: string, body: string }[] }> = Handlebars.compile(source2); +const post = { url: "/hello-world", body: "Hello World!" }; +const context2 = { posts: [post] }; +const source2 = '
    {{#posts}}
  • {{{link_to this}}}
  • {{/posts}}
'; +const template2: HandlebarsTemplateDelegate<{ posts: { url: string, body: string }[] }> = Handlebars.compile(source2); template2(context2); Handlebars.registerHelper('link_to', (title: string, context: typeof post) => { return '' + title + '!'; }); - -var context3 = { posts: [{url: '/hello-world', body: 'Hello World!'}] }; -var source3 = '
    {{#posts}}
  • {{{link_to "Post" this}}}
  • {{/posts}}
'; -var template3 = Handlebars.compile(source3); +const context3 = { posts: [{url: '/hello-world', body: 'Hello World!'}] }; +const source3 = '
    {{#posts}}
  • {{{link_to "Post" this}}}
  • {{/posts}}
'; +const template3 = Handlebars.compile(source3); template3(context3); -var source4 = '
    {{#people}}
  • {{#link}}{{name}}{{/link}}
  • {{/people}}
'; +const source4 = '
    {{#people}}
  • {{#link}}{{name}}{{/link}}
  • {{/people}}
'; Handlebars.registerHelper('link', function(context: any) { return '' + context.fn(this) + ''; }); -var template4 = Handlebars.compile<{ people: { name: string, id: number }[] }>(source4); -var data2 = { 'people': [ +const template4 = Handlebars.compile<{ people: { name: string, id: number }[] }>(source4); +const data2 = { 'people': [ { 'name': 'Alan', 'id': 1 }, { 'name': 'Yehuda', 'id': 2 } ]}; template4(data2); -var source5 = '
    {{#people}}
  • {{> link}}
  • {{/people}}
'; +const source5 = '
    {{#people}}
  • {{> link}}
  • {{/people}}
'; Handlebars.registerPartial('link', '{{name}}'); -var template5 = Handlebars.compile(source5); -var data3 = { 'people': [ +const template5 = Handlebars.compile(source5); +const data3 = { 'people': [ { 'name': 'Alan', 'id': 1 }, { 'name': 'Yehuda', 'id': 2 } ]}; template5(data3); -Handlebars.registerHelper('list', (items: any, fn: (item: any) => string) => { - var out = '
    '; - for(var i=0, l=items.length; i' + fn(items[i]) + ''; - } - return out + '
'; -}); -Handlebars.registerHelper('fullName', (person: typeof context.author) => { - return person.firstName + ' ' + person.lastName; +const source6 = '{{#list nav}}{{title}}{{/list}}'; +const template6 = Handlebars.compile(source6); +Handlebars.registerHelper('list', (context, options: Handlebars.HelperOptions) => { + let ret = "
    "; + for(let i=0, j=context.length; i" + options.fn(context[i]) + ""; + } + return ret + "
"; }); +template6([{url:"", title:""}]) -var escapedExpression = Handlebars.Utils.escapeExpression(''); + +const escapedExpression = Handlebars.Utils.escapeExpression(''); Handlebars.helpers !== undefined; diff --git a/types/handlebars/index.d.ts b/types/handlebars/index.d.ts index eb5958f6db..351d98fb10 100644 --- a/types/handlebars/index.d.ts +++ b/types/handlebars/index.d.ts @@ -1,15 +1,48 @@ -// Type definitions for Handlebars v4.0.5 +// Type definitions for Handlebars v4.0.11 // Project: http://handlebarsjs.com/ -// Definitions by: Boris Yankov +// Definitions by: Boris Yankov , Sergei Dorogin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 declare namespace Handlebars { - export function registerHelper(name: string, fn: Function, inverse?: boolean): void; - export function registerHelper(name: Object): void; - export function registerPartial(name: string, str: any): void; + export interface TemplateDelegate { + (context: T, options?: RuntimeOptions): string; + } + + export type Template = TemplateDelegate|string; + + export interface RuntimeOptions { + partial?: boolean; + depths?: any[]; + helpers?: { [name: string]: Function }; + partials?: { [name: string]: HandlebarsTemplateDelegate }; + decorators?: { [name: string]: Function }; + data?: any; + blockParams?: any[]; + } + + export interface HelperOptions { + fn: TemplateDelegate; + inverse: TemplateDelegate; + hash: any; + data?: any; + } + + export interface HelperDelegate { + (context?: any, arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any, options?: HelperOptions): any; + } + export interface HelperDeclareSpec { + [key: string]: HelperDelegate; + } + + export function registerHelper(name: string, fn: HelperDelegate): void; + export function registerHelper(name: HelperDeclareSpec): void; export function unregisterHelper(name: string): void; + + export function registerPartial(name: string, fn: Template): void; export function unregisterPartial(name: string): void; + + // TODO: replace Function with actual signature export function registerDecorator(name: string, fn: Function): void; export function unregisterDecorator(name: string): void; @@ -25,23 +58,36 @@ declare namespace Handlebars { export function create(): typeof Handlebars; - export var SafeString: typeof hbs.SafeString; - export var escapeExpression: typeof hbs.Utils.escapeExpression; - export var Utils: typeof hbs.Utils; - export var logger: Logger; - export var templates: HandlebarsTemplates; - export var helpers: { [name: string]: Function }; - export var partials: { [name: string]: any }; - export var decorators: { [name: string]: Function }; - - export function registerDecorator(name: string, fn: Function): void; - export function registerDecorator(obj: {[name: string] : Function}): void; - export function unregisterDecorator(name: string): void; + export const escapeExpression: typeof Utils.escapeExpression; + //export const Utils: typeof hbs.Utils; + export const logger: Logger; + export const templates: HandlebarsTemplates; + export const helpers: { [name: string]: HelperDelegate }; + export const partials: { [name: string]: any }; + // TODO: replace Function with actual signature + export const decorators: { [name: string]: Function }; export function noConflict(): typeof Handlebars; - export module AST { - export var helpers: hbs.AST.helpers; + export class SafeString { + constructor(str: string); + toString(): string; + toHTML(): string; + } + + export namespace Utils { + export function escapeExpression(str: string): string; + export function createFrame(object: any): any; + export function blockParams(obj: any[], ids: any[]): any[]; + export function isEmpty(obj: any) : boolean; + export function extend(obj: any, ...source: any[]): any; + export function toString(obj: any): string; + export function isArray(obj: any): boolean; + export function isFunction(obj: any): boolean; + } + + export namespace AST { + export const helpers: hbs.AST.helpers; } interface ICompiler { @@ -96,9 +142,8 @@ interface HandlebarsTemplatable { template: HandlebarsTemplateDelegate; } -interface HandlebarsTemplateDelegate { - (context: T, options?: RuntimeOptions): string; -} +// NOTE: for backward compatibility of this typing +type HandlebarsTemplateDelegate = Handlebars.TemplateDelegate; interface HandlebarsTemplates { [index: string]: HandlebarsTemplateDelegate; @@ -108,13 +153,8 @@ interface TemplateSpecification { } -interface RuntimeOptions { - partial?: boolean; - depths?: any[]; - helpers?: { [name: string]: Function } - partials?: { [name: string]: HandlebarsTemplateDelegate } - decorators?: { [name: string]: Function } -} +// for backward compatibility of this typing +type RuntimeOptions = Handlebars.RuntimeOptions; interface CompileOptions { data?: boolean; @@ -128,7 +168,7 @@ interface CompileOptions { with?: boolean; log?: boolean; lookup?: boolean; - } + }; knownHelpersOnly?: boolean; noEscape?: boolean; strict?: boolean; @@ -144,21 +184,10 @@ interface PrecompileOptions extends CompileOptions { } declare namespace hbs { - class SafeString { - constructor(str: string); - static toString(): string; - } + // for backward compatibility of this typing + type SafeString = Handlebars.SafeString; - namespace Utils { - function escapeExpression(str: string): string; - function createFrame(object: any): any; - function blockParams(obj: any[], ids: any[]): any[]; - function isEmpty(obj: any) : boolean; - function extend(obj: any, ...source: any[]): any; - function toString(obj: any): string; - function isArray(obj: any): boolean; - function isFunction(obj: any): boolean; - } + type Utils = typeof Handlebars.Utils; } interface Logger { @@ -231,11 +260,11 @@ declare namespace hbs { interface PartialBlockStatement extends Statement { name: PathExpression | SubExpression; - params: Expression[], - hash: Hash, - program: Program, - openStrip: StripFlags, - closeStrip: StripFlags + params: Expression[]; + hash: Hash; + program: Program; + openStrip: StripFlags; + closeStrip: StripFlags; } interface ContentStatement extends Statement { diff --git a/types/handlebars/tsconfig.json b/types/handlebars/tsconfig.json index 5f874f3996..5c7bf000d0 100644 --- a/types/handlebars/tsconfig.json +++ b/types/handlebars/tsconfig.json @@ -19,5 +19,9 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true - } + }, + "files": [ + "index.d.ts", + "handlebars-tests.ts" + ] } \ No newline at end of file diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index 3628a7a931..d4072b0cd7 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Marc Bornträger // Rafael Souza Fijalkowski // Justin Simms +// Simon Schick // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -1008,7 +1009,7 @@ export interface ResponseToolkit { * @return Return value: none. * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-hstatename-value-options) */ - state(name: string, value: string, options?: ServerStateCookieOptions): void; + state(name: string, value: string | object, options?: ServerStateCookieOptions): void; /** * Used by the [authentication] method to indicate authentication failed and pass back the credentials received where: @@ -1143,7 +1144,7 @@ export interface RouteOptionsAccess { * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionscache) */ export type RouteOptionsCache = { - privacy?: 'default' | 'public' | 'privacy'; + privacy?: 'default' | 'public' | 'private'; statuses?: number[]; otherwise?: string; } & ( @@ -1724,12 +1725,7 @@ export interface RouteOptions { * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#request-lifecycle) */ ext?: { - onPreAuth?: Lifecycle.Method; - onCredentials?: Lifecycle.Method; - onPostAuth?: Lifecycle.Method; - onPreHandler?: Lifecycle.Method; - onPostHandler?: Lifecycle.Method; - onPreResponse?: Lifecycle.Method; + [key in RouteRequestExtType]?: RouteExtObject | RouteExtObject[]; }; /** @@ -2229,8 +2225,8 @@ export interface RequestEvent { error: object; } -export type LogEventHandler = (event: LogEvent, tags: object) => void; -export type RequestEventHandler = (request: Request, event: RequestEvent, tags: object) => void; +export type LogEventHandler = (event: LogEvent, tags: { [key: string]: true }) => void; +export type RequestEventHandler = (request: Request, event: RequestEvent, tags: { [key: string]: true }) => void; export type ResponseEventHandler = (request: Request) => void; export type RouteEventHandler = (route: ServerRoute) => void; export type StartEventHandler = () => void; @@ -2354,15 +2350,17 @@ export interface ServerEvents extends Podium { * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#request-lifecycle) */ export type ServerExtType = 'onPreStart' | 'onPostStart' | 'onPreStop' | 'onPostStop'; -export type ServerRequestExtType = - 'onRequest' - | 'onPreAuth' +export type RouteRequestExtType = 'onPreAuth' | 'onCredentials' | 'onPostAuth' | 'onPreHandler' | 'onPostHandler' | 'onPreResponse'; +export type ServerRequestExtType = + RouteRequestExtType + | 'onRequest'; + /** * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverextevents) * Registers an extension function in one of the request lifecycle extension points where: @@ -2401,14 +2399,11 @@ export interface ServerExtEventsObject { * * request extension points: a lifecycle method. */ method: ServerExtPointFunction | ServerExtPointFunction[]; - /** - * options - (optional) an object with the following: - * * before - a string or array of strings of plugin names this method must execute before (on the same event). Otherwise, extension methods are executed in the order added. - * * after - a string or array of strings of plugin names this method must execute after (on the same event). Otherwise, extension methods are executed in the order added. - * * bind - a context object passed back to the provided method (via this) when called. Ignored if the method is an arrow function. - * * sandbox - if set to 'plugin' when adding a request extension points the extension is only added to routes defined by the current plugin. Not allowed when configuring route-level extensions, - * or when adding server extensions. Defaults to 'server' which applies to any route added to the server the extension is added to. - */ + options?: ServerExtOptions; +} + +export interface RouteExtObject { + method: Lifecycle.Method; options?: ServerExtOptions; } @@ -2586,7 +2581,7 @@ export interface ServerInjectOptions extends Shot.RequestOptions { /** * sets the initial value of request.app, defaults to {}. */ - app: ApplicationState; + app?: ApplicationState; /** * sets the initial value of request.plugins, defaults to {}. */ diff --git a/types/hapi/test/route/ext.ts b/types/hapi/test/route/ext.ts index 0a2ac25a4b..b8dff44699 100644 --- a/types/hapi/test/route/ext.ts +++ b/types/hapi/test/route/ext.ts @@ -7,9 +7,16 @@ server.route({ path: "/test", options: { ext: { - onPreResponse(request, h) { - return h.continue; + onPreResponse: { + method(_request, h) { + return h.continue; + }, }, + onPostHandler: [{ + method(_request, h) { + return h.continue; + }, + }], } } }); diff --git a/types/hapi/test/server/server-state.ts b/types/hapi/test/server/server-state.ts index 97cf5997f0..ba4ffe344c 100644 --- a/types/hapi/test/server/server-state.ts +++ b/types/hapi/test/server/server-state.ts @@ -1,5 +1,5 @@ // from https://hapijs.com/tutorials/cookies?lang=en_US -import { Request, ResponseToolkit, Server, ServerOptions, ServerRoute, ServerStateCookieOptions } from "hapi"; +import { Server, ServerOptions, ServerRoute, ServerStateCookieOptions } from "hapi"; const options: ServerOptions = { port: 8000, @@ -8,7 +8,8 @@ const options: ServerOptions = { const serverRoute: ServerRoute = { path: '/say-hello', method: 'GET', - handler(request, h) { + handler(_request, h) { + h.state('test', { test: true }); return h.response('Hello').state('data', { firstVisit: false }); } }; diff --git a/types/hellojs/hellojs-tests.ts b/types/hellojs/hellojs-tests.ts index 4a4e068379..8cf42d11e4 100644 --- a/types/hellojs/hellojs-tests.ts +++ b/types/hellojs/hellojs-tests.ts @@ -4,7 +4,8 @@ hello.init({ oauth: { version: 2, auth: '', - grant: '' + grant: '', + response_type: 'id_token token' }, refresh: true, scope_delim: ' ', diff --git a/types/hellojs/index.d.ts b/types/hellojs/index.d.ts index e8efdaf19c..5b23b29e07 100644 --- a/types/hellojs/index.d.ts +++ b/types/hellojs/index.d.ts @@ -53,7 +53,15 @@ declare namespace hello { type HelloJSResponseCallback = (r: any, headers: any) => void; - type HelloJSTokenResponseType = "token" | "code"; + type HelloJSTokenResponseType = + "code" + | "code id_token" + | "code id_token token" + | "code token" + | "id_token" + | "id_token token" + | "none" + | "token"; type HelloJSDisplayType = "popup" | "page" | "none"; diff --git a/types/highcharts/highstock.d.ts b/types/highcharts/highstock.d.ts index d2d81af469..a97ae9effa 100644 --- a/types/highcharts/highstock.d.ts +++ b/types/highcharts/highstock.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Highstock 2.1.5 +// Type definitions for Highstock 2.1.6 // Project: http://www.highcharts.com/ // Definitions by: David Deutsch @@ -87,12 +87,39 @@ declare namespace Highstock { scrollbar?: ScrollbarOptions; } + interface XAxisOptions extends AxisOptions { + ordinal?: boolean; + overscroll?: number; + } + + interface YAxisOptions extends AxisOptions { + height?: number | string; + maxLength?: number | string; + minLength?: number | string; + resize?: { + controlledAxis?: { + next?: Array; + prev?: Array; + }, + cursor?: string; + enabled?: boolean; + lineColor?: string; + lineDashStyle?: string; + lineWidth?: number; + x?: number; + y?: number; + }; + reversedStacks?: boolean; + tooltipValueFormat?: string; + top?: number | string; + } + interface Options extends Highcharts.Options { navigator?: NavigatorOptions; rangeSelector?: RangeSelectorOptions; scrollbar?: ScrollbarOptions; - xAxis?: AxisOptions[] | AxisOptions; - yAxis?: AxisOptions[] | AxisOptions; + xAxis?: XAxisOptions[] |XAxisOptions; + yAxis?: YAxisOptions[] | YAxisOptions; } interface Chart { diff --git a/types/highcharts/index.d.ts b/types/highcharts/index.d.ts index cf73a08e68..1434999411 100644 --- a/types/highcharts/index.d.ts +++ b/types/highcharts/index.d.ts @@ -5242,6 +5242,96 @@ declare namespace Highcharts { upColor?: Color; } + interface WordCloudChart extends BarChart { + /** + * For some series, there is a limit that shuts down initial animation by default when the total number of points + * in the chart is too high. For example, for a column chart and its derivatives, animation doesn't run if there + * is more than 250 points totally. To disable this cap, set animationLimit to Infinity. + * @default undefined + * @since 6.0.0 + */ + animationLimit?: number; + /** + * By default, series are exposed to screen readers as regions. By enabling this option, the series element itself + * will be exposed in the same way as the data points. This is useful if the series is not used as a grouping entity + * in the chart, but you still want to attach a description to the series. + * Requires the Accessibility module. + * @default undefined + * @since 5.0.12 + */ + exposeElementToA11y?: boolean; + /** + * This option decides which algorithm is used for placement, and rotation of a word. The choice of algorith is + * therefore a crucial part of the resulting layout of the wordcloud. It is possible for users to add their own + * custom placement strategies for use in word cloud. Read more about it in our documentation + * @default center + * @since 6.0.0 + */ + placementStrategy?: string; + /** + * Same as accessibility.pointDescriptionFormatter, but for an individual series. Overrides the chart wide + * configuration. + * @default undefined + * @since 5.0.12 + */ + pointDescriptionFormatter?: () => string; + /** + * Rotation options for the words in the wordcloud. + * @since 6.0.0 + */ + rotation?: { + /** + * The smallest degree of rotation for a + * @default 0 + * @since 6.0.0 + */ + from?: number; + /** + * The largest degree of rotation for a word. + * @default 90 + * @since 6.0.0 + */ + to?: number; + /** + * The number of possible orientations for a word, within the range of rotation.from and rotation.to. + * @default 2 + * @since 6.0.0 + */ + orientations?: number; + }; + + /** + * If set to True, the accessibility module will skip past the points in this series for keyboard navigation. + * @default undefined + * @since 5.0.12 + */ + skipKeyboardNavigation?: boolean; + /** + * Spiral used for placing a word after the inital position experienced a collision with either another word or the + * borders. It is possible for users to add their own custom spiralling algorithms for use in word cloud. Read more + * about it in our documentation + * @default rectangular + * @since 6.0.0 + */ + spiral?: string; + /** + * CSS styles for the words. + * @since 6.0.0 + */ + style?: { + /** + * @default sans-serif + * @since 6.0.0 + */ + fontFamily?: string; + /** + * @default 900 + * @since 6.0.0 + */ + fontWeight?: number | string; + }; + } + /** * The plotOptions is a wrapper object for config objects for each series type. The config objects for each series can * also be overridden for each series item as given in the series array. @@ -5423,6 +5513,7 @@ declare namespace Highcharts { interface SplineChartSeriesOptions extends IndividualSeriesOptions, SplineChart { } interface TreeMapChartSeriesOptions extends IndividualSeriesOptions, TreeMapChart { } interface WaterFallChartSeriesOptions extends IndividualSeriesOptions, WaterFallChart { } + interface WordCloudChartSeriesOptions extends IndividualSeriesOptions, WordCloudChart { } interface DataPoint { /** @@ -6711,6 +6802,36 @@ declare namespace Highcharts { map(array: any[], fn: Function): any[]; wrap(prototype: any, type: string, cb: (proceed: Function, ...args: any[]) => void): void; + + /** + * Add an event listener. + * + * @see {@link https://api.highcharts.com/class-reference/Highcharts#addEvent} + * @see {@link https://www.highcharts.com/docs/extending-highcharts/extending-highcharts} + * + * @param element The element or object to add a listener to. It can be a HTMLDOMElement, an Highcharts.SVGElement or any other object. + * @param type The event type. + * @param cb The function callback to execute when the event is fired. + * @returns A callback function to remove the added event. + */ + addEvent(element: HTMLElement | ElementObject | object, + type: string, + cb: (evt: Event) => void): () => void; + + /** + * Fire an event that was registered with + * + * @see {@link https://api.highcharts.com/class-reference/Highcharts#fireEvent} + * + * @param element The element or object to add a listener to. It can be a HTMLDOMElement, an Highcharts.SVGElement or any other object. + * @param type The event type. + * @param eventArguments Custom event arguments that are passed on as an argument to the event handler. + * @param defaultFunction The default function to execute if the other listeners haven't returned false. + */ + fireEvent(element: HTMLElement | ElementObject | object, + type: string, + eventArguments?: any, + defaultFunction?: () => void): void; } /** diff --git a/types/highcharts/test/index.ts b/types/highcharts/test/index.ts index c4ea1bd7a8..310886b585 100644 --- a/types/highcharts/test/index.ts +++ b/types/highcharts/test/index.ts @@ -2789,3 +2789,30 @@ function test_TitleUpdate() { } }); } + +function test_AddAndFireEvent() { + const chart = $('#container').highcharts(); + const type = 'drilldown'; + const evt = Highcharts.addEvent(chart, type, it => {}); + Highcharts.fireEvent(chart, type); +} + +function test_WordCloud() { + const allDefaults: Highcharts.WordCloudChartSeriesOptions = {}; + + // partial wordcloud demo + const series: Highcharts.WordCloudChartSeriesOptions = { + type: 'wordcloud', + data: [], + name: 'Occurrences', + rotation: { + to: 0 + }, + tooltip: { + headerFormat: null, + pointFormatter() { + return `${this.name}: Occurrence ${this.weight}`; + } + } + }; +} diff --git a/types/highland/highland-tests.ts b/types/highland/highland-tests.ts index 5f1c734395..a1c48c944b 100644 --- a/types/highland/highland-tests.ts +++ b/types/highland/highland-tests.ts @@ -337,6 +337,8 @@ fooStream.toCallback((err: Error) => {}); // UTILS // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool = _.isNil(x); + bool = _.isStream(x); bool = _.isStream(fooStream); diff --git a/types/highland/index.d.ts b/types/highland/index.d.ts index eff8fb2769..473e93880a 100644 --- a/types/highland/index.d.ts +++ b/types/highland/index.d.ts @@ -89,6 +89,17 @@ interface HighlandStatic { // UTILS // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + /** + * Returns true if `x` is the end of stream marker. + * + * @id isNil + * @section Streams + * @name _.isNil(x) + * @param x - the object to test + * @api public + */ + isNil(x: R | Highland.Nil): x is Highland.Nil; + /** * Returns true if `x` is a Highland Stream. * diff --git a/types/html2canvas/index.d.ts b/types/html2canvas/index.d.ts index dbc38f44bc..4fcfd81338 100644 --- a/types/html2canvas/index.d.ts +++ b/types/html2canvas/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for html2canvas.js 0.5 +// Type definitions for html2canvas.js 1.0-alpha // Project: https://github.com/niklasvh/html2canvas -// Definitions by: Richard Hepburn , Pei-Tang Huang +// Definitions by: Richard Hepburn , Pei-Tang Huang , Sebastian Schocke // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -8,15 +8,27 @@ declare namespace Html2Canvas { interface Html2CanvasOptions { + /** Whether to parse and render the element asynchronously */ + async?: boolean; + /** Whether to allow cross-origin images to taint the canvas */ allowTaint?: boolean; /** Canvas background color, if none is specified in DOM. Set undefined for transparent */ - background?: string; + backgroundColor?: string; - /** Define the heigt of the canvas in pixels. If null, renders with full height of the window. */ - height?: number; + /** Existing canvas element to use as a base for drawing on */ + canvas?: any; + /** Whether to use ForeignObject rendering if the browser supports it */ + foreignObjectRendering?: boolean; + + /** Predicate function which removes the matching elements from the render. */ + ignoreElements?: (element: HTMLElement) => boolean; + + /** Timeout for loading images, in milliseconds. Setting it to 0 will result in no timeout. */ + imageTimeout?: number; + /** Whether to render each letter seperately. Necessary if letter-spacing is used. */ letterRendering?: boolean; @@ -26,20 +38,44 @@ declare namespace Html2Canvas { /** Url to the proxy which is to be used for loading cross-origin images. If left empty, cross-origin images won't be loaded. */ proxy?: string; + /** Whether to cleanup the cloned DOM elements html2canvas creates temporarily */ + removeContainer?: boolean; + + /** The scale to use for rendering. Defaults to the browsers device pixel ratio. */ + scale?: number; + + /** Use svg powered rendering where available (FF11+). */ + svgRendering?: boolean; + /** Whether to test each image if it taints the canvas before drawing them */ taintTest?: boolean; - /** Timeout for loading images, in milliseconds. Setting it to 0 will result in no timeout. */ - timeout?: number; - - /** Define the width of the canvas in pixels. If null, renders with full width of the window. */ - width?: number; - /** Whether to attempt to load cross-origin images as CORS served, before reverting back to proxy. */ useCORS?: boolean; - /** Use svg powered rendering where available (FF11+). */ - svgRendering?: boolean; + /** Define the width of the canvas in pixels. If null, renders with full width of the window. */ + width?: number; + + /** Define the heigt of the canvas in pixels. If null, renders with full height of the window. */ + height?: number; + + /** Crop canvas x-coordinate */ + x?: number; + + /** Crop canvas y-coordinate */ + y?: number; + + /** The x-scroll position to used when rendering element, (for example if the Element uses position: fixed ) */ + scrollX?: number; + + /** The y-scroll position to used when rendering element, (for example if the Element uses position: fixed ) */ + scrollY?: number; + + /** Window width to use when rendering Element, which may affect things like Media queries */ + windowWidth?: number; + + /** Window height to use when rendering Element, which may affect things like Media queries */ + windowHeight?: number; } } diff --git a/types/hubot/hubot-tests.ts b/types/hubot/hubot-tests.ts index 9c5e832bc2..1c7540c950 100644 --- a/types/hubot/hubot-tests.ts +++ b/types/hubot/hubot-tests.ts @@ -4,11 +4,12 @@ const brain = new Hubot.Brain(); brain; // $ExpectType Brain brain.userForName('someone'); // $ExpectType any -const robot = new Hubot.Robot( +const robot = new Hubot.Robot<{}>( 'src/adapters', 'slack', false, 'hubot', ); -robot; // $ExpectType Robot +robot; // $ExpectType Robot<{}> +robot.adapter; // $ExpectType {} robot.hear(/hello/, () => null); // $ExpectType void diff --git a/types/hubot/index.d.ts b/types/hubot/index.d.ts index e0a809f69a..7da5501736 100644 --- a/types/hubot/index.d.ts +++ b/types/hubot/index.d.ts @@ -20,26 +20,27 @@ declare namespace Hubot { id: string; } - class Response { + class Response { match: RegExpMatchArray; message: Message; - constructor(robot: Robot, message: Message, match: RegExpMatchArray); + constructor(robot: R, message: Message, match: RegExpMatchArray); send(...strings: string[]): void; reply(...strings: string[]): void; random(items: T[]): T; } - type ListenerCallback = (response: Response) => void; + type ListenerCallback = (response: Response) => void; - class Robot { + class Robot { brain: Brain; + readonly adapter: A; constructor(adapterPath: string, adapter: string, httpd: boolean, name: string, alias?: string); - hear(regex: RegExp, callback: ListenerCallback): void; - hear(regex: RegExp, options: any, callback: ListenerCallback): void; - respond(regex: RegExp, callback: ListenerCallback): void; - respond(regex: RegExp, options: any, callback: ListenerCallback): void; + hear(regex: RegExp, callback: ListenerCallback): void; + hear(regex: RegExp, options: any, callback: ListenerCallback): void; + respond(regex: RegExp, callback: ListenerCallback): void; + respond(regex: RegExp, options: any, callback: ListenerCallback): void; } } diff --git a/types/i18next-express-middleware/index.d.ts b/types/i18next-express-middleware/index.d.ts index f9877b2659..d28a334429 100644 --- a/types/i18next-express-middleware/index.d.ts +++ b/types/i18next-express-middleware/index.d.ts @@ -5,104 +5,130 @@ // TypeScript Version: 2.3 declare namespace I18next { - interface I18nextOptions extends i18nextExpressMiddleware.I18nextOptions { } + interface I18nextOptions extends i18nextExpressMiddleware.I18nextOptions {} } declare namespace i18nextExpressMiddleware { - /** - * @summary Interface for Language detector options. - * @interface - */ - interface LanguageDetectorOptions { - caches?: Array|boolean; - cookieDomain?: string; - cookieExpirationDate?: Date; - lookupCookie?: string; - lookupFromPathIndex?: number; - lookupQuerystring?: string; - lookupSession?: string; - order?: Array; - } + /** + * @summary Interface for Language detector options. + * @interface + */ + interface LanguageDetectorOptions { + caches?: Array | boolean + cookieDomain?: string + cookieExpirationDate?: Date + lookupCookie?: string + lookupFromPathIndex?: number + lookupQuerystring?: string + lookupSession?: string + order?: Array + } - /** - * @summary i18next options. - * @interface - */ - interface I18nextOptions { - detection?: LanguageDetectorOptions; - } + /** + * @summary i18next options. + * @interface + */ + interface I18nextOptions { + detection?: LanguageDetectorOptions + } } -declare module "i18next-express-middleware" { - import express = require("express"); - import i18next = require("i18next"); +declare module 'i18next-express-middleware' { + import express = require('express') + import i18next = require('i18next') + + /** + * @summary Interface for middleware to use i18next in express.js. + * @interface + */ + export interface i18nextExpressMiddleware { + LanguageDetector(): express.Handler + missingKeyHandler(): express.Handler + } + + /** + * @summary Interface for own detection functionality. + */ + export interface i18nextCustomDetection { + name: string + lookup: ( + req: express.Request, + res: express.Response, + options?: Object + ) => void + cacheUserLanguage: ( + req: express.Request, + res: express.Response, + lng?: any, + options?: Object + ) => void + } + + /** + * @summary Detects user language from current request. + * @class + */ + export class LanguageDetector { + /** + * @summary Constructor. + * @constructor + * @param {any} services The services. + * @param {Object} options The options. + * @param {Object} allOptions The all options. + */ + constructor(services?: any, options?: Object, allOptions?: Object) /** - * @summary Interface for middleware to use i18next in express.js. - * @interface + * @summary Adds detector. + * @param {i18nextCustomDetection} detector The detector to add. */ - export interface i18nextExpressMiddleware { - LanguageDetector(): express.Handler; - missingKeyHandler(): express.Handler; - } + addDetector(detector: i18nextCustomDetection): void + + // NOTE: add documentation + cacheUserLanguage( + req: express.Request, + res: express.Response, + detectionOrder: any + ): void /** - * @summary Interface for own detection functionality. + * @summary Detects the language. + * @param {Request} req The HTTP request. + * @param {Response} res The HTTP response. + * @param {detectionOrder} detectionOrder The detection order. */ - export interface i18nextCustomDetection { - name: string; - lookup: (req: express.Request, res: express.Response, options?: Object) => void; - cacheUserLanguage: (req: express.Request, res: express.Response, lng?: any, options?: Object) => void; - } + detect( + req: express.Request, + res: express.Response, + detectionOrder: any + ): void /** - * @summary Detects user language from current request. - * @class + * @summary Initializes class. + * @param {any} services The services. + * @param {Object} options The options. + * @param {Object} allOptions The all options. */ - export class LanguageDetector { - /** - * @summary Constructor. - * @constructor - * @param {any} services The services. - * @param {Object} options The options. - * @param {Object} allOptions The all options. - */ - constructor(services?: any, options?: Object, allOptions?: Object); + init(services: any, options?: Object, allOptions?: Object): void + } - /** - * @summary Adds detector. - * @param {i18nextCustomDetection} detector The detector to add. - */ - addDetector(detector: i18nextCustomDetection): void; + export function getResourcesHandler( + i18next: i18next.i18n, + options: Object + ): express.Handler + export function handle( + i18next: i18next.i18n, + options?: Object + ): express.Handler - // NOTE: add documentation - cacheUserLanguage(req: express.Request, res: express.Response, detectionOrder: any): void; - - /** - * @summary Detects the language. - * @param {Request} req The HTTP request. - * @param {Response} res The HTTP response. - * @param {detectionOrder} detectionOrder The detection order. - */ - detect(req: express.Request, res: express.Response, detectionOrder: any): void; - - /** - * @summary Initializes class. - * @param {any} services The services. - * @param {Object} options The options. - * @param {Object} allOptions The all options. - */ - init(services: any, options?: Object, allOptions?: Object): void; - } - - export function getResourcesHandler(i18next: i18next.i18n, options: Object): express.Handler; - export function handle(i18next: i18next.i18n, options?: Object): express.Handler; - - /** - * @summary Gets handler for missing key. - * @param {I18nextStatic} i18next The i18next. - * @param {Object} options The options. - * @return {express.Handler} The express handler. - */ - export function missingKeyHandler(i18next: i18next.i18n, options: Object): express.Handler; + /** + * @summary Gets handler for missing key. + * @param {I18nextStatic} i18next The i18next. + * @param {Object} options The options. + * @return {express.Handler} The express handler. + */ + export function missingKeyHandler( + i18next: i18next.i18n, + options?: Object + ): express.Handler } diff --git a/types/inquirer/index.d.ts b/types/inquirer/index.d.ts index 4fc2ca4ce0..d9258f7a48 100644 --- a/types/inquirer/index.d.ts +++ b/types/inquirer/index.d.ts @@ -5,6 +5,8 @@ // Jouderian // Qibang // Jason Dreyzehner +// Synarque +// Justin Rockwood // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -15,7 +17,7 @@ import through = require('through'); declare namespace inquirer { type Prompts = { [name: string]: PromptModule }; type ChoiceType = string | objects.ChoiceOption | objects.Separator; - type Questions = + type Questions = | Question | ReadonlyArray> | Rx.Observable>; @@ -90,7 +92,7 @@ declare namespace inquirer { * Default value(s) to use if nothing is entered, or a function that returns the default value(s). * If defined as a function, the first parameter will be the current inquirer session answers. */ - default?: any | ((answers: T) => any); + default?: any | ((answers: T) => any) | ((answers: T) => Promise); /** * Choices array or a function returning a choices array. If defined as a function, * the first parameter will be the current inquirer session answers. @@ -99,22 +101,29 @@ declare namespace inquirer { */ choices?: | ReadonlyArray - | ((answers: T) => ReadonlyArray); + | ((answers: T) => ReadonlyArray) + | ((answers: T) => Promise>); /** * Receive the user input and should return true if the value is valid, and an error message (String) * otherwise. If false is returned, a default error message is provided. */ - validate?(input: string, answers?: T): boolean | string; + validate?(input: string, answers?: T): boolean | string | Promise; /** * Receive the user input and return the filtered value to be used inside the program. * The value returned will be added to the Answers hash. */ - filter?(input: string): string; + filter?(input: string): string | Promise; + /** + * Receive the user input and return the transformed value to be displayed to the user. The + * transformation only impacts what is shown while editing. It does not impact the answers + * hash. + */ + transformer?(input: string): string; /** * Receive the current user answers hash and should return true or false depending on whether or * not this question should be asked. The value can also be a simple boolean. */ - when?: boolean | ((answers: T) => boolean); + when?: boolean | ((answers: T) => boolean) | ((answers: T) => Promise); paginated?: boolean; /** * Change the number of lines that will be rendered when using list, rawList, expand or checkbox. @@ -240,7 +249,7 @@ declare namespace inquirer { interface ChoiceOption { name?: string; - value?: string; + value?: any; type?: string; extra?: any; key?: string; diff --git a/types/inquirer/inquirer-tests.ts b/types/inquirer/inquirer-tests.ts index 7cc0fddd2a..aa545adae0 100644 --- a/types/inquirer/inquirer-tests.ts +++ b/types/inquirer/inquirer-tests.ts @@ -584,3 +584,45 @@ inquirer.prompt( console.log(JSON.stringify(answers, null, ' ')); } ); + +// +// Other tests not covered in the examples provided with inquirer +// + +// Tests promises from default, choices, validate, filter, and when + +interface AsyncAnswers { + choice: 'ONE' | 'TWO' | 'THREE'; + choseTwo: boolean; + confirmation: string; +} + +async function testAsyncPrompt(): Promise { + const answers: AsyncAnswers = await inquirer.prompt([ + { + type: 'list', + name: 'choice', + message: 'How many do you want?', + default: () => Promise.resolve('two'), + choices: () => Promise.resolve(['one', 'two', 'three']), + filter: (input: string) => Promise.resolve(input.toUpperCase()), + }, + { + type: 'confirm', + name: 'choseTwo', + message: 'Are you sure you want two?', + when: (choices: AsyncAnswers) => Promise.resolve(choices.choice === 'TWO'), + }, + { + type: 'input', + name: 'confirmation', + message: 'Type YES if you really, really want it', + validate: (input: string) => Promise.resolve(input.toUpperCase() === 'YES' ? true : 'Enter YES'), + transformer: (input: string) => input.toUpperCase(), + }, + ]); + + console.log(JSON.stringify(answers, null, ' ')); +} + +testAsyncPrompt(); diff --git a/types/is-color/index.d.ts b/types/is-color/index.d.ts new file mode 100644 index 0000000000..f6c545246f --- /dev/null +++ b/types/is-color/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for is-color 1.0 +// Project: https://github.com/morishitter/is-color +// Definitions by: Vitor Luiz Cavalcanti +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function isColor(str: string): boolean; + +declare namespace isColor { + function isRgb(str: string): boolean; + function isRgba(str: string): boolean; + function isHsl(str: string): boolean; + function isHsla(str: string): boolean; + function isHex(str: string): boolean; + function isKeyword(str: string): boolean; + function isInherit(str: string): str is 'inherit'; + function isCurrentColor(str: string): str is ('currentColor' | 'currentcolor'); + function isTransparent(str: string): str is 'transparent'; +} + +export = isColor; diff --git a/types/is-color/is-color-tests.ts b/types/is-color/is-color-tests.ts new file mode 100644 index 0000000000..a17ffc7b08 --- /dev/null +++ b/types/is-color/is-color-tests.ts @@ -0,0 +1,23 @@ +import isColor = require('is-color'); + +isColor('#000'); +// => boolean + +isColor.isHex('#000'); +// => boolean +isColor.isHsl('#000'); +// => boolean +isColor.isHsla('#000'); +// => boolean +isColor.isRgb('rgb(0, 0, 0)'); +// => boolean +isColor.isRgba('rgba(0,0,0, 0)'); +// => boolean +isColor.isKeyword('red'); +// => boolean +isColor.isInherit('inherit'); +// => is 'inherit' +isColor.isTransparent('transparent'); +// => is 'transparent' +isColor.isCurrentColor('currentColor'); +// => is 'currentColor'|'currentcolor' diff --git a/types/is-color/tsconfig.json b/types/is-color/tsconfig.json new file mode 100644 index 0000000000..41488170d8 --- /dev/null +++ b/types/is-color/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", + "is-color-tests.ts" + ] +} diff --git a/types/is-color/tslint.json b/types/is-color/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-color/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-empty/index.d.ts b/types/is-empty/index.d.ts new file mode 100644 index 0000000000..ca712b74cb --- /dev/null +++ b/types/is-empty/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for is-empty 1.2 +// Project: https://github.com/ianstormtaylor/is-empty +// Definitions by: Stanislav Termosa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Test if a value is empty + */ +declare function isEmpty(value: any): boolean; + +export = isEmpty; diff --git a/types/is-empty/is-empty-tests.ts b/types/is-empty/is-empty-tests.ts new file mode 100644 index 0000000000..3c49359089 --- /dev/null +++ b/types/is-empty/is-empty-tests.ts @@ -0,0 +1,10 @@ +import isEmpty = require('is-empty'); + +isEmpty({}); +isEmpty(null); +isEmpty(undefined); +isEmpty(9); +isEmpty(new Object()); +isEmpty(Array); +isEmpty(''); +isEmpty(() => {}); diff --git a/types/is-empty/tsconfig.json b/types/is-empty/tsconfig.json new file mode 100644 index 0000000000..c9e999956e --- /dev/null +++ b/types/is-empty/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", + "is-empty-tests.ts" + ] +} diff --git a/types/is-empty/tslint.json b/types/is-empty/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-empty/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is/index.d.ts b/types/is/index.d.ts index b61bd6deee..3b70472d65 100644 --- a/types/is/index.d.ts +++ b/types/is/index.d.ts @@ -32,6 +32,11 @@ interface IsStatic { */ error(value: any): boolean; + /** + * Checks if the given value type is function. + */ + fn(value: any): boolean; + /** * Checks if the given value type is function. */ @@ -587,7 +592,7 @@ interface IsStaticApi { * Checks if the given value type is arguments. */ arguments(...value: any[]): boolean; - + /** * Checks if the given value type is arguments. */ @@ -633,6 +638,16 @@ interface IsStaticApi { */ error(value: any[]): boolean; + /** + * Checks if the given value type is function. + */ + fn(...value: any[]): boolean; + + /** + * Checks if the given value type is function. + */ + fn(value: any[]): boolean; + /** * Checks if the given value type is function. */ @@ -1234,12 +1249,12 @@ interface Is extends IsStatic { * Override RegExps if you think they suck. */ setRegexp(value: RegExp, regexp: 'url'): boolean; - + /** * Override RegExps if you think they suck. */ setRegexp(value: RegExp, regexp: 'email'): boolean; - + /** * Override RegExps if you think they suck. */ diff --git a/types/is/is-tests.ts b/types/is/is-tests.ts index 674d5ff761..0084de8990 100644 --- a/types/is/is-tests.ts +++ b/types/is/is-tests.ts @@ -36,6 +36,12 @@ is.all.error(new Error(), 'bar'); is.any.error(new Error(), 'bar'); is.all.error([new Error(), 'foo', 'bar']); +is.fn(toString); +is.not.fn({ foo: 'bar' }); +is.all.fn(toString, 'bar'); +is.any.fn(toString, 'bar'); +is.all.fn([toString, 'foo', 'bar']); + is.function(toString); is.not.function({ foo: 'bar' }); is.all.function(toString, 'bar'); diff --git a/types/istanbul/index.d.ts b/types/istanbul/index.d.ts index ee23e27782..fe45802865 100644 --- a/types/istanbul/index.d.ts +++ b/types/istanbul/index.d.ts @@ -24,6 +24,7 @@ declare namespace istanbul { interface Collector { new (options?: any): Collector; add(coverage: any, testName?: string): void; + getFinalCoverage(): any; } interface Config { diff --git a/types/jackrabbit/index.d.ts b/types/jackrabbit/index.d.ts new file mode 100644 index 0000000000..ec0ff27fa9 --- /dev/null +++ b/types/jackrabbit/index.d.ts @@ -0,0 +1,66 @@ +// Type definitions for jackrabbit 4.3 +// Project: https://github.com/hunterloftis/jackrabbit +// Definitions by: Elvis Adomnica +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import { Connection, Options, Message } from 'amqplib'; + +declare namespace jackrabbit { + function jackrabbit(url: string): JackRabbit; + + interface JackRabbit extends NodeJS.EventEmitter { + default(): Exchange; + direct(name?: string): Exchange; + fanout(name?: string): Exchange; + topic(name?: string): Exchange; + close(callback: (e: Error) => any): void; + getInternals: () => { + amqp: any; + connection: Connection; + }; + } + + enum exchangeType { + direct = 'direct', + fanout = 'fanout', + topic = 'topic', + } + + interface Exchange extends NodeJS.EventEmitter { + name: string; + type: exchangeType; + options: Options.AssertExchange; + queue(options: QueueOptions): Queue; + connect(con: Connection): Exchange; + publish(message: any, options?: PublishOptions): Exchange; + } + + type PublishOptions = Options.Publish & { + key: string; + reply?: AckCallback; + }; + + type QueueOptions = Options.AssertQueue & { + name?: string; + key?: string; + keys?: ReadonlyArray; + prefetch?: number; + }; + + type AckCallback = (data?: any) => void; + + interface Queue extends NodeJS.EventEmitter { + name: string; + options: QueueOptions; + connect(con: Connection): void; + consume: ( + callback: (data: any, ack: AckCallback, nack: () => void, msg: Message) => void, + options?: Options.Consume + ) => void; + cancel(done: any): void; + purge(done: any): void; + } +} + +export default jackrabbit.jackrabbit; diff --git a/types/jackrabbit/jackrabbit-tests.ts b/types/jackrabbit/jackrabbit-tests.ts new file mode 100644 index 0000000000..57bd961259 --- /dev/null +++ b/types/jackrabbit/jackrabbit-tests.ts @@ -0,0 +1,62 @@ +import jackrabbit from 'jackrabbit'; + +const RABBIT_URL = 'amqp://localhost'; + +function onMessage(data: any) {} +function ack() {} + +// $ExpectError +jackrabbit(); +// $ExpectError +jackrabbit(1); + +const rabbit = jackrabbit(RABBIT_URL); + +// test default exchange based on '1-hello-world' example +const defaultExchange = rabbit.default(); +const hello = defaultExchange.queue({ name: 'hello' }); + +defaultExchange.publish('Hello World!', { key: 'hello' }); + +hello.consume(onMessage, { noAck: true }); + +// test fanout exchange based on '3-pubsub' example +const fanoutExchange = rabbit.fanout(); + +fanoutExchange.publish('this is a log'); + +const fanoutQueue = fanoutExchange.queue({ exclusive: true }); +fanoutQueue.consume(onMessage, { noAck: true }); + +// test direct exchange based on '4-routing' example +const directExchange = rabbit.direct('direct_logs'); + +directExchange.publish({ text: 'this is a harmless log' }, { key: 'info' }); +directExchange.publish({ text: 'this one is more important' }, { key: 'warning' }); +directExchange.publish({ text: 'pay attention to me!' }, { key: 'error' }); + +const errorsQueue = directExchange.queue({ exclusive: true, key: 'error' }); +const logsQueue = directExchange.queue({ exclusive: true, keys: ['info', 'warning'] }); + +errorsQueue.consume((onMessage, ack) => {}); +logsQueue.consume((onMessage, ack) => {}); + +// test reply based on '6-rpc' example +const exchange = rabbit.default(); +const rpc = exchange.queue({ name: 'rpc_queue', prefetch: 1, durable: false }); + +exchange.publish( + { n: 40 }, + { + key: 'rpc_queue', + reply: onReply, + } +); + +function onReply(data: any) {} + +rpc.consume(onRequest); + +function onRequest(data: any, reply: (data: any) => void) { + reply({ field: 'value' }); +} diff --git a/types/jackrabbit/tsconfig.json b/types/jackrabbit/tsconfig.json new file mode 100644 index 0000000000..3d053557b2 --- /dev/null +++ b/types/jackrabbit/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "jackrabbit-tests.ts"] +} diff --git a/types/jackrabbit/tslint.json b/types/jackrabbit/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jackrabbit/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jest-environment-puppeteer/index.d.ts b/types/jest-environment-puppeteer/index.d.ts new file mode 100644 index 0000000000..e22bee2f7d --- /dev/null +++ b/types/jest-environment-puppeteer/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for jest-environment-puppeteer 2.2 +// Project: https://github.com/smooth-code/jest-puppeteer/tree/master/packages/jest-environment-puppeteer +// Definitions by: Josh Goldberg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Browser, Page } from "puppeteer"; + +declare global { + const browser: Browser; + const page: Page; +} + +export { }; diff --git a/types/jest-environment-puppeteer/jest-environment-puppeteer-tests.ts b/types/jest-environment-puppeteer/jest-environment-puppeteer-tests.ts new file mode 100644 index 0000000000..3de8c3661a --- /dev/null +++ b/types/jest-environment-puppeteer/jest-environment-puppeteer-tests.ts @@ -0,0 +1,4 @@ +import * as puppeteer from "puppeteer"; + +const myBrowser: puppeteer.Browser = browser; +const myPage: puppeteer.Page = page; diff --git a/types/jest-environment-puppeteer/tsconfig.json b/types/jest-environment-puppeteer/tsconfig.json new file mode 100644 index 0000000000..ed53d60edd --- /dev/null +++ b/types/jest-environment-puppeteer/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", + "jest-environment-puppeteer-tests.ts" + ] +} diff --git a/types/jest-environment-puppeteer/tslint.json b/types/jest-environment-puppeteer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jest-environment-puppeteer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jest-image-snapshot/index.d.ts b/types/jest-image-snapshot/index.d.ts new file mode 100644 index 0000000000..c15e435cc9 --- /dev/null +++ b/types/jest-image-snapshot/index.d.ts @@ -0,0 +1,75 @@ +// Type definitions for jest-image-snapshot 2.4 +// Project: https://github.com/americanexpress/jest-image-snapshot#readme +// Definitions by: Janeene Beeforth +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +/** + * Options to be passed to the 'pixelmatch' image diffing function. + */ +export interface PixelmatchOptions { + /** Matching threshold, ranges from 0 to 1. Smaller values make the comparison more sensitive. 0.1 by default. */ + readonly threshold?: number; + /** If true, disables detecting and ignoring anti-aliased pixels. false by default. */ + readonly includeAA?: boolean; +} + +export interface MatchImageSnapshotOptions { + /** + * Custom config passed to 'pixelmatch' + */ + customDiffConfig?: PixelmatchOptions; + /** + * Custom snapshots directory. + * Absolute path of a directory to keep the snapshot in. + */ + customSnapshotsDir?: string; + /** + * A custom name to give this snapshot. If not provided, one is computed automatically. + */ + customSnapshotIdentifier?: string; + /** + * Removes coloring from the console output, useful if storing the results to a file. + * Defaults to false. + */ + noColors?: boolean; + /** + * Sets the threshold that would trigger a test failure based on the failureThresholdType selected. This is different + * to the customDiffConfig.threshold above - the customDiffConfig.threshold is the per pixel failure threshold, whereas + * this is the failure threshold for the entire comparison. + * Defaults to 0. + */ + failureThreshold?: number; + /** + * Sets the type of threshold that would trigger a failure. + * Defaults to 'pixel'. + */ + failureThresholdType?: 'pixel' | 'percent'; +} + +/** + * Function to be passed to jest's expect.extend. + * Example: + * import { toMatchImageSnapshot } from 'jest-image-snapshot'; + * expect.extend({ toMatchImageSnapshot }); + */ +export function toMatchImageSnapshot(): { message(): string; pass: boolean; }; + +/** + * Configurable function that can be passed to jest's expect.extend. + * Example: + * import { configureToMatchImageSnapshot } from 'jest-image-snapshot'; + * const toMatchImageSnapshot = configureToMatchImageSnapshot({ noColors: true }); + * expect.extend({ toMatchImageSnapshot }); + */ +export function configureToMatchImageSnapshot(options: MatchImageSnapshotOptions): () => { message(): string; pass: boolean; }; + +declare global { + namespace jest { + interface Matchers { + toMatchImageSnapshot(): R; + } + } +} diff --git a/types/jest-image-snapshot/jest-image-snapshot-tests.ts b/types/jest-image-snapshot/jest-image-snapshot-tests.ts new file mode 100644 index 0000000000..a2ccb8c777 --- /dev/null +++ b/types/jest-image-snapshot/jest-image-snapshot-tests.ts @@ -0,0 +1,23 @@ +// Typescript Version: 2.3 +import { toMatchImageSnapshot, configureToMatchImageSnapshot } from 'jest-image-snapshot'; + +it('should be able to use toMatchImageSnapshot in a test', () => { + expect.extend({ toMatchImageSnapshot }); + + expect(400).toMatchImageSnapshot(); +}); + +it('should be able to use configureToMatchImageSnapshot in a test', () => { + const matchFn = configureToMatchImageSnapshot({ + noColors: true, + customDiffConfig: { + threshold: 5, + includeAA: false + }, + failureThreshold: 10, + failureThresholdType: 'percent' + }); + expect.extend({ toMatchImageSnapshot: matchFn }); + + expect('Me').toMatchImageSnapshot(); +}); diff --git a/types/jest-image-snapshot/tsconfig.json b/types/jest-image-snapshot/tsconfig.json new file mode 100644 index 0000000000..5bf932371d --- /dev/null +++ b/types/jest-image-snapshot/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", + "jest-image-snapshot-tests.ts" + ] +} diff --git a/types/jest-image-snapshot/tslint.json b/types/jest-image-snapshot/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jest-image-snapshot/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jest-specific-snapshot/index.d.ts b/types/jest-specific-snapshot/index.d.ts new file mode 100644 index 0000000000..ef0e7f4225 --- /dev/null +++ b/types/jest-specific-snapshot/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for jest-specific-snapshot 0.5 +// Project: https://github.com/igor-dv/jest-specific-snapshot#readme +// Definitions by: Janeene Beeforth +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/// + +declare global { + namespace jest { + interface Matchers { + toMatchSpecificSnapshot(snapshotFilename: string): R; + } + } +} + +/** + * Specify the serializer that should be used by toMatchSpecificSnapshot. + * Note: toMatchSpecificSnapshot ignores the existing jest snapshot serializer settings. If you want to use a custom serializer, + * you need to set it via this addSerializer function. + */ +export function addSerializer(serializer: any): void; + +/** + * This is used to create a customized version of toMatchSpecificSnapshot. + */ +export function toMatchSpecificSnapshot(data: any, snapshotFile: string, testName: string): () => { message(): string; pass: boolean; }; diff --git a/types/jest-specific-snapshot/jest-specific-snapshot-tests.ts b/types/jest-specific-snapshot/jest-specific-snapshot-tests.ts new file mode 100644 index 0000000000..046a563c9e --- /dev/null +++ b/types/jest-specific-snapshot/jest-specific-snapshot-tests.ts @@ -0,0 +1,16 @@ +import { addSerializer, toMatchSpecificSnapshot } from 'jest-specific-snapshot'; +import toJson from 'enzyme-to-json'; + +expect(100).toMatchSpecificSnapshot('mySnapshotFile.snap'); + +addSerializer(toJson); + +function doSomeThing(received: any) { + return received; +} +expect.extend({ + toMatchDecoratedSpecificSnapshot(received, snapshotFile) { + const data = doSomeThing(received); + return toMatchSpecificSnapshot.call(this, data, snapshotFile); + } +}); diff --git a/types/jest-specific-snapshot/tsconfig.json b/types/jest-specific-snapshot/tsconfig.json new file mode 100644 index 0000000000..e4156ae2ff --- /dev/null +++ b/types/jest-specific-snapshot/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", + "jest-specific-snapshot-tests.ts" + ] +} diff --git a/types/jest-specific-snapshot/tslint.json b/types/jest-specific-snapshot/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jest-specific-snapshot/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index 3dc26955e6..4520247216 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -560,7 +560,7 @@ declare namespace jest { // Relevant parts of Jasmine's API are below so they can be changed and removed over time. // This file can't reference jasmine.d.ts since the globals aren't compatible. -declare function spyOn(object: any, method: string): jasmine.Spy; +declare function spyOn(object: T, method: keyof T): jasmine.Spy; /** * If you call the function pending anywhere in the spec body, * no matter the expectations, the spec will be marked pending. diff --git a/types/jest/jest-tests.ts b/types/jest/jest-tests.ts index 786dccb641..a90a7a9e5a 100644 --- a/types/jest/jest-tests.ts +++ b/types/jest/jest-tests.ts @@ -367,6 +367,11 @@ describe('missing tests', () => { expect(mock.getMockName()).toBe('Carrot'); }); + it('tests mock name functionality', () => { + const mock = spyOn(console, 'warn'); + expect(mock).toHaveBeenCalled(); + }); + it('creates snapshoter', () => { jest.disableAutomock().mock('./render', () => jest.fn((): string => "{Link to: \"facebook\"}"), { virtual: true }); const render: () => string = require('./render'); diff --git a/types/johnny-five/index.d.ts b/types/johnny-five/index.d.ts index 297069f0f1..5f0f6a9f37 100644 --- a/types/johnny-five/index.d.ts +++ b/types/johnny-five/index.d.ts @@ -102,6 +102,7 @@ export interface BoardOption { repl?: boolean; debug?: boolean; timeout?: number; + io?: any; } export declare class Board { diff --git a/types/jquery-countto/index.d.ts b/types/jquery-countto/index.d.ts new file mode 100644 index 0000000000..babeb7741b --- /dev/null +++ b/types/jquery-countto/index.d.ts @@ -0,0 +1,57 @@ +// Type definitions for JQuery CountTo 1.2 +// Project: https://github.com/mhuggins/jquery-countTo +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +export type Options = Partial<{ + /** + * The number to start counting from + */ + from: number; + + /** + * The number to stop counting at + */ + to: number; + + /** + * The number of milliseconds it should take to finish counting + */ + speed: number; + + /** + * The number of milliseconds to wait between refreshing the counter + */ + refreshInterval: number; + + /** + * The number of decimal places to show when using the default formatter + */ + decimals: number; + + /** + * A handler that is used to format the current value before rendering to the DOM + */ + formatter: (value: number, options: Options) => string; + + /** + * A callback function that is triggered for every iteration that the counter updates + */ + onUpdate: (value: number) => void; + + /** + * A callback function that is triggered when counting finishes + */ + onComplete: (value: number) => void; +}>; + +export type Method = 'start' | 'stop' | 'toggle' | 'restart'; + +declare global { + interface JQuery { + countTo(methodOrOptions?: Method | Options): JQuery; + } +} diff --git a/types/jquery-countto/jquery-countto-tests.ts b/types/jquery-countto/jquery-countto-tests.ts new file mode 100644 index 0000000000..07ec15518b --- /dev/null +++ b/types/jquery-countto/jquery-countto-tests.ts @@ -0,0 +1,30 @@ +import { Options } from "jquery-countto"; + +// Basic usage +$('.timer').countTo(); + +// With options +const options: Options = { + from: 50, + to: 2500, + speed: 1000, + refreshInterval: 50, + formatter: (value: number, options: Options) => { + return value.toFixed(options.decimals); + }, + onUpdate: (value: number) => { + console.log(value); + }, + onComplete: (value: number) => { + console.log(value); + } + }; + +$('.timer').countTo(options); +$('.timer').countTo({from: 50}); + +// Controls +$('.timer').countTo('start'); +$('.timer').countTo('stop'); +$('.timer').countTo('restart'); +$('.timer').countTo('toggle'); diff --git a/types/jquery-countto/tsconfig.json b/types/jquery-countto/tsconfig.json new file mode 100644 index 0000000000..3d5cf520dd --- /dev/null +++ b/types/jquery-countto/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, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jquery-countto-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery-countto/tslint.json b/types/jquery-countto/tslint.json new file mode 100644 index 0000000000..d04fe2e1fa --- /dev/null +++ b/types/jquery-countto/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} \ No newline at end of file diff --git a/types/jquery-drawer/index.d.ts b/types/jquery-drawer/index.d.ts new file mode 100644 index 0000000000..6c96e711aa --- /dev/null +++ b/types/jquery-drawer/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for jquery-drawer 3.2 +// Project: http://git.blivesta.com/drawer +// Definitions by: Pine Mizune +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// +/// + +interface JQueryDrawerClassOptions { + nav?: string; + toggle?: string; + overlay?: string; + open?: string; + close?: string; + dropdown?: string; +} + +interface JQueryDrawerOptions { + class?: JQueryDrawerClassOptions; + iscroll?: IScrollOptions; + showOverlay?: boolean; +} + +interface JQuery { + drawer(options?: JQueryDrawerOptions): JQuery; + drawer(method: 'open'|'close'|'toggle'|'destroy'): JQuery; + on(event: 'drawer.opened'|'drawer.closed', handler: () => void): JQuery; +} diff --git a/types/jquery-drawer/jquery-drawer-tests.ts b/types/jquery-drawer/jquery-drawer-tests.ts new file mode 100644 index 0000000000..b0249f8618 --- /dev/null +++ b/types/jquery-drawer/jquery-drawer-tests.ts @@ -0,0 +1,46 @@ +const elem = $('foo'); + +elem.drawer(); +elem.drawer({}); +elem.drawer({ + class: { + nav: 'drawer-nav', + toggle: 'drawer-toggle', + overlay: 'drawer-overlay', + open: 'drawer-open', + close: 'drawer-close', + dropdown: 'drawer-dropdown' + }, + iscroll: { + mouseWheel: true, + preventDefault: false, + }, + showOverlay: true, +}); +elem.drawer({ class: {} }); +elem.drawer({ + class: { + nav: 'drawer-nav', + toggle: 'drawer-toggle', + overlay: 'drawer-overlay', + open: 'drawer-open', + close: 'drawer-close', + dropdown: 'drawer-dropdown' + }, +}); +elem.drawer({ iscroll: {} }); +elem.drawer({ + iscroll: { + mouseWheel: true, + preventDefault: false, + }, +}); +elem.drawer({ showOverlay: true }); + +elem.on('drawer.opened', () => {}); +elem.on('drawer.closed', () => {}); + +elem.drawer('open'); +elem.drawer('close'); +elem.drawer('toggle'); +elem.drawer('destroy'); diff --git a/types/jquery-drawer/tsconfig.json b/types/jquery-drawer/tsconfig.json new file mode 100644 index 0000000000..a22a6dec91 --- /dev/null +++ b/types/jquery-drawer/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", + "jquery-drawer-tests.ts" + ] +} diff --git a/types/jquery-drawer/tslint.json b/types/jquery-drawer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jquery-drawer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jquery-focusable/index.d.ts b/types/jquery-focusable/index.d.ts new file mode 100644 index 0000000000..b65fd23d38 --- /dev/null +++ b/types/jquery-focusable/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for JQuery Focusable 1.0 +// Project: https://github.com/makeup-jquery/jquery-focusable +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +export type Options = Partial<{ + /** + * Find elements with tabindex equal to -1 + */ + findNegativeTabindex: boolean; + + /** + * Find elements with tabindex greater than 0 + */ + findPositiveTabindex: true; +}>; + +declare global { + interface JQuery { + focusable(options?: Options): JQuery; + } +} diff --git a/types/jquery-focusable/jquery-focusable-tests.ts b/types/jquery-focusable/jquery-focusable-tests.ts new file mode 100644 index 0000000000..2935d5f38f --- /dev/null +++ b/types/jquery-focusable/jquery-focusable-tests.ts @@ -0,0 +1,12 @@ +import { Options } from "jquery-focusable"; + +// Basic usage +$('body').focusable(); + +// With options +const options: Options = { + findNegativeTabindex: true, + findPositiveTabindex: true + }; + +$('body').focusable(options); diff --git a/types/jquery-focusable/tsconfig.json b/types/jquery-focusable/tsconfig.json new file mode 100644 index 0000000000..d216e5326b --- /dev/null +++ b/types/jquery-focusable/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, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jquery-focusable-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery-focusable/tslint.json b/types/jquery-focusable/tslint.json new file mode 100644 index 0000000000..d04fe2e1fa --- /dev/null +++ b/types/jquery-focusable/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} \ No newline at end of file diff --git a/types/jquery-lazyload/index.d.ts b/types/jquery-lazyload/index.d.ts index 5505c247f5..28563a774d 100644 --- a/types/jquery-lazyload/index.d.ts +++ b/types/jquery-lazyload/index.d.ts @@ -15,7 +15,7 @@ declare namespace JQueryLazyLoad { container?: JQuery; data_attribute?: string; skip_invisible?: boolean; - appear?: null; + appear?: ((elementsLeft: number, options: Options) => void) | null; load?: (elementsLeft?: number, options?: Options) => void; placeholder?: string; } diff --git a/types/jquery-lazyload/jquery-lazyload-tests.ts b/types/jquery-lazyload/jquery-lazyload-tests.ts index 086069d11d..105bbe094a 100644 --- a/types/jquery-lazyload/jquery-lazyload-tests.ts +++ b/types/jquery-lazyload/jquery-lazyload-tests.ts @@ -9,7 +9,10 @@ $(document).ready(() => { effect: 'fadeIn', container: $('#container'), failure_limit: 10, - skip_invisible: true + skip_invisible: true, + appear: (elementsLeft: number, settings: JQueryLazyLoad.Options) => { + console.log(elementsLeft); + } }; $('.lazyload').lazyload(options); diff --git a/types/jquery.pin/index.d.ts b/types/jquery.pin/index.d.ts new file mode 100644 index 0000000000..df132c6571 --- /dev/null +++ b/types/jquery.pin/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for JQuery Pin 1.0 +// Project: https://github.com/webpop/jquery.pin +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +export interface Options { + minWidth?: number; + activeClass?: string; + containerSelector?: string; + padding?: { + top?: number; + bottom?: number; + }; +} +declare global { + interface JQuery { + pin(options?: Options): JQuery; + } +} diff --git a/types/jquery.pin/jquery.pin-tests.ts b/types/jquery.pin/jquery.pin-tests.ts new file mode 100644 index 0000000000..b43c6e7881 --- /dev/null +++ b/types/jquery.pin/jquery.pin-tests.ts @@ -0,0 +1,17 @@ +import { Options } from "jquery.pin"; + +// basic usage +$(".pinned").pin(); + +// with options +const options: Options = { + activeClass: 'active', + minWidth: 940, + containerSelector: '.container', + padding: { + top: 10, + bottom: 10 + } +}; + +$(".pinned").pin(options); diff --git a/types/jquery.pin/tsconfig.json b/types/jquery.pin/tsconfig.json new file mode 100644 index 0000000000..4e880d5205 --- /dev/null +++ b/types/jquery.pin/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, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jquery.pin-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery.pin/tslint.json b/types/jquery.pin/tslint.json new file mode 100644 index 0000000000..d04fe2e1fa --- /dev/null +++ b/types/jquery.pin/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} \ No newline at end of file diff --git a/types/js-yaml/index.d.ts b/types/js-yaml/index.d.ts index 2fa264cbd9..da2d2a36c8 100644 --- a/types/js-yaml/index.d.ts +++ b/types/js-yaml/index.d.ts @@ -1,11 +1,15 @@ -// Type definitions for js-yaml 3.10 +// Type definitions for js-yaml 3.11 // Project: https://github.com/nodeca/js-yaml // Definitions by: Bart van der Schoor , Sebastian Clausen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -export function safeLoad(str: string, opts?: LoadOptions): any; -export function load(str: string, opts?: LoadOptions): any; +export as namespace jsyaml; + +export type DocumentLoadResult = object | undefined; + +export function safeLoad(str: string, opts?: LoadOptions): DocumentLoadResult; +export function load(str: string, opts?: LoadOptions): DocumentLoadResult; export class Type { constructor(tag: string, opts?: TypeConstructorOptions); @@ -26,8 +30,12 @@ export class Schema implements SchemaDefinition { static create(schemas: Schema[] | Schema, types: Type[] | Type): Schema; } -export function safeLoadAll(str: string, iterator?: (doc: any) => void, opts?: LoadOptions): any; -export function loadAll(str: string, iterator?: (doc: any) => void, opts?: LoadOptions): any; +export function safeLoadAll(str: string, iterator?: undefined, opts?: LoadOptions): DocumentLoadResult[]; +export function safeLoadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): undefined; + +export function loadAll(str: string, iterator?: undefined, opts?: LoadOptions): DocumentLoadResult[]; + +export function loadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): undefined; export function safeDump(obj: any, opts?: DumpOptions): string; export function dump(obj: any, opts?: DumpOptions): string; diff --git a/types/js-yaml/js-yaml-tests.ts b/types/js-yaml/js-yaml-tests.ts index 3d5ecc17bf..9a61da204f 100644 --- a/types/js-yaml/js-yaml-tests.ts +++ b/types/js-yaml/js-yaml-tests.ts @@ -109,40 +109,44 @@ type.styleAliases; // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -// $ExpectType any +// $ExpectType DocumentLoadResult yaml.safeLoad(str); -// $ExpectType any +// $ExpectType DocumentLoadResult yaml.safeLoad(str, loadOpts); -// $ExpectType any +// $ExpectType DocumentLoadResult yaml.load(str); -// $ExpectType any +// $ExpectType DocumentLoadResult yaml.load(str, loadOpts); // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -// $ExpectType any +// $ExpectType DocumentLoadResult[] yaml.safeLoadAll(str); -// $ExpectType any + +// $ExpectType undefined yaml.safeLoadAll(str, (doc) => { value = doc; }); -// $ExpectType any +// $ExpectType undefined yaml.safeLoadAll(str, (doc) => { value = doc; }, loadOpts); +// $ExpectType DocumentLoadResult[] value = yaml.safeLoadAll(str, undefined, loadOpts); -// $ExpectType any +// $ExpectType DocumentLoadResult[] value = yaml.loadAll(str); -// $ExpectType any + +// $ExpectType undefined yaml.loadAll(str, (doc) => { value = doc; }); -// $ExpectType any +// $ExpectType undefined yaml.loadAll(str, (doc) => { value = doc; }, loadOpts); +// $ExpectType DocumentLoadResult[] value = yaml.loadAll(str, undefined, loadOpts); // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff --git a/types/jsforce/api/analytics.d.ts b/types/jsforce/api/analytics.d.ts new file mode 100644 index 0000000000..02f04fac41 --- /dev/null +++ b/types/jsforce/api/analytics.d.ts @@ -0,0 +1,82 @@ +import { callback } from '../connection'; + +interface ReportInfo { +} + +export class Dashboard { + describe(callback?: callback): Promise; + + del(callback?: callback): Promise; + + destory(callback?: callback): Promise; + + delete(callback?: callback): Promise; + + components(componentIds: () => any | string[] | string, callback?: callback): Promise; + + status(callback?: callback): Promise; + + refresh(callback?: callback): Promise; + + clone(name: string | object, folderid: string, callback?: callback): Promise; +} + +export class ReportInstance { + constructor(report: Report, id: string); + + retrieve(callback: callback): Promise +} + +export class Report { + describe(callback?: callback): Promise; + + del(callback?: callback): Promise; + + destory(callback?: callback): Promise; + + delete(callback?: callback): Promise; + + clone(name: string, callback?: callback): Promise; + + explain(callback?: callback): Promise; + + run(options: () => any | object, callback?: callback): Promise; + + exec(options: () => any | object, callback?: callback): Promise; + + execute(options: () => any | object, callback?: callback): Promise; + + executeAsync(options: () => any | object, callback?: callback): Promise; + + instance(id: string): ReportInstance; + + instances(callback?: callback): Promise; +} + +export interface ReportInstanceAttrs { +} + +export interface ExplainInfo { +} + +export interface ReportMetadata { +} + +export interface ReportResult { +} + +export interface ReportInfo { +} + +export interface DashboardInfo { +} + +export class Analytics { + report(id: string): Promise; + + reports(callback?: callback): Promise; + + dashboard(id: string): Promise; + + dashboards(callback?: callback): Promise; +} diff --git a/types/jsforce/api/chatter.d.ts b/types/jsforce/api/chatter.d.ts new file mode 100644 index 0000000000..05fc4551e0 --- /dev/null +++ b/types/jsforce/api/chatter.d.ts @@ -0,0 +1,71 @@ +import { Connection, callback } from '../connection'; +import { Query } from '../query'; +import { Stream } from 'stream'; + +interface BatchRequestParams extends RequestParams { + method: string; + url: string; + richInput?: string; +} + +interface BatchRequestResult { + statusCode: string; + result: RequestResult; +} + +interface BatchRequestResults { + hasError: boolean; + results: BatchRequestResult[]; +} + +interface RequestParams { + method: string; + url: string; + body?: string; +} + +export class RequestResult { +} + +export class Request implements Promise { + constructor(chatter: Chatter, params: RequestParams); + + batchParams(): BatchRequestParams; + + promise(): Promise; + + stream(): Stream; + + catch(onrejected?: ((reason: any) => (PromiseLike | TResult)) | null | undefined): Promise; + + then(onfulfilled?: ((value: T) => (PromiseLike | TResult1)) | null | undefined, + onrejected?: ((reason: any) => (PromiseLike | TResult2)) | null | undefined): Promise; + + thenCall(callback?: (err: Error, records: T) => void): Query; + + readonly [Symbol.toStringTag]: 'Promise'; +} + +export class Resource extends Request { + constructor(chatter: Chatter, url: string, queryParams?: object); + + create(data: object | string, callback?: callback): Request; + + del(callback?: callback): Request; + + delete(callback?: callback): Request; + + retrieve(callback?: callback): Request; + + update(data: object, callback?: callback): Request; +} + +export class Chatter { + constructor(conn: Connection); + + batch(callback?: callback): Promise; + + request(params: RequestParams, callback?: callback>): Request; + + resource(url: string, queryParams?: object): Resource +} diff --git a/types/jsforce/api/metadata.d.ts b/types/jsforce/api/metadata.d.ts new file mode 100644 index 0000000000..c867ece15b --- /dev/null +++ b/types/jsforce/api/metadata.d.ts @@ -0,0 +1,178 @@ +import { callback, Connection } from '../connection'; +import { EventEmitter } from 'events'; +import { Stream } from 'stream'; + +interface DeployResult { + id: string; + checkOnly: boolean; + completedDate: string; + createdDate: string; + details?: object[]; + done: boolean; + errorMessage?: string; + errorStatusCode?: string; + ignoreWarnings?: boolean; + lastModifiedDate: string; + numberComponentErrors: number; + numberComponentsDeployed: number; + numberComponentsTotal: number; + numberTestErrors: number; + numberTestsCompleted: number; + numberTestsTotal: number; + rollbackOnError?: boolean; + startDate: string; + status: string; + success: boolean; +} + +interface MetadataObject { + childXmlNames: string[]; + directoryName: string; + inFolder: boolean; + metaFile: boolean; + suffix: string; + xmlName: string; +} + +interface DescribeMetadataResult { + metadataObjects: MetadataObject[]; + organizationNamespace: string; + partialSaveAllowed: boolean; + testRequired: boolean; +} + +interface FileProperties { + type: string; + createdById: string; + createdByName: string; + createdDate: string; + fileName: string; + fullName: string; + id: string; + lastModifiedById: string; + lastModifiedByName: string; + lastModifiedDate: string; + manageableState?: string; + namespacePrefix?: string; +} + +interface ListMetadataQuery { + type: string; + folder?: string; +} + +interface MetadataInfo { + fullName: string; +} + +interface RetrieveRequest { +} + +interface RetrieveResult { + fileProperties: FileProperties[]; + id: string; + messages: object[]; + zipFile: string +} + +interface SaveResult { + success: boolean; + fullName: string; +} + +interface UpdateMetadataInfo { + currentName: string; + metadata: MetadataInfo; +} + +interface UpsertResult { + success: boolean; + fullName: string; + created: boolean; +} + +interface AsyncResult { + done: boolean; + id: string; + state: string; + statusCode?: string; + message?: string; +} + +interface DeployOptions { + allowMissingFiles?: boolean; + autoUpdatePackage?: boolean; + checkOnly?: boolean; + ignoreWarnings?: boolean; + performRetrieve?: boolean; + purgeOnDelete?: boolean; + rollbackOnError?: boolean; + runAllTests?: boolean; + runTests?: string[]; + singlePackage?: boolean; +} + +export class AsyncResultLocator extends EventEmitter implements Promise { + check(callback?: callback): Promise + + complete(callback?: callback): Promise + + poll(interval: number, timeout: number): void; + + catch(onrejected?: ((reason: any) => (PromiseLike | TResult)) | null | undefined): Promise; + + then(onfulfilled?: ((value: T) => (PromiseLike | TResult1)) | null | undefined, + onrejected?: ((reason: any) => (PromiseLike | TResult2)) | null | undefined): Promise; + + readonly [Symbol.toStringTag]: "Promise"; +} + +export class DeployResultLocator extends AsyncResultLocator {} +export class RetrieveResultLocator extends AsyncResultLocator {} + +export class Metadata { + pollInterval: number; + pollTimeout: number; + + constructor(conn: Connection); + + checkDeployStatus(id: string, includeDetails?: boolean, callback?: callback): Promise + + checkRetrieveStatus(id: string, callback?: callback): Promise + + checkStatus(ids: string | string[], callback?: callback>): AsyncResultLocator> + + create(type: string, metadata: MetadataInfo | Array, callback?: callback>): Promise> + + createAsync(type: string, metadata: MetadataInfo | Array, callback?: callback>): Promise> + + createSync(type: string, metadata: MetadataInfo | Array, callback?: callback>): Promise>; + + delete(type: string, fullNames: string | string[], callback?: callback>): Promise>; + + deleteAsync(type: string, metadata: string | string[] | MetadataInfo | Array, callback?: callback>): AsyncResultLocator> + + deleteSync(type: string, fullNames: string | string[], callback?: callback>): Promise>; + + deploy(zipInput: Stream | Buffer | string, options: DeployOptions, callback?:callback): DeployResultLocator; + + describe(version?: string, callback?: callback): Promise; + + list(queries: ListMetadataQuery | Array, version?: string, callback?: callback>): Promise>; + + read(type: string, fullNames: string | string[], callback?: callback>): Promise>; + + readSync(type: string, fullNames: string | string[], callback?: callback>): Promise>; + + rename(type: string, oldFullName: string, newFullName: string, callback?: callback): Promise + + retrieve(request: RetrieveRequest, callback: callback): RetrieveResultLocator + + update(type: string, updateMetadata: MetadataInfo | Array, callback?: callback>): Promise> + + updateAsync(type: string, updateMetadata: MetadataInfo, callback?: callback>): AsyncResultLocator> + + updateSync(type: string, updateMetadata: MetadataInfo | Array, callback?: callback>): Promise> + + upsert(type: string, metadata: MetadataInfo | Array, callback?: callback>): Promise> +} diff --git a/types/jsforce/connection.d.ts b/types/jsforce/connection.d.ts index 4c3e1eb5fb..06cda5e29f 100644 --- a/types/jsforce/connection.d.ts +++ b/types/jsforce/connection.d.ts @@ -1,8 +1,14 @@ -import { SObjectCreateOptions } from './create-options'; -import { DescribeSObjectResult } from './describe-result'; +import { EventEmitter } from 'events'; +import { DescribeSObjectResult, DescribeGlobalResult } from './describe-result'; import { Query, QueryResult } from './query'; +import { Record } from './record'; import { RecordResult } from './record-result'; import { SObject } from './salesforce-object'; +import { Analytics } from './api/analytics'; +import { Chatter } from './api/chatter'; +import { Metadata } from './api/metadata'; + +export type callback = (err: Error, result: T) => void; // These are pulled out because according to http://jsforce.github.io/jsforce/doc/connection.js.html#line49 // the oauth options can either be in the `oauth2` proeprty OR spread across the main connection @@ -13,6 +19,12 @@ export interface OAuth2Options { redirectUri?: string; } +export interface RequestInfo { + method?: string; + url?: string; + headers?: object; +} + export interface ConnectionOptions extends OAuth2Options { accessToken?: string; callOptions?: Object; @@ -36,6 +48,14 @@ export interface UserInfo { url: string; } +export abstract class RestApi { + get(path: string, options: object, callback: () => object): Promise; + post(path: string, body: object, options: object, callback: () => object): Promise; + put(path: string, body: object, options: object, callback: () => object): Promise; + patch(path: string, body: object, options: object, callback: () => object): Promise; + del(path: string, options: object, callback: () => object): Promise; +} + export type ConnectionEvent = "refresh"; /** @@ -57,19 +77,58 @@ export type ConnectionEvent = "refresh"; * * to ensure that you have the correct data types for the various collection names. */ -export interface Connection { +export abstract class BaseConnection extends EventEmitter { + _baseUrl(): string; + request(info: RequestInfo | string, options?: Object, callback?: (err: Error, Object: object) => void): Promise; query(soql: string, callback?: (err: Error, result: QueryResult) => void): Query>; + queryMore(locator: string, options?: object, callback?: (err: Error, result: QueryResult) => void): Promise>; + create(type: string, records: Record|Array>, options?: Object, + callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; + insert(type: string, records: Record|Array>, options?: Object, + callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; + retrieve(type: string, ids: string|string[], options?: Object, + callback?: (err: Error, result: Record | Array>) => void): Promise<(Record | Array>)>; + update(type: string, records: Record|Array>, options?: Object, + callback?: (err: Error, result: RecordResult | Array>) => void): Promise<(RecordResult | RecordResult[])>; + upsert(type: string, records: Record|Array>, extIdField: string, options?: Object, + callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; + del(type: string, ids: string|string[], options?: Object, + callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; + delete(type: string, ids: string|string[], options?: Object, + callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; + destroy(type: string, ids: string|string[], options?: Object, + callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; + describe(type: string, callback?: (err: Error, result: DescribeSObjectResult) => void): Promise; + describeGlobal(callback?: (err: Error, result: DescribeGlobalResult) => void): Promise; sobject(resource: string): SObject; } -export class Connection implements Connection { +export class Connection extends BaseConnection { constructor(params: ConnectionOptions) + + tooling: Tooling; + analytics: Analytics; + chatter: Chatter; + metadata: Metadata; + + // Specific to Connection + instanceUrl: string; + version: string; accessToken: string; + initialize(options?: ConnectionOptions): void; + queryAll(soql: string, options?: object, callback?: (err: Error, result: QueryResult) => void): Query>; + authorize(code: string, callback?: (err: Error, res: UserInfo) => void): Promise; login(user: string, password: string, callback?: (err: Error, res: UserInfo) => void): Promise; loginByOAuth2(user: string, password: string, callback?: (err: Error, res: UserInfo) => void): Promise; loginBySoap(user: string, password: string, callback?: (err: Error, res: UserInfo) => void): Promise; logout(callback?: (err: Error, res: undefined) => void): Promise; logoutByOAuth2(callback?: (err: Error, res: undefined) => void): Promise; logoutBySoap(callback?: (err: Error, res: undefined) => void): Promise; - on(eventName: ConnectionEvent, callback: Function): void; +} + +export class Tooling extends BaseConnection { + _logger: any; + + // Specific to tooling + executeAnonymous(body: string, callback?: (err: Error, res: any) => void): Promise; } diff --git a/types/jsforce/describe-result.d.ts b/types/jsforce/describe-result.d.ts index 584a62d3bf..352c4223a6 100644 --- a/types/jsforce/describe-result.d.ts +++ b/types/jsforce/describe-result.d.ts @@ -1,4 +1,30 @@ export interface DescribeSObjectResult { label: string; - fields: string[]; + fields: object[]; +} + +export interface DescribeGlobalResult { + activateable: boolean; + createable: boolean; + custom: boolean; + customSetting: boolean; + deletable: boolean; + deprecatedAndHidden: boolean; + feedEnabled: boolean; + hasSubtypes: boolean; + isSubtype: boolean; + keyPrefix: string; + label: string; + labelPlural: string; + layoutable: boolean; + mergeable: boolean; + mruEnabled: boolean; + name: string; + queryable: boolean; + replicateable: boolean; + retrieveable: boolean; + searchable: boolean; + triggerable: boolean; + undeletable: boolean; + updateable: boolean; } diff --git a/types/jsforce/index.d.ts b/types/jsforce/index.d.ts index 73a848b79f..edb2830f52 100644 --- a/types/jsforce/index.d.ts +++ b/types/jsforce/index.d.ts @@ -2,6 +2,8 @@ // Project: https://github.com/jsforce/jsforce // Definitions by: Dolan Miu // Kamil Ejsymont +// Thomas Dvornik +// Tim Noonan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -13,6 +15,16 @@ import * as glob from 'glob'; export { Date } from './date-enum'; export { Record } from './record'; export { RecordResult } from './record-result'; -export { Connection } from './connection'; +export { Connection, ConnectionOptions, RequestInfo, Tooling, callback } from './connection'; export { SObject } from './salesforce-object'; export { SalesforceId } from './salesforce-id'; +export { OAuth2, OAuth2Options } from './oauth2'; +export { Query, QueryResult } from './query'; +export { Promise } from './promise'; +export { Report, Dashboard, Analytics, ReportInstance, DashboardInfo, ReportInfo, ExplainInfo, ReportInstanceAttrs, + ReportMetadata, ReportResult } from './api/analytics'; +export { Chatter, Request, RequestResult, BatchRequestResults, BatchRequestParams, + Resource, BatchRequestResult, RequestParams } from './api/chatter'; +export { Metadata, SaveResult, MetadataInfo, AsyncResult, RetrieveResultLocator, RetrieveRequest, FileProperties, + ListMetadataQuery, DescribeMetadataResult, DeployOptions, AsyncResultLocator, RetrieveResult, MetadataObject, + DeployResult, DeployResultLocator, UpdateMetadataInfo, UpsertResult } from './api/metadata'; diff --git a/types/jsforce/jsforce-tests.ts b/types/jsforce/jsforce-tests.ts index 2c1b5b1f9c..9205d59096 100644 --- a/types/jsforce/jsforce-tests.ts +++ b/types/jsforce/jsforce-tests.ts @@ -79,7 +79,7 @@ salesforceConnection.query('SELECT Id FROM Account') .on('end', (query: any) => { console.log(records); }) - .on('error', (error) => { + .on('error', (error: Error) => { console.log('Error returned from query:', error); }) .run({ autoFetch: true, maxFetch: 25 }); @@ -89,3 +89,191 @@ salesforceConnection.sobject('Coverage__c') salesforceConnection.sobject('Coverage__c') .select(['Id', 'Name']).del("test", () => { }); + +async function testAnalytics(conn: sf.Connection): Promise { + const analytics: sf.Analytics = conn.analytics; + + const dashboards: sf.DashboardInfo[] = await analytics.dashboards(); + const dashboard = dashboards[0] as any; + Object.keys(dashboards[0]) + .forEach((key: string) => console.log(`key: ${key} : ${dashboard[key]}`)); + console.log('dashboard keys from await'); + + analytics.dashboards((err, dashboards: sf.DashboardInfo[]) => { + const _dashboard: any = dashboards[0] as any; + Object.keys(_dashboard) + .forEach((key: string) => console.log(`key: ${key} : ${_dashboard[key]}`)); + console.log('dashboard keys from callback'); + }); + + const reports: sf.ReportInfo[] = await analytics.reports(); + const report: any = reports[0] as any; + Object.keys(reports[0]).forEach((key: string) => console.log(`key: ${key} : ${report[key]}`)); + + analytics.reports((err, reports: sf.ReportInfo[]) => { + const _report: any = reports[0] as any; + Object.keys(reports[0]) + .forEach((key: string) => console.log(`key: ${key} : ${_report[key]}`)); + console.log('report keys from callback'); + }); +} + +async function testMetadata(conn: sf.Connection): Promise { + const md: sf.Metadata = conn.metadata; + const m: sf.DescribeMetadataResult = await md.describe('34.0'); + const pages: sf.MetadataObject[] = + m.metadataObjects.filter((value: sf.MetadataObject) => value.directoryName === 'pages'); + console.log(`ApexPage?: ${pages[0].xmlName === 'ApexPage'}`); + + const types: sf.ListMetadataQuery[] = [{type: 'CustomObject', folder: null}]; + md.list(types, '39.0', (err, properties: sf.FileProperties[]) => { + if (err) { + console.error('err', err); + return; + } + const meta: sf.FileProperties = properties[0]; + console.log('metadata count: ' + properties.length); + console.log('createdById: ' + meta.createdById); + console.log('createdByName: ' + meta.createdByName); + console.log('createdDate: ' + meta.createdDate); + console.log('fileName: ' + meta.fileName); + console.log('fullName: ' + meta.fullName); + console.log('id: ' + meta.id); + console.log('lastModifiedById: ' + meta.lastModifiedById); + console.log('lastModifiedByName: ' + meta.lastModifiedByName); + console.log('lastModifiedDate: ' + meta.lastModifiedDate); + console.log('manageableState: ' + meta.manageableState); + console.log('namespacePrefix: ' + meta.namespacePrefix); + console.log('type: ' + meta.type); + }); + + const fullNames: string[] = [ 'Account', 'Contact' ]; + const info: sf.MetadataInfo | sf.MetadataInfo[] = await md.read('CustomObject', fullNames); + console.log((info as sf.MetadataInfo[])[0].fullName); + console.log((info as sf.MetadataInfo[])[1].fullName); + + const now: number = Date.now(); + const now2: number = now + 1; + const metadata = [{ + fullName: `TestObject${now}__c`, + label: `Test Object ${now}`, + pluralLabel: `Test Object ${now}`, + nameField: { + type: 'Text', + label: `Test Object Name ${now}` + }, + deploymentStatus: 'Deployed', + sharingModel: 'ReadWrite' + }, { + fullName: `TestObject${now2}__c`, + label: `Test Object ${now2}`, + pluralLabel: `Test Object ${now2}`, + nameField: { + type: 'AutoNumber', + label: 'Test Object #' + }, + deploymentStatus: 'InDevelopment', + sharingModel: 'Private' + }]; + + const result: sf.SaveResult | sf.SaveResult[] = await md.create('CustomObject', metadata); + console.log(`created ${(result as sf.SaveResult[])[0].fullName} - ${(result as sf.SaveResult[])[0].success}`); + console.log(`created ${(result as sf.SaveResult[])[1].fullName} - ${(result as sf.SaveResult[])[1].success}`); + + const fullNames2: string[] = [`TestObject${now}__c`, `TestObject${now2}__c`]; + const result2: sf.SaveResult | sf.SaveResult[] = + await (md.delete('CustomObject', fullNames2) as Promise); + console.log(`deleted ${result2[0].fullName} - ${result2[0].success}`); + console.log(`deleted ${result2[1].fullName} - ${result2[1].success}`); +} + +async function testChatter(conn: sf.Connection): Promise { + const chatter: sf.Chatter = conn.chatter; + chatter.resource('/feed-elements').create({ + body: { + messageSegments: [{ + type: 'Text', + text: 'This is new post' + }] + }, + feedElementType : 'FeedItem', + subjectId: 'me' + }, (err: Error, result: any) => { + if (err) { + throw err; + } + const feedMessageUrl = `/feed-elements/${result.id}/capabilities/comments/items`; + chatter.resource(feedMessageUrl).create({ + body: { + messageSegments: [{ + type: 'Text', + text: 'This is new comment on the post' + }] + } + }, (err: Error, result: any) => { + if (err) { + throw err; + } + console.log("Id: " + result.id); + console.log("URL: " + result.url); + console.log("Body: " + result.body.messageSegments[0].text); + }); + }); + + const resourceMe: sf.Resource = chatter.resource('/users/me'); + resourceMe.retrieve((err, res: any) => { + if (err) { + console.error(err); + return; + } + console.log("username: " + res.username); + console.log("email: " + res.email); + console.log("small photo url: " + res.photo.smallPhotoUrl); + }); + + chatter.resource('/users', { q: 'Suzuki' }).retrieve((err, result: any) => { + if (err) { + console.error(err); + return; + } + console.log("current page URL: " + result['currentPageUrl']); + console.log("next page URL: " + result['nextPageUrl']); + console.log("users count: " + result['users'].length); + for (const user of result['users']) { + console.log('User ID: ' + user.id); + console.log('User URL: ' + user.url); + console.log('Username: ' + user.username); + } + }); + + const feedResource: sf.Resource = chatter.resource('/feed-elements'); + + const feedCreateRequest: any = await (feedResource.create({ + body: { + messageSegments: [{ + type: 'Text', + text: 'This is new comment on the post' + }] + }, + feedElementType : 'FeedItem', + subjectId: 'me' + }) as Promise); + + console.log(`feedCreateRequest.id: ${feedCreateRequest.id}`); + const itemLikesUrl = `/feed-elements/${feedCreateRequest.id}/capabilities/chatter-likes/items`; + const itemsLikeResource: sf.Resource = chatter.resource(itemLikesUrl); + + const itemsLikeCreateResult: sf.RequestResult = await (itemsLikeResource.create('') as Promise); + console.log(`itemsLikeCreateResult['likedItem']: ${itemsLikeCreateResult as any ['likedItem']}`); +} + +(async () => { + const query2: sf.QueryResult = + await (salesforceConnection.query("SELECT Id, Name FROM User") as Promise>); + console.log("Query Promise: total in database: " + query2.totalSize); + console.log("Query Promise: total fetched : " + query2.records[0]); + + await testAnalytics(salesforceConnection); + await testChatter(salesforceConnection); + await testMetadata(salesforceConnection); +})(); diff --git a/types/jsforce/oauth2.d.ts b/types/jsforce/oauth2.d.ts new file mode 100644 index 0000000000..833a9d45fd --- /dev/null +++ b/types/jsforce/oauth2.d.ts @@ -0,0 +1,35 @@ +export interface OAuth2Options { + authzServiceUrl?: string; + tokenServiceUrl?: string; + clientId?: string; + clientSecret?: string; + httpProxy?: string; + loginUrl?: string; + proxyUrl?: string; + redirectUri?: string; + refreshToken?: string; + revokeServiceUrl?: string; + authCode?: string; + privateKeyFile?: string; + privateKey?: string; // Used for sfdx auth files for legacy support reasons +} + +export class OAuth2 { + constructor (options? : OAuth2Options); + + protected _postParams(options: any, callback: () => any): void + + loginUrl: string; + authzServiceUrl: string; + tokenServiceUrl: string; + revokeServiceUrl: string; + clientId: string; + clientSecret: string; + redirectUri: string; + + getAuthorizationUrl(params: any): string; + refreshToken(code: string, callback?: () => any): Promise; + requestToken(code: string, callback?: () => any): Promise; + authenticate(username: string, password: string, callback?: () => any): Promise; + revokeToken(accessToken: string, callback?: () => any): Promise; +} diff --git a/types/jsforce/promise.d.ts b/types/jsforce/promise.d.ts new file mode 100644 index 0000000000..f4f6e0660b --- /dev/null +++ b/types/jsforce/promise.d.ts @@ -0,0 +1,3 @@ +export class Promise { + thenCall: (cb: () => void) => void; +} diff --git a/types/jsforce/query.d.ts b/types/jsforce/query.d.ts index 0e7d413cf8..b33af41ede 100644 --- a/types/jsforce/query.d.ts +++ b/types/jsforce/query.d.ts @@ -1,7 +1,5 @@ // http://jsforce.github.io/jsforce/doc/Query.html import { Readable } from 'stream'; - -import { SalesforceId } from './salesforce-id'; import { RecordResult } from './record-result'; export interface ExecuteOptions { @@ -19,38 +17,63 @@ export interface QueryResult { export class Query extends Readable implements Promise { end(): Query; + filter(filter: Object): Query; + include(include: string): Query; + hint(hint: Object): Query; + limit(value: number): Query; + maxFetch(value: number): Query; + offset(value: number): Query; + skip(value: number): Query; - sort(keyOrList: string | Object[] | Object, direction?: "ASC" | "DESC" | number): Query; + + sort(keyOrList: string | Object[] | Object, direction?: 'ASC' | 'DESC' | number): Query; + run(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query; + execute(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query; + exec(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query; + del(type?: string, callback?: (err: Error, ret: RecordResult) => void): any; del(callback?: (err: Error, ret: RecordResult) => void): any; + delete(type?: string, callback?: (err: Error, ret: RecordResult) => void): any; delete(callback?: (err: Error, ret: RecordResult) => void): any; + destroy(type?: string, callback?: (err: Error, ret: RecordResult) => void): Promise; destroy(callback?: (err: Error, ret: RecordResult) => void): Promise; destroy(error?: Error): void; + explain(callback?: (err: Error, info: ExplainInfo) => void): Promise; + map(callback: (currentValue: Object) => void): Promise; + scanAll(value: boolean): Query; + select(fields: Object | string[] | string): Query; + thenCall(callback?: (err: Error, records: T) => void): Query; + toSOQL(callback: (err: Error, soql: string) => void): Promise; + update(mapping: any, type: string, callback: (err: Error, records: RecordResult[]) => void): Promise; + where(conditions: Object | string): Query; - // Implementing promise methods - then(onfulfilled?: any): Promise; - catch(onrejected?: any): Promise; finally(): Promise; - [Symbol.toStringTag]: "Promise"; + + [Symbol.toStringTag]: 'Promise'; + + catch(onrejected?: ((reason: any) => (PromiseLike | TResult))): Promise; + + then(onfulfilled?: ((value: T) => (PromiseLike | TResult1)), + onrejected?: ((reason: any) => (PromiseLike | TResult2))): Promise; } -export class ExplainInfo { } +export class ExplainInfo {} diff --git a/types/jsoneditor-for-react/index.d.ts b/types/jsoneditor-for-react/index.d.ts new file mode 100644 index 0000000000..707f03c63e --- /dev/null +++ b/types/jsoneditor-for-react/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for jsoneditor-for-react 0.0 +// Project: https://github.com/mixj93/jsoneditor-for-react#readme +// Definitions by: JoshGoldberg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from "react"; +import JSONEditor, { JSONEditorOptions } from "jsoneditor"; + +export interface ReactJsonEditorProps { + values: {}; +} + +export default class ReactJsoneditor extends React.Component { + private editor?: JSONEditor; + private options?: JSONEditorOptions; +} diff --git a/types/jsoneditor-for-react/jsoneditor-for-react-tests.tsx b/types/jsoneditor-for-react/jsoneditor-for-react-tests.tsx new file mode 100644 index 0000000000..fc8211e628 --- /dev/null +++ b/types/jsoneditor-for-react/jsoneditor-for-react-tests.tsx @@ -0,0 +1,4 @@ +import * as React from "react"; +import ReactJsonEditor from "jsoneditor-for-react"; + +const component = ; diff --git a/types/jsoneditor-for-react/tsconfig.json b/types/jsoneditor-for-react/tsconfig.json new file mode 100644 index 0000000000..7a855a2dc9 --- /dev/null +++ b/types/jsoneditor-for-react/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsoneditor-for-react-tests.tsx" + ] +} diff --git a/types/jsoneditor-for-react/tslint.json b/types/jsoneditor-for-react/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsoneditor-for-react/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jss/css.d.ts b/types/jss/css.d.ts new file mode 100644 index 0000000000..2d5e89139a --- /dev/null +++ b/types/jss/css.d.ts @@ -0,0 +1,136 @@ +// These CSS typings adapted from TypeStyle: https://github.com/typestyle/typestyle + +import { Observable } from 'indefinite-observable'; +import * as csstype from 'csstype'; + +type Length = string | number; + +export type ObservableProperties

= { + [K in keyof P]: P[K] | Observable +}; + +export type CSSProperties = + & ObservableProperties> + & ObservableProperties>; + +export interface JssProps { + '@global'?: CSSProperties; + extend?: string; + composes?: string | string[]; +} + +export interface JssExpand { + animation: + | { + delay: CSSProperties['animationDelay']; + direction: CSSProperties['animationDirection']; + duration: CSSProperties['animationDuration']; + iterationCount: CSSProperties['animationIterationCount']; + name: CSSProperties['animationName']; + playState: CSSProperties['animationPlayState']; + timingFunction: CSSProperties['animationTimingFunction']; + } + | CSSProperties['animation']; + background: + | { + attachment: CSSProperties['backgroundAttachment']; + color: CSSProperties['backgroundColor']; + image: CSSProperties['backgroundImage']; + position: + | CSSProperties['backgroundPosition'] + | [csstype.Properties['backgroundPosition'], csstype.Properties['backgroundPosition']]; // Can be written using array e.g. `[0 0]` + repeat: CSSProperties['backgroundRepeat']; + size: + | CSSProperties['backgroundSize'] + | [csstype.Properties['backgroundSize'], csstype.Properties['backgroundSize']]; // Can be written using array e.g. `['center' 'center']` + } + | CSSProperties['background']; + border: + | { + color: CSSProperties['borderColor']; + style: CSSProperties['borderStyle']; + width: CSSProperties['borderWidth']; + } + | CSSProperties['border']; + boxShadow: + | { + x: Length; + y: Length; + blur: Length; + spread: Length; + color: CSSProperties['color']; + inset?: 'inset'; // If you want to add inset you need to write 'inset: 'inset'' + } + | CSSProperties['boxShadow']; + flex: + | { + basis: CSSProperties['flexBasis']; + direction: CSSProperties['flexDirection']; + flow: CSSProperties['flexFlow']; + grow: CSSProperties['flexGrow']; + shrink: CSSProperties['flexShrink']; + wrap: CSSProperties['flexWrap']; + } + | CSSProperties['flex']; + font: + | { + family: CSSProperties['fontFamily']; + size: CSSProperties['fontSize']; + stretch: CSSProperties['fontStretch']; + style: CSSProperties['fontStyle']; + variant: CSSProperties['fontVariant']; + weight: CSSProperties['fontWeight']; + } + | CSSProperties['font']; + listStyle: + | { + image: CSSProperties['listStyleImage']; + position: CSSProperties['listStylePosition']; + type: CSSProperties['listStyleType']; + } + | CSSProperties['listStyle']; + margin: + | { + bottom: CSSProperties['marginBottom']; + left: CSSProperties['marginLeft']; + right: CSSProperties['marginRight']; + top: CSSProperties['marginTop']; + } + | CSSProperties['margin']; + padding: + | { + bottom: CSSProperties['paddingBottom']; + left: CSSProperties['paddingLeft']; + right: CSSProperties['paddingRight']; + top: CSSProperties['paddingTop']; + } + | CSSProperties['padding']; + outline: + | { + color: CSSProperties['outlineColor']; + style: CSSProperties['outlineStyle']; + width: CSSProperties['outlineWidth']; + } + | CSSProperties['outline']; + textShadow: + | { + x: Length; + y: Length; + blur: Length; + color: CSSProperties['color']; + } + | CSSProperties['textShadow']; + transition: + | { + delay: CSSProperties['transitionDelay']; + duration: CSSProperties['transitionDuration']; + property: CSSProperties['transitionProperty']; + timingFunction: CSSProperties['transitionTimingFunction']; + } + | CSSProperties['transition']; +} + +export type JssExpandArr = { [k in keyof JssExpand]?: JssExpand[k] | Array }; + +export type SimpleStyle = CSSProperties & JssProps & JssExpandArr; +export type Style = SimpleStyle | Observable>; diff --git a/types/jss/index.d.ts b/types/jss/index.d.ts index 0f77605b2c..0b40c82f8f 100644 --- a/types/jss/index.d.ts +++ b/types/jss/index.d.ts @@ -1,9 +1,15 @@ -// Type definitions for jss 9.3 +// Type definitions for jss 9.5 // Project: https://github.com/cssinjs/jss#readme // Definitions by: Brenton Simpson // Oleg Slobodskoi +// Thomas Crockett // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 + +import { Style } from './css'; + +export type Styles = Record; +export type Classes = Record; export interface ToCssOptions { indent?: number; @@ -17,13 +23,12 @@ export interface Rule { prop(key: string, value: any): this; toJSON(): string; } -export interface StyleSheet { + +export interface StyleSheet { // Gives auto-completion on the rules declared in `createStyleSheet` without // causing errors for rules added dynamically after creation. - classes: { - [K in keyof T]: string; - } & { [key: string]: string }; - options: any; + classes: Classes; + options: RuleOptions; linked: boolean; attached: boolean; /** @@ -39,21 +44,21 @@ export interface StyleSheet { * Will insert a rule also after the stylesheet has been rendered first time. */ addRule(style: Style, options?: Partial): Rule; - addRule(name: string, style: Style, options?: Partial): Rule; + addRule(name: RuleName, style: Style, options?: Partial): Rule; /** * Create and add rules. * Will render also after Style Sheet was rendered the first time. */ - addRules(styles: { [key: string]: Style }, options?: Partial): Rule[]; + addRules(styles: Partial>, options?: Partial): Rule[]; /** * Get a rule by name. */ - getRule(name: string): Rule; + getRule(name: RuleName): Rule; /** * Delete a rule by name. * Returns `true`: if rule has been deleted from the DOM. */ - deleteRule(name: string): boolean; + deleteRule(name: RuleName): boolean; /** * Get index of a rule. */ @@ -62,39 +67,37 @@ export interface StyleSheet { * Update the function values with a new data. */ update(data?: {}): this; - update(name: string, data: {}): this; + update(name: RuleName, data: {}): this; /** * Convert rules to a CSS string. */ toString(options?: ToCssOptions): string; } -export type GenerateClassName = (rule: Rule, sheet?: StyleSheet) => string; -export interface Style { - [key: string]: any; -} +export type GenerateClassName = (rule: Rule, sheet?: StyleSheet) => string; + export interface JSSPlugin { [key: string]: () => Partial<{ - onCreateRule(name: string, style: Style, options: RuleOptions): Rule, - onProcessRule(rule: Rule, sheet: StyleSheet): void, - onProcessStyle(style: Style, rule: Rule, sheet: StyleSheet): Style, - onProcessSheet(sheet: StyleSheet): void, - onChangeValue(value: any, prop: string, rule: Rule): any, - onUpdate(data: {}, rule: Rule, sheet: StyleSheet): void, + onCreateRule(name: string, style: Style, options: RuleOptions): Rule; + onProcessRule(rule: Rule, sheet: StyleSheet): void; + onProcessStyle(style: Style, rule: Rule, sheet: StyleSheet): Style; + onProcessSheet(sheet: StyleSheet): void; + onChangeValue(value: any, prop: string, rule: Rule): any; + onUpdate(data: {}, rule: Rule, sheet: StyleSheet): void; }>; } export interface JSSOptions { - createGenerateClassName(): GenerateClassName; + createGenerateClassName(): GenerateClassName; plugins: ReadonlyArray; virtual: boolean; insertionPoint: string | HTMLElement; } -export interface RuleFactoryOptions { +export interface RuleFactoryOptions { selector: string; - classes: { [key: string]: string }; - sheet: StyleSheet; + classes: Classes; + sheet: StyleSheet; index: number; jss: JSS; - generateClassName: GenerateClassName; + generateClassName: GenerateClassName; } export interface RuleOptions { index: number; @@ -102,32 +105,32 @@ export interface RuleOptions { } export declare class SheetsRegistry { constructor(); - registry: ReadonlyArray>; + registry: ReadonlyArray; readonly index: number; - add(sheet: StyleSheet): void; + add(sheet: StyleSheet): void; reset(): void; - remove(sheet: StyleSheet): void; + remove(sheet: StyleSheet): void; toString(options?: ToCssOptions): string; } declare class JSS { constructor(options?: Partial); - createStyleSheet( - styles: T, + createStyleSheet( + styles: Partial>, options?: Partial<{ - media: string, - meta: string, - link: boolean, - element: HTMLStyleElement, - index: number, - generateClassName: GenerateClassName, - classNamePrefix: string, + media: string; + meta: string; + link: boolean; + element: HTMLStyleElement; + index: number; + generateClassName: GenerateClassName; + classNamePrefix: string; }>, - ): StyleSheet; - removeStyleSheet(sheet: StyleSheet): this; + ): StyleSheet; + removeStyleSheet(sheet: StyleSheet): this; setup(options?: Partial): this; - use(plugin: JSSPlugin): this; - createRule(style: Style, options?: Partial): Rule; - createRule(name: string, style: Style, options?: Partial): Rule; + use(...plugins: JSSPlugin[]): this; + createRule(style: Style, options?: RuleFactoryOptions): Rule; + createRule(name: Name, style: Style, options?: RuleFactoryOptions): Rule; } /** * Creates a new instance of JSS. diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index a5c6f34126..5e9a876036 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -7,14 +7,27 @@ import { } from 'jss'; const jss = createJSS().setup({}); +jss.use({}, {}); // $ExpectType JSS -const styleSheet = jss.createStyleSheet( +const styleSheet = jss.createStyleSheet( { ruleWithMockObservable: { - subscribe() {} + subscribe: observer => { + const next = typeof observer === 'function' ? observer : observer.next; + next({ background: 'blue', display: 'flex' }); + next({ invalidKey: 'blueish' }); // $ExpectError + + // only kebab case allowed in observables + next({ 'align-items': 'center' }); + next({ alignItems: 'center' }); // $ExpectError + return { + unsubscribe() {} + }; + } }, container: { display: 'flex', + 'align-items': 'center', width: 100, opacity: .5, }, @@ -56,14 +69,23 @@ attachedStyleSheet.addRules({ }, }); -attachedStyleSheet.detach(); +styleSheet.addRule('badProperty', { + thisIsNotAValidProperty: 'blah', // $ExpectError +}); -sharedInstance.createStyleSheet({ +styleSheet.addRule('badValue', { // $ExpectError + 'align-items': Symbol(), +}); + +const styleSheet2 = sharedInstance.createStyleSheet({ container: { background: '#000099', } }); +styleSheet2.classes.container; // $ExpectType string +styleSheet2.classes.notAValidKey; // $ExpectError + /* SheetsRegistry test */ const sheetsRegistry = new SheetsRegistry(); sheetsRegistry.add(styleSheet); @@ -71,7 +93,11 @@ sheetsRegistry.add(styleSheet); const secondStyleSheet = jss.createStyleSheet( { ruleWithMockObservable: { - subscribe() {} + subscribe() { + return { + unsubscribe() {} + }; + } }, container2: { display: 'flex', diff --git a/types/jss/package.json b/types/jss/package.json new file mode 100644 index 0000000000..59a8354d7d --- /dev/null +++ b/types/jss/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "dependencies": { + "csstype": "^2.0.0", + "indefinite-observable": "^1.0.1" + } +} diff --git a/types/jstree/index.d.ts b/types/jstree/index.d.ts index 6bbbb43d2a..d1ac386a49 100644 --- a/types/jstree/index.d.ts +++ b/types/jstree/index.d.ts @@ -1968,37 +1968,37 @@ interface JSTreeGetJsonOptions { /** * do not return state information */ - no_state: boolean; + no_state?: boolean; /** * do not return ID */ - no_id: boolean; + no_id?: boolean; /** * do not include children */ - no_children: boolean; + no_children?: boolean; /** * do not include node data */ - no_data: boolean; + no_data?: boolean; /** * do not include LI attributes */ - no_li_attr: boolean; + no_li_attr?: boolean; /** * do not include A attributes */ - no_a_attr: boolean; + no_a_attr?: boolean; /** * return flat JSON instead of nested */ - flat: boolean; + flat?: boolean; } interface JSTreeBindOptions { diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index cb40e26da7..58c656956c 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for JW Player V8.0 -// Project: http://developer.longtailvideo.com/trac/ +// Project: https://github.com/jwplayer/jwplayer/ // Definitions by: Martin Duparc // Tomer Kruvi // Philipp Gürtler @@ -255,8 +255,8 @@ interface JWPlayer { getSafeRegion(): Region; getState(): string; getVolume(): number; - getContainer(): HTMLElement; - getEnvironment(): Environment; + getContainer(): HTMLElement; + getEnvironment(): Environment; getWidth(): number; load(playlist: any[]): void; load(playlist: string): void; diff --git a/types/jwt-express/index.d.ts b/types/jwt-express/index.d.ts new file mode 100644 index 0000000000..cbae9f5b8a --- /dev/null +++ b/types/jwt-express/index.d.ts @@ -0,0 +1,233 @@ +// Type definitions for jwt-express 1.1 +// Project: https://github.com/AustP/jwt-express#readme +// Definitions by: Nick Paddock +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +import express = require("express"); +import jsonwebtoken = require("jsonwebtoken"); + +export interface JWT { + /** + * Indicates if the JWT is expired. valid will always be false if this is true. + */ + expired: boolean; + + /** + * The jwt-express options. + */ + options: JWTExpressOptions; + + /** + * The payload of the JWT (must be an object). jwt-express will add a stales key-value pair to the payload for stale. + */ + payload: any; + + /** + * The secret used to sign /verify the JWT. + */ + secret: string; + + /** + * Indicates if the JWT is stale. The default timeout before a JWT is considered stale is 15 minutes. + */ + stale: boolean; + + /** + * The signed token of the JWT. + */ + token: string; + + /** + * Indicates if this JWT is valid. This means that the payload hasn't been tampered with and that the JWT hasn't expired yet. + */ + valid: boolean; + + /** + * Resigns this JWT Objects's payload. + * + * @return this + */ + resign(): JWT; + + /** + * Calls the revoke function defined in the jwt.init() options with this JWT Object as the first parameter. + * + * @return this + */ + revoke(): JWT; + + /** + * Generates a signed token from the payload. + * + * @param payload The payload of the JWT (must be an object). + * @return this + */ + sign(payload: any): JWT; + + /** + * Stores this JWT in the cookie (if configured to use cookies). + * + * @param res The response in which to store the JWT. + * @return this + */ + store(res: express.Response): JWT; + + /** + * This function is called when the jwt is passed through JSON.stringify. + * We don't want the secret or options to be stringified. + * + * @return The JSON form of the object. + */ + toJSON(): any; + + /** + * Verify the token and load the info into this JWT. + * + * @param token The signed token to verify. + * @return this + */ + verify(token: string): JWT; +} + +export interface JWTExpressOptions { + /** + * The name of the cookie (default: 'jwt-express') + */ + cookie?: string; + + /** + * Options to use when storing the cookie (default: {httpOnly: true}) + */ + cookieOptions?: express.CookieOptions; + + /** + * If true, will use cookies, otherwise will use the Authorization header (default: true) + */ + cookies?: boolean; + + /** + * Indicates if the JWT should be refreshed and stored every request (default: true) + */ + refresh?: boolean; + + /** + * The property of req to populate (default: 'jwt') + */ + reqProperty?: string; + + /** + * jwt.revoke() will call this function (default: function(jwt) {}) + */ + revoke?: (jwt: JWT) => void; + + /** + * Options to use when signing the JWT (default: {}) + */ + signOptions?: jsonwebtoken.SignOptions; + + /** + * Milliseconds when the jwt will go stale (default: 900000 (15 minutes)) + */ + stales?: number; + + /** + * Additional verification. Must return a boolean (default: function(jwt) {return true}) + */ + verify?: (jwt: JWT) => boolean; + + /** + * Options to use when verifying the JWT (default: {}) + */ + verifyOptions?: jsonwebtoken.VerifyOptions; +} + +export interface JWTExpressError extends Error { + name: string; + message: string; +} + +export let options: JWTExpressOptions; + +/** + * Returns a middleware function that ensures a JWT is valid and fresh. Useful to protect + * sensitive actions from CSRF. This method will trigger error handling if the JWT is not active. + * + * @return Express middleware + */ +export function active(): express.RequestHandler; + +/** + * If using cookies, this method will clear the current JWT out of the cookie. + * + * @return Express middleware + */ +export function clear(): express.RequestHandler; + +/** + * Returns a newly created / signed JWT Object from the payload. + * + * @param secret + * If secret is a string, that string will be used to verify / sign with. + * If secret is a function, that function will be called with the payload as its first parameter, + * and must return a string which will be used to verify / sign with. + * @param payload The payload of the JWT. + * @return JWT + */ +export function create(secret: string | ((payload: any) => string), payload: any): JWT; + +/** + * The jwt.init() function returns a middleware function for Express so it must be called inside app.use(). + * It will automatically read in the JWT from either the cookie or the Authorization header (configured by you) + * and add a JWT object to the Request object (req). It will also add the jwt() method to the Response object (res) + * to create / store JWTs. jwt.init() must be called before any other jwt method. + * + * @param secret + * If secret is a string, that string will be used to verify / sign with. + * If secret is a function, that function will be called with the Express HTTP Request as its first parameter, + * and must return a string which will be used to verify / sign with. + * @param options The options of jwt-express. + * @return Express middleware + */ +export function init(secret: string | ((req: express.Request) => string), options?: JWTExpressOptions): express.RequestHandler; + +/** + * Returns a middleware function that requires the payload to contain / match certain data. + * This method will trigger error handling if the JWT fails the requirement. + * + * @param key + * This is they key used to look up the value in the payload. + * If only this value is passed to jwt.require(), then the middleware function will check that the value is truthy. + * @param operator The operator to compare the information + * @param value The value to compare the payload data against + * @return Express middleware + */ +export function require(key: string, operator?: string, value?: any): express.RequestHandler; + +/** + * Returns a middleware function that ensures a JWT is valid. This method will trigger error handling if the JWT is not valid. + * + * @return Express middleware + */ +export function valid(): express.RequestHandler; + +declare global { + namespace Express { + interface Request { + jwt: JWT; + } + + interface Response { + /** + * Returns a newly created / signed JWT Object from the payload. If you are using cookies, + * it will automatically store the JWT in the cookie as well. + * + * @param payload The payload of the JWT + * @return The newly created JWT + */ + jwt(payload: any): JWT; + } + } +} diff --git a/types/jwt-express/jwt-express-tests.ts b/types/jwt-express/jwt-express-tests.ts new file mode 100644 index 0000000000..fedf8137b3 --- /dev/null +++ b/types/jwt-express/jwt-express-tests.ts @@ -0,0 +1,65 @@ +import exp = require("express"); +import jwt = require("jwt-express"); + +const app = exp(); + +app.use(jwt.active()); +app.use(jwt.clear()); +let jwtObj = jwt.create("Secret", { }); +jwtObj = jwt.create((p) => "Secret", { }); +app.use(jwt.init("Secret")); +app.use(jwt.init(req => "Secret")); +app.use(jwt.init("Secret", { + cookie: "jwt-express", + cookieOptions: { + httpOnly: true + }, + cookies: true, + refresh: true, + reqProperty: "jwt", + revoke: (revokeJWT: jwt.JWT) => { jwtObj = revokeJWT; }, + signOptions: { + expiresIn: "1h" + }, + stales: 1000, + verify: (verifyJWT: jwt.JWT) => { jwtObj = verifyJWT; return true; }, + verifyOptions: { + ignoreExpiration: true + } +})); +app.use(jwt.require("key")); +app.use(jwt.require("key", "==", "value")); +app.use(jwt.valid()); + +let resObj: exp.Response = {}; +app.use((err: jwt.JWTExpressError, req: exp.Request, res: exp.Response, next: exp.NextFunction) => { + err.message.startsWith(""); + err.name.startsWith(""); + resObj = res; + jwtObj = req.jwt; + req.jwt.payload; + req.hostname.startsWith(""); + jwtObj = res.jwt({ }); +}); + +jwtObj.expired.valueOf(); +app.use(jwt.init(req => "Secret", jwtObj.options)); +jwtObj.payload; +jwtObj.secret.startsWith(""); +jwtObj.stale.valueOf(); +jwtObj.token.startsWith(""); +jwtObj.valid.valueOf(); + +jwtObj = jwtObj.resign(); +jwtObj = jwtObj.revoke(); +jwtObj = jwtObj.sign(jwtObj.payload); +jwtObj = jwtObj.store(resObj); +jwtObj = jwtObj.verify(jwtObj.token); +jwtObj.toJSON(); + +app.get("", (req: exp.Request, res: exp.Response, next: exp.NextFunction) => { + jwtObj = req.jwt; + req.jwt.payload; + req.hostname.startsWith(""); + jwtObj = res.jwt({ }); +}); diff --git a/types/jwt-express/tsconfig.json b/types/jwt-express/tsconfig.json new file mode 100644 index 0000000000..293e5e4548 --- /dev/null +++ b/types/jwt-express/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jwt-express-tests.ts" + ] +} diff --git a/types/jwt-express/tslint.json b/types/jwt-express/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jwt-express/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/karma-viewport/index.d.ts b/types/karma-viewport/index.d.ts new file mode 100644 index 0000000000..10196485ca --- /dev/null +++ b/types/karma-viewport/index.d.ts @@ -0,0 +1,124 @@ +// Type definitions for karma-viewport 0.4 +// Project: https://github.com/squidfunk/karma-viewport +// Definitions by: Karak +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Type definition file for 'karma-viewport' +// https://www.npmjs.com/package/karma-viewport + +declare namespace KarmaViewport { + interface Breakpoint { + name: string; + size: { + width: number, + height: number, + }; + } + + interface Config { + /** Context selector */ + context: string; + /** Breakpoints */ + breakpoints: Breakpoint[]; + } + + class Viewport { + /** + * Create viewport resizer + * + * @param config - Configuration + * @param context - Initialization context + */ + constructor(config: Config, context: Window); + + /** + * Load and embed document into viewport + * + * @param url - URL of document to load + * @param cb - Callback to execute after document was loaded + */ + load(url: string, cb: () => void): void; + + /** + * Set viewport to number or array + */ + set(width: number, height?: number): void; + + /** + * Set viewport to breakpoint identifier + */ + set(name: string): void; + + /** + * Reset viewport + */ + reset(): void; + + /** + * Execute a callback for all breakpoints between the first and last given + * + * @example + * viewport.between("mobile", "tablet", name => { + * ... + * }) + * + * @param first - First breakpoint name + * @param last - Last breakpoint name + * @param cb - Callback to execute after resizing + */ + between(first: string, last: string, cb: (name: string) => void): void; + + /** + * Execute a callback for all breakpoints + * + * @example + * viewport.each(name => { + * ... + * }) + * + * @param cb - Callback to execute after resizing + */ + each(cb: (name: string) => void): void; + + /** + * Execute a callback starting at the given breakpoint + * + * @example + * viewport.from("tablet", name => { + * ... + * }) + * + * @param first - First breakpoint name + * @param cb - Callback to execute after resizing + */ + from(first: string, cb: (name: string) => void): void; + + /** + * Execute a callback ending at the given breakpoint + * + * @example + * viewport.to("tablet", name => { + * ... + * }) + * + * @param last - Last breakpoint name + * @param cb - Callback to execute after resizing + */ + to(last: string, cb: (name: string) => void): void; + + /** + * Retrieve configuration + * + * @return Configuration + */ + readonly config: Config; // get config() + + /** + * Retrieve context element + * + * @return context element + */ + readonly element: HTMLIFrameElement; // get element() + } +} + +declare const viewport: KarmaViewport.Viewport; diff --git a/types/karma-viewport/karma-viewport-tests.ts b/types/karma-viewport/karma-viewport-tests.ts new file mode 100644 index 0000000000..f220f35d98 --- /dev/null +++ b/types/karma-viewport/karma-viewport-tests.ts @@ -0,0 +1,46 @@ +// Set to 320px x 100% +viewport.set(320); + +// Set to 320px x 480px +viewport.set(320, 480); + +// Set to 320px x 480px by breakpoints +viewport.set("mobile"); + +// Reset to 100% x 100% +viewport.reset(); + +// Load entire webpages for testing: +viewport.load("/path/to/fixture.html", () => console.log('done')); + +// Run tests for mobile, tablet and screen +viewport.each(name => { + // ... +}); + +// Run tests for tablet and screen +viewport.from("tablet", name => { + // ... +}); + +// Run tests for mobile and tablet +viewport.to("tablet", name => { + // ... +}); + +// Run tests for tablet and screen +viewport.between("tablet", "screen", name => { + // ... +}); + +// get config +viewport.config.breakpoints.forEach(breakpoint => { + const name: string = breakpoint.name; + const width: number = breakpoint.size.width; + const height: number = breakpoint.size.height; +}); + +const contextSelector: string = viewport.config.context; + +// get element +const iframe: HTMLIFrameElement = viewport.element; diff --git a/types/karma-viewport/tsconfig.json b/types/karma-viewport/tsconfig.json new file mode 100644 index 0000000000..def40ab217 --- /dev/null +++ b/types/karma-viewport/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", + "karma-viewport-tests.ts" + ] +} diff --git a/types/karma-viewport/tslint.json b/types/karma-viewport/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/karma-viewport/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/keyv/index.d.ts b/types/keyv/index.d.ts new file mode 100644 index 0000000000..9d0e2c6404 --- /dev/null +++ b/types/keyv/index.d.ts @@ -0,0 +1,56 @@ +// Type definitions for keyv 3.0 +// Project: https://github.com/lukechilds/keyv +// Definitions by: AryloYeung +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +interface KeyvOptions { + /** Namespace for the current instance. */ + namespace?: string; + /** A custom serialization function. */ + serialize?: (data: any) => string; + /** A custom deserialization function. */ + deserialize?: (data: string) => any; + /** The connection string URI. */ + uri?: string; + /** The storage adapter instance to be used by Keyv. */ + store?: any; + /** Default TTL. Can be overridden by specififying a TTL on `.set()`. */ + ttl?: number; + /** Specify an adapter to use. e.g `'redis'` or `'mongodb'`. */ + adapter?: string; +} + +declare class Keyv extends NodeJS.EventEmitter { + /** + * @param opts The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options. + */ + constructor(opts?: KeyvOptions); + /** + * @param uri The connection string URI. + * + * Merged into the options object as options.uri. + * @param opts The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options. + */ + constructor(uri?: string, opts?: KeyvOptions); + /** Returns the value. */ + get(key: string): Promise; + /** + * Set a value. + * + * By default keys are persistent. You can set an expiry TTL in milliseconds. + */ + set(key: string, value: any, ttl?: number): Promise; + /** + * Deletes an entry. + * + * Returns `true` if the key existed, `false` if not. + */ + delete(key: string): Promise; + /** Delete all entries in the current namespace. */ + clear(): Promise; +} + +export = Keyv; diff --git a/types/keyv/keyv-tests.ts b/types/keyv/keyv-tests.ts new file mode 100644 index 0000000000..7ee4cac90e --- /dev/null +++ b/types/keyv/keyv-tests.ts @@ -0,0 +1,25 @@ +import Keyv = require("keyv"); + +new Keyv({ + uri: 'redis://user:pass@localhost:6379', + namespace: "redis" +}); + +new Keyv('mongodb://user:pass@localhost:27017/dbname'); +new Keyv('redis://user:pass@localhost:6379'); +new Keyv('sqlite://path/to/database.sqlite'); +new Keyv('postgresql://user:pass@localhost:5432/dbname'); +new Keyv('mysql://user:pass@localhost:3306/dbname'); +new Keyv(); + +(async () => { + const keyv = new Keyv(); + + keyv.on('error', err => console.log('Connection Error', err)); + + await keyv.set('foo', 'expires in 1 second', 1000); // true + await keyv.set('foo', 'never expires'); // true + await keyv.get('foo'); // 'never expires' + await keyv.delete('foo'); // true + await keyv.clear(); // undefined +})(); diff --git a/types/keyv/tsconfig.json b/types/keyv/tsconfig.json new file mode 100644 index 0000000000..47eab45180 --- /dev/null +++ b/types/keyv/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", + "keyv-tests.ts" + ] +} diff --git a/types/keyv/tslint.json b/types/keyv/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/keyv/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/knex/index.d.ts b/types/knex/index.d.ts index 1d405f54b0..9c07f69f9b 100644 --- a/types/knex/index.d.ts +++ b/types/knex/index.d.ts @@ -125,6 +125,7 @@ declare namespace Knex { havingRaw: RawQueryBuilder; orHaving: Having; orHavingRaw: RawQueryBuilder; + havingIn: HavingIn; // Clear clearSelect(): QueryBuilder; @@ -324,6 +325,10 @@ declare namespace Knex { (tableName: string, column1: string, operator: string, column2: string): QueryBuilder; } + interface HavingIn { + (columnName: string, values: Value[]): QueryBuilder; + } + // commons interface ColumnNameQueryBuilder { diff --git a/types/knockout/index.d.ts b/types/knockout/index.d.ts index 0964d24284..d4031b2337 100644 --- a/types/knockout/index.d.ts +++ b/types/knockout/index.d.ts @@ -444,10 +444,10 @@ interface KnockoutStatic { toJS(viewModel: any): any; isObservable(instance: any): instance is KnockoutObservable; - isObservable(instance: KnockoutObservable): instance is KnockoutObservable; + isObservable(instance: KnockoutObservable | T): instance is KnockoutObservable; isWriteableObservable(instance: any): instance is KnockoutObservable; - isWriteableObservable(instance: KnockoutObservable): instance is KnockoutObservable; + isWriteableObservable(instance: KnockoutObservable | T): instance is KnockoutObservable; isComputed(instance: any): instance is KnockoutComputed; isComputed(instance: KnockoutObservable | T): instance is KnockoutComputed; diff --git a/types/koa-session/index.d.ts b/types/koa-session/index.d.ts index 8650a07d91..75721a5b2d 100644 --- a/types/koa-session/index.d.ts +++ b/types/koa-session/index.d.ts @@ -156,6 +156,11 @@ declare namespace session { */ rolling?: boolean; + /** + * Renew session when session is nearly expired, so we can always keep user logged in. (default is false) + */ + renew?: boolean; + /** * You can store the session content in external stores(redis, mongodb or other DBs) */ @@ -166,7 +171,7 @@ declare namespace session { * ContextStore must be a class which claims three instance methods demonstrated above. * new ContextStore(ctx) will be executed on every request. */ - ContextStore?: { new(): stores }; + ContextStore?: { new(ctx: Koa.Context): stores }; /** * If you want to add prefix for all external session id, you can use options.prefix, it will not work if options.genid present. diff --git a/types/koa/index.d.ts b/types/koa/index.d.ts index 2a5c49f110..07ddadc0c8 100644 --- a/types/koa/index.d.ts +++ b/types/koa/index.d.ts @@ -21,6 +21,7 @@ import * as accepts from "accepts"; import * as Cookies from "cookies"; import { EventEmitter } from "events"; import { IncomingMessage, ServerResponse, Server } from "http"; +import { Http2ServerRequest, Http2ServerResponse } from 'http2'; import httpAssert = require("http-assert"); import * as Keygrip from "keygrip"; import * as compose from "koa-compose"; @@ -500,9 +501,9 @@ declare class Application extends EventEmitter { /** * Return a request handler callback - * for node's native http server. + * for node's native http/http2 server. */ - callback(): (req: IncomingMessage, res: ServerResponse) => void; + callback(): (req: IncomingMessage | Http2ServerRequest, res: ServerResponse | Http2ServerResponse) => void; /** * Initialize a new context. diff --git a/types/leaflet-draw/index.d.ts b/types/leaflet-draw/index.d.ts index 7fd33f2152..62025a7c46 100644 --- a/types/leaflet-draw/index.d.ts +++ b/types/leaflet-draw/index.d.ts @@ -279,7 +279,7 @@ declare module 'leaflet' { * * Default value: L.Icon.Default() */ - icon?: Icon; + icon?: Icon | DivIcon; /** * This should be a high number to ensure that you can draw over all other layers on the map. diff --git a/types/leaflet-draw/leaflet-draw-tests.ts b/types/leaflet-draw/leaflet-draw-tests.ts index 54015fa404..7a51fe401f 100644 --- a/types/leaflet-draw/leaflet-draw-tests.ts +++ b/types/leaflet-draw/leaflet-draw-tests.ts @@ -121,3 +121,18 @@ function testExampleControlOptions() { } }); } + +function testMarkerOptionsIcon() { + const markerIcon = new L.Draw.Marker(map, { + icon: new L.Icon({ + iconUrl: 'my-icon.png', + iconSize: new L.Point(32, 32), + }), + }); + const markerDivIcon = new L.Draw.Marker(map, { + icon: new L.DivIcon({ + className: "marker-icon", + iconSize: new L.Point(32, 32), + }), + }); +} diff --git a/types/leaflet/index.d.ts b/types/leaflet/index.d.ts index 41b4fbd84c..89f9625114 100644 --- a/types/leaflet/index.d.ts +++ b/types/leaflet/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/Leaflet/Leaflet // Definitions by: Alejandro Sánchez // Arne Schubert +// Michael Auer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -611,7 +612,7 @@ export interface PolylineOptions extends PathOptions { export class Polyline extends Path { constructor(latlngs: LatLngExpression[], options?: PolylineOptions); toGeoJSON(): geojson.Feature; - getLatLngs(): LatLng[]; + getLatLngs(): LatLng[] | LatLng[][] | LatLng[][][]; setLatLngs(latlngs: LatLngExpression[]): this; isEmpty(): boolean; getCenter(): LatLng; diff --git a/types/lodash/common/array.d.ts b/types/lodash/common/array.d.ts index 49f93aa313..34b9548221 100644 --- a/types/lodash/common/array.d.ts +++ b/types/lodash/common/array.d.ts @@ -1405,7 +1405,7 @@ declare module "../index" { this: LoDashImplicitWrapper | null | undefined>, values1: List, values2: List, - ...values: Array | Comparator2>, + ...values: Array | Comparator2> ): LoDashImplicitWrapper; /** @@ -1444,7 +1444,7 @@ declare module "../index" { this: LoDashExplicitWrapper | null | undefined>, values1: List, values2: List, - ...values: Array | Comparator2>, + ...values: Array | Comparator2> ): LoDashExplicitWrapper; /** diff --git a/types/lodash/common/function.d.ts b/types/lodash/common/function.d.ts index 31055a2781..71ec3bb884 100644 --- a/types/lodash/common/function.d.ts +++ b/types/lodash/common/function.d.ts @@ -95,7 +95,7 @@ declare module "../index" { // bind interface FunctionBind { - placeholder: any; + placeholder: __; ( func: (...args: any[]) => any, @@ -145,7 +145,7 @@ declare module "../index" { // bindKey interface FunctionBindKey { - placeholder: any; + placeholder: __; ( object: object, @@ -195,7 +195,7 @@ declare module "../index" { // curry - interface LoDashStatic { + interface Curry { /** * Creates a function that accepts one or more arguments of func that when called either invokes func returning * its result, if all func arguments have been provided, or returns a function that accepts one or more of the @@ -204,7 +204,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curry(func: (t1: T1) => R, arity?: number): + (func: (t1: T1) => R, arity?: number): CurriedFunction1; /** * Creates a function that accepts one or more arguments of func that when called either invokes func returning @@ -214,7 +214,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curry(func: (t1: T1, t2: T2) => R, arity?: number): + (func: (t1: T1, t2: T2) => R, arity?: number): CurriedFunction2; /** * Creates a function that accepts one or more arguments of func that when called either invokes func returning @@ -224,7 +224,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curry(func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): + (func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): CurriedFunction3; /** * Creates a function that accepts one or more arguments of func that when called either invokes func returning @@ -234,7 +234,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curry(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): + (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): CurriedFunction4; /** * Creates a function that accepts one or more arguments of func that when called either invokes func returning @@ -244,7 +244,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curry(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): + (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): CurriedFunction5; /** * Creates a function that accepts one or more arguments of func that when called either invokes func returning @@ -254,7 +254,13 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curry(func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; + (func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; + + placeholder: __; + } + + interface LoDashStatic { + curry: Curry; } interface CurriedFunction1 { @@ -265,60 +271,149 @@ declare module "../index" { interface CurriedFunction2 { (): CurriedFunction2; (t1: T1): CurriedFunction1; + (t1: __, t2: T2): CurriedFunction1; (t1: T1, t2: T2): R; } interface CurriedFunction3 { (): CurriedFunction3; (t1: T1): CurriedFunction2; + (t1: __, t2: T2): CurriedFunction2; (t1: T1, t2: T2): CurriedFunction1; + (t1: __, t2: __, t3: T3): CurriedFunction2; + (t1: T1, t2: __, t3: T3): CurriedFunction1; + (t1: __, t2: T2, t3: T3): CurriedFunction1; (t1: T1, t2: T2, t3: T3): R; } interface CurriedFunction4 { (): CurriedFunction4; (t1: T1): CurriedFunction3; + (t1: __, t2: T2): CurriedFunction3; (t1: T1, t2: T2): CurriedFunction2; + (t1: __, t2: __, t3: T3): CurriedFunction3; + (t1: __, t2: __, t3: T3): CurriedFunction2; + (t1: __, t2: T2, t3: T3): CurriedFunction2; (t1: T1, t2: T2, t3: T3): CurriedFunction1; + (t1: __, t2: __, t3: __, t4: T4): CurriedFunction3; + (t1: T1, t2: __, t3: __, t4: T4): CurriedFunction2; + (t1: __, t2: T2, t3: __, t4: T4): CurriedFunction2; + (t1: __, t2: __, t3: T3, t4: T4): CurriedFunction2; + (t1: T1, t2: T2, t3: __, t4: T4): CurriedFunction1; + (t1: T1, t2: __, t3: T3, t4: T4): CurriedFunction1; + (t1: __, t2: T2, t3: T3, t4: T4): CurriedFunction1; (t1: T1, t2: T2, t3: T3, t4: T4): R; } interface CurriedFunction5 { (): CurriedFunction5; (t1: T1): CurriedFunction4; + (t1: __, t2: T2): CurriedFunction4; (t1: T1, t2: T2): CurriedFunction3; + (t1: __, t2: __, t3: T3): CurriedFunction4; + (t1: T1, t2: __, t3: T3): CurriedFunction3; + (t1: __, t2: T2, t3: T3): CurriedFunction3; (t1: T1, t2: T2, t3: T3): CurriedFunction2; + (t1: __, t2: __, t3: __, t4: T4): CurriedFunction4; + (t1: T1, t2: __, t3: __, t4: T4): CurriedFunction3; + (t1: __, t2: T2, t3: __, t4: T4): CurriedFunction3; + (t1: __, t2: __, t3: T3, t4: T4): CurriedFunction3; + (t1: T1, t2: T2, t3: __, t4: T4): CurriedFunction2; + (t1: T1, t2: __, t3: T3, t4: T4): CurriedFunction2; + (t1: __, t2: T2, t3: T3, t4: T4): CurriedFunction2; (t1: T1, t2: T2, t3: T3, t4: T4): CurriedFunction1; + (t1: __, t2: __, t3: __, t4: __, t5: T5): CurriedFunction4; + (t1: T1, t2: __, t3: __, t4: __, t5: T5): CurriedFunction3; + (t1: __, t2: T2, t3: __, t4: __, t5: T5): CurriedFunction3; + (t1: __, t2: __, t3: T3, t4: __, t5: T5): CurriedFunction3; + (t1: __, t2: __, t3: __, t4: T4, t5: T5): CurriedFunction3; + (t1: T1, t2: T2, t3: __, t4: __, t5: T5): CurriedFunction2; + (t1: T1, t2: __, t3: T3, t4: __, t5: T5): CurriedFunction2; + (t1: T1, t2: __, t3: __, t4: T4, t5: T5): CurriedFunction2; + (t1: __, t2: T2, t3: T3, t4: __, t5: T5): CurriedFunction2; + (t1: __, t2: T2, t3: __, t4: T4, t5: T5): CurriedFunction2; + (t1: __, t2: __, t3: T3, t4: T4, t5: T5): CurriedFunction2; + (t1: T1, t2: T2, t3: T3, t4: __, t5: T5): CurriedFunction1; + (t1: T1, t2: T2, t3: __, t4: T4, t5: T5): CurriedFunction1; + (t1: T1, t2: __, t3: T3, t4: T4, t5: T5): CurriedFunction1; + (t1: __, t2: T2, t3: T3, t4: T4, t5: T5): CurriedFunction1; (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; } + interface RightCurriedFunction1 { (): RightCurriedFunction1; (t1: T1): R; } + interface RightCurriedFunction2 { (): RightCurriedFunction2; (t2: T2): RightCurriedFunction1; + (t1: T1, t2: __): RightCurriedFunction1; (t1: T1, t2: T2): R; } + interface RightCurriedFunction3 { (): RightCurriedFunction3; (t3: T3): RightCurriedFunction2; + (t2: T2, t3: __): RightCurriedFunction2; (t2: T2, t3: T3): RightCurriedFunction1; + (t1: T1, t2: __, t3: __): RightCurriedFunction2; + (t1: T1, t2: T2, t3: __): RightCurriedFunction1; + (t1: T1, t2: __, t3: T3): RightCurriedFunction1; (t1: T1, t2: T2, t3: T3): R; } + interface RightCurriedFunction4 { (): RightCurriedFunction4; (t4: T4): RightCurriedFunction3; + (t3: T3, t4: __): RightCurriedFunction3; (t3: T3, t4: T4): RightCurriedFunction2; + (t2: T2, t3: __, t4: __): RightCurriedFunction3; + (t2: T2, t3: T3, t4: __): RightCurriedFunction2; + (t2: T2, t3: __, t4: T4): RightCurriedFunction2; (t2: T2, t3: T3, t4: T4): RightCurriedFunction1; + (t1: T1, t2: __, t3: __, t4: __): RightCurriedFunction3; + (t1: T1, t2: T2, t3: __, t4: __): RightCurriedFunction2; + (t1: T1, t2: __, t3: T3, t4: __): RightCurriedFunction2; + (t1: T1, t2: __, t3: __, t4: T4): RightCurriedFunction2; + (t1: T1, t2: T2, t3: T3, t4: __): RightCurriedFunction1; + (t1: T1, t2: T2, t3: __, t4: T4): RightCurriedFunction1; + (t1: T1, t2: __, t3: T3, t4: T4): RightCurriedFunction1; (t1: T1, t2: T2, t3: T3, t4: T4): R; } + interface RightCurriedFunction5 { (): RightCurriedFunction5; (t5: T5): RightCurriedFunction4; + (t4: T4, t5: __): RightCurriedFunction4; (t4: T4, t5: T5): RightCurriedFunction3; + (t3: T3, t4: __, t5: __): RightCurriedFunction4; + (t3: T3, t4: T4, t5: __): RightCurriedFunction3; + (t3: T3, t4: __, t5: T5): RightCurriedFunction3; (t3: T3, t4: T4, t5: T5): RightCurriedFunction2; + (t2: T2, t3: __, t4: __, t5: __): RightCurriedFunction4; + (t2: T2, t3: T3, t4: __, t5: __): RightCurriedFunction3; + (t2: T2, t3: __, t4: T4, t5: __): RightCurriedFunction3; + (t2: T2, t3: __, t4: __, t5: T5): RightCurriedFunction3; + (t2: T2, t3: T3, t4: T4, t5: __): RightCurriedFunction2; + (t2: T2, t3: T3, t4: __, t5: T5): RightCurriedFunction2; + (t2: T2, t3: __, t4: T4, t5: T5): RightCurriedFunction2; (t2: T2, t3: T3, t4: T4, t5: T5): RightCurriedFunction1; + (t1: T1, t2: __, t3: __, t4: __, t5: __): RightCurriedFunction4; + (t1: T1, t2: T2, t3: __, t4: __, t5: __): RightCurriedFunction3; + (t1: T1, t2: __, t3: T3, t4: __, t5: __): RightCurriedFunction3; + (t1: T1, t2: __, t3: __, t4: T4, t5: __): RightCurriedFunction3; + (t1: T1, t2: __, t3: __, t4: __, t5: T5): RightCurriedFunction3; + (t1: T1, t2: T2, t3: T3, t4: __, t5: __): RightCurriedFunction2; + (t1: T1, t2: T2, t3: __, t4: T4, t5: __): RightCurriedFunction2; + (t1: T1, t2: T2, t3: __, t4: __, t5: T5): RightCurriedFunction2; + (t1: T1, t2: __, t3: T3, t4: T4, t5: __): RightCurriedFunction2; + (t1: T1, t2: __, t3: T3, t4: __, t5: T5): RightCurriedFunction2; + (t1: T1, t2: __, t3: __, t4: T4, t5: T5): RightCurriedFunction2; + (t1: T1, t2: T2, t3: T3, t4: T4, t5: __): RightCurriedFunction1; + (t1: T1, t2: T2, t3: T3, t4: __, t5: T5): RightCurriedFunction1; + (t1: T1, t2: T2, t3: __, t4: T4, t5: T5): RightCurriedFunction1; + (t1: T1, t2: __, t3: T3, t4: T4, t5: T5): RightCurriedFunction1; (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; } @@ -398,7 +493,7 @@ declare module "../index" { // curryRight - interface LoDashStatic { + interface CurryRight { /** * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight * instead of _.partial. @@ -406,7 +501,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curryRight(func: (t1: T1) => R, arity?: number): + (func: (t1: T1) => R, arity?: number): RightCurriedFunction1; /** * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight @@ -415,7 +510,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curryRight(func: (t1: T1, t2: T2) => R, arity?: number): + (func: (t1: T1, t2: T2) => R, arity?: number): RightCurriedFunction2; /** * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight @@ -424,7 +519,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curryRight(func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): + (func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): RightCurriedFunction3; /** * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight @@ -433,7 +528,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): + (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): RightCurriedFunction4; /** * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight @@ -442,7 +537,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): + (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): RightCurriedFunction5; /** * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight @@ -451,7 +546,13 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curryRight(func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; + (func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; + + placeholder: __; + } + + interface LoDashStatic { + curryRight: CurryRight; } interface LoDashImplicitWrapper { @@ -828,7 +929,8 @@ declare module "../index" { partial: ExplicitPartial; } - type PH = LoDashStatic; + /** The placeholder, to be used in curried functions */ + type __ = LoDashStatic; type Function0 = () => R; type Function1 = (t1: T1) => R; @@ -845,36 +947,38 @@ declare module "../index" { // arity 2 (func: Function2): Function2; (func: Function2, arg1: T1): Function1< T2, R>; - (func: Function2, plc1: PH, arg2: T2): Function1; + (func: Function2, plc1: __, arg2: T2): Function1; (func: Function2, arg1: T1, arg2: T2): Function0< R>; // arity 3 (func: Function3): Function3; (func: Function3, arg1: T1): Function2< T2, T3, R>; - (func: Function3, plc1: PH, arg2: T2): Function2; + (func: Function3, plc1: __, arg2: T2): Function2; (func: Function3, arg1: T1, arg2: T2): Function1< T3, R>; - (func: Function3, plc1: PH, plc2: PH, arg3: T3): Function2; - (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; - (func: Function3, plc1: PH, arg2: T2, arg3: T3): Function1; + (func: Function3, plc1: __, plc2: __, arg3: T3): Function2; + (func: Function3, arg1: T1, plc2: __, arg3: T3): Function1< T2, R>; + (func: Function3, plc1: __, arg2: T2, arg3: T3): Function1; (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0< R>; // arity 4 (func: Function4): Function4; (func: Function4, arg1: T1): Function3< T2, T3, T4, R>; - (func: Function4, plc1: PH, arg2: T2): Function3; + (func: Function4, plc1: __, arg2: T2): Function3; (func: Function4, arg1: T1, arg2: T2): Function2< T3, T4, R>; - (func: Function4, plc1: PH, plc2: PH, arg3: T3): Function3; - (func: Function4, arg1: T1, plc2: PH, arg3: T3): Function2< T2, T4, R>; - (func: Function4, plc1: PH, arg2: T2, arg3: T3): Function2; + (func: Function4, plc1: __, plc2: __, arg3: T3): Function3; + (func: Function4, arg1: T1, plc2: __, arg3: T3): Function2< T2, T4, R>; + (func: Function4, plc1: __, arg2: T2, arg3: T3): Function2; (func: Function4, arg1: T1, arg2: T2, arg3: T3): Function1< T4, R>; - (func: Function4, plc1: PH, plc2: PH, plc3: PH, arg4: T4): Function3; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; - (func: Function4, plc1: PH, arg2: T2, plc3: PH, arg4: T4): Function2; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; - (func: Function4, plc1: PH, plc2: PH, arg3: T3, arg4: T4): Function2; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; - (func: Function4, plc1: PH, arg2: T2, arg3: T3, arg4: T4): Function1; + (func: Function4, plc1: __, plc2: __, plc3: __, arg4: T4): Function3; + (func: Function4, arg1: T1, plc2: __, plc3: __, arg4: T4): Function2< T2, T3, R>; + (func: Function4, plc1: __, arg2: T2, plc3: __, arg4: T4): Function2; + (func: Function4, arg1: T1, arg2: T2, plc3: __, arg4: T4): Function1< T3, R>; + (func: Function4, plc1: __, plc2: __, arg3: T3, arg4: T4): Function2; + (func: Function4, arg1: T1, plc2: __, arg3: T3, arg4: T4): Function1< T2, R>; + (func: Function4, plc1: __, arg2: T2, arg3: T3, arg4: T4): Function1; (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; // catch-all (func: (...args: any[]) => any, ...args: any[]): (...args: any[]) => any; + + placeholder: __; } interface ImplicitPartial { @@ -886,33 +990,33 @@ declare module "../index" { // arity 2 (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, arg2: T2): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; // arity 3 (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, arg2: T2): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, plc2: __, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, arg2: T2, arg3: T3): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; // arity 4 (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, arg2: T2): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, plc2: __, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, arg2: T2, arg3: T3): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, plc2: __, plc3: __, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, plc3: __, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, arg2: T2, plc3: __, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: __, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, plc2: __, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; // catch-all (...args: any[]): LoDashImplicitWrapper<(...args: any[]) => any>; @@ -927,33 +1031,33 @@ declare module "../index" { // arity 2 (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, arg2: T2): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; // arity 3 (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, arg2: T2): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, plc2: __, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, arg2: T2, arg3: T3): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; // arity 4 (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, arg2: T2): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, plc2: __, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, arg2: T2, arg3: T3): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, plc2: __, plc3: __, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, plc3: __, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, arg2: T2, plc3: __, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: __, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, plc2: __, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; // catch-all (...args: any[]): LoDashExplicitWrapper<(...args: any[]) => any>; @@ -994,37 +1098,39 @@ declare module "../index" { (func: Function1, arg1: T1): Function0; // arity 2 (func: Function2): Function2; - (func: Function2, arg1: T1, plc2: PH): Function1< T2, R>; + (func: Function2, arg1: T1, plc2: __): Function1< T2, R>; (func: Function2, arg2: T2): Function1; (func: Function2, arg1: T1, arg2: T2): Function0< R>; // arity 3 (func: Function3): Function3; - (func: Function3, arg1: T1, plc2: PH, plc3: PH): Function2< T2, T3, R>; - (func: Function3, arg2: T2, plc3: PH): Function2; - (func: Function3, arg1: T1, arg2: T2, plc3: PH): Function1< T3, R>; + (func: Function3, arg1: T1, plc2: __, plc3: __): Function2< T2, T3, R>; + (func: Function3, arg2: T2, plc3: __): Function2; + (func: Function3, arg1: T1, arg2: T2, plc3: __): Function1< T3, R>; (func: Function3, arg3: T3): Function2; - (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; + (func: Function3, arg1: T1, plc2: __, arg3: T3): Function1< T2, R>; (func: Function3, arg2: T2, arg3: T3): Function1; (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0< R>; // arity 4 (func: Function4): Function4; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, plc4: PH): Function3< T2, T3, T4, R>; - (func: Function4, arg2: T2, plc3: PH, plc4: PH): Function3; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, plc4: PH): Function2< T3, T4, R>; - (func: Function4, arg3: T3, plc4: PH): Function3; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, plc4: PH): Function2< T2, T4, R>; - (func: Function4, arg2: T2, arg3: T3, plc4: PH): Function2; - (func: Function4, arg1: T1, arg2: T2, arg3: T3, plc4: PH): Function1< T4, R>; + (func: Function4, arg1: T1, plc2: __, plc3: __, plc4: __): Function3< T2, T3, T4, R>; + (func: Function4, arg2: T2, plc3: __, plc4: __): Function3; + (func: Function4, arg1: T1, arg2: T2, plc3: __, plc4: __): Function2< T3, T4, R>; + (func: Function4, arg3: T3, plc4: __): Function3; + (func: Function4, arg1: T1, plc2: __, arg3: T3, plc4: __): Function2< T2, T4, R>; + (func: Function4, arg2: T2, arg3: T3, plc4: __): Function2; + (func: Function4, arg1: T1, arg2: T2, arg3: T3, plc4: __): Function1< T4, R>; (func: Function4, arg4: T4): Function3; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; - (func: Function4, arg2: T2, plc3: PH, arg4: T4): Function2; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; + (func: Function4, arg1: T1, plc2: __, plc3: __, arg4: T4): Function2< T2, T3, R>; + (func: Function4, arg2: T2, plc3: __, arg4: T4): Function2; + (func: Function4, arg1: T1, arg2: T2, plc3: __, arg4: T4): Function1< T3, R>; (func: Function4, arg3: T3, arg4: T4): Function2; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; + (func: Function4, arg1: T1, plc2: __, arg3: T3, arg4: T4): Function1< T2, R>; (func: Function4, arg2: T2, arg3: T3, arg4: T4): Function1; (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; // catch-all (func: (...args: any[]) => any, ...args: any[]): (...args: any[]) => any; + + placeholder: __; } interface ImplicitPartialRight { @@ -1035,33 +1141,33 @@ declare module "../index" { (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; // arity 2 (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg2: T2): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; // arity 3 (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, plc3: __): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, plc3: __): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: __): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, arg3: T3): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; // arity 4 (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg3: T3, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, plc4: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, plc3: __, plc4: __): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, plc3: __, plc4: __): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: __, plc4: __): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg3: T3, plc4: __): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, arg3: T3, plc4: __): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3, plc4: __): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, plc4: __): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, plc3: __, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, plc3: __, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: __, arg4: T4): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, arg3: T3, arg4: T4): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; // catch-all @@ -1076,33 +1182,33 @@ declare module "../index" { (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; // arity 2 (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg2: T2): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; // arity 3 (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, plc3: __): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, plc3: __): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: __): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, arg3: T3): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; // arity 4 (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg3: T3, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, plc4: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, plc3: __, plc4: __): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, plc3: __, plc4: __): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: __, plc4: __): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg3: T3, plc4: __): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, arg3: T3, plc4: __): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3, plc4: __): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, plc4: __): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, plc3: __, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, plc3: __, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: __, arg4: T4): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, arg3: T3, arg4: T4): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; // catch-all diff --git a/types/lodash/common/object.d.ts b/types/lodash/common/object.d.ts index 4bedba42ae..4845e7f31b 100644 --- a/types/lodash/common/object.d.ts +++ b/types/lodash/common/object.d.ts @@ -3217,7 +3217,7 @@ declare module "../index" { * @param object The object to modify. * @param path The path of the property to set. * @param value The value to set. - * @parem customizer The function to customize assigned values. + * @param customizer The function to customize assigned values. * @return Returns object. */ setWith( diff --git a/types/lodash/common/util.d.ts b/types/lodash/common/util.d.ts index 69fbc42cc0..8aad451ca1 100644 --- a/types/lodash/common/util.d.ts +++ b/types/lodash/common/util.d.ts @@ -1207,14 +1207,14 @@ declare module "../index" { * @param context The context object. * @return Returns a new lodash function. */ - runInContext(context?: object): typeof _; + runInContext(context?: object): LoDashStatic; } interface LoDashImplicitWrapper { /** * @see _.runInContext */ - runInContext(): typeof _; + runInContext(): LoDashStatic; } // stubArray diff --git a/types/lodash/fp.d.ts b/types/lodash/fp.d.ts index 783a56a98f..725ee237aa 100644 --- a/types/lodash/fp.d.ts +++ b/types/lodash/fp.d.ts @@ -2,789 +2,4512 @@ // If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: // npm run fp -import add = require("./fp/add"); -import after = require("./fp/after"); -import all = require("./fp/all"); -import allPass = require("./fp/allPass"); -import always = require("./fp/always"); -import any = require("./fp/any"); -import anyPass = require("./fp/anyPass"); -import apply = require("./fp/apply"); -import ary = require("./fp/ary"); -import assign = require("./fp/assign"); -import assignAll = require("./fp/assignAll"); -import assignAllWith = require("./fp/assignAllWith"); -import assignIn = require("./fp/assignIn"); -import assignInAll = require("./fp/assignInAll"); -import assignInAllWith = require("./fp/assignInAllWith"); -import assignInWith = require("./fp/assignInWith"); -import assignWith = require("./fp/assignWith"); -import assoc = require("./fp/assoc"); -import assocPath = require("./fp/assocPath"); -import at = require("./fp/at"); -import attempt = require("./fp/attempt"); -import before = require("./fp/before"); -import bind = require("./fp/bind"); -import bindAll = require("./fp/bindAll"); -import bindKey = require("./fp/bindKey"); -import camelCase = require("./fp/camelCase"); -import capitalize = require("./fp/capitalize"); -import castArray = require("./fp/castArray"); -import ceil = require("./fp/ceil"); -import chunk = require("./fp/chunk"); -import clamp = require("./fp/clamp"); -import clone = require("./fp/clone"); -import cloneDeep = require("./fp/cloneDeep"); -import cloneDeepWith = require("./fp/cloneDeepWith"); -import cloneWith = require("./fp/cloneWith"); -import compact = require("./fp/compact"); -import complement = require("./fp/complement"); -import compose = require("./fp/compose"); -import concat = require("./fp/concat"); -import cond = require("./fp/cond"); -import conforms = require("./fp/conforms"); -import conformsTo = require("./fp/conformsTo"); -import constant = require("./fp/constant"); -import contains = require("./fp/contains"); -import countBy = require("./fp/countBy"); -import create = require("./fp/create"); -import curry = require("./fp/curry"); -import curryN = require("./fp/curryN"); -import curryRight = require("./fp/curryRight"); -import curryRightN = require("./fp/curryRightN"); -import debounce = require("./fp/debounce"); -import deburr = require("./fp/deburr"); -import defaults = require("./fp/defaults"); -import defaultsAll = require("./fp/defaultsAll"); -import defaultsDeep = require("./fp/defaultsDeep"); -import defaultsDeepAll = require("./fp/defaultsDeepAll"); -import defaultTo = require("./fp/defaultTo"); -import defer = require("./fp/defer"); -import delay = require("./fp/delay"); -import difference = require("./fp/difference"); -import differenceBy = require("./fp/differenceBy"); -import differenceWith = require("./fp/differenceWith"); -import dissoc = require("./fp/dissoc"); -import dissocPath = require("./fp/dissocPath"); -import divide = require("./fp/divide"); -import drop = require("./fp/drop"); -import dropLast = require("./fp/dropLast"); -import dropLastWhile = require("./fp/dropLastWhile"); -import dropRight = require("./fp/dropRight"); -import dropRightWhile = require("./fp/dropRightWhile"); -import dropWhile = require("./fp/dropWhile"); -import each = require("./fp/each"); -import eachRight = require("./fp/eachRight"); -import endsWith = require("./fp/endsWith"); -import entries = require("./fp/entries"); -import entriesIn = require("./fp/entriesIn"); -import eq = require("./fp/eq"); -import equals = require("./fp/equals"); -import escape = require("./fp/escape"); -import escapeRegExp = require("./fp/escapeRegExp"); -import every = require("./fp/every"); -import extend = require("./fp/extend"); -import extendAll = require("./fp/extendAll"); -import extendAllWith = require("./fp/extendAllWith"); -import extendWith = require("./fp/extendWith"); -import F = require("./fp/F"); -import fill = require("./fp/fill"); -import filter = require("./fp/filter"); -import find = require("./fp/find"); -import findFrom = require("./fp/findFrom"); -import findIndex = require("./fp/findIndex"); -import findIndexFrom = require("./fp/findIndexFrom"); -import findKey = require("./fp/findKey"); -import findLast = require("./fp/findLast"); -import findLastFrom = require("./fp/findLastFrom"); -import findLastIndex = require("./fp/findLastIndex"); -import findLastIndexFrom = require("./fp/findLastIndexFrom"); -import findLastKey = require("./fp/findLastKey"); -import first = require("./fp/first"); -import flatMap = require("./fp/flatMap"); -import flatMapDeep = require("./fp/flatMapDeep"); -import flatMapDepth = require("./fp/flatMapDepth"); -import flatten = require("./fp/flatten"); -import flattenDeep = require("./fp/flattenDeep"); -import flattenDepth = require("./fp/flattenDepth"); -import flip = require("./fp/flip"); -import floor = require("./fp/floor"); -import flow = require("./fp/flow"); -import flowRight = require("./fp/flowRight"); -import forEach = require("./fp/forEach"); -import forEachRight = require("./fp/forEachRight"); -import forIn = require("./fp/forIn"); -import forInRight = require("./fp/forInRight"); -import forOwn = require("./fp/forOwn"); -import forOwnRight = require("./fp/forOwnRight"); -import fromPairs = require("./fp/fromPairs"); -import functions = require("./fp/functions"); -import functionsIn = require("./fp/functionsIn"); -import get = require("./fp/get"); -import getOr = require("./fp/getOr"); -import groupBy = require("./fp/groupBy"); -import gt = require("./fp/gt"); -import gte = require("./fp/gte"); -import has = require("./fp/has"); -import hasIn = require("./fp/hasIn"); -import head = require("./fp/head"); -import identical = require("./fp/identical"); -import identity = require("./fp/identity"); -import includes = require("./fp/includes"); -import includesFrom = require("./fp/includesFrom"); -import indexBy = require("./fp/indexBy"); -import indexOf = require("./fp/indexOf"); -import indexOfFrom = require("./fp/indexOfFrom"); -import init = require("./fp/init"); -import initial = require("./fp/initial"); -import inRange = require("./fp/inRange"); -import intersection = require("./fp/intersection"); -import intersectionBy = require("./fp/intersectionBy"); -import intersectionWith = require("./fp/intersectionWith"); -import invert = require("./fp/invert"); -import invertBy = require("./fp/invertBy"); -import invertObj = require("./fp/invertObj"); -import invoke = require("./fp/invoke"); -import invokeArgs = require("./fp/invokeArgs"); -import invokeArgsMap = require("./fp/invokeArgsMap"); -import invokeMap = require("./fp/invokeMap"); -import isArguments = require("./fp/isArguments"); -import isArray = require("./fp/isArray"); -import isArrayBuffer = require("./fp/isArrayBuffer"); -import isArrayLike = require("./fp/isArrayLike"); -import isArrayLikeObject = require("./fp/isArrayLikeObject"); -import isBoolean = require("./fp/isBoolean"); -import isBuffer = require("./fp/isBuffer"); -import isDate = require("./fp/isDate"); -import isElement = require("./fp/isElement"); -import isEmpty = require("./fp/isEmpty"); -import isEqual = require("./fp/isEqual"); -import isEqualWith = require("./fp/isEqualWith"); -import isError = require("./fp/isError"); -import isFinite = require("./fp/isFinite"); -import isFunction = require("./fp/isFunction"); -import isInteger = require("./fp/isInteger"); -import isLength = require("./fp/isLength"); -import isMap = require("./fp/isMap"); -import isMatch = require("./fp/isMatch"); -import isMatchWith = require("./fp/isMatchWith"); -import isNaN = require("./fp/isNaN"); -import isNative = require("./fp/isNative"); -import isNil = require("./fp/isNil"); -import isNull = require("./fp/isNull"); -import isNumber = require("./fp/isNumber"); -import isObject = require("./fp/isObject"); -import isObjectLike = require("./fp/isObjectLike"); -import isPlainObject = require("./fp/isPlainObject"); -import isRegExp = require("./fp/isRegExp"); -import isSafeInteger = require("./fp/isSafeInteger"); -import isSet = require("./fp/isSet"); -import isString = require("./fp/isString"); -import isSymbol = require("./fp/isSymbol"); -import isTypedArray = require("./fp/isTypedArray"); -import isUndefined = require("./fp/isUndefined"); -import isWeakMap = require("./fp/isWeakMap"); -import isWeakSet = require("./fp/isWeakSet"); -import iteratee = require("./fp/iteratee"); -import join = require("./fp/join"); -import juxt = require("./fp/juxt"); -import kebabCase = require("./fp/kebabCase"); -import keyBy = require("./fp/keyBy"); -import keys = require("./fp/keys"); -import keysIn = require("./fp/keysIn"); -import last = require("./fp/last"); -import lastIndexOf = require("./fp/lastIndexOf"); -import lastIndexOfFrom = require("./fp/lastIndexOfFrom"); -import lowerCase = require("./fp/lowerCase"); -import lowerFirst = require("./fp/lowerFirst"); -import lt = require("./fp/lt"); -import lte = require("./fp/lte"); -import map = require("./fp/map"); -import mapKeys = require("./fp/mapKeys"); -import mapValues = require("./fp/mapValues"); -import matches = require("./fp/matches"); -import matchesProperty = require("./fp/matchesProperty"); -import max = require("./fp/max"); -import maxBy = require("./fp/maxBy"); -import mean = require("./fp/mean"); -import meanBy = require("./fp/meanBy"); -import memoize = require("./fp/memoize"); -import merge = require("./fp/merge"); -import mergeAll = require("./fp/mergeAll"); -import mergeAllWith = require("./fp/mergeAllWith"); -import mergeWith = require("./fp/mergeWith"); -import method = require("./fp/method"); -import methodOf = require("./fp/methodOf"); -import min = require("./fp/min"); -import minBy = require("./fp/minBy"); -import multiply = require("./fp/multiply"); -import nAry = require("./fp/nAry"); -import negate = require("./fp/negate"); -import noConflict = require("./fp/noConflict"); -import noop = require("./fp/noop"); -import now = require("./fp/now"); -import nth = require("./fp/nth"); -import nthArg = require("./fp/nthArg"); -import omit = require("./fp/omit"); -import omitAll = require("./fp/omitAll"); -import omitBy = require("./fp/omitBy"); -import once = require("./fp/once"); -import orderBy = require("./fp/orderBy"); -import over = require("./fp/over"); -import overArgs = require("./fp/overArgs"); -import overEvery = require("./fp/overEvery"); -import overSome = require("./fp/overSome"); -import pad = require("./fp/pad"); -import padChars = require("./fp/padChars"); -import padCharsEnd = require("./fp/padCharsEnd"); -import padCharsStart = require("./fp/padCharsStart"); -import padEnd = require("./fp/padEnd"); -import padStart = require("./fp/padStart"); -import parseInt = require("./fp/parseInt"); -import partial = require("./fp/partial"); -import partialRight = require("./fp/partialRight"); -import partition = require("./fp/partition"); -import path = require("./fp/path"); -import pathEq = require("./fp/pathEq"); -import pathOr = require("./fp/pathOr"); -import paths = require("./fp/paths"); -import pick = require("./fp/pick"); -import pickAll = require("./fp/pickAll"); -import pickBy = require("./fp/pickBy"); -import pipe = require("./fp/pipe"); -import pluck = require("./fp/pluck"); -import prop = require("./fp/prop"); -import propEq = require("./fp/propEq"); -import property = require("./fp/property"); -import propertyOf = require("./fp/propertyOf"); -import propOr = require("./fp/propOr"); -import props = require("./fp/props"); -import pull = require("./fp/pull"); -import pullAll = require("./fp/pullAll"); -import pullAllBy = require("./fp/pullAllBy"); -import pullAllWith = require("./fp/pullAllWith"); -import pullAt = require("./fp/pullAt"); -import random = require("./fp/random"); -import range = require("./fp/range"); -import rangeRight = require("./fp/rangeRight"); -import rangeStep = require("./fp/rangeStep"); -import rangeStepRight = require("./fp/rangeStepRight"); -import rearg = require("./fp/rearg"); -import reduce = require("./fp/reduce"); -import reduceRight = require("./fp/reduceRight"); -import reject = require("./fp/reject"); -import remove = require("./fp/remove"); -import repeat = require("./fp/repeat"); -import replace = require("./fp/replace"); -import rest = require("./fp/rest"); -import restFrom = require("./fp/restFrom"); -import result = require("./fp/result"); -import reverse = require("./fp/reverse"); -import round = require("./fp/round"); -import runInContext = require("./fp/runInContext"); -import sample = require("./fp/sample"); -import sampleSize = require("./fp/sampleSize"); -import set = require("./fp/set"); -import setWith = require("./fp/setWith"); -import shuffle = require("./fp/shuffle"); -import size = require("./fp/size"); -import slice = require("./fp/slice"); -import snakeCase = require("./fp/snakeCase"); -import some = require("./fp/some"); -import sortBy = require("./fp/sortBy"); -import sortedIndex = require("./fp/sortedIndex"); -import sortedIndexBy = require("./fp/sortedIndexBy"); -import sortedIndexOf = require("./fp/sortedIndexOf"); -import sortedLastIndex = require("./fp/sortedLastIndex"); -import sortedLastIndexBy = require("./fp/sortedLastIndexBy"); -import sortedLastIndexOf = require("./fp/sortedLastIndexOf"); -import sortedUniq = require("./fp/sortedUniq"); -import sortedUniqBy = require("./fp/sortedUniqBy"); -import split = require("./fp/split"); -import spread = require("./fp/spread"); -import spreadFrom = require("./fp/spreadFrom"); -import startCase = require("./fp/startCase"); -import startsWith = require("./fp/startsWith"); -import stubArray = require("./fp/stubArray"); -import stubFalse = require("./fp/stubFalse"); -import stubObject = require("./fp/stubObject"); -import stubString = require("./fp/stubString"); -import stubTrue = require("./fp/stubTrue"); -import subtract = require("./fp/subtract"); -import sum = require("./fp/sum"); -import sumBy = require("./fp/sumBy"); -import symmetricDifference = require("./fp/symmetricDifference"); -import symmetricDifferenceBy = require("./fp/symmetricDifferenceBy"); -import symmetricDifferenceWith = require("./fp/symmetricDifferenceWith"); -import T = require("./fp/T"); -import tail = require("./fp/tail"); -import take = require("./fp/take"); -import takeLast = require("./fp/takeLast"); -import takeLastWhile = require("./fp/takeLastWhile"); -import takeRight = require("./fp/takeRight"); -import takeRightWhile = require("./fp/takeRightWhile"); -import takeWhile = require("./fp/takeWhile"); -import tap = require("./fp/tap"); -import template = require("./fp/template"); -import throttle = require("./fp/throttle"); -import thru = require("./fp/thru"); -import times = require("./fp/times"); -import toArray = require("./fp/toArray"); -import toFinite = require("./fp/toFinite"); -import toInteger = require("./fp/toInteger"); -import toLength = require("./fp/toLength"); -import toLower = require("./fp/toLower"); -import toNumber = require("./fp/toNumber"); -import toPairs = require("./fp/toPairs"); -import toPairsIn = require("./fp/toPairsIn"); -import toPath = require("./fp/toPath"); -import toPlainObject = require("./fp/toPlainObject"); -import toSafeInteger = require("./fp/toSafeInteger"); -import toString = require("./fp/toString"); -import toUpper = require("./fp/toUpper"); -import transform = require("./fp/transform"); -import trim = require("./fp/trim"); -import trimChars = require("./fp/trimChars"); -import trimCharsEnd = require("./fp/trimCharsEnd"); -import trimCharsStart = require("./fp/trimCharsStart"); -import trimEnd = require("./fp/trimEnd"); -import trimStart = require("./fp/trimStart"); -import truncate = require("./fp/truncate"); -import unapply = require("./fp/unapply"); -import unary = require("./fp/unary"); -import unescape = require("./fp/unescape"); -import union = require("./fp/union"); -import unionBy = require("./fp/unionBy"); -import unionWith = require("./fp/unionWith"); -import uniq = require("./fp/uniq"); -import uniqBy = require("./fp/uniqBy"); -import uniqueId = require("./fp/uniqueId"); -import uniqWith = require("./fp/uniqWith"); -import unnest = require("./fp/unnest"); -import unset = require("./fp/unset"); -import unzip = require("./fp/unzip"); -import unzipWith = require("./fp/unzipWith"); -import update = require("./fp/update"); -import updateWith = require("./fp/updateWith"); -import upperCase = require("./fp/upperCase"); -import upperFirst = require("./fp/upperFirst"); -import useWith = require("./fp/useWith"); -import values = require("./fp/values"); -import valuesIn = require("./fp/valuesIn"); -import where = require("./fp/where"); -import whereEq = require("./fp/whereEq"); -import without = require("./fp/without"); -import words = require("./fp/words"); -import wrap = require("./fp/wrap"); -import xor = require("./fp/xor"); -import xorBy = require("./fp/xorBy"); -import xorWith = require("./fp/xorWith"); -import zip = require("./fp/zip"); -import zipAll = require("./fp/zipAll"); -import zipObj = require("./fp/zipObj"); -import zipObject = require("./fp/zipObject"); -import zipObjectDeep = require("./fp/zipObjectDeep"); -import zipWith = require("./fp/zipWith"); +import lodash = require("./index"); export = _; declare const _: _.LoDashFp; declare namespace _ { + interface LodashAdd { + (augend: number): LodashAdd1x1; + (augend: lodash.__, addend: number): LodashAdd1x2; + (augend: number, addend: number): number; + } + type LodashAdd1x1 = (addend: number) => number; + type LodashAdd1x2 = (augend: number) => number; + interface LodashAfter { + any>(func: TFunc): LodashAfter1x1; + (func: lodash.__, n: number): LodashAfter1x2; + any>(func: TFunc, n: number): TFunc; + } + type LodashAfter1x1 = (n: number) => TFunc; + type LodashAfter1x2 = any>(func: TFunc) => TFunc; + interface LodashEvery { + (predicate: lodash.ValueIterateeCustom): LodashEvery1x1; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashEvery1x2; + (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): boolean; + (predicate: lodash.__, collection: T | null | undefined): LodashEvery2x2; + (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): boolean; + } + type LodashEvery1x1 = (collection: lodash.List | object | null | undefined) => boolean; + type LodashEvery1x2 = (predicate: lodash.ValueIterateeCustom) => boolean; + type LodashEvery2x2 = (predicate: lodash.ValueIterateeCustom) => boolean; + type LodashOverEvery = (predicates: lodash.Many<(...args: T[]) => boolean>) => (...args: T[]) => boolean; + type LodashConstant = (value: T) => () => T; + interface LodashSome { + (predicate: lodash.ValueIterateeCustom): LodashSome1x1; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashSome1x2; + (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): boolean; + (predicate: lodash.__, collection: T | null | undefined): LodashSome2x2; + (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): boolean; + } + type LodashSome1x1 = (collection: lodash.List | object | null | undefined) => boolean; + type LodashSome1x2 = (predicate: lodash.ValueIterateeCustom) => boolean; + type LodashSome2x2 = (predicate: lodash.ValueIterateeCustom) => boolean; + type LodashOverSome = (predicates: lodash.Many<(...args: T[]) => boolean>) => (...args: T[]) => boolean; + type LodashApply = (func: (...args: any[]) => TResult) => (...args: any[]) => TResult; + interface LodashAry { + (n: number): LodashAry1x1; + (n: lodash.__, func: (...args: any[]) => any): LodashAry1x2; + (n: number, func: (...args: any[]) => any): (...args: any[]) => any; + } + type LodashAry1x1 = (func: (...args: any[]) => any) => (...args: any[]) => any; + type LodashAry1x2 = (n: number) => (...args: any[]) => any; + interface LodashAssign { + (object: TObject): LodashAssign1x1; + (object: lodash.__, source: TSource): LodashAssign1x2; + (object: TObject, source: TSource): TObject & TSource; + } + type LodashAssign1x1 = (source: TSource) => TObject & TSource; + type LodashAssign1x2 = (object: TObject) => TObject & TSource; + type LodashAssignAll = (object: ReadonlyArray) => any; + interface LodashAssignAllWith { + (customizer: lodash.AssignCustomizer): LodashAssignAllWith1x1; + (customizer: lodash.__, args: ReadonlyArray): LodashAssignAllWith1x2; + (customizer: lodash.AssignCustomizer, args: ReadonlyArray): any; + } + type LodashAssignAllWith1x1 = (args: ReadonlyArray) => any; + type LodashAssignAllWith1x2 = (customizer: lodash.AssignCustomizer) => any; + interface LodashAssignIn { + (object: TObject): LodashAssignIn1x1; + (object: lodash.__, source: TSource): LodashAssignIn1x2; + (object: TObject, source: TSource): TObject & TSource; + } + type LodashAssignIn1x1 = (source: TSource) => TObject & TSource; + type LodashAssignIn1x2 = (object: TObject) => TObject & TSource; + type LodashAssignInAll = (object: ReadonlyArray) => TResult; + interface LodashAssignInAllWith { + (customizer: lodash.AssignCustomizer): LodashAssignInAllWith1x1; + (customizer: lodash.__, args: ReadonlyArray): LodashAssignInAllWith1x2; + (customizer: lodash.AssignCustomizer, args: ReadonlyArray): any; + } + type LodashAssignInAllWith1x1 = (args: ReadonlyArray) => any; + type LodashAssignInAllWith1x2 = (customizer: lodash.AssignCustomizer) => any; + interface LodashAssignInWith { + (customizer: lodash.AssignCustomizer): LodashAssignInWith1x1; + (customizer: lodash.__, object: TObject): LodashAssignInWith1x2; + (customizer: lodash.AssignCustomizer, object: TObject): LodashAssignInWith1x3; + (customizer: lodash.__, object: lodash.__, source: TSource): LodashAssignInWith1x4; + (customizer: lodash.AssignCustomizer, object: lodash.__, source: TSource): LodashAssignInWith1x5; + (customizer: lodash.__, object: TObject, source: TSource): LodashAssignInWith1x6; + (customizer: lodash.AssignCustomizer, object: TObject, source: TSource): TObject & TSource; + } + interface LodashAssignInWith1x1 { + (object: TObject): LodashAssignInWith1x3; + (object: lodash.__, source: TSource): LodashAssignInWith1x5; + (object: TObject, source: TSource): TObject & TSource; + } + interface LodashAssignInWith1x2 { + (customizer: lodash.AssignCustomizer): LodashAssignInWith1x3; + (customizer: lodash.__, source: TSource): LodashAssignInWith1x6; + (customizer: lodash.AssignCustomizer, source: TSource): TObject & TSource; + } + type LodashAssignInWith1x3 = (source: TSource) => TObject & TSource; + interface LodashAssignInWith1x4 { + (customizer: lodash.AssignCustomizer): LodashAssignInWith1x5; + (customizer: lodash.__, object: TObject): LodashAssignInWith1x6; + (customizer: lodash.AssignCustomizer, object: TObject): TObject & TSource; + } + type LodashAssignInWith1x5 = (object: TObject) => TObject & TSource; + type LodashAssignInWith1x6 = (customizer: lodash.AssignCustomizer) => TObject & TSource; + interface LodashAssignWith { + (customizer: lodash.AssignCustomizer): LodashAssignWith1x1; + (customizer: lodash.__, object: TObject): LodashAssignWith1x2; + (customizer: lodash.AssignCustomizer, object: TObject): LodashAssignWith1x3; + (customizer: lodash.__, object: lodash.__, source: TSource): LodashAssignWith1x4; + (customizer: lodash.AssignCustomizer, object: lodash.__, source: TSource): LodashAssignWith1x5; + (customizer: lodash.__, object: TObject, source: TSource): LodashAssignWith1x6; + (customizer: lodash.AssignCustomizer, object: TObject, source: TSource): TObject & TSource; + } + interface LodashAssignWith1x1 { + (object: TObject): LodashAssignWith1x3; + (object: lodash.__, source: TSource): LodashAssignWith1x5; + (object: TObject, source: TSource): TObject & TSource; + } + interface LodashAssignWith1x2 { + (customizer: lodash.AssignCustomizer): LodashAssignWith1x3; + (customizer: lodash.__, source: TSource): LodashAssignWith1x6; + (customizer: lodash.AssignCustomizer, source: TSource): TObject & TSource; + } + type LodashAssignWith1x3 = (source: TSource) => TObject & TSource; + interface LodashAssignWith1x4 { + (customizer: lodash.AssignCustomizer): LodashAssignWith1x5; + (customizer: lodash.__, object: TObject): LodashAssignWith1x6; + (customizer: lodash.AssignCustomizer, object: TObject): TObject & TSource; + } + type LodashAssignWith1x5 = (object: TObject) => TObject & TSource; + type LodashAssignWith1x6 = (customizer: lodash.AssignCustomizer) => TObject & TSource; + interface LodashSet { + (path: lodash.PropertyPath): LodashSet1x1; + (path: lodash.__, value: any): LodashSet1x2; + (path: lodash.PropertyPath, value: any): LodashSet1x3; + (path: lodash.__, value: lodash.__, object: T): LodashSet1x4; + (path: lodash.PropertyPath, value: lodash.__, object: T): LodashSet1x5; + (path: lodash.__, value: any, object: T): LodashSet1x6; + (path: lodash.PropertyPath, value: any, object: T): T; + (path: lodash.__, value: lodash.__, object: object): LodashSet2x4; + (path: lodash.PropertyPath, value: lodash.__, object: object): LodashSet2x5; + (path: lodash.__, value: any, object: object): LodashSet2x6; + (path: lodash.PropertyPath, value: any, object: object): TResult; + } + interface LodashSet1x1 { + (value: any): LodashSet1x3; + (value: lodash.__, object: T): LodashSet1x5; + (value: any, object: T): T; + (value: lodash.__, object: object): LodashSet2x5; + (value: any, object: object): TResult; + } + interface LodashSet1x2 { + (path: lodash.PropertyPath): LodashSet1x3; + (path: lodash.__, object: T): LodashSet1x6; + (path: lodash.PropertyPath, object: T): T; + (path: lodash.__, object: object): LodashSet2x6; + (path: lodash.PropertyPath, object: object): TResult; + } + interface LodashSet1x3 { + (object: T): T; + (object: object): TResult; + } + interface LodashSet1x4 { + (path: lodash.PropertyPath): LodashSet1x5; + (path: lodash.__, value: any): LodashSet1x6; + (path: lodash.PropertyPath, value: any): T; + } + type LodashSet1x5 = (value: any) => T; + type LodashSet1x6 = (path: lodash.PropertyPath) => T; + interface LodashSet2x4 { + (path: lodash.PropertyPath): LodashSet2x5; + (path: lodash.__, value: any): LodashSet2x6; + (path: lodash.PropertyPath, value: any): TResult; + } + type LodashSet2x5 = (value: any) => TResult; + type LodashSet2x6 = (path: lodash.PropertyPath) => TResult; + interface LodashAt { + (props: lodash.PropertyPath): LodashAt1x1; + (props: lodash.__, object: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashAt1x2; + (props: lodash.PropertyPath, object: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): T[]; + (props: lodash.Many): LodashAt2x1; + (props: lodash.__, object: T | null | undefined): LodashAt2x2; + (props: lodash.Many, object: T | null | undefined): Array; + } + type LodashAt1x1 = (object: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined) => T[]; + type LodashAt1x2 = (props: lodash.PropertyPath) => T[]; + type LodashAt2x1 = (object: T | null | undefined) => Array; + type LodashAt2x2 = (props: lodash.Many) => Array; + type LodashAttempt = (func: (...args: any[]) => TResult) => TResult|Error; + interface LodashBefore { + any>(func: TFunc): LodashBefore1x1; + (func: lodash.__, n: number): LodashBefore1x2; + any>(func: TFunc, n: number): TFunc; + } + type LodashBefore1x1 = (n: number) => TFunc; + type LodashBefore1x2 = any>(func: TFunc) => TFunc; + interface LodashBind { + (func: (...args: any[]) => any): LodashBind1x1; + (func: lodash.__, thisArg: any): LodashBind1x2; + (func: (...args: any[]) => any, thisArg: any): (...args: any[]) => any; + placeholder: lodash.__; + } + type LodashBind1x1 = (thisArg: any) => (...args: any[]) => any; + type LodashBind1x2 = (func: (...args: any[]) => any) => (...args: any[]) => any; + interface LodashBindAll { + (methodNames: lodash.Many): LodashBindAll1x1; + (methodNames: lodash.__, object: T): LodashBindAll1x2; + (methodNames: lodash.Many, object: T): T; + } + type LodashBindAll1x1 = (object: T) => T; + type LodashBindAll1x2 = (methodNames: lodash.Many) => T; + interface LodashBindKey { + (object: object): LodashBindKey1x1; + (object: lodash.__, key: string): LodashBindKey1x2; + (object: object, key: string): (...args: any[]) => any; + placeholder: lodash.__; + } + type LodashBindKey1x1 = (key: string) => (...args: any[]) => any; + type LodashBindKey1x2 = (object: object) => (...args: any[]) => any; + type LodashCamelCase = (string: string) => string; + type LodashCapitalize = (string: string) => string; + type LodashCastArray = (value: lodash.Many) => T[]; + type LodashCeil = (n: number) => number; + interface LodashChunk { + (size: number): LodashChunk1x1; + (size: lodash.__, array: lodash.List | null | undefined): LodashChunk1x2; + (size: number, array: lodash.List | null | undefined): T[][]; + } + type LodashChunk1x1 = (array: lodash.List | null | undefined) => T[][]; + type LodashChunk1x2 = (size: number) => T[][]; + interface LodashClamp { + (lower: number): LodashClamp1x1; + (lower: lodash.__, upper: number): LodashClamp1x2; + (lower: number, upper: number): LodashClamp1x3; + (lower: lodash.__, upper: lodash.__, number: number): LodashClamp1x4; + (lower: number, upper: lodash.__, number: number): LodashClamp1x5; + (lower: lodash.__, upper: number, number: number): LodashClamp1x6; + (lower: number, upper: number, number: number): number; + } + interface LodashClamp1x1 { + (upper: number): LodashClamp1x3; + (upper: lodash.__, number: number): LodashClamp1x5; + (upper: number, number: number): number; + } + interface LodashClamp1x2 { + (lower: number): LodashClamp1x3; + (lower: lodash.__, number: number): LodashClamp1x6; + (lower: number, number: number): number; + } + type LodashClamp1x3 = (number: number) => number; + interface LodashClamp1x4 { + (lower: number): LodashClamp1x5; + (lower: lodash.__, upper: number): LodashClamp1x6; + (lower: number, upper: number): number; + } + type LodashClamp1x5 = (upper: number) => number; + type LodashClamp1x6 = (lower: number) => number; + type LodashClone = (value: T) => T; + type LodashCloneDeep = (value: T) => T; + interface LodashCloneDeepWith { + (customizer: lodash.CloneDeepWithCustomizer): LodashCloneDeepWith1x1; + (customizer: lodash.__, value: T): LodashCloneDeepWith1x2; + (customizer: lodash.CloneDeepWithCustomizer, value: T): any; + } + type LodashCloneDeepWith1x1 = (value: T) => any; + type LodashCloneDeepWith1x2 = (customizer: lodash.CloneDeepWithCustomizer) => any; + interface LodashCloneWith { + (customizer: lodash.CloneWithCustomizer): LodashCloneWith1x1; + (customizer: lodash.__, value: T): LodashCloneWith1x2; + (customizer: lodash.CloneWithCustomizer, value: T): TResult; + (customizer: lodash.CloneWithCustomizer): LodashCloneWith2x1; + (customizer: lodash.CloneWithCustomizer, value: T): TResult | T; + } + type LodashCloneWith1x1 = (value: T) => TResult; + interface LodashCloneWith1x2 { + (customizer: lodash.CloneWithCustomizer): TResult; + (customizer: lodash.CloneWithCustomizer): TResult | T; + } + type LodashCloneWith2x1 = (value: T) => TResult | T; + type LodashCompact = (array: lodash.List | null | undefined) => T[]; + type LodashNegate = any>(predicate: T) => T; + interface LodashFlowRight { + (f2: (a: R1) => R2, f1: () => R1): () => R2; + (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R3; + (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R4; + (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R5; + (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R6; + (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R7; + (f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R2; + (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R3; + (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R4; + (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R5; + (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R6; + (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R7; + (f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R2; + (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R3; + (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R4; + (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R5; + (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R6; + (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R7; + (f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R2; + (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R3; + (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R4; + (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R5; + (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R6; + (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R7; + (f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; + (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; + (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; + (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; + (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; + (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; + (f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R2; + (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R3; + (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R4; + (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R5; + (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R6; + (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R7; + (f7: (a: any) => any, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array any>>): (...args: any[]) => any; + (funcs: Array any>>): (...args: any[]) => any; + } + interface LodashConcat { + (array: lodash.Many): LodashConcat1x1; + (array: lodash.__, values: lodash.Many): LodashConcat1x2; + (array: lodash.Many, values: lodash.Many): T[]; + } + type LodashConcat1x1 = (values: lodash.Many) => T[]; + type LodashConcat1x2 = (array: lodash.Many) => T[]; + type LodashCond = (pairs: Array>) => (Target: T) => R; + interface LodashConformsTo { + (source: lodash.ConformsPredicateObject): LodashConformsTo1x1; + (source: lodash.__, object: T): LodashConformsTo1x2; + (source: lodash.ConformsPredicateObject, object: T): boolean; + } + type LodashConformsTo1x1 = (object: T) => boolean; + type LodashConformsTo1x2 = (source: lodash.ConformsPredicateObject) => boolean; + interface LodashContains { + (target: T): LodashContains1x1; + (target: lodash.__, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashContains1x2; + (target: T, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): boolean; + } + type LodashContains1x1 = (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined) => boolean; + type LodashContains1x2 = (target: T) => boolean; + interface LodashCountBy { + (iteratee: (value: string) => T): LodashCountBy1x1; + (iteratee: lodash.__, collection: string | null | undefined): LodashCountBy1x2; + (iteratee: (value: string) => T, collection: string | null | undefined): lodash.Dictionary; + (iteratee: lodash.ValueIteratee): LodashCountBy2x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashCountBy2x2; + (iteratee: lodash.ValueIteratee, collection: lodash.List | null | undefined): lodash.Dictionary; + (iteratee: lodash.__, collection: T | null | undefined): LodashCountBy3x2; + (iteratee: lodash.ValueIteratee, collection: T | null | undefined): lodash.Dictionary; + } + type LodashCountBy1x1 = (collection: string | null | undefined) => lodash.Dictionary; + type LodashCountBy1x2 = (iteratee: (value: string) => T) => lodash.Dictionary; + type LodashCountBy2x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; + type LodashCountBy2x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; + type LodashCountBy3x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; + type LodashCreate = (prototype: T) => T & U; + interface LodashCurry { + (func: (t1: T1) => R): lodash.CurriedFunction1; + (func: (t1: T1, t2: T2) => R): lodash.CurriedFunction2; + (func: (t1: T1, t2: T2, t3: T3) => R): lodash.CurriedFunction3; + (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): lodash.CurriedFunction4; + (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): lodash.CurriedFunction5; + (func: (...args: any[]) => any): (...args: any[]) => any; + placeholder: lodash.__; + } + interface LodashCurryN { + (arity: number): LodashCurryN1x1; + (arity: lodash.__, func: (t1: T1) => R): LodashCurryN1x2; + (arity: number, func: (t1: T1) => R): lodash.CurriedFunction1; + (arity: lodash.__, func: (t1: T1, t2: T2) => R): LodashCurryN2x2; + (arity: number, func: (t1: T1, t2: T2) => R): lodash.CurriedFunction2; + (arity: lodash.__, func: (t1: T1, t2: T2, t3: T3) => R): LodashCurryN3x2; + (arity: number, func: (t1: T1, t2: T2, t3: T3) => R): lodash.CurriedFunction3; + (arity: lodash.__, func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): LodashCurryN4x2; + (arity: number, func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): lodash.CurriedFunction4; + (arity: lodash.__, func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): LodashCurryN5x2; + (arity: number, func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): lodash.CurriedFunction5; + (arity: lodash.__, func: (...args: any[]) => any): LodashCurryN6x2; + (arity: number, func: (...args: any[]) => any): (...args: any[]) => any; + placeholder: lodash.__; + } + interface LodashCurryN1x1 { + (func: (t1: T1) => R): lodash.CurriedFunction1; + (func: (t1: T1, t2: T2) => R): lodash.CurriedFunction2; + (func: (t1: T1, t2: T2, t3: T3) => R): lodash.CurriedFunction3; + (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): lodash.CurriedFunction4; + (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): lodash.CurriedFunction5; + (func: (...args: any[]) => any): (...args: any[]) => any; + } + type LodashCurryN1x2 = (arity: number) => lodash.CurriedFunction1; + type LodashCurryN2x2 = (arity: number) => lodash.CurriedFunction2; + type LodashCurryN3x2 = (arity: number) => lodash.CurriedFunction3; + type LodashCurryN4x2 = (arity: number) => lodash.CurriedFunction4; + type LodashCurryN5x2 = (arity: number) => lodash.CurriedFunction5; + type LodashCurryN6x2 = (arity: number) => (...args: any[]) => any; + interface LodashCurryRight { + (func: (t1: T1) => R): lodash.RightCurriedFunction1; + (func: (t1: T1, t2: T2) => R): lodash.RightCurriedFunction2; + (func: (t1: T1, t2: T2, t3: T3) => R): lodash.RightCurriedFunction3; + (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): lodash.RightCurriedFunction4; + (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): lodash.RightCurriedFunction5; + (func: (...args: any[]) => any): (...args: any[]) => any; + placeholder: lodash.__; + } + interface LodashCurryRightN { + (arity: number): LodashCurryRightN1x1; + (arity: lodash.__, func: (t1: T1) => R): LodashCurryRightN1x2; + (arity: number, func: (t1: T1) => R): lodash.RightCurriedFunction1; + (arity: lodash.__, func: (t1: T1, t2: T2) => R): LodashCurryRightN2x2; + (arity: number, func: (t1: T1, t2: T2) => R): lodash.RightCurriedFunction2; + (arity: lodash.__, func: (t1: T1, t2: T2, t3: T3) => R): LodashCurryRightN3x2; + (arity: number, func: (t1: T1, t2: T2, t3: T3) => R): lodash.RightCurriedFunction3; + (arity: lodash.__, func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): LodashCurryRightN4x2; + (arity: number, func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): lodash.RightCurriedFunction4; + (arity: lodash.__, func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): LodashCurryRightN5x2; + (arity: number, func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): lodash.RightCurriedFunction5; + (arity: lodash.__, func: (...args: any[]) => any): LodashCurryRightN6x2; + (arity: number, func: (...args: any[]) => any): (...args: any[]) => any; + placeholder: lodash.__; + } + interface LodashCurryRightN1x1 { + (func: (t1: T1) => R): lodash.RightCurriedFunction1; + (func: (t1: T1, t2: T2) => R): lodash.RightCurriedFunction2; + (func: (t1: T1, t2: T2, t3: T3) => R): lodash.RightCurriedFunction3; + (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): lodash.RightCurriedFunction4; + (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): lodash.RightCurriedFunction5; + (func: (...args: any[]) => any): (...args: any[]) => any; + } + type LodashCurryRightN1x2 = (arity: number) => lodash.RightCurriedFunction1; + type LodashCurryRightN2x2 = (arity: number) => lodash.RightCurriedFunction2; + type LodashCurryRightN3x2 = (arity: number) => lodash.RightCurriedFunction3; + type LodashCurryRightN4x2 = (arity: number) => lodash.RightCurriedFunction4; + type LodashCurryRightN5x2 = (arity: number) => lodash.RightCurriedFunction5; + type LodashCurryRightN6x2 = (arity: number) => (...args: any[]) => any; + interface LodashDebounce { + (wait: number): LodashDebounce1x1; + any>(wait: lodash.__, func: T): LodashDebounce1x2; + any>(wait: number, func: T): T & lodash.Cancelable; + } + type LodashDebounce1x1 = any>(func: T) => T & lodash.Cancelable; + type LodashDebounce1x2 = (wait: number) => T & lodash.Cancelable; + type LodashDeburr = (string: string) => string; + interface LodashDefaults { + (source: TSource): LodashDefaults1x1; + (source: lodash.__, object: TObject): LodashDefaults1x2; + (source: TSource, object: TObject): TSource & TObject; + } + type LodashDefaults1x1 = (object: TObject) => TSource & TObject; + type LodashDefaults1x2 = (source: TSource) => TSource & TObject; + type LodashDefaultsAll = (object: ReadonlyArray) => any; + interface LodashDefaultsDeep { + (sources: any): LodashDefaultsDeep1x1; + (sources: lodash.__, object: any): LodashDefaultsDeep1x2; + (sources: any, object: any): any; + } + type LodashDefaultsDeep1x1 = (object: any) => any; + type LodashDefaultsDeep1x2 = (sources: any) => any; + type LodashDefaultsDeepAll = (object: ReadonlyArray) => any; + interface LodashDefaultTo { + (defaultValue: T): LodashDefaultTo1x1; + (defaultValue: lodash.__, value: T | null | undefined): LodashDefaultTo1x2; + (defaultValue: T, value: T | null | undefined): T; + (defaultValue: TDefault): LodashDefaultTo2x1; + (defaultValue: TDefault, value: T | null | undefined): T | TDefault; + } + type LodashDefaultTo1x1 = (value: T | null | undefined) => T; + interface LodashDefaultTo1x2 { + (defaultValue: T): T; + (defaultValue: TDefault): T | TDefault; + } + type LodashDefaultTo2x1 = (value: T | null | undefined) => T | TDefault; + type LodashDefer = (func: (...args: any[]) => any, ...args: any[]) => number; + interface LodashDelay { + (wait: number): LodashDelay1x1; + (wait: lodash.__, func: (...args: any[]) => any): LodashDelay1x2; + (wait: number, func: (...args: any[]) => any): number; + } + type LodashDelay1x1 = (func: (...args: any[]) => any) => number; + type LodashDelay1x2 = (wait: number) => number; + interface LodashDifference { + (array: lodash.List | null | undefined): LodashDifference1x1; + (array: lodash.__, values: lodash.List): LodashDifference1x2; + (array: lodash.List | null | undefined, values: lodash.List): T[]; + } + type LodashDifference1x1 = (values: lodash.List) => T[]; + type LodashDifference1x2 = (array: lodash.List | null | undefined) => T[]; + interface LodashDifferenceBy { + (iteratee: lodash.ValueIteratee): LodashDifferenceBy1x1; + (iteratee: lodash.__, array: lodash.List | null | undefined): LodashDifferenceBy1x2; + (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined): LodashDifferenceBy1x3; + (iteratee: lodash.__, array: lodash.__, values: lodash.List): LodashDifferenceBy1x4; + (iteratee: lodash.ValueIteratee, array: lodash.__, values: lodash.List): LodashDifferenceBy1x5; + (iteratee: lodash.__, array: lodash.List | null | undefined, values: lodash.List): LodashDifferenceBy1x6; + (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined, values: lodash.List): T1[]; + } + interface LodashDifferenceBy1x1 { + (array: lodash.List | null | undefined): LodashDifferenceBy1x3; + (array: lodash.__, values: lodash.List): LodashDifferenceBy1x5; + (array: lodash.List | null | undefined, values: lodash.List): T1[]; + } + interface LodashDifferenceBy1x2 { + (iteratee: lodash.ValueIteratee): LodashDifferenceBy1x3; + (iteratee: lodash.__, values: lodash.List): LodashDifferenceBy1x6; + (iteratee: lodash.ValueIteratee, values: lodash.List): T1[]; + } + type LodashDifferenceBy1x3 = (values: lodash.List) => T1[]; + interface LodashDifferenceBy1x4 { + (iteratee: lodash.ValueIteratee): LodashDifferenceBy1x5; + (iteratee: lodash.__, array: lodash.List | null | undefined): LodashDifferenceBy1x6; + (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined): T1[]; + } + type LodashDifferenceBy1x5 = (array: lodash.List | null | undefined) => T1[]; + type LodashDifferenceBy1x6 = (iteratee: lodash.ValueIteratee) => T1[]; + interface LodashDifferenceWith { + (comparator: lodash.Comparator2): LodashDifferenceWith1x1; + (comparator: lodash.__, array: lodash.List | null | undefined): LodashDifferenceWith1x2; + (comparator: lodash.Comparator2, array: lodash.List | null | undefined): LodashDifferenceWith1x3; + (comparator: lodash.__, array: lodash.__, values: lodash.List): LodashDifferenceWith1x4; + (comparator: lodash.Comparator2, array: lodash.__, values: lodash.List): LodashDifferenceWith1x5; + (comparator: lodash.__, array: lodash.List | null | undefined, values: lodash.List): LodashDifferenceWith1x6; + (comparator: lodash.Comparator2, array: lodash.List | null | undefined, values: lodash.List): T1[]; + } + interface LodashDifferenceWith1x1 { + (array: lodash.List | null | undefined): LodashDifferenceWith1x3; + (array: lodash.__, values: lodash.List): LodashDifferenceWith1x5; + (array: lodash.List | null | undefined, values: lodash.List): T1[]; + } + interface LodashDifferenceWith1x2 { + (comparator: lodash.Comparator2): LodashDifferenceWith1x3; + (comparator: lodash.__, values: lodash.List): LodashDifferenceWith1x6; + (comparator: lodash.Comparator2, values: lodash.List): T1[]; + } + type LodashDifferenceWith1x3 = (values: lodash.List) => T1[]; + interface LodashDifferenceWith1x4 { + (comparator: lodash.Comparator2): LodashDifferenceWith1x5; + (comparator: lodash.__, array: lodash.List | null | undefined): LodashDifferenceWith1x6; + (comparator: lodash.Comparator2, array: lodash.List | null | undefined): T1[]; + } + type LodashDifferenceWith1x5 = (array: lodash.List | null | undefined) => T1[]; + type LodashDifferenceWith1x6 = (comparator: lodash.Comparator2) => T1[]; + interface LodashUnset { + (path: lodash.PropertyPath): LodashUnset1x1; + (path: lodash.__, object: any): LodashUnset1x2; + (path: lodash.PropertyPath, object: any): boolean; + } + type LodashUnset1x1 = (object: any) => boolean; + type LodashUnset1x2 = (path: lodash.PropertyPath) => boolean; + interface LodashDivide { + (dividend: number): LodashDivide1x1; + (dividend: lodash.__, divisor: number): LodashDivide1x2; + (dividend: number, divisor: number): number; + } + type LodashDivide1x1 = (divisor: number) => number; + type LodashDivide1x2 = (dividend: number) => number; + interface LodashDrop { + (n: number): LodashDrop1x1; + (n: lodash.__, array: lodash.List | null | undefined): LodashDrop1x2; + (n: number, array: lodash.List | null | undefined): T[]; + } + type LodashDrop1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashDrop1x2 = (n: number) => T[]; + interface LodashDropRight { + (n: number): LodashDropRight1x1; + (n: lodash.__, array: lodash.List | null | undefined): LodashDropRight1x2; + (n: number, array: lodash.List | null | undefined): T[]; + } + type LodashDropRight1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashDropRight1x2 = (n: number) => T[]; + interface LodashDropRightWhile { + (predicate: lodash.ValueIteratee): LodashDropRightWhile1x1; + (predicate: lodash.__, array: lodash.List | null | undefined): LodashDropRightWhile1x2; + (predicate: lodash.ValueIteratee, array: lodash.List | null | undefined): T[]; + } + type LodashDropRightWhile1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashDropRightWhile1x2 = (predicate: lodash.ValueIteratee) => T[]; + interface LodashDropWhile { + (predicate: lodash.ValueIteratee): LodashDropWhile1x1; + (predicate: lodash.__, array: lodash.List | null | undefined): LodashDropWhile1x2; + (predicate: lodash.ValueIteratee, array: lodash.List | null | undefined): T[]; + } + type LodashDropWhile1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashDropWhile1x2 = (predicate: lodash.ValueIteratee) => T[]; + interface LodashForEach { + (iteratee: (value: T) => any): LodashForEach1x1; + (iteratee: lodash.__, collection: ReadonlyArray): LodashForEach1x2; + (iteratee: (value: T) => any, collection: ReadonlyArray): T[]; + (iteratee: (value: string) => any): LodashForEach2x1; + (iteratee: lodash.__, collection: string): LodashForEach2x2; + (iteratee: (value: string) => any, collection: string): string; + (iteratee: lodash.__, collection: lodash.List): LodashForEach3x2; + (iteratee: (value: T) => any, collection: lodash.List): lodash.List; + (iteratee: lodash.__, collection: T): LodashForEach4x2; + (iteratee: (value: T[keyof T]) => any, collection: T): T; + (iteratee: lodash.__, collection: TArray & (T[] | null | undefined)): LodashForEach5x2; + (iteratee: (value: T) => any, collection: TArray & (T[] | null | undefined)): TArray; + (iteratee: lodash.__, collection: TString): LodashForEach6x2; + (iteratee: (value: string) => any, collection: TString): TString; + | null | undefined>(iteratee: lodash.__, collection: TList & (lodash.List | null | undefined)): LodashForEach7x2; + | null | undefined>(iteratee: (value: T) => any, collection: TList & (lodash.List | null | undefined)): TList; + (iteratee: lodash.__, collection: T | null | undefined): LodashForEach8x2; + (iteratee: (value: T[keyof T]) => any, collection: T | null | undefined): T | null | undefined; + } + interface LodashForEach1x1 { + (collection: ReadonlyArray): T[]; + (collection: lodash.List): lodash.List; + (collection: T1): T1; + (collection: TArray & (T[] | null | undefined)): TArray; + | null | undefined>(collection: TList & (lodash.List | null | undefined)): TList; + (collection: T1 | null | undefined): T1 | null | undefined; + } + type LodashForEach1x2 = (iteratee: (value: T) => any) => T[]; + interface LodashForEach2x1 { + (collection: string): string; + (collection: TString): TString; + } + type LodashForEach2x2 = (iteratee: (value: string) => any) => string; + type LodashForEach3x2 = (iteratee: (value: T) => any) => lodash.List; + type LodashForEach4x2 = (iteratee: (value: T[keyof T]) => any) => T; + type LodashForEach5x2 = (iteratee: (value: T) => any) => TArray; + type LodashForEach6x2 = (iteratee: (value: string) => any) => TString; + type LodashForEach7x2 = (iteratee: (value: T) => any) => TList; + type LodashForEach8x2 = (iteratee: (value: T[keyof T]) => any) => T | null | undefined; + interface LodashForEachRight { + (iteratee: (value: T) => any): LodashForEachRight1x1; + (iteratee: lodash.__, collection: ReadonlyArray): LodashForEachRight1x2; + (iteratee: (value: T) => any, collection: ReadonlyArray): T[]; + (iteratee: (value: string) => any): LodashForEachRight2x1; + (iteratee: lodash.__, collection: string): LodashForEachRight2x2; + (iteratee: (value: string) => any, collection: string): string; + (iteratee: lodash.__, collection: lodash.List): LodashForEachRight3x2; + (iteratee: (value: T) => any, collection: lodash.List): lodash.List; + (iteratee: lodash.__, collection: T): LodashForEachRight4x2; + (iteratee: (value: T[keyof T]) => any, collection: T): T; + (iteratee: lodash.__, collection: TArray & (T[] | null | undefined)): LodashForEachRight5x2; + (iteratee: (value: T) => any, collection: TArray & (T[] | null | undefined)): TArray; + (iteratee: lodash.__, collection: TString): LodashForEachRight6x2; + (iteratee: (value: string) => any, collection: TString): TString; + | null | undefined>(iteratee: lodash.__, collection: TList & (lodash.List | null | undefined)): LodashForEachRight7x2; + | null | undefined>(iteratee: (value: T) => any, collection: TList & (lodash.List | null | undefined)): TList; + (iteratee: lodash.__, collection: T | null | undefined): LodashForEachRight8x2; + (iteratee: (value: T[keyof T]) => any, collection: T | null | undefined): T | null | undefined; + } + interface LodashForEachRight1x1 { + (collection: ReadonlyArray): T[]; + (collection: lodash.List): lodash.List; + (collection: T1): T1; + (collection: TArray & (T[] | null | undefined)): TArray; + | null | undefined>(collection: TList & (lodash.List | null | undefined)): TList; + (collection: T1 | null | undefined): T1 | null | undefined; + } + type LodashForEachRight1x2 = (iteratee: (value: T) => any) => T[]; + interface LodashForEachRight2x1 { + (collection: string): string; + (collection: TString): TString; + } + type LodashForEachRight2x2 = (iteratee: (value: string) => any) => string; + type LodashForEachRight3x2 = (iteratee: (value: T) => any) => lodash.List; + type LodashForEachRight4x2 = (iteratee: (value: T[keyof T]) => any) => T; + type LodashForEachRight5x2 = (iteratee: (value: T) => any) => TArray; + type LodashForEachRight6x2 = (iteratee: (value: string) => any) => TString; + type LodashForEachRight7x2 = (iteratee: (value: T) => any) => TList; + type LodashForEachRight8x2 = (iteratee: (value: T[keyof T]) => any) => T | null | undefined; + interface LodashEndsWith { + (target: string): LodashEndsWith1x1; + (target: lodash.__, string: string): LodashEndsWith1x2; + (target: string, string: string): boolean; + } + type LodashEndsWith1x1 = (string: string) => boolean; + type LodashEndsWith1x2 = (target: string) => boolean; + interface LodashToPairs { + (object: lodash.Dictionary | lodash.NumericDictionary): Array<[string, T]>; + (object: object): Array<[string, any]>; + } + interface LodashToPairsIn { + (object: lodash.Dictionary | lodash.NumericDictionary): Array<[string, T]>; + (object: object): Array<[string, any]>; + } + interface LodashEq { + (value: any): LodashEq1x1; + (value: lodash.__, other: any): LodashEq1x2; + (value: any, other: any): boolean; + } + type LodashEq1x1 = (other: any) => boolean; + type LodashEq1x2 = (value: any) => boolean; + interface LodashIsEqual { + (value: any): LodashIsEqual1x1; + (value: lodash.__, other: any): LodashIsEqual1x2; + (value: any, other: any): boolean; + } + type LodashIsEqual1x1 = (other: any) => boolean; + type LodashIsEqual1x2 = (value: any) => boolean; + type LodashEscape = (string: string) => string; + type LodashEscapeRegExp = (string: string) => string; + interface LodashExtend { + (object: TObject): LodashExtend1x1; + (object: lodash.__, source: TSource): LodashExtend1x2; + (object: TObject, source: TSource): TObject & TSource; + } + type LodashExtend1x1 = (source: TSource) => TObject & TSource; + type LodashExtend1x2 = (object: TObject) => TObject & TSource; + type LodashExtendAll = (object: ReadonlyArray) => TResult; + interface LodashExtendAllWith { + (customizer: lodash.AssignCustomizer): LodashExtendAllWith1x1; + (customizer: lodash.__, args: ReadonlyArray): LodashExtendAllWith1x2; + (customizer: lodash.AssignCustomizer, args: ReadonlyArray): any; + } + type LodashExtendAllWith1x1 = (args: ReadonlyArray) => any; + type LodashExtendAllWith1x2 = (customizer: lodash.AssignCustomizer) => any; + interface LodashExtendWith { + (customizer: lodash.AssignCustomizer): LodashExtendWith1x1; + (customizer: lodash.__, object: TObject): LodashExtendWith1x2; + (customizer: lodash.AssignCustomizer, object: TObject): LodashExtendWith1x3; + (customizer: lodash.__, object: lodash.__, source: TSource): LodashExtendWith1x4; + (customizer: lodash.AssignCustomizer, object: lodash.__, source: TSource): LodashExtendWith1x5; + (customizer: lodash.__, object: TObject, source: TSource): LodashExtendWith1x6; + (customizer: lodash.AssignCustomizer, object: TObject, source: TSource): TObject & TSource; + } + interface LodashExtendWith1x1 { + (object: TObject): LodashExtendWith1x3; + (object: lodash.__, source: TSource): LodashExtendWith1x5; + (object: TObject, source: TSource): TObject & TSource; + } + interface LodashExtendWith1x2 { + (customizer: lodash.AssignCustomizer): LodashExtendWith1x3; + (customizer: lodash.__, source: TSource): LodashExtendWith1x6; + (customizer: lodash.AssignCustomizer, source: TSource): TObject & TSource; + } + type LodashExtendWith1x3 = (source: TSource) => TObject & TSource; + interface LodashExtendWith1x4 { + (customizer: lodash.AssignCustomizer): LodashExtendWith1x5; + (customizer: lodash.__, object: TObject): LodashExtendWith1x6; + (customizer: lodash.AssignCustomizer, object: TObject): TObject & TSource; + } + type LodashExtendWith1x5 = (object: TObject) => TObject & TSource; + type LodashExtendWith1x6 = (customizer: lodash.AssignCustomizer) => TObject & TSource; + type LodashStubFalse = () => boolean; + interface LodashFill { + (start: number): LodashFill1x1; + (start: lodash.__, end: number): LodashFill1x2; + (start: number, end: number): LodashFill1x3; + (start: lodash.__, end: lodash.__, value: T): LodashFill1x4; + (start: number, end: lodash.__, value: T): LodashFill1x5; + (start: lodash.__, end: number, value: T): LodashFill1x6; + (start: number, end: number, value: T): LodashFill1x7; + (start: lodash.__, end: lodash.__, value: lodash.__, array: U[] | null | undefined): LodashFill1x8; + (start: number, end: lodash.__, value: lodash.__, array: U[] | null | undefined): LodashFill1x9; + (start: lodash.__, end: number, value: lodash.__, array: U[] | null | undefined): LodashFill1x10; + (start: number, end: number, value: lodash.__, array: U[] | null | undefined): LodashFill1x11; + (start: lodash.__, end: lodash.__, value: T, array: U[] | null | undefined): LodashFill1x12; + (start: number, end: lodash.__, value: T, array: U[] | null | undefined): LodashFill1x13; + (start: lodash.__, end: number, value: T, array: U[] | null | undefined): LodashFill1x14; + (start: number, end: number, value: T, array: U[] | null | undefined): Array; + (start: lodash.__, end: lodash.__, value: lodash.__, array: lodash.List | null | undefined): LodashFill2x8; + (start: number, end: lodash.__, value: lodash.__, array: lodash.List | null | undefined): LodashFill2x9; + (start: lodash.__, end: number, value: lodash.__, array: lodash.List | null | undefined): LodashFill2x10; + (start: number, end: number, value: lodash.__, array: lodash.List | null | undefined): LodashFill2x11; + (start: lodash.__, end: lodash.__, value: T, array: lodash.List | null | undefined): LodashFill2x12; + (start: number, end: lodash.__, value: T, array: lodash.List | null | undefined): LodashFill2x13; + (start: lodash.__, end: number, value: T, array: lodash.List | null | undefined): LodashFill2x14; + (start: number, end: number, value: T, array: lodash.List | null | undefined): lodash.List; + } + interface LodashFill1x1 { + (end: number): LodashFill1x3; + (end: lodash.__, value: T): LodashFill1x5; + (end: number, value: T): LodashFill1x7; + (end: lodash.__, value: lodash.__, array: U[] | null | undefined): LodashFill1x9; + (end: number, value: lodash.__, array: U[] | null | undefined): LodashFill1x11; + (end: lodash.__, value: T, array: U[] | null | undefined): LodashFill1x13; + (end: number, value: T, array: U[] | null | undefined): Array; + (end: lodash.__, value: lodash.__, array: lodash.List | null | undefined): LodashFill2x9; + (end: number, value: lodash.__, array: lodash.List | null | undefined): LodashFill2x11; + (end: lodash.__, value: T, array: lodash.List | null | undefined): LodashFill2x13; + (end: number, value: T, array: lodash.List | null | undefined): lodash.List; + } + interface LodashFill1x2 { + (start: number): LodashFill1x3; + (start: lodash.__, value: T): LodashFill1x6; + (start: number, value: T): LodashFill1x7; + (start: lodash.__, value: lodash.__, array: U[] | null | undefined): LodashFill1x10; + (start: number, value: lodash.__, array: U[] | null | undefined): LodashFill1x11; + (start: lodash.__, value: T, array: U[] | null | undefined): LodashFill1x14; + (start: number, value: T, array: U[] | null | undefined): Array; + (start: lodash.__, value: lodash.__, array: lodash.List | null | undefined): LodashFill2x10; + (start: number, value: lodash.__, array: lodash.List | null | undefined): LodashFill2x11; + (start: lodash.__, value: T, array: lodash.List | null | undefined): LodashFill2x14; + (start: number, value: T, array: lodash.List | null | undefined): lodash.List; + } + interface LodashFill1x3 { + (value: T): LodashFill1x7; + (value: lodash.__, array: U[] | null | undefined): LodashFill1x11; + (value: T, array: U[] | null | undefined): Array; + (value: lodash.__, array: lodash.List | null | undefined): LodashFill2x11; + (value: T, array: lodash.List | null | undefined): lodash.List; + } + interface LodashFill1x4 { + (start: number): LodashFill1x5; + (start: lodash.__, end: number): LodashFill1x6; + (start: number, end: number): LodashFill1x7; + (start: lodash.__, end: lodash.__, array: U[] | null | undefined): LodashFill1x12; + (start: number, end: lodash.__, array: U[] | null | undefined): LodashFill1x13; + (start: lodash.__, end: number, array: U[] | null | undefined): LodashFill1x14; + (start: number, end: number, array: U[] | null | undefined): Array; + (start: lodash.__, end: lodash.__, array: lodash.List | null | undefined): LodashFill2x12; + (start: number, end: lodash.__, array: lodash.List | null | undefined): LodashFill2x13; + (start: lodash.__, end: number, array: lodash.List | null | undefined): LodashFill2x14; + (start: number, end: number, array: lodash.List | null | undefined): lodash.List; + } + interface LodashFill1x5 { + (end: number): LodashFill1x7; + (end: lodash.__, array: U[] | null | undefined): LodashFill1x13; + (end: number, array: U[] | null | undefined): Array; + (end: lodash.__, array: lodash.List | null | undefined): LodashFill2x13; + (end: number, array: lodash.List | null | undefined): lodash.List; + } + interface LodashFill1x6 { + (start: number): LodashFill1x7; + (start: lodash.__, array: U[] | null | undefined): LodashFill1x14; + (start: number, array: U[] | null | undefined): Array; + (start: lodash.__, array: lodash.List | null | undefined): LodashFill2x14; + (start: number, array: lodash.List | null | undefined): lodash.List; + } + interface LodashFill1x7 { + (array: U[] | null | undefined): Array; + (array: lodash.List | null | undefined): lodash.List; + } + interface LodashFill1x8 { + (start: number): LodashFill1x9; + (start: lodash.__, end: number): LodashFill1x10; + (start: number, end: number): LodashFill1x11; + (start: lodash.__, end: lodash.__, value: T): LodashFill1x12; + (start: number, end: lodash.__, value: T): LodashFill1x13; + (start: lodash.__, end: number, value: T): LodashFill1x14; + (start: number, end: number, value: T): Array; + } + interface LodashFill1x9 { + (end: number): LodashFill1x11; + (end: lodash.__, value: T): LodashFill1x13; + (end: number, value: T): Array; + } + interface LodashFill1x10 { + (start: number): LodashFill1x11; + (start: lodash.__, value: T): LodashFill1x14; + (start: number, value: T): Array; + } + type LodashFill1x11 = (value: T) => Array; + interface LodashFill1x12 { + (start: number): LodashFill1x13; + (start: lodash.__, end: number): LodashFill1x14; + (start: number, end: number): Array; + } + type LodashFill1x13 = (end: number) => Array; + type LodashFill1x14 = (start: number) => Array; + interface LodashFill2x8 { + (start: number): LodashFill2x9; + (start: lodash.__, end: number): LodashFill2x10; + (start: number, end: number): LodashFill2x11; + (start: lodash.__, end: lodash.__, value: T): LodashFill2x12; + (start: number, end: lodash.__, value: T): LodashFill2x13; + (start: lodash.__, end: number, value: T): LodashFill2x14; + (start: number, end: number, value: T): lodash.List; + } + interface LodashFill2x9 { + (end: number): LodashFill2x11; + (end: lodash.__, value: T): LodashFill2x13; + (end: number, value: T): lodash.List; + } + interface LodashFill2x10 { + (start: number): LodashFill2x11; + (start: lodash.__, value: T): LodashFill2x14; + (start: number, value: T): lodash.List; + } + type LodashFill2x11 = (value: T) => lodash.List; + interface LodashFill2x12 { + (start: number): LodashFill2x13; + (start: lodash.__, end: number): LodashFill2x14; + (start: number, end: number): lodash.List; + } + type LodashFill2x13 = (end: number) => lodash.List; + type LodashFill2x14 = (start: number) => lodash.List; + interface LodashFilter { + (predicate: (value: string) => boolean): LodashFilter1x1; + (predicate: lodash.__, collection: string | null | undefined): LodashFilter1x2; + (predicate: (value: string) => boolean, collection: string | null | undefined): string[]; + (predicate: lodash.ValueIteratorTypeGuard): LodashFilter2x1; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashFilter2x2; + (predicate: lodash.ValueIteratorTypeGuard, collection: lodash.List | null | undefined): S[]; + (predicate: lodash.ValueIterateeCustom): LodashFilter3x1; + (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): T[]; + (predicate: lodash.ValueIteratorTypeGuard): LodashFilter4x1; + (predicate: lodash.__, collection: T | null | undefined): LodashFilter4x2; + (predicate: lodash.ValueIteratorTypeGuard, collection: T | null | undefined): S[]; + (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): Array; + } + type LodashFilter1x1 = (collection: string | null | undefined) => string[]; + type LodashFilter1x2 = (predicate: (value: string) => boolean) => string[]; + type LodashFilter2x1 = (collection: lodash.List | null | undefined) => S[]; + interface LodashFilter2x2 { + (predicate: lodash.ValueIteratorTypeGuard): S[]; + (predicate: lodash.ValueIterateeCustom): T[]; + } + type LodashFilter3x1 = (collection: lodash.List | object | null | undefined) => T[]; + type LodashFilter4x1 = (collection: T | null | undefined) => S[]; + interface LodashFilter4x2 { + (predicate: lodash.ValueIteratorTypeGuard): S[]; + (predicate: lodash.ValueIterateeCustom): Array; + } + interface LodashFind { + (predicate: lodash.ValueIteratorTypeGuard): LodashFind1x1; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashFind1x2; + (predicate: lodash.ValueIteratorTypeGuard, collection: lodash.List | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFind2x1; + (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): T|undefined; + (predicate: lodash.ValueIteratorTypeGuard): LodashFind3x1; + (predicate: lodash.__, collection: T | null | undefined): LodashFind3x2; + (predicate: lodash.ValueIteratorTypeGuard, collection: T | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): T[keyof T]|undefined; + } + type LodashFind1x1 = (collection: lodash.List | null | undefined) => S|undefined; + interface LodashFind1x2 { + (predicate: lodash.ValueIteratorTypeGuard): S|undefined; + (predicate: lodash.ValueIterateeCustom): T|undefined; + } + type LodashFind2x1 = (collection: lodash.List | object | null | undefined) => T|undefined; + type LodashFind3x1 = (collection: T | null | undefined) => S|undefined; + interface LodashFind3x2 { + (predicate: lodash.ValueIteratorTypeGuard): S|undefined; + (predicate: lodash.ValueIterateeCustom): T[keyof T]|undefined; + } + interface LodashFindFrom { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindFrom1x1; + (predicate: lodash.__, fromIndex: number): LodashFindFrom1x2; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number): LodashFindFrom1x3; + (predicate: lodash.__, fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindFrom1x4; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindFrom1x5; + (predicate: lodash.__, fromIndex: number, collection: lodash.List | null | undefined): LodashFindFrom1x6; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number, collection: lodash.List | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindFrom2x1; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): LodashFindFrom2x3; + (predicate: lodash.ValueIterateeCustom, fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindFrom2x5; + (predicate: lodash.ValueIterateeCustom, fromIndex: number, collection: lodash.List | null | undefined): T|undefined; + (predicate: lodash.ValueIteratorTypeGuard): LodashFindFrom3x1; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number): LodashFindFrom3x3; + (predicate: lodash.__, fromIndex: lodash.__, collection: T | null | undefined): LodashFindFrom3x4; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: lodash.__, collection: T | null | undefined): LodashFindFrom3x5; + (predicate: lodash.__, fromIndex: number, collection: T | null | undefined): LodashFindFrom3x6; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number, collection: T | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom, fromIndex: lodash.__, collection: T | null | undefined): LodashFindFrom4x5; + (predicate: lodash.ValueIterateeCustom, fromIndex: number, collection: T | null | undefined): T[keyof T]|undefined; + } + interface LodashFindFrom1x1 { + (fromIndex: number): LodashFindFrom1x3; + (fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindFrom1x5; + (fromIndex: number, collection: lodash.List | null | undefined): S|undefined; + } + interface LodashFindFrom1x2 { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindFrom1x3; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashFindFrom1x6; + (predicate: lodash.ValueIteratorTypeGuard, collection: lodash.List | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindFrom2x3; + (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): T|undefined; + (predicate: lodash.ValueIteratorTypeGuard): LodashFindFrom3x3; + (predicate: lodash.__, collection: T | null | undefined): LodashFindFrom3x6; + (predicate: lodash.ValueIteratorTypeGuard, collection: T | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): T[keyof T]|undefined; + } + type LodashFindFrom1x3 = (collection: lodash.List | null | undefined) => S|undefined; + interface LodashFindFrom1x4 { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindFrom1x5; + (predicate: lodash.__, fromIndex: number): LodashFindFrom1x6; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindFrom2x5; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): T|undefined; + } + type LodashFindFrom1x5 = (fromIndex: number) => S|undefined; + interface LodashFindFrom1x6 { + (predicate: lodash.ValueIteratorTypeGuard): S|undefined; + (predicate: lodash.ValueIterateeCustom): T|undefined; + } + interface LodashFindFrom2x1 { + (fromIndex: number): LodashFindFrom2x3; + (fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindFrom2x5; + (fromIndex: number, collection: lodash.List | object | null | undefined): T|undefined; + (fromIndex: lodash.__, collection: T1 | null | undefined): LodashFindFrom4x5; + } + interface LodashFindFrom2x3 { + (collection: lodash.List | null | undefined): T|undefined; + (collection: object | null | undefined): object|undefined; + } + type LodashFindFrom2x5 = (fromIndex: number) => T|undefined; + interface LodashFindFrom3x1 { + (fromIndex: number): LodashFindFrom3x3; + (fromIndex: lodash.__, collection: T | null | undefined): LodashFindFrom3x5; + (fromIndex: number, collection: T | null | undefined): S|undefined; + } + type LodashFindFrom3x3 = (collection: T | null | undefined) => S|undefined; + interface LodashFindFrom3x4 { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindFrom3x5; + (predicate: lodash.__, fromIndex: number): LodashFindFrom3x6; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindFrom4x5; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): T[keyof T]|undefined; + } + type LodashFindFrom3x5 = (fromIndex: number) => S|undefined; + interface LodashFindFrom3x6 { + (predicate: lodash.ValueIteratorTypeGuard): S|undefined; + (predicate: lodash.ValueIterateeCustom): T[keyof T]|undefined; + } + type LodashFindFrom4x5 = (fromIndex: number) => T[keyof T]|undefined; + interface LodashFindIndex { + (predicate: lodash.ValueIterateeCustom): LodashFindIndex1x1; + (predicate: lodash.__, array: lodash.List | null | undefined): LodashFindIndex1x2; + (predicate: lodash.ValueIterateeCustom, array: lodash.List | null | undefined): number; + } + type LodashFindIndex1x1 = (array: lodash.List | null | undefined) => number; + type LodashFindIndex1x2 = (predicate: lodash.ValueIterateeCustom) => number; + interface LodashFindIndexFrom { + (predicate: lodash.ValueIterateeCustom): LodashFindIndexFrom1x1; + (predicate: lodash.__, fromIndex: number): LodashFindIndexFrom1x2; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): LodashFindIndexFrom1x3; + (predicate: lodash.__, fromIndex: lodash.__, array: lodash.List | null | undefined): LodashFindIndexFrom1x4; + (predicate: lodash.ValueIterateeCustom, fromIndex: lodash.__, array: lodash.List | null | undefined): LodashFindIndexFrom1x5; + (predicate: lodash.__, fromIndex: number, array: lodash.List | null | undefined): LodashFindIndexFrom1x6; + (predicate: lodash.ValueIterateeCustom, fromIndex: number, array: lodash.List | null | undefined): number; + } + interface LodashFindIndexFrom1x1 { + (fromIndex: number): LodashFindIndexFrom1x3; + (fromIndex: lodash.__, array: lodash.List | null | undefined): LodashFindIndexFrom1x5; + (fromIndex: number, array: lodash.List | null | undefined): number; + } + interface LodashFindIndexFrom1x2 { + (predicate: lodash.ValueIterateeCustom): LodashFindIndexFrom1x3; + (predicate: lodash.__, array: lodash.List | null | undefined): LodashFindIndexFrom1x6; + (predicate: lodash.ValueIterateeCustom, array: lodash.List | null | undefined): number; + } + type LodashFindIndexFrom1x3 = (array: lodash.List | null | undefined) => number; + interface LodashFindIndexFrom1x4 { + (predicate: lodash.ValueIterateeCustom): LodashFindIndexFrom1x5; + (predicate: lodash.__, fromIndex: number): LodashFindIndexFrom1x6; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): number; + } + type LodashFindIndexFrom1x5 = (fromIndex: number) => number; + type LodashFindIndexFrom1x6 = (predicate: lodash.ValueIterateeCustom) => number; + interface LodashFindKey { + (predicate: lodash.ValueIteratee): LodashFindKey1x1; + (predicate: lodash.__, object: T | null | undefined): LodashFindKey1x2; + (predicate: lodash.ValueIteratee, object: T | null | undefined): string | undefined; + } + type LodashFindKey1x1 = (object: object | null | undefined) => string | undefined; + type LodashFindKey1x2 = (predicate: lodash.ValueIteratee) => string | undefined; + interface LodashFindLast { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindLast1x1; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashFindLast1x2; + (predicate: lodash.ValueIteratorTypeGuard, collection: lodash.List | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindLast2x1; + (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): T|undefined; + (predicate: lodash.ValueIteratorTypeGuard): LodashFindLast3x1; + (predicate: lodash.__, collection: T | null | undefined): LodashFindLast3x2; + (predicate: lodash.ValueIteratorTypeGuard, collection: T | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): T[keyof T]|undefined; + } + type LodashFindLast1x1 = (collection: lodash.List | null | undefined) => S|undefined; + interface LodashFindLast1x2 { + (predicate: lodash.ValueIteratorTypeGuard): S|undefined; + (predicate: lodash.ValueIterateeCustom): T|undefined; + } + type LodashFindLast2x1 = (collection: lodash.List | object | null | undefined) => T|undefined; + type LodashFindLast3x1 = (collection: T | null | undefined) => S|undefined; + interface LodashFindLast3x2 { + (predicate: lodash.ValueIteratorTypeGuard): S|undefined; + (predicate: lodash.ValueIterateeCustom): T[keyof T]|undefined; + } + interface LodashFindLastFrom { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindLastFrom1x1; + (predicate: lodash.__, fromIndex: number): LodashFindLastFrom1x2; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number): LodashFindLastFrom1x3; + (predicate: lodash.__, fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindLastFrom1x4; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindLastFrom1x5; + (predicate: lodash.__, fromIndex: number, collection: lodash.List | null | undefined): LodashFindLastFrom1x6; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number, collection: lodash.List | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindLastFrom2x1; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): LodashFindLastFrom2x3; + (predicate: lodash.ValueIterateeCustom, fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindLastFrom2x5; + (predicate: lodash.ValueIterateeCustom, fromIndex: number, collection: lodash.List | null | undefined): T|undefined; + (predicate: lodash.ValueIteratorTypeGuard): LodashFindLastFrom3x1; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number): LodashFindLastFrom3x3; + (predicate: lodash.__, fromIndex: lodash.__, collection: T | null | undefined): LodashFindLastFrom3x4; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: lodash.__, collection: T | null | undefined): LodashFindLastFrom3x5; + (predicate: lodash.__, fromIndex: number, collection: T | null | undefined): LodashFindLastFrom3x6; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number, collection: T | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom, fromIndex: lodash.__, collection: T | null | undefined): LodashFindLastFrom4x5; + (predicate: lodash.ValueIterateeCustom, fromIndex: number, collection: T | null | undefined): T[keyof T]|undefined; + } + interface LodashFindLastFrom1x1 { + (fromIndex: number): LodashFindLastFrom1x3; + (fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindLastFrom1x5; + (fromIndex: number, collection: lodash.List | null | undefined): S|undefined; + } + interface LodashFindLastFrom1x2 { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindLastFrom1x3; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashFindLastFrom1x6; + (predicate: lodash.ValueIteratorTypeGuard, collection: lodash.List | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindLastFrom2x3; + (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): T|undefined; + (predicate: lodash.ValueIteratorTypeGuard): LodashFindLastFrom3x3; + (predicate: lodash.__, collection: T | null | undefined): LodashFindLastFrom3x6; + (predicate: lodash.ValueIteratorTypeGuard, collection: T | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): T[keyof T]|undefined; + } + type LodashFindLastFrom1x3 = (collection: lodash.List | null | undefined) => S|undefined; + interface LodashFindLastFrom1x4 { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindLastFrom1x5; + (predicate: lodash.__, fromIndex: number): LodashFindLastFrom1x6; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindLastFrom2x5; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): T|undefined; + } + type LodashFindLastFrom1x5 = (fromIndex: number) => S|undefined; + interface LodashFindLastFrom1x6 { + (predicate: lodash.ValueIteratorTypeGuard): S|undefined; + (predicate: lodash.ValueIterateeCustom): T|undefined; + } + interface LodashFindLastFrom2x1 { + (fromIndex: number): LodashFindLastFrom2x3; + (fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindLastFrom2x5; + (fromIndex: number, collection: lodash.List | object | null | undefined): T|undefined; + (fromIndex: lodash.__, collection: T1 | null | undefined): LodashFindLastFrom4x5; + } + interface LodashFindLastFrom2x3 { + (collection: lodash.List | null | undefined): T|undefined; + (collection: object | null | undefined): object|undefined; + } + type LodashFindLastFrom2x5 = (fromIndex: number) => T|undefined; + interface LodashFindLastFrom3x1 { + (fromIndex: number): LodashFindLastFrom3x3; + (fromIndex: lodash.__, collection: T | null | undefined): LodashFindLastFrom3x5; + (fromIndex: number, collection: T | null | undefined): S|undefined; + } + type LodashFindLastFrom3x3 = (collection: T | null | undefined) => S|undefined; + interface LodashFindLastFrom3x4 { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindLastFrom3x5; + (predicate: lodash.__, fromIndex: number): LodashFindLastFrom3x6; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindLastFrom4x5; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): T[keyof T]|undefined; + } + type LodashFindLastFrom3x5 = (fromIndex: number) => S|undefined; + interface LodashFindLastFrom3x6 { + (predicate: lodash.ValueIteratorTypeGuard): S|undefined; + (predicate: lodash.ValueIterateeCustom): T[keyof T]|undefined; + } + type LodashFindLastFrom4x5 = (fromIndex: number) => T[keyof T]|undefined; + interface LodashFindLastIndex { + (predicate: lodash.ValueIterateeCustom): LodashFindLastIndex1x1; + (predicate: lodash.__, array: lodash.List | null | undefined): LodashFindLastIndex1x2; + (predicate: lodash.ValueIterateeCustom, array: lodash.List | null | undefined): number; + } + type LodashFindLastIndex1x1 = (array: lodash.List | null | undefined) => number; + type LodashFindLastIndex1x2 = (predicate: lodash.ValueIterateeCustom) => number; + interface LodashFindLastIndexFrom { + (predicate: lodash.ValueIterateeCustom): LodashFindLastIndexFrom1x1; + (predicate: lodash.__, fromIndex: number): LodashFindLastIndexFrom1x2; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): LodashFindLastIndexFrom1x3; + (predicate: lodash.__, fromIndex: lodash.__, array: lodash.List | null | undefined): LodashFindLastIndexFrom1x4; + (predicate: lodash.ValueIterateeCustom, fromIndex: lodash.__, array: lodash.List | null | undefined): LodashFindLastIndexFrom1x5; + (predicate: lodash.__, fromIndex: number, array: lodash.List | null | undefined): LodashFindLastIndexFrom1x6; + (predicate: lodash.ValueIterateeCustom, fromIndex: number, array: lodash.List | null | undefined): number; + } + interface LodashFindLastIndexFrom1x1 { + (fromIndex: number): LodashFindLastIndexFrom1x3; + (fromIndex: lodash.__, array: lodash.List | null | undefined): LodashFindLastIndexFrom1x5; + (fromIndex: number, array: lodash.List | null | undefined): number; + } + interface LodashFindLastIndexFrom1x2 { + (predicate: lodash.ValueIterateeCustom): LodashFindLastIndexFrom1x3; + (predicate: lodash.__, array: lodash.List | null | undefined): LodashFindLastIndexFrom1x6; + (predicate: lodash.ValueIterateeCustom, array: lodash.List | null | undefined): number; + } + type LodashFindLastIndexFrom1x3 = (array: lodash.List | null | undefined) => number; + interface LodashFindLastIndexFrom1x4 { + (predicate: lodash.ValueIterateeCustom): LodashFindLastIndexFrom1x5; + (predicate: lodash.__, fromIndex: number): LodashFindLastIndexFrom1x6; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): number; + } + type LodashFindLastIndexFrom1x5 = (fromIndex: number) => number; + type LodashFindLastIndexFrom1x6 = (predicate: lodash.ValueIterateeCustom) => number; + interface LodashFindLastKey { + (predicate: lodash.ValueIteratee): LodashFindLastKey1x1; + (predicate: lodash.__, object: T | null | undefined): LodashFindLastKey1x2; + (predicate: lodash.ValueIteratee, object: T | null | undefined): string | undefined; + } + type LodashFindLastKey1x1 = (object: object | null | undefined) => string | undefined; + type LodashFindLastKey1x2 = (predicate: lodash.ValueIteratee) => string | undefined; + type LodashHead = (array: lodash.List | null | undefined) => T | undefined; + interface LodashFlatMap { + (iteratee: (value: T) => lodash.Many): LodashFlatMap1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashFlatMap1x2; + (iteratee: (value: T) => lodash.Many, collection: lodash.List | null | undefined): TResult[]; + (iteratee: (value: T[keyof T]) => lodash.Many): LodashFlatMap2x1; + (iteratee: lodash.__, collection: T | null | undefined): LodashFlatMap2x2; + (iteratee: (value: T[keyof T]) => lodash.Many, collection: T | null | undefined): TResult[]; + (iteratee: string): LodashFlatMap3x1; + (iteratee: lodash.__, collection: object | null | undefined): LodashFlatMap3x2; + (iteratee: string, collection: object | null | undefined): any[]; + (iteratee: object): LodashFlatMap4x1; + (iteratee: object, collection: object | null | undefined): boolean[]; + } + type LodashFlatMap1x1 = (collection: lodash.List | null | undefined) => TResult[]; + type LodashFlatMap1x2 = (iteratee: (value: T) => lodash.Many) => TResult[]; + type LodashFlatMap2x1 = (collection: T | null | undefined) => TResult[]; + type LodashFlatMap2x2 = (iteratee: (value: T[keyof T]) => lodash.Many) => TResult[]; + type LodashFlatMap3x1 = (collection: object | null | undefined) => any[]; + interface LodashFlatMap3x2 { + (iteratee: string): any[]; + (iteratee: object): boolean[]; + } + type LodashFlatMap4x1 = (collection: object | null | undefined) => boolean[]; + interface LodashFlatMapDeep { + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult): LodashFlatMapDeep1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashFlatMapDeep1x2; + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult, collection: lodash.List | null | undefined): TResult[]; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult): LodashFlatMapDeep2x1; + (iteratee: lodash.__, collection: T | null | undefined): LodashFlatMapDeep2x2; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult, collection: T | null | undefined): TResult[]; + (iteratee: string): LodashFlatMapDeep3x1; + (iteratee: lodash.__, collection: object | null | undefined): LodashFlatMapDeep3x2; + (iteratee: string, collection: object | null | undefined): any[]; + (iteratee: object): LodashFlatMapDeep4x1; + (iteratee: object, collection: object | null | undefined): boolean[]; + } + type LodashFlatMapDeep1x1 = (collection: lodash.List | null | undefined) => TResult[]; + type LodashFlatMapDeep1x2 = (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult) => TResult[]; + type LodashFlatMapDeep2x1 = (collection: T | null | undefined) => TResult[]; + type LodashFlatMapDeep2x2 = (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult) => TResult[]; + type LodashFlatMapDeep3x1 = (collection: object | null | undefined) => any[]; + interface LodashFlatMapDeep3x2 { + (iteratee: string): any[]; + (iteratee: object): boolean[]; + } + type LodashFlatMapDeep4x1 = (collection: object | null | undefined) => boolean[]; + interface LodashFlatMapDepth { + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult): LodashFlatMapDepth1x1; + (iteratee: lodash.__, depth: number): LodashFlatMapDepth1x2; + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult, depth: number): LodashFlatMapDepth1x3; + (iteratee: lodash.__, depth: lodash.__, collection: lodash.List | null | undefined): LodashFlatMapDepth1x4; + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult, depth: lodash.__, collection: lodash.List | null | undefined): LodashFlatMapDepth1x5; + (iteratee: lodash.__, depth: number, collection: lodash.List | null | undefined): LodashFlatMapDepth1x6; + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult, depth: number, collection: lodash.List | null | undefined): TResult[]; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult): LodashFlatMapDepth2x1; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult, depth: number): LodashFlatMapDepth2x3; + (iteratee: lodash.__, depth: lodash.__, collection: T | null | undefined): LodashFlatMapDepth2x4; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult, depth: lodash.__, collection: T | null | undefined): LodashFlatMapDepth2x5; + (iteratee: lodash.__, depth: number, collection: T | null | undefined): LodashFlatMapDepth2x6; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult, depth: number, collection: T | null | undefined): TResult[]; + (iteratee: string): LodashFlatMapDepth3x1; + (iteratee: string, depth: number): LodashFlatMapDepth3x3; + (iteratee: lodash.__, depth: lodash.__, collection: object | null | undefined): LodashFlatMapDepth3x4; + (iteratee: string, depth: lodash.__, collection: object | null | undefined): LodashFlatMapDepth3x5; + (iteratee: lodash.__, depth: number, collection: object | null | undefined): LodashFlatMapDepth3x6; + (iteratee: string, depth: number, collection: object | null | undefined): any[]; + (iteratee: object): LodashFlatMapDepth4x1; + (iteratee: object, depth: number): LodashFlatMapDepth4x3; + (iteratee: object, depth: lodash.__, collection: object | null | undefined): LodashFlatMapDepth4x5; + (iteratee: object, depth: number, collection: object | null | undefined): boolean[]; + } + interface LodashFlatMapDepth1x1 { + (depth: number): LodashFlatMapDepth1x3; + (depth: lodash.__, collection: lodash.List | null | undefined): LodashFlatMapDepth1x5; + (depth: number, collection: lodash.List | null | undefined): TResult[]; + } + interface LodashFlatMapDepth1x2 { + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult): LodashFlatMapDepth1x3; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashFlatMapDepth1x6; + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult, collection: lodash.List | null | undefined): TResult[]; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult): LodashFlatMapDepth2x3; + (iteratee: lodash.__, collection: T | null | undefined): LodashFlatMapDepth2x6; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult, collection: T | null | undefined): TResult[]; + (iteratee: string): LodashFlatMapDepth3x3; + (iteratee: lodash.__, collection: object | null | undefined): LodashFlatMapDepth3x6; + (iteratee: string, collection: object | null | undefined): any[]; + (iteratee: object): LodashFlatMapDepth4x3; + (iteratee: object, collection: object | null | undefined): boolean[]; + } + type LodashFlatMapDepth1x3 = (collection: lodash.List | null | undefined) => TResult[]; + interface LodashFlatMapDepth1x4 { + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult): LodashFlatMapDepth1x5; + (iteratee: lodash.__, depth: number): LodashFlatMapDepth1x6; + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult, depth: number): TResult[]; + } + type LodashFlatMapDepth1x5 = (depth: number) => TResult[]; + type LodashFlatMapDepth1x6 = (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult) => TResult[]; + interface LodashFlatMapDepth2x1 { + (depth: number): LodashFlatMapDepth2x3; + (depth: lodash.__, collection: T | null | undefined): LodashFlatMapDepth2x5; + (depth: number, collection: T | null | undefined): TResult[]; + } + type LodashFlatMapDepth2x3 = (collection: T | null | undefined) => TResult[]; + interface LodashFlatMapDepth2x4 { + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult): LodashFlatMapDepth2x5; + (iteratee: lodash.__, depth: number): LodashFlatMapDepth2x6; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult, depth: number): TResult[]; + } + type LodashFlatMapDepth2x5 = (depth: number) => TResult[]; + type LodashFlatMapDepth2x6 = (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult) => TResult[]; + interface LodashFlatMapDepth3x1 { + (depth: number): LodashFlatMapDepth3x3; + (depth: lodash.__, collection: object | null | undefined): LodashFlatMapDepth3x5; + (depth: number, collection: object | null | undefined): any[]; + } + type LodashFlatMapDepth3x3 = (collection: object | null | undefined) => any[]; + interface LodashFlatMapDepth3x4 { + (iteratee: string): LodashFlatMapDepth3x5; + (iteratee: lodash.__, depth: number): LodashFlatMapDepth3x6; + (iteratee: string, depth: number): any[]; + (iteratee: object): LodashFlatMapDepth4x5; + (iteratee: object, depth: number): boolean[]; + } + type LodashFlatMapDepth3x5 = (depth: number) => any[]; + interface LodashFlatMapDepth3x6 { + (iteratee: string): any[]; + (iteratee: object): boolean[]; + } + interface LodashFlatMapDepth4x1 { + (depth: number): LodashFlatMapDepth4x3; + (depth: lodash.__, collection: object | null | undefined): LodashFlatMapDepth4x5; + (depth: number, collection: object | null | undefined): boolean[]; + } + type LodashFlatMapDepth4x3 = (collection: object | null | undefined) => boolean[]; + type LodashFlatMapDepth4x5 = (depth: number) => boolean[]; + type LodashFlatten = (array: lodash.List> | null | undefined) => T[]; + type LodashFlattenDeep = (array: lodash.ListOfRecursiveArraysOrValues | null | undefined) => T[]; + interface LodashFlattenDepth { + (depth: number): LodashFlattenDepth1x1; + (depth: lodash.__, array: lodash.ListOfRecursiveArraysOrValues | null | undefined): LodashFlattenDepth1x2; + (depth: number, array: lodash.ListOfRecursiveArraysOrValues | null | undefined): T[]; + } + type LodashFlattenDepth1x1 = (array: lodash.ListOfRecursiveArraysOrValues | null | undefined) => T[]; + type LodashFlattenDepth1x2 = (depth: number) => T[]; + type LodashFlip = any>(func: T) => T; + type LodashFloor = (n: number) => number; + interface LodashFlow { + (f1: () => R1, f2: (a: R1) => R2): () => R2; + (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): () => R3; + (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): () => R4; + (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): () => R5; + (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): () => R6; + (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): () => R7; + (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): () => any; + (f1: (a1: A1) => R1, f2: (a: R1) => R2): (a1: A1) => R2; + (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1) => R3; + (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1) => R4; + (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1) => R5; + (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1) => R6; + (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1) => R7; + (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1) => any; + (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2) => R2; + (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2) => R3; + (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2) => R4; + (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2) => R5; + (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2) => R6; + (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2) => R7; + (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2) => any; + (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3) => R2; + (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3) => R3; + (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3) => R4; + (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3) => R5; + (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3) => R6; + (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3) => R7; + (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3) => any; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3, a4: A4) => any; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any; + (funcs: Array any>>): (...args: any[]) => any; + } + interface LodashForIn { + (iteratee: (value: T) => any): LodashForIn1x1; + (iteratee: lodash.__, object: T): LodashForIn1x2; + (iteratee: (value: T[keyof T]) => any, object: T): T; + (iteratee: lodash.__, object: T | null | undefined): LodashForIn2x2; + (iteratee: (value: T[keyof T]) => any, object: T | null | undefined): T | null | undefined; + } + interface LodashForIn1x1 { + (object: T1): T1; + (object: T1 | null | undefined): T1 | null | undefined; + } + type LodashForIn1x2 = (iteratee: (value: T[keyof T]) => any) => T; + type LodashForIn2x2 = (iteratee: (value: T[keyof T]) => any) => T | null | undefined; + interface LodashForInRight { + (iteratee: (value: T) => any): LodashForInRight1x1; + (iteratee: lodash.__, object: T): LodashForInRight1x2; + (iteratee: (value: T[keyof T]) => any, object: T): T; + (iteratee: lodash.__, object: T | null | undefined): LodashForInRight2x2; + (iteratee: (value: T[keyof T]) => any, object: T | null | undefined): T | null | undefined; + } + interface LodashForInRight1x1 { + (object: T1): T1; + (object: T1 | null | undefined): T1 | null | undefined; + } + type LodashForInRight1x2 = (iteratee: (value: T[keyof T]) => any) => T; + type LodashForInRight2x2 = (iteratee: (value: T[keyof T]) => any) => T | null | undefined; + interface LodashForOwn { + (iteratee: (value: T) => any): LodashForOwn1x1; + (iteratee: lodash.__, object: T): LodashForOwn1x2; + (iteratee: (value: T[keyof T]) => any, object: T): T; + (iteratee: lodash.__, object: T | null | undefined): LodashForOwn2x2; + (iteratee: (value: T[keyof T]) => any, object: T | null | undefined): T | null | undefined; + } + interface LodashForOwn1x1 { + (object: T1): T1; + (object: T1 | null | undefined): T1 | null | undefined; + } + type LodashForOwn1x2 = (iteratee: (value: T[keyof T]) => any) => T; + type LodashForOwn2x2 = (iteratee: (value: T[keyof T]) => any) => T | null | undefined; + interface LodashForOwnRight { + (iteratee: (value: T) => any): LodashForOwnRight1x1; + (iteratee: lodash.__, object: T): LodashForOwnRight1x2; + (iteratee: (value: T[keyof T]) => any, object: T): T; + (iteratee: lodash.__, object: T | null | undefined): LodashForOwnRight2x2; + (iteratee: (value: T[keyof T]) => any, object: T | null | undefined): T | null | undefined; + } + interface LodashForOwnRight1x1 { + (object: T1): T1; + (object: T1 | null | undefined): T1 | null | undefined; + } + type LodashForOwnRight1x2 = (iteratee: (value: T[keyof T]) => any) => T; + type LodashForOwnRight2x2 = (iteratee: (value: T[keyof T]) => any) => T | null | undefined; + interface LodashFromPairs { + (pairs: lodash.List<[lodash.PropertyName, T]> | null | undefined): lodash.Dictionary; + (pairs: lodash.List | null | undefined): lodash.Dictionary; + } + type LodashFunctions = (object: any) => string[]; + type LodashFunctionsIn = (object: any) => string[]; + interface LodashGet { + (path: TKey | [TKey]): LodashGet1x1; + (path: lodash.__, object: TObject): LodashGet1x2; + (path: TKey | [TKey], object: TObject): TObject[TKey]; + (path: lodash.__, object: TObject | null | undefined): LodashGet2x2; + (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; + (path: number): LodashGet3x1; + (path: lodash.__, object: lodash.NumericDictionary): LodashGet3x2; + (path: number, object: lodash.NumericDictionary): T; + (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashGet4x2; + (path: number, object: lodash.NumericDictionary | null | undefined): T | undefined; + (path: lodash.PropertyPath): LodashGet5x1; + (path: lodash.__, object: null | undefined): LodashGet5x2; + (path: lodash.PropertyPath, object: null | undefined): undefined; + (path: lodash.__, object: any): LodashGet6x2; + (path: lodash.PropertyPath, object: any): any; + } + interface LodashGet1x1 { + (object: TObject): TObject[TKey]; + (object: TObject | null | undefined): TObject[TKey] | undefined; + } + type LodashGet1x2 = (path: TKey | [TKey]) => TObject[TKey]; + type LodashGet2x2 = (path: TKey | [TKey]) => TObject[TKey] | undefined; + interface LodashGet3x1 { + (object: lodash.NumericDictionary): T; + (object: lodash.NumericDictionary | null | undefined): T | undefined; + } + type LodashGet3x2 = (path: number) => T; + type LodashGet4x2 = (path: number) => T | undefined; + interface LodashGet5x1 { + (object: null | undefined): undefined; + (object: any): any; + } + type LodashGet5x2 = (path: lodash.PropertyPath) => undefined; + type LodashGet6x2 = (path: lodash.PropertyPath) => any; + interface LodashGetOr { + (defaultValue: TDefault): LodashGetOr1x1; + (defaultValue: lodash.__, path: TKey | [TKey]): LodashGetOr1x2; + (defaultValue: TDefault, path: TKey | [TKey]): LodashGetOr1x3; + (defaultValue: lodash.__, path: lodash.__, object: TObject | null | undefined): LodashGetOr1x4; + (defaultValue: TDefault, path: lodash.__, object: TObject | null | undefined): LodashGetOr1x5; + (defaultValue: lodash.__, path: TKey | [TKey], object: TObject | null | undefined): LodashGetOr1x6; + (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (defaultValue: lodash.__, path: number): LodashGetOr2x2; + (defaultValue: TDefault, path: number): LodashGetOr2x3; + (defaultValue: lodash.__, path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashGetOr2x4; + (defaultValue: TDefault, path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashGetOr2x5; + (defaultValue: lodash.__, path: number, object: lodash.NumericDictionary | null | undefined): LodashGetOr2x6; + (defaultValue: TDefault, path: number, object: lodash.NumericDictionary | null | undefined): T | TDefault; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashGetOr3x2; + (defaultValue: TDefault, path: lodash.PropertyPath): LodashGetOr3x3; + (defaultValue: lodash.__, path: lodash.__, object: null | undefined): LodashGetOr3x4; + (defaultValue: TDefault, path: lodash.__, object: null | undefined): LodashGetOr3x5; + (defaultValue: lodash.__, path: lodash.PropertyPath, object: null | undefined): LodashGetOr3x6; + (defaultValue: TDefault, path: lodash.PropertyPath, object: null | undefined): TDefault; + (defaultValue: any): LodashGetOr4x1; + (defaultValue: any, path: lodash.PropertyPath): LodashGetOr4x3; + (defaultValue: lodash.__, path: lodash.__, object: any): LodashGetOr4x4; + (defaultValue: any, path: lodash.__, object: any): LodashGetOr4x5; + (defaultValue: lodash.__, path: lodash.PropertyPath, object: any): LodashGetOr4x6; + (defaultValue: any, path: lodash.PropertyPath, object: any): any; + } + interface LodashGetOr1x1 { + (path: TKey | [TKey]): LodashGetOr1x3; + (path: lodash.__, object: TObject | null | undefined): LodashGetOr1x5; + (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (path: number): LodashGetOr2x3; + (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashGetOr2x5; + (path: number, object: lodash.NumericDictionary | null | undefined): T | TDefault; + (path: lodash.PropertyPath): LodashGetOr3x3; + (path: lodash.__, object: null | undefined): LodashGetOr3x5; + (path: lodash.PropertyPath, object: null | undefined): TDefault; + } + interface LodashGetOr1x2 { + (defaultValue: TDefault): LodashGetOr1x3; + (defaultValue: lodash.__, object: TObject | null | undefined): LodashGetOr1x6; + (defaultValue: TDefault, object: TObject | null | undefined): TObject[TKey] | TDefault; + } + type LodashGetOr1x3 = (object: TObject | null | undefined) => TObject[TKey] | TDefault; + interface LodashGetOr1x4 { + (defaultValue: TDefault): LodashGetOr1x5; + (defaultValue: lodash.__, path: TKey | [TKey]): LodashGetOr1x6; + (defaultValue: TDefault, path: TKey | [TKey]): TObject[TKey] | TDefault; + } + type LodashGetOr1x5 = (path: TKey | [TKey]) => TObject[TKey] | TDefault; + type LodashGetOr1x6 = (defaultValue: TDefault) => TObject[TKey] | TDefault; + interface LodashGetOr2x2 { + (defaultValue: TDefault): LodashGetOr2x3; + (defaultValue: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashGetOr2x6; + (defaultValue: TDefault, object: lodash.NumericDictionary | null | undefined): T | TDefault; + } + type LodashGetOr2x3 = (object: lodash.NumericDictionary | null | undefined) => T | TDefault; + interface LodashGetOr2x4 { + (defaultValue: TDefault): LodashGetOr2x5; + (defaultValue: lodash.__, path: number): LodashGetOr2x6; + (defaultValue: TDefault, path: number): T | TDefault; + } + type LodashGetOr2x5 = (path: number) => T | TDefault; + type LodashGetOr2x6 = (defaultValue: TDefault) => T | TDefault; + interface LodashGetOr3x2 { + (defaultValue: TDefault): LodashGetOr3x3; + (defaultValue: lodash.__, object: null | undefined): LodashGetOr3x6; + (defaultValue: TDefault, object: null | undefined): TDefault; + (defaultValue: any): LodashGetOr4x3; + (defaultValue: lodash.__, object: any): LodashGetOr4x6; + (defaultValue: any, object: any): any; + } + type LodashGetOr3x3 = (object: null | undefined) => TDefault; + interface LodashGetOr3x4 { + (defaultValue: TDefault): LodashGetOr3x5; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashGetOr3x6; + (defaultValue: TDefault, path: lodash.PropertyPath): TDefault; + } + type LodashGetOr3x5 = (path: lodash.PropertyPath) => TDefault; + type LodashGetOr3x6 = (defaultValue: TDefault) => TDefault; + interface LodashGetOr4x1 { + (path: lodash.PropertyPath): LodashGetOr4x3; + (path: lodash.__, object: any): LodashGetOr4x5; + (path: lodash.PropertyPath, object: any): any; + } + type LodashGetOr4x3 = (object: any) => any; + interface LodashGetOr4x4 { + (defaultValue: any): LodashGetOr4x5; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashGetOr4x6; + (defaultValue: any, path: lodash.PropertyPath): any; + } + type LodashGetOr4x5 = (path: lodash.PropertyPath) => any; + type LodashGetOr4x6 = (defaultValue: any) => any; + interface LodashGroupBy { + (iteratee: (value: string) => lodash.NotVoid): LodashGroupBy1x1; + (iteratee: lodash.__, collection: string | null | undefined): LodashGroupBy1x2; + (iteratee: (value: string) => lodash.NotVoid, collection: string | null | undefined): lodash.Dictionary; + (iteratee: lodash.ValueIteratee): LodashGroupBy2x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashGroupBy2x2; + (iteratee: lodash.ValueIteratee, collection: lodash.List | null | undefined): lodash.Dictionary; + (iteratee: lodash.__, collection: T | null | undefined): LodashGroupBy3x2; + (iteratee: lodash.ValueIteratee, collection: T | null | undefined): lodash.Dictionary>; + } + type LodashGroupBy1x1 = (collection: string | null | undefined) => lodash.Dictionary; + type LodashGroupBy1x2 = (iteratee: (value: string) => lodash.NotVoid) => lodash.Dictionary; + type LodashGroupBy2x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; + type LodashGroupBy2x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; + type LodashGroupBy3x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary>; + interface LodashGt { + (value: any): LodashGt1x1; + (value: lodash.__, other: any): LodashGt1x2; + (value: any, other: any): boolean; + } + type LodashGt1x1 = (other: any) => boolean; + type LodashGt1x2 = (value: any) => boolean; + interface LodashGte { + (value: any): LodashGte1x1; + (value: lodash.__, other: any): LodashGte1x2; + (value: any, other: any): boolean; + } + type LodashGte1x1 = (other: any) => boolean; + type LodashGte1x2 = (value: any) => boolean; + interface LodashHas { + (path: lodash.PropertyPath): LodashHas1x1; + (path: lodash.__, object: T): LodashHas1x2; + (path: lodash.PropertyPath, object: T): boolean; + } + type LodashHas1x1 = (object: T) => boolean; + type LodashHas1x2 = (path: lodash.PropertyPath) => boolean; + interface LodashHasIn { + (path: lodash.PropertyPath): LodashHasIn1x1; + (path: lodash.__, object: T): LodashHasIn1x2; + (path: lodash.PropertyPath, object: T): boolean; + } + type LodashHasIn1x1 = (object: T) => boolean; + type LodashHasIn1x2 = (path: lodash.PropertyPath) => boolean; + interface LodashIdentity { + (value: T): T; + (): undefined; + } + interface LodashIncludes { + (target: T): LodashIncludes1x1; + (target: lodash.__, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashIncludes1x2; + (target: T, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): boolean; + } + type LodashIncludes1x1 = (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined) => boolean; + type LodashIncludes1x2 = (target: T) => boolean; + interface LodashIncludesFrom { + (target: T): LodashIncludesFrom1x1; + (target: lodash.__, fromIndex: number): LodashIncludesFrom1x2; + (target: T, fromIndex: number): LodashIncludesFrom1x3; + (target: lodash.__, fromIndex: lodash.__, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashIncludesFrom1x4; + (target: T, fromIndex: lodash.__, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashIncludesFrom1x5; + (target: lodash.__, fromIndex: number, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashIncludesFrom1x6; + (target: T, fromIndex: number, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): boolean; + } + interface LodashIncludesFrom1x1 { + (fromIndex: number): LodashIncludesFrom1x3; + (fromIndex: lodash.__, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashIncludesFrom1x5; + (fromIndex: number, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): boolean; + } + interface LodashIncludesFrom1x2 { + (target: T): LodashIncludesFrom1x3; + (target: lodash.__, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashIncludesFrom1x6; + (target: T, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): boolean; + } + type LodashIncludesFrom1x3 = (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined) => boolean; + interface LodashIncludesFrom1x4 { + (target: T): LodashIncludesFrom1x5; + (target: lodash.__, fromIndex: number): LodashIncludesFrom1x6; + (target: T, fromIndex: number): boolean; + } + type LodashIncludesFrom1x5 = (fromIndex: number) => boolean; + type LodashIncludesFrom1x6 = (target: T) => boolean; + interface LodashKeyBy { + (iteratee: (value: string) => lodash.PropertyName): LodashKeyBy1x1; + (iteratee: lodash.__, collection: string | null | undefined): LodashKeyBy1x2; + (iteratee: (value: string) => lodash.PropertyName, collection: string | null | undefined): lodash.Dictionary; + (iteratee: lodash.ValueIterateeCustom): LodashKeyBy2x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashKeyBy2x2; + (iteratee: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): lodash.Dictionary; + (iteratee: lodash.__, collection: T | null | undefined): LodashKeyBy3x2; + (iteratee: lodash.ValueIterateeCustom, collection: T | null | undefined): lodash.Dictionary; + } + type LodashKeyBy1x1 = (collection: string | null | undefined) => lodash.Dictionary; + type LodashKeyBy1x2 = (iteratee: (value: string) => lodash.PropertyName) => lodash.Dictionary; + type LodashKeyBy2x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; + type LodashKeyBy2x2 = (iteratee: lodash.ValueIterateeCustom) => lodash.Dictionary; + type LodashKeyBy3x2 = (iteratee: lodash.ValueIterateeCustom) => lodash.Dictionary; + interface LodashIndexOf { + (value: T): LodashIndexOf1x1; + (value: lodash.__, array: lodash.List | null | undefined): LodashIndexOf1x2; + (value: T, array: lodash.List | null | undefined): number; + } + type LodashIndexOf1x1 = (array: lodash.List | null | undefined) => number; + type LodashIndexOf1x2 = (value: T) => number; + interface LodashIndexOfFrom { + (value: T): LodashIndexOfFrom1x1; + (value: lodash.__, fromIndex: number): LodashIndexOfFrom1x2; + (value: T, fromIndex: number): LodashIndexOfFrom1x3; + (value: lodash.__, fromIndex: lodash.__, array: lodash.List | null | undefined): LodashIndexOfFrom1x4; + (value: T, fromIndex: lodash.__, array: lodash.List | null | undefined): LodashIndexOfFrom1x5; + (value: lodash.__, fromIndex: number, array: lodash.List | null | undefined): LodashIndexOfFrom1x6; + (value: T, fromIndex: number, array: lodash.List | null | undefined): number; + } + interface LodashIndexOfFrom1x1 { + (fromIndex: number): LodashIndexOfFrom1x3; + (fromIndex: lodash.__, array: lodash.List | null | undefined): LodashIndexOfFrom1x5; + (fromIndex: number, array: lodash.List | null | undefined): number; + } + interface LodashIndexOfFrom1x2 { + (value: T): LodashIndexOfFrom1x3; + (value: lodash.__, array: lodash.List | null | undefined): LodashIndexOfFrom1x6; + (value: T, array: lodash.List | null | undefined): number; + } + type LodashIndexOfFrom1x3 = (array: lodash.List | null | undefined) => number; + interface LodashIndexOfFrom1x4 { + (value: T): LodashIndexOfFrom1x5; + (value: lodash.__, fromIndex: number): LodashIndexOfFrom1x6; + (value: T, fromIndex: number): number; + } + type LodashIndexOfFrom1x5 = (fromIndex: number) => number; + type LodashIndexOfFrom1x6 = (value: T) => number; + type LodashInitial = (array: lodash.List | null | undefined) => T[]; + interface LodashInRange { + (start: number): LodashInRange1x1; + (start: lodash.__, end: number): LodashInRange1x2; + (start: number, end: number): LodashInRange1x3; + (start: lodash.__, end: lodash.__, n: number): LodashInRange1x4; + (start: number, end: lodash.__, n: number): LodashInRange1x5; + (start: lodash.__, end: number, n: number): LodashInRange1x6; + (start: number, end: number, n: number): boolean; + } + interface LodashInRange1x1 { + (end: number): LodashInRange1x3; + (end: lodash.__, n: number): LodashInRange1x5; + (end: number, n: number): boolean; + } + interface LodashInRange1x2 { + (start: number): LodashInRange1x3; + (start: lodash.__, n: number): LodashInRange1x6; + (start: number, n: number): boolean; + } + type LodashInRange1x3 = (n: number) => boolean; + interface LodashInRange1x4 { + (start: number): LodashInRange1x5; + (start: lodash.__, end: number): LodashInRange1x6; + (start: number, end: number): boolean; + } + type LodashInRange1x5 = (end: number) => boolean; + type LodashInRange1x6 = (start: number) => boolean; + interface LodashIntersection { + (arrays2: lodash.List): LodashIntersection1x1; + (arrays2: lodash.__, arrays: lodash.List): LodashIntersection1x2; + (arrays2: lodash.List, arrays: lodash.List): T[]; + } + type LodashIntersection1x1 = (arrays: lodash.List) => T[]; + type LodashIntersection1x2 = (arrays2: lodash.List) => T[]; + interface LodashIntersectionBy { + (iteratee: lodash.ValueIteratee): LodashIntersectionBy1x1; + (iteratee: lodash.__, array: lodash.List | null): LodashIntersectionBy1x2; + (iteratee: lodash.ValueIteratee, array: lodash.List | null): LodashIntersectionBy1x3; + (iteratee: lodash.__, array: lodash.__, values: lodash.List): LodashIntersectionBy1x4; + (iteratee: lodash.ValueIteratee, array: lodash.__, values: lodash.List): LodashIntersectionBy1x5; + (iteratee: lodash.__, array: lodash.List | null, values: lodash.List): LodashIntersectionBy1x6; + (iteratee: lodash.ValueIteratee, array: lodash.List | null, values: lodash.List): T1[]; + } + interface LodashIntersectionBy1x1 { + (array: lodash.List | null): LodashIntersectionBy1x3; + (array: lodash.__, values: lodash.List): LodashIntersectionBy1x5; + (array: lodash.List | null, values: lodash.List): T1[]; + } + interface LodashIntersectionBy1x2 { + (iteratee: lodash.ValueIteratee): LodashIntersectionBy1x3; + (iteratee: lodash.__, values: lodash.List): LodashIntersectionBy1x6; + (iteratee: lodash.ValueIteratee, values: lodash.List): T1[]; + } + type LodashIntersectionBy1x3 = (values: lodash.List) => T1[]; + interface LodashIntersectionBy1x4 { + (iteratee: lodash.ValueIteratee): LodashIntersectionBy1x5; + (iteratee: lodash.__, array: lodash.List | null): LodashIntersectionBy1x6; + (iteratee: lodash.ValueIteratee, array: lodash.List | null): T1[]; + } + type LodashIntersectionBy1x5 = (array: lodash.List | null) => T1[]; + type LodashIntersectionBy1x6 = (iteratee: lodash.ValueIteratee) => T1[]; + interface LodashIntersectionWith { + (comparator: lodash.Comparator2): LodashIntersectionWith1x1; + (comparator: lodash.__, array: lodash.List | null | undefined): LodashIntersectionWith1x2; + (comparator: lodash.Comparator2, array: lodash.List | null | undefined): LodashIntersectionWith1x3; + (comparator: lodash.__, array: lodash.__, values: lodash.List): LodashIntersectionWith1x4; + (comparator: lodash.Comparator2, array: lodash.__, values: lodash.List): LodashIntersectionWith1x5; + (comparator: lodash.__, array: lodash.List | null | undefined, values: lodash.List): LodashIntersectionWith1x6; + (comparator: lodash.Comparator2, array: lodash.List | null | undefined, values: lodash.List): T1[]; + } + interface LodashIntersectionWith1x1 { + (array: lodash.List | null | undefined): LodashIntersectionWith1x3; + (array: lodash.__, values: lodash.List): LodashIntersectionWith1x5; + (array: lodash.List | null | undefined, values: lodash.List): T1[]; + } + interface LodashIntersectionWith1x2 { + (comparator: lodash.Comparator2): LodashIntersectionWith1x3; + (comparator: lodash.__, values: lodash.List): LodashIntersectionWith1x6; + (comparator: lodash.Comparator2, values: lodash.List): T1[]; + } + type LodashIntersectionWith1x3 = (values: lodash.List) => T1[]; + interface LodashIntersectionWith1x4 { + (comparator: lodash.Comparator2): LodashIntersectionWith1x5; + (comparator: lodash.__, array: lodash.List | null | undefined): LodashIntersectionWith1x6; + (comparator: lodash.Comparator2, array: lodash.List | null | undefined): T1[]; + } + type LodashIntersectionWith1x5 = (array: lodash.List | null | undefined) => T1[]; + type LodashIntersectionWith1x6 = (comparator: lodash.Comparator2) => T1[]; + type LodashInvert = (object: object) => lodash.Dictionary; + interface LodashInvertBy { + (interatee: lodash.ValueIteratee): LodashInvertBy1x1; + (interatee: lodash.__, object: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashInvertBy1x2; + (interatee: lodash.ValueIteratee, object: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; + (interatee: lodash.__, object: T | null | undefined): LodashInvertBy2x2; + (interatee: lodash.ValueIteratee, object: T | null | undefined): lodash.Dictionary; + } + type LodashInvertBy1x1 = (object: lodash.List | lodash.Dictionary | lodash.NumericDictionary | object | null | undefined) => lodash.Dictionary; + type LodashInvertBy1x2 = (interatee: lodash.ValueIteratee) => lodash.Dictionary; + type LodashInvertBy2x2 = (interatee: lodash.ValueIteratee) => lodash.Dictionary; + interface LodashInvoke { + (path: lodash.PropertyPath): LodashInvoke1x1; + (path: lodash.__, object: any): LodashInvoke1x2; + (path: lodash.PropertyPath, object: any): any; + } + type LodashInvoke1x1 = (object: any) => any; + type LodashInvoke1x2 = (path: lodash.PropertyPath) => any; + interface LodashInvokeArgs { + (path: lodash.PropertyPath): LodashInvokeArgs1x1; + (path: lodash.__, args: ReadonlyArray): LodashInvokeArgs1x2; + (path: lodash.PropertyPath, args: ReadonlyArray): LodashInvokeArgs1x3; + (path: lodash.__, args: lodash.__, object: any): LodashInvokeArgs1x4; + (path: lodash.PropertyPath, args: lodash.__, object: any): LodashInvokeArgs1x5; + (path: lodash.__, args: ReadonlyArray, object: any): LodashInvokeArgs1x6; + (path: lodash.PropertyPath, args: ReadonlyArray, object: any): any; + } + interface LodashInvokeArgs1x1 { + (args: ReadonlyArray): LodashInvokeArgs1x3; + (args: lodash.__, object: any): LodashInvokeArgs1x5; + (args: ReadonlyArray, object: any): any; + } + interface LodashInvokeArgs1x2 { + (path: lodash.PropertyPath): LodashInvokeArgs1x3; + (path: lodash.__, object: any): LodashInvokeArgs1x6; + (path: lodash.PropertyPath, object: any): any; + } + type LodashInvokeArgs1x3 = (object: any) => any; + interface LodashInvokeArgs1x4 { + (path: lodash.PropertyPath): LodashInvokeArgs1x5; + (path: lodash.__, args: ReadonlyArray): LodashInvokeArgs1x6; + (path: lodash.PropertyPath, args: ReadonlyArray): any; + } + type LodashInvokeArgs1x5 = (args: ReadonlyArray) => any; + type LodashInvokeArgs1x6 = (path: lodash.PropertyPath) => any; + interface LodashInvokeArgsMap { + (methodName: string): LodashInvokeArgsMap1x1; + (methodNameOrMethod: lodash.__, args: ReadonlyArray): LodashInvokeArgsMap1x2; + (methodName: string, args: ReadonlyArray): LodashInvokeArgsMap1x3; + (methodNameOrMethod: lodash.__, args: lodash.__, collection: object | null | undefined): LodashInvokeArgsMap1x4; + (methodName: string, args: lodash.__, collection: object | null | undefined): LodashInvokeArgsMap1x5; + (methodNameOrMethod: lodash.__, args: ReadonlyArray, collection: object | null | undefined): LodashInvokeArgsMap1x6; + (methodName: string, args: ReadonlyArray, collection: object | null | undefined): any[]; + (method: (...args: any[]) => TResult): LodashInvokeArgsMap2x1; + (method: (...args: any[]) => TResult, args: ReadonlyArray): LodashInvokeArgsMap2x3; + (method: (...args: any[]) => TResult, args: lodash.__, collection: object | null | undefined): LodashInvokeArgsMap2x5; + (method: (...args: any[]) => TResult, args: ReadonlyArray, collection: object | null | undefined): TResult[]; + } + interface LodashInvokeArgsMap1x1 { + (args: ReadonlyArray): LodashInvokeArgsMap1x3; + (args: lodash.__, collection: object | null | undefined): LodashInvokeArgsMap1x5; + (args: ReadonlyArray, collection: object | null | undefined): any[]; + } + interface LodashInvokeArgsMap1x2 { + (methodName: string): LodashInvokeArgsMap1x3; + (methodNameOrMethod: lodash.__, collection: object | null | undefined): LodashInvokeArgsMap1x6; + (methodName: string, collection: object | null | undefined): any[]; + (method: (...args: any[]) => TResult): LodashInvokeArgsMap2x3; + (method: (...args: any[]) => TResult, collection: object | null | undefined): TResult[]; + } + type LodashInvokeArgsMap1x3 = (collection: object | null | undefined) => any[]; + interface LodashInvokeArgsMap1x4 { + (methodName: string): LodashInvokeArgsMap1x5; + (methodNameOrMethod: lodash.__, args: ReadonlyArray): LodashInvokeArgsMap1x6; + (methodName: string, args: ReadonlyArray): any[]; + (method: (...args: any[]) => TResult): LodashInvokeArgsMap2x5; + (method: (...args: any[]) => TResult, args: ReadonlyArray): TResult[]; + } + type LodashInvokeArgsMap1x5 = (args: ReadonlyArray) => any[]; + interface LodashInvokeArgsMap1x6 { + (methodName: string): any[]; + (method: (...args: any[]) => TResult): TResult[]; + } + interface LodashInvokeArgsMap2x1 { + (args: ReadonlyArray): LodashInvokeArgsMap2x3; + (args: lodash.__, collection: object | null | undefined): LodashInvokeArgsMap2x5; + (args: ReadonlyArray, collection: object | null | undefined): TResult[]; + } + type LodashInvokeArgsMap2x3 = (collection: object | null | undefined) => TResult[]; + type LodashInvokeArgsMap2x5 = (args: ReadonlyArray) => TResult[]; + interface LodashInvokeMap { + (methodName: string): LodashInvokeMap1x1; + (methodNameOrMethod: lodash.__, collection: object | null | undefined): LodashInvokeMap1x2; + (methodName: string, collection: object | null | undefined): any[]; + (method: (...args: any[]) => TResult): LodashInvokeMap2x1; + (method: (...args: any[]) => TResult, collection: object | null | undefined): TResult[]; + } + type LodashInvokeMap1x1 = (collection: object | null | undefined) => any[]; + interface LodashInvokeMap1x2 { + (methodName: string): any[]; + (method: (...args: any[]) => TResult): TResult[]; + } + type LodashInvokeMap2x1 = (collection: object | null | undefined) => TResult[]; + type LodashIsArguments = (value: any) => value is IArguments; + type LodashIsArray = (value: any) => value is any[]; + type LodashIsArrayBuffer = (value: any) => value is ArrayBuffer; + interface LodashIsArrayLike { + (value: T & string & number): boolean; + (value: ((...args: any[]) => any) | null | undefined): value is never; + (value: any): value is { length: number }; + } + interface LodashIsArrayLikeObject { + (value: T & string & number): boolean; + // tslint:disable-next-line:ban-types (type guard doesn't seem to work correctly without the Function type) + (value: ((...args: any[]) => any) | Function | string | boolean | number | null | undefined): value is never; + // tslint:disable-next-line:ban-types (type guard doesn't seem to work correctly without the Function type) + (value: T | ((...args: any[]) => any) | Function | string | boolean | number | null | undefined): value is T & { length: number }; + } + type LodashIsBoolean = (value: any) => value is boolean; + type LodashIsBuffer = (value: any) => boolean; + type LodashIsDate = (value: any) => value is Date; + type LodashIsElement = (value: any) => boolean; + type LodashIsEmpty = (value: any) => boolean; + interface LodashIsEqualWith { + (customizer: lodash.IsEqualCustomizer): LodashIsEqualWith1x1; + (customizer: lodash.__, value: any): LodashIsEqualWith1x2; + (customizer: lodash.IsEqualCustomizer, value: any): LodashIsEqualWith1x3; + (customizer: lodash.__, value: lodash.__, other: any): LodashIsEqualWith1x4; + (customizer: lodash.IsEqualCustomizer, value: lodash.__, other: any): LodashIsEqualWith1x5; + (customizer: lodash.__, value: any, other: any): LodashIsEqualWith1x6; + (customizer: lodash.IsEqualCustomizer, value: any, other: any): boolean; + } + interface LodashIsEqualWith1x1 { + (value: any): LodashIsEqualWith1x3; + (value: lodash.__, other: any): LodashIsEqualWith1x5; + (value: any, other: any): boolean; + } + interface LodashIsEqualWith1x2 { + (customizer: lodash.IsEqualCustomizer): LodashIsEqualWith1x3; + (customizer: lodash.__, other: any): LodashIsEqualWith1x6; + (customizer: lodash.IsEqualCustomizer, other: any): boolean; + } + type LodashIsEqualWith1x3 = (other: any) => boolean; + interface LodashIsEqualWith1x4 { + (customizer: lodash.IsEqualCustomizer): LodashIsEqualWith1x5; + (customizer: lodash.__, value: any): LodashIsEqualWith1x6; + (customizer: lodash.IsEqualCustomizer, value: any): boolean; + } + type LodashIsEqualWith1x5 = (value: any) => boolean; + type LodashIsEqualWith1x6 = (customizer: lodash.IsEqualCustomizer) => boolean; + type LodashIsError = (value: any) => value is Error; + type LodashIsFinite = (value: any) => boolean; + type LodashIsFunction = (value: any) => value is (...args: any[]) => any; + type LodashIsInteger = (value: any) => boolean; + type LodashIsLength = (value: any) => boolean; + type LodashIsMap = (value: any) => value is Map; + interface LodashIsMatch { + (source: object): LodashIsMatch1x1; + (source: lodash.__, object: object): LodashIsMatch1x2; + (source: object, object: object): boolean; + } + type LodashIsMatch1x1 = (object: object) => boolean; + type LodashIsMatch1x2 = (source: object) => boolean; + interface LodashIsMatchWith { + (customizer: lodash.isMatchWithCustomizer): LodashIsMatchWith1x1; + (customizer: lodash.__, source: object): LodashIsMatchWith1x2; + (customizer: lodash.isMatchWithCustomizer, source: object): LodashIsMatchWith1x3; + (customizer: lodash.__, source: lodash.__, object: object): LodashIsMatchWith1x4; + (customizer: lodash.isMatchWithCustomizer, source: lodash.__, object: object): LodashIsMatchWith1x5; + (customizer: lodash.__, source: object, object: object): LodashIsMatchWith1x6; + (customizer: lodash.isMatchWithCustomizer, source: object, object: object): boolean; + } + interface LodashIsMatchWith1x1 { + (source: object): LodashIsMatchWith1x3; + (source: lodash.__, object: object): LodashIsMatchWith1x5; + (source: object, object: object): boolean; + } + interface LodashIsMatchWith1x2 { + (customizer: lodash.isMatchWithCustomizer): LodashIsMatchWith1x3; + (customizer: lodash.__, object: object): LodashIsMatchWith1x6; + (customizer: lodash.isMatchWithCustomizer, object: object): boolean; + } + type LodashIsMatchWith1x3 = (object: object) => boolean; + interface LodashIsMatchWith1x4 { + (customizer: lodash.isMatchWithCustomizer): LodashIsMatchWith1x5; + (customizer: lodash.__, source: object): LodashIsMatchWith1x6; + (customizer: lodash.isMatchWithCustomizer, source: object): boolean; + } + type LodashIsMatchWith1x5 = (source: object) => boolean; + type LodashIsMatchWith1x6 = (customizer: lodash.isMatchWithCustomizer) => boolean; + type LodashIsNaN = (value: any) => boolean; + type LodashIsNative = (value: any) => value is (...args: any[]) => any; + type LodashIsNil = (value: any) => value is null | undefined; + type LodashIsNull = (value: any) => value is null; + type LodashIsNumber = (value: any) => value is number; + type LodashIsObject = (value: any) => boolean; + type LodashIsObjectLike = (value: any) => boolean; + type LodashIsPlainObject = (value: any) => boolean; + type LodashIsRegExp = (value: any) => value is RegExp; + type LodashIsSafeInteger = (value: any) => boolean; + type LodashIsSet = (value: any) => value is Set; + type LodashIsString = (value: any) => value is string; + type LodashIsSymbol = (value: any) => boolean; + type LodashIsTypedArray = (value: any) => boolean; + type LodashIsUndefined = (value: any) => value is undefined; + type LodashIsWeakMap = (value: any) => value is WeakMap; + type LodashIsWeakSet = (value: any) => value is WeakSet; + interface LodashIteratee { + any>(func: TFunction): TFunction; + (func: string | object): (...args: any[]) => any; + } + interface LodashJoin { + (separator: string): LodashJoin1x1; + (separator: lodash.__, array: lodash.List | null | undefined): LodashJoin1x2; + (separator: string, array: lodash.List | null | undefined): string; + } + type LodashJoin1x1 = (array: lodash.List | null | undefined) => string; + type LodashJoin1x2 = (separator: string) => string; + type LodashOver = (iteratees: lodash.Many<(...args: any[]) => TResult>) => (...args: any[]) => TResult[]; + type LodashKebabCase = (string: string) => string; + type LodashKeys = (object: any) => string[]; + type LodashKeysIn = (object: any) => string[]; + type LodashLast = (array: lodash.List | null | undefined) => T | undefined; + interface LodashLastIndexOf { + (value: T): LodashLastIndexOf1x1; + (value: lodash.__, array: lodash.List | null | undefined): LodashLastIndexOf1x2; + (value: T, array: lodash.List | null | undefined): number; + } + type LodashLastIndexOf1x1 = (array: lodash.List | null | undefined) => number; + type LodashLastIndexOf1x2 = (value: T) => number; + interface LodashLastIndexOfFrom { + (value: T): LodashLastIndexOfFrom1x1; + (value: lodash.__, fromIndex: true|number): LodashLastIndexOfFrom1x2; + (value: T, fromIndex: true|number): LodashLastIndexOfFrom1x3; + (value: lodash.__, fromIndex: lodash.__, array: lodash.List | null | undefined): LodashLastIndexOfFrom1x4; + (value: T, fromIndex: lodash.__, array: lodash.List | null | undefined): LodashLastIndexOfFrom1x5; + (value: lodash.__, fromIndex: true|number, array: lodash.List | null | undefined): LodashLastIndexOfFrom1x6; + (value: T, fromIndex: true|number, array: lodash.List | null | undefined): number; + } + interface LodashLastIndexOfFrom1x1 { + (fromIndex: true|number): LodashLastIndexOfFrom1x3; + (fromIndex: lodash.__, array: lodash.List | null | undefined): LodashLastIndexOfFrom1x5; + (fromIndex: true|number, array: lodash.List | null | undefined): number; + } + interface LodashLastIndexOfFrom1x2 { + (value: T): LodashLastIndexOfFrom1x3; + (value: lodash.__, array: lodash.List | null | undefined): LodashLastIndexOfFrom1x6; + (value: T, array: lodash.List | null | undefined): number; + } + type LodashLastIndexOfFrom1x3 = (array: lodash.List | null | undefined) => number; + interface LodashLastIndexOfFrom1x4 { + (value: T): LodashLastIndexOfFrom1x5; + (value: lodash.__, fromIndex: true|number): LodashLastIndexOfFrom1x6; + (value: T, fromIndex: true|number): number; + } + type LodashLastIndexOfFrom1x5 = (fromIndex: true|number) => number; + type LodashLastIndexOfFrom1x6 = (value: T) => number; + type LodashLowerCase = (string: string) => string; + type LodashLowerFirst = (string: string) => string; + interface LodashLt { + (value: any): LodashLt1x1; + (value: lodash.__, other: any): LodashLt1x2; + (value: any, other: any): boolean; + } + type LodashLt1x1 = (other: any) => boolean; + type LodashLt1x2 = (value: any) => boolean; + interface LodashLte { + (value: any): LodashLte1x1; + (value: lodash.__, other: any): LodashLte1x2; + (value: any, other: any): boolean; + } + type LodashLte1x1 = (other: any) => boolean; + type LodashLte1x2 = (value: any) => boolean; + interface LodashMap { + (iteratee: (value: T) => TResult): LodashMap1x1; + (iteratee: lodash.__, collection: T[] | null | undefined): LodashMap1x2; + (iteratee: (value: T) => TResult, collection: T[] | lodash.List | null | undefined): TResult[]; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashMap2x2; + (iteratee: (value: T[keyof T]) => TResult): LodashMap3x1; + (iteratee: lodash.__, collection: T | null | undefined): LodashMap3x2; + (iteratee: (value: T[keyof T]) => TResult, collection: T | null | undefined): TResult[]; + (iteratee: K): LodashMap4x1; + (iteratee: lodash.__, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashMap4x2; + (iteratee: K, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): Array; + (iteratee: string): LodashMap5x1; + (iteratee: string, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): any[]; + (iteratee: object): LodashMap6x1; + (iteratee: object, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): boolean[]; + } + type LodashMap1x1 = (collection: T[] | lodash.List | null | undefined) => TResult[]; + type LodashMap1x2 = (iteratee: (value: T) => TResult) => TResult[]; + type LodashMap2x2 = (iteratee: (value: T) => TResult) => TResult[]; + type LodashMap3x1 = (collection: T | null | undefined) => TResult[]; + type LodashMap3x2 = (iteratee: (value: T[keyof T]) => TResult) => TResult[]; + type LodashMap4x1 = (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined) => Array; + interface LodashMap4x2 { + (iteratee: K): Array; + (iteratee: string): any[]; + (iteratee: object): boolean[]; + } + type LodashMap5x1 = (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined) => any[]; + type LodashMap6x1 = (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined) => boolean[]; + interface LodashMapKeys { + (iteratee: lodash.ValueIteratee): LodashMapKeys1x1; + (iteratee: lodash.__, object: lodash.List | null | undefined): LodashMapKeys1x2; + (iteratee: lodash.ValueIteratee, object: lodash.List | null | undefined): lodash.Dictionary; + (iteratee: lodash.ValueIteratee): LodashMapKeys2x1; + (iteratee: lodash.__, object: T | null | undefined): LodashMapKeys2x2; + (iteratee: lodash.ValueIteratee, object: T | null | undefined): lodash.Dictionary; + } + type LodashMapKeys1x1 = (object: lodash.List | null | undefined) => lodash.Dictionary; + type LodashMapKeys1x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; + type LodashMapKeys2x1 = (object: T | null | undefined) => lodash.Dictionary; + type LodashMapKeys2x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; + interface LodashMapValues { + (callback: (value: string) => TResult): LodashMapValues1x1; + (callback: lodash.__, obj: string | null | undefined): LodashMapValues1x2; + (callback: (value: string) => TResult, obj: string | null | undefined): lodash.NumericDictionary; + (callback: (value: T) => TResult): LodashMapValues2x1; + (callbackOrIterateeOrIterateeOrIteratee: lodash.__, obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashMapValues2x2; + (callback: (value: T) => TResult, obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; + (callback: (value: T[keyof T]) => TResult): LodashMapValues3x1; + (callbackOrIterateeOrIteratee: lodash.__, obj: T | null | undefined): LodashMapValues3x2; + (callback: (value: T[keyof T]) => TResult, obj: T | null | undefined): { [P in keyof T]: TResult }; + (iteratee: object): LodashMapValues4x1; + (iteratee: object, obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; + (iteratee: object, obj: T | null | undefined): { [P in keyof T]: boolean }; + (iteratee: TKey): LodashMapValues6x1; + (iteratee: TKey, obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; + (iteratee: string): LodashMapValues7x1; + (iteratee: string, obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; + (iteratee: string, obj: T | null | undefined): { [P in keyof T]: any }; + } + type LodashMapValues1x1 = (obj: string | null | undefined) => lodash.NumericDictionary; + type LodashMapValues1x2 = (callback: (value: string) => TResult) => lodash.NumericDictionary; + type LodashMapValues2x1 = (obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined) => lodash.Dictionary; + interface LodashMapValues2x2 { + (callback: (value: T) => TResult): lodash.Dictionary; + (iteratee: object): lodash.Dictionary; + (iteratee: TKey): lodash.Dictionary; + (iteratee: string): lodash.Dictionary; + } + type LodashMapValues3x1 = (obj: T | null | undefined) => { [P in keyof T]: TResult }; + interface LodashMapValues3x2 { + (callback: (value: T[keyof T]) => TResult): { [P in keyof T]: TResult }; + (iteratee: object): { [P in keyof T]: boolean }; + (iteratee: string): { [P in keyof T]: any }; + } + interface LodashMapValues4x1 { + (obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; + (obj: T | null | undefined): { [P in keyof T]: boolean }; + } + type LodashMapValues6x1 = (obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined) => lodash.Dictionary; + interface LodashMapValues7x1 { + (obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; + (obj: T | null | undefined): { [P in keyof T]: any }; + } + interface LodashMatchesProperty { + (path: lodash.PropertyPath): LodashMatchesProperty1x1; + (path: lodash.__, srcValue: T): LodashMatchesProperty1x2; + (path: lodash.PropertyPath, srcValue: T): (value: any) => boolean; + } + type LodashMatchesProperty1x1 = (srcValue: T) => (value: any) => boolean; + type LodashMatchesProperty1x2 = (path: lodash.PropertyPath) => (value: any) => boolean; + type LodashMax = (collection: lodash.List | null | undefined) => T | undefined; + interface LodashMaxBy { + (iteratee: lodash.ValueIteratee): LodashMaxBy1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashMaxBy1x2; + (iteratee: lodash.ValueIteratee, collection: lodash.List | null | undefined): T | undefined; + } + type LodashMaxBy1x1 = (collection: lodash.List | null | undefined) => T | undefined; + type LodashMaxBy1x2 = (iteratee: lodash.ValueIteratee) => T | undefined; + type LodashMean = (collection: lodash.List | null | undefined) => number; + interface LodashMeanBy { + (iteratee: lodash.ValueIteratee): LodashMeanBy1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashMeanBy1x2; + (iteratee: lodash.ValueIteratee, collection: lodash.List | null | undefined): number; + } + type LodashMeanBy1x1 = (collection: lodash.List | null | undefined) => number; + type LodashMeanBy1x2 = (iteratee: lodash.ValueIteratee) => number; + type LodashMemoize = any>(func: T) => T & lodash.MemoizedFunction; + interface LodashMerge { + (object: TObject): LodashMerge1x1; + (object: lodash.__, source: TSource): LodashMerge1x2; + (object: TObject, source: TSource): TObject & TSource; + } + type LodashMerge1x1 = (source: TSource) => TObject & TSource; + type LodashMerge1x2 = (object: TObject) => TObject & TSource; + type LodashMergeAll = (object: ReadonlyArray) => any; + interface LodashMergeAllWith { + (customizer: lodash.MergeWithCustomizer): LodashMergeAllWith1x1; + (customizer: lodash.__, args: ReadonlyArray): LodashMergeAllWith1x2; + (customizer: lodash.MergeWithCustomizer, args: ReadonlyArray): any; + } + type LodashMergeAllWith1x1 = (args: ReadonlyArray) => any; + type LodashMergeAllWith1x2 = (customizer: lodash.MergeWithCustomizer) => any; + interface LodashMergeWith { + (customizer: lodash.MergeWithCustomizer): LodashMergeWith1x1; + (customizer: lodash.__, object: TObject): LodashMergeWith1x2; + (customizer: lodash.MergeWithCustomizer, object: TObject): LodashMergeWith1x3; + (customizer: lodash.__, object: lodash.__, source: TSource): LodashMergeWith1x4; + (customizer: lodash.MergeWithCustomizer, object: lodash.__, source: TSource): LodashMergeWith1x5; + (customizer: lodash.__, object: TObject, source: TSource): LodashMergeWith1x6; + (customizer: lodash.MergeWithCustomizer, object: TObject, source: TSource): TObject & TSource; + } + interface LodashMergeWith1x1 { + (object: TObject): LodashMergeWith1x3; + (object: lodash.__, source: TSource): LodashMergeWith1x5; + (object: TObject, source: TSource): TObject & TSource; + } + interface LodashMergeWith1x2 { + (customizer: lodash.MergeWithCustomizer): LodashMergeWith1x3; + (customizer: lodash.__, source: TSource): LodashMergeWith1x6; + (customizer: lodash.MergeWithCustomizer, source: TSource): TObject & TSource; + } + type LodashMergeWith1x3 = (source: TSource) => TObject & TSource; + interface LodashMergeWith1x4 { + (customizer: lodash.MergeWithCustomizer): LodashMergeWith1x5; + (customizer: lodash.__, object: TObject): LodashMergeWith1x6; + (customizer: lodash.MergeWithCustomizer, object: TObject): TObject & TSource; + } + type LodashMergeWith1x5 = (object: TObject) => TObject & TSource; + type LodashMergeWith1x6 = (customizer: lodash.MergeWithCustomizer) => TObject & TSource; + type LodashMethod = (path: lodash.PropertyPath) => (object: any) => any; + type LodashMethodOf = (object: object) => (path: lodash.PropertyPath) => any; + type LodashMin = (collection: lodash.List | null | undefined) => T | undefined; + interface LodashMinBy { + (iteratee: lodash.ValueIteratee): LodashMinBy1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashMinBy1x2; + (iteratee: lodash.ValueIteratee, collection: lodash.List | null | undefined): T | undefined; + } + type LodashMinBy1x1 = (collection: lodash.List | null | undefined) => T | undefined; + type LodashMinBy1x2 = (iteratee: lodash.ValueIteratee) => T | undefined; + interface LodashMultiply { + (multiplier: number): LodashMultiply1x1; + (multiplier: lodash.__, multiplicand: number): LodashMultiply1x2; + (multiplier: number, multiplicand: number): number; + } + type LodashMultiply1x1 = (multiplicand: number) => number; + type LodashMultiply1x2 = (multiplier: number) => number; + type LodashNoConflict = () => typeof _; + type LodashNoop = (...args: any[]) => void; + type LodashNow = () => number; + interface LodashNth { + (n: number): LodashNth1x1; + (n: lodash.__, array: lodash.List | null | undefined): LodashNth1x2; + (n: number, array: lodash.List | null | undefined): T | undefined; + } + type LodashNth1x1 = (array: lodash.List | null | undefined) => T | undefined; + type LodashNth1x2 = (n: number) => T | undefined; + type LodashNthArg = (n: number) => (...args: any[]) => any; + interface LodashOmit { + (paths: lodash.PropertyPath): LodashOmit1x1; + (paths: lodash.__, object: T | null | undefined): LodashOmit1x2; + (paths: lodash.PropertyPath, object: T | null | undefined): T; + (paths: lodash.__, object: T | null | undefined): LodashOmit2x2; + (paths: lodash.PropertyPath, object: T | null | undefined): lodash.PartialObject; + } + interface LodashOmit1x1 { + (object: T | null | undefined): T; + (object: T | null | undefined): lodash.PartialObject; + } + type LodashOmit1x2 = (paths: lodash.PropertyPath) => T; + type LodashOmit2x2 = (paths: lodash.PropertyPath) => lodash.PartialObject; + interface LodashOmitBy { + (predicate: lodash.ValueKeyIteratee): LodashOmitBy1x1; + (predicate: lodash.__, object: T | null | undefined): LodashOmitBy1x2; + (predicate: lodash.ValueKeyIteratee, object: T | null | undefined): lodash.PartialObject; + } + type LodashOmitBy1x1 = (object: T1 | null | undefined) => lodash.PartialObject; + type LodashOmitBy1x2 = (predicate: lodash.ValueKeyIteratee) => lodash.PartialObject; + type LodashOnce = any>(func: T) => T; + interface LodashOrderBy { + (iteratees: lodash.Many<(value: T) => lodash.NotVoid>): LodashOrderBy1x1; + (iteratees: lodash.__, orders: lodash.Many): LodashOrderBy1x2; + (iteratees: lodash.Many<(value: T) => lodash.NotVoid>, orders: lodash.Many): LodashOrderBy1x3; + (iteratees: lodash.__, orders: lodash.__, collection: lodash.List | null | undefined): LodashOrderBy1x4; + (iteratees: lodash.Many<(value: T) => lodash.NotVoid>, orders: lodash.__, collection: lodash.List | null | undefined): LodashOrderBy1x5; + (iteratees: lodash.__, orders: lodash.Many, collection: lodash.List | null | undefined): LodashOrderBy1x6; + (iteratees: lodash.Many<(value: T) => lodash.NotVoid> | lodash.Many>, orders: lodash.Many, collection: lodash.List | null | undefined): T[]; + (iteratees: lodash.Many>): LodashOrderBy2x1; + (iteratees: lodash.Many>, orders: lodash.Many): LodashOrderBy2x3; + (iteratees: lodash.Many>, orders: lodash.__, collection: lodash.List | null | undefined): LodashOrderBy2x5; + (iteratees: lodash.__, orders: lodash.__, collection: T | null | undefined): LodashOrderBy3x4; + (iteratees: lodash.Many<(value: T[keyof T]) => lodash.NotVoid>, orders: lodash.__, collection: T | null | undefined): LodashOrderBy3x5; + (iteratees: lodash.__, orders: lodash.Many, collection: T | null | undefined): LodashOrderBy3x6; + (iteratees: lodash.Many<(value: T[keyof T]) => lodash.NotVoid> | lodash.Many>, orders: lodash.Many, collection: T | null | undefined): Array; + (iteratees: lodash.Many>, orders: lodash.__, collection: T | null | undefined): LodashOrderBy4x5; + } + interface LodashOrderBy1x1 { + (orders: lodash.Many): LodashOrderBy1x3; + (orders: lodash.__, collection: lodash.List | null | undefined): LodashOrderBy1x5; + (orders: lodash.Many, collection: lodash.List | object | null | undefined): T[]; + (orders: lodash.__, collection: T1 | null | undefined): LodashOrderBy3x5; + } + interface LodashOrderBy1x2 { + (iteratees: lodash.Many<(value: T) => lodash.NotVoid>): LodashOrderBy1x3; + (iteratees: lodash.__, collection: lodash.List | null | undefined): LodashOrderBy1x6; + (iteratees: lodash.Many<(value: T) => lodash.NotVoid> | lodash.Many>, collection: lodash.List | null | undefined): T[]; + (iteratees: lodash.Many>): LodashOrderBy2x3; + (iteratees: lodash.__, collection: T | null | undefined): LodashOrderBy3x6; + (iteratees: lodash.Many<(value: T[keyof T]) => lodash.NotVoid> | lodash.Many>, collection: T | null | undefined): Array; + } + interface LodashOrderBy1x3 { + (collection: lodash.List | null | undefined): T[]; + (collection: object | null | undefined): object[]; + } + interface LodashOrderBy1x4 { + (iteratees: lodash.Many<(value: T) => lodash.NotVoid>): LodashOrderBy1x5; + (iteratees: lodash.__, orders: lodash.Many): LodashOrderBy1x6; + (iteratees: lodash.Many<(value: T) => lodash.NotVoid> | lodash.Many>, orders: lodash.Many): T[]; + (iteratees: lodash.Many>): LodashOrderBy2x5; + } + type LodashOrderBy1x5 = (orders: lodash.Many) => T[]; + type LodashOrderBy1x6 = (iteratees: lodash.Many<(value: T) => lodash.NotVoid> | lodash.Many>) => T[]; + interface LodashOrderBy2x1 { + (orders: lodash.Many): LodashOrderBy2x3; + (orders: lodash.__, collection: lodash.List | null | undefined): LodashOrderBy2x5; + (orders: lodash.Many, collection: lodash.List | object | null | undefined): T[]; + (orders: lodash.__, collection: T1 | null | undefined): LodashOrderBy4x5; + } + interface LodashOrderBy2x3 { + (collection: lodash.List | null | undefined): T[]; + (collection: object | null | undefined): object[]; + } + type LodashOrderBy2x5 = (orders: lodash.Many) => T[]; + interface LodashOrderBy3x4 { + (iteratees: lodash.Many<(value: T[keyof T]) => lodash.NotVoid>): LodashOrderBy3x5; + (iteratees: lodash.__, orders: lodash.Many): LodashOrderBy3x6; + (iteratees: lodash.Many<(value: T[keyof T]) => lodash.NotVoid> | lodash.Many>, orders: lodash.Many): Array; + (iteratees: lodash.Many>): LodashOrderBy4x5; + } + type LodashOrderBy3x5 = (orders: lodash.Many) => Array; + type LodashOrderBy3x6 = (iteratees: lodash.Many<(value: T[keyof T]) => lodash.NotVoid> | lodash.Many>) => Array; + type LodashOrderBy4x5 = (orders: lodash.Many) => Array; + interface LodashOverArgs { + (func: (...args: any[]) => any): LodashOverArgs1x1; + (func: lodash.__, transforms: lodash.Many<(...args: any[]) => any>): LodashOverArgs1x2; + (func: (...args: any[]) => any, transforms: lodash.Many<(...args: any[]) => any>): (...args: any[]) => any; + } + type LodashOverArgs1x1 = (transforms: lodash.Many<(...args: any[]) => any>) => (...args: any[]) => any; + type LodashOverArgs1x2 = (func: (...args: any[]) => any) => (...args: any[]) => any; + interface LodashPad { + (length: number): LodashPad1x1; + (length: lodash.__, string: string): LodashPad1x2; + (length: number, string: string): string; + } + type LodashPad1x1 = (string: string) => string; + type LodashPad1x2 = (length: number) => string; + interface LodashPadChars { + (chars: string): LodashPadChars1x1; + (chars: lodash.__, length: number): LodashPadChars1x2; + (chars: string, length: number): LodashPadChars1x3; + (chars: lodash.__, length: lodash.__, string: string): LodashPadChars1x4; + (chars: string, length: lodash.__, string: string): LodashPadChars1x5; + (chars: lodash.__, length: number, string: string): LodashPadChars1x6; + (chars: string, length: number, string: string): string; + } + interface LodashPadChars1x1 { + (length: number): LodashPadChars1x3; + (length: lodash.__, string: string): LodashPadChars1x5; + (length: number, string: string): string; + } + interface LodashPadChars1x2 { + (chars: string): LodashPadChars1x3; + (chars: lodash.__, string: string): LodashPadChars1x6; + (chars: string, string: string): string; + } + type LodashPadChars1x3 = (string: string) => string; + interface LodashPadChars1x4 { + (chars: string): LodashPadChars1x5; + (chars: lodash.__, length: number): LodashPadChars1x6; + (chars: string, length: number): string; + } + type LodashPadChars1x5 = (length: number) => string; + type LodashPadChars1x6 = (chars: string) => string; + interface LodashPadCharsEnd { + (chars: string): LodashPadCharsEnd1x1; + (chars: lodash.__, length: number): LodashPadCharsEnd1x2; + (chars: string, length: number): LodashPadCharsEnd1x3; + (chars: lodash.__, length: lodash.__, string: string): LodashPadCharsEnd1x4; + (chars: string, length: lodash.__, string: string): LodashPadCharsEnd1x5; + (chars: lodash.__, length: number, string: string): LodashPadCharsEnd1x6; + (chars: string, length: number, string: string): string; + } + interface LodashPadCharsEnd1x1 { + (length: number): LodashPadCharsEnd1x3; + (length: lodash.__, string: string): LodashPadCharsEnd1x5; + (length: number, string: string): string; + } + interface LodashPadCharsEnd1x2 { + (chars: string): LodashPadCharsEnd1x3; + (chars: lodash.__, string: string): LodashPadCharsEnd1x6; + (chars: string, string: string): string; + } + type LodashPadCharsEnd1x3 = (string: string) => string; + interface LodashPadCharsEnd1x4 { + (chars: string): LodashPadCharsEnd1x5; + (chars: lodash.__, length: number): LodashPadCharsEnd1x6; + (chars: string, length: number): string; + } + type LodashPadCharsEnd1x5 = (length: number) => string; + type LodashPadCharsEnd1x6 = (chars: string) => string; + interface LodashPadCharsStart { + (chars: string): LodashPadCharsStart1x1; + (chars: lodash.__, length: number): LodashPadCharsStart1x2; + (chars: string, length: number): LodashPadCharsStart1x3; + (chars: lodash.__, length: lodash.__, string: string): LodashPadCharsStart1x4; + (chars: string, length: lodash.__, string: string): LodashPadCharsStart1x5; + (chars: lodash.__, length: number, string: string): LodashPadCharsStart1x6; + (chars: string, length: number, string: string): string; + } + interface LodashPadCharsStart1x1 { + (length: number): LodashPadCharsStart1x3; + (length: lodash.__, string: string): LodashPadCharsStart1x5; + (length: number, string: string): string; + } + interface LodashPadCharsStart1x2 { + (chars: string): LodashPadCharsStart1x3; + (chars: lodash.__, string: string): LodashPadCharsStart1x6; + (chars: string, string: string): string; + } + type LodashPadCharsStart1x3 = (string: string) => string; + interface LodashPadCharsStart1x4 { + (chars: string): LodashPadCharsStart1x5; + (chars: lodash.__, length: number): LodashPadCharsStart1x6; + (chars: string, length: number): string; + } + type LodashPadCharsStart1x5 = (length: number) => string; + type LodashPadCharsStart1x6 = (chars: string) => string; + interface LodashPadEnd { + (length: number): LodashPadEnd1x1; + (length: lodash.__, string: string): LodashPadEnd1x2; + (length: number, string: string): string; + } + type LodashPadEnd1x1 = (string: string) => string; + type LodashPadEnd1x2 = (length: number) => string; + interface LodashPadStart { + (length: number): LodashPadStart1x1; + (length: lodash.__, string: string): LodashPadStart1x2; + (length: number, string: string): string; + } + type LodashPadStart1x1 = (string: string) => string; + type LodashPadStart1x2 = (length: number) => string; + interface LodashParseInt { + (radix: number): LodashParseInt1x1; + (radix: lodash.__, string: string): LodashParseInt1x2; + (radix: number, string: string): number; + } + type LodashParseInt1x1 = (string: string) => number; + type LodashParseInt1x2 = (radix: number) => number; + interface LodashPartial { + (args: ReadonlyArray): LodashPartial1x1; + (args: lodash.__, func: (...args: any[]) => any): LodashPartial1x2; + (args: ReadonlyArray, func: (...args: any[]) => any): (...args: any[]) => any; + placeholder: lodash.__; + } + type LodashPartial1x1 = (func: (...args: any[]) => any) => (...args: any[]) => any; + type LodashPartial1x2 = (args: ReadonlyArray) => (...args: any[]) => any; + interface LodashPartialRight { + (args: ReadonlyArray): LodashPartialRight1x1; + (args: lodash.__, func: (...args: any[]) => any): LodashPartialRight1x2; + (args: ReadonlyArray, func: (...args: any[]) => any): (...args: any[]) => any; + placeholder: lodash.__; + } + type LodashPartialRight1x1 = (func: (...args: any[]) => any) => (...args: any[]) => any; + type LodashPartialRight1x2 = (args: ReadonlyArray) => (...args: any[]) => any; + interface LodashPartition { + (callback: lodash.ValueIteratee): LodashPartition1x1; + (callback: lodash.__, collection: lodash.List | null | undefined): LodashPartition1x2; + (callback: lodash.ValueIteratee, collection: lodash.List | null | undefined): [T[], T[]]; + (callback: lodash.__, collection: T | null | undefined): LodashPartition2x2; + (callback: lodash.ValueIteratee, collection: T | null | undefined): [Array, Array]; + } + type LodashPartition1x1 = (collection: lodash.List | object | null | undefined) => [T[], T[]]; + type LodashPartition1x2 = (callback: lodash.ValueIteratee) => [T[], T[]]; + type LodashPartition2x2 = (callback: lodash.ValueIteratee) => [Array, Array]; + interface LodashPath { + (path: TKey | [TKey]): LodashPath1x1; + (path: lodash.__, object: TObject): LodashPath1x2; + (path: TKey | [TKey], object: TObject): TObject[TKey]; + (path: lodash.__, object: TObject | null | undefined): LodashPath2x2; + (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; + (path: number): LodashPath3x1; + (path: lodash.__, object: lodash.NumericDictionary): LodashPath3x2; + (path: number, object: lodash.NumericDictionary): T; + (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPath4x2; + (path: number, object: lodash.NumericDictionary | null | undefined): T | undefined; + (path: lodash.PropertyPath): LodashPath5x1; + (path: lodash.__, object: null | undefined): LodashPath5x2; + (path: lodash.PropertyPath, object: null | undefined): undefined; + (path: lodash.__, object: any): LodashPath6x2; + (path: lodash.PropertyPath, object: any): any; + } + interface LodashPath1x1 { + (object: TObject): TObject[TKey]; + (object: TObject | null | undefined): TObject[TKey] | undefined; + } + type LodashPath1x2 = (path: TKey | [TKey]) => TObject[TKey]; + type LodashPath2x2 = (path: TKey | [TKey]) => TObject[TKey] | undefined; + interface LodashPath3x1 { + (object: lodash.NumericDictionary): T; + (object: lodash.NumericDictionary | null | undefined): T | undefined; + } + type LodashPath3x2 = (path: number) => T; + type LodashPath4x2 = (path: number) => T | undefined; + interface LodashPath5x1 { + (object: null | undefined): undefined; + (object: any): any; + } + type LodashPath5x2 = (path: lodash.PropertyPath) => undefined; + type LodashPath6x2 = (path: lodash.PropertyPath) => any; + interface LodashPathOr { + (defaultValue: TDefault): LodashPathOr1x1; + (defaultValue: lodash.__, path: TKey | [TKey]): LodashPathOr1x2; + (defaultValue: TDefault, path: TKey | [TKey]): LodashPathOr1x3; + (defaultValue: lodash.__, path: lodash.__, object: TObject | null | undefined): LodashPathOr1x4; + (defaultValue: TDefault, path: lodash.__, object: TObject | null | undefined): LodashPathOr1x5; + (defaultValue: lodash.__, path: TKey | [TKey], object: TObject | null | undefined): LodashPathOr1x6; + (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (defaultValue: lodash.__, path: number): LodashPathOr2x2; + (defaultValue: TDefault, path: number): LodashPathOr2x3; + (defaultValue: lodash.__, path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPathOr2x4; + (defaultValue: TDefault, path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPathOr2x5; + (defaultValue: lodash.__, path: number, object: lodash.NumericDictionary | null | undefined): LodashPathOr2x6; + (defaultValue: TDefault, path: number, object: lodash.NumericDictionary | null | undefined): T | TDefault; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashPathOr3x2; + (defaultValue: TDefault, path: lodash.PropertyPath): LodashPathOr3x3; + (defaultValue: lodash.__, path: lodash.__, object: null | undefined): LodashPathOr3x4; + (defaultValue: TDefault, path: lodash.__, object: null | undefined): LodashPathOr3x5; + (defaultValue: lodash.__, path: lodash.PropertyPath, object: null | undefined): LodashPathOr3x6; + (defaultValue: TDefault, path: lodash.PropertyPath, object: null | undefined): TDefault; + (defaultValue: any): LodashPathOr4x1; + (defaultValue: any, path: lodash.PropertyPath): LodashPathOr4x3; + (defaultValue: lodash.__, path: lodash.__, object: any): LodashPathOr4x4; + (defaultValue: any, path: lodash.__, object: any): LodashPathOr4x5; + (defaultValue: lodash.__, path: lodash.PropertyPath, object: any): LodashPathOr4x6; + (defaultValue: any, path: lodash.PropertyPath, object: any): any; + } + interface LodashPathOr1x1 { + (path: TKey | [TKey]): LodashPathOr1x3; + (path: lodash.__, object: TObject | null | undefined): LodashPathOr1x5; + (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (path: number): LodashPathOr2x3; + (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPathOr2x5; + (path: number, object: lodash.NumericDictionary | null | undefined): T | TDefault; + (path: lodash.PropertyPath): LodashPathOr3x3; + (path: lodash.__, object: null | undefined): LodashPathOr3x5; + (path: lodash.PropertyPath, object: null | undefined): TDefault; + } + interface LodashPathOr1x2 { + (defaultValue: TDefault): LodashPathOr1x3; + (defaultValue: lodash.__, object: TObject | null | undefined): LodashPathOr1x6; + (defaultValue: TDefault, object: TObject | null | undefined): TObject[TKey] | TDefault; + } + type LodashPathOr1x3 = (object: TObject | null | undefined) => TObject[TKey] | TDefault; + interface LodashPathOr1x4 { + (defaultValue: TDefault): LodashPathOr1x5; + (defaultValue: lodash.__, path: TKey | [TKey]): LodashPathOr1x6; + (defaultValue: TDefault, path: TKey | [TKey]): TObject[TKey] | TDefault; + } + type LodashPathOr1x5 = (path: TKey | [TKey]) => TObject[TKey] | TDefault; + type LodashPathOr1x6 = (defaultValue: TDefault) => TObject[TKey] | TDefault; + interface LodashPathOr2x2 { + (defaultValue: TDefault): LodashPathOr2x3; + (defaultValue: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPathOr2x6; + (defaultValue: TDefault, object: lodash.NumericDictionary | null | undefined): T | TDefault; + } + type LodashPathOr2x3 = (object: lodash.NumericDictionary | null | undefined) => T | TDefault; + interface LodashPathOr2x4 { + (defaultValue: TDefault): LodashPathOr2x5; + (defaultValue: lodash.__, path: number): LodashPathOr2x6; + (defaultValue: TDefault, path: number): T | TDefault; + } + type LodashPathOr2x5 = (path: number) => T | TDefault; + type LodashPathOr2x6 = (defaultValue: TDefault) => T | TDefault; + interface LodashPathOr3x2 { + (defaultValue: TDefault): LodashPathOr3x3; + (defaultValue: lodash.__, object: null | undefined): LodashPathOr3x6; + (defaultValue: TDefault, object: null | undefined): TDefault; + (defaultValue: any): LodashPathOr4x3; + (defaultValue: lodash.__, object: any): LodashPathOr4x6; + (defaultValue: any, object: any): any; + } + type LodashPathOr3x3 = (object: null | undefined) => TDefault; + interface LodashPathOr3x4 { + (defaultValue: TDefault): LodashPathOr3x5; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashPathOr3x6; + (defaultValue: TDefault, path: lodash.PropertyPath): TDefault; + } + type LodashPathOr3x5 = (path: lodash.PropertyPath) => TDefault; + type LodashPathOr3x6 = (defaultValue: TDefault) => TDefault; + interface LodashPathOr4x1 { + (path: lodash.PropertyPath): LodashPathOr4x3; + (path: lodash.__, object: any): LodashPathOr4x5; + (path: lodash.PropertyPath, object: any): any; + } + type LodashPathOr4x3 = (object: any) => any; + interface LodashPathOr4x4 { + (defaultValue: any): LodashPathOr4x5; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashPathOr4x6; + (defaultValue: any, path: lodash.PropertyPath): any; + } + type LodashPathOr4x5 = (path: lodash.PropertyPath) => any; + type LodashPathOr4x6 = (defaultValue: any) => any; + interface LodashPick { + (props: lodash.Many): LodashPick1x1; + (props: lodash.__, object: T): LodashPick1x2; + (props: lodash.Many, object: T): Pick; + (props: lodash.PropertyPath): LodashPick2x1; + (props: lodash.__, object: T | null | undefined): LodashPick2x2; + (props: lodash.PropertyPath, object: T | null | undefined): lodash.PartialDeep; + } + type LodashPick1x1 = (object: T) => Pick; + type LodashPick1x2 = (props: lodash.Many) => Pick; + type LodashPick2x1 = (object: T | null | undefined) => lodash.PartialDeep; + type LodashPick2x2 = (props: lodash.PropertyPath) => lodash.PartialDeep; + interface LodashPickBy { + (predicate: lodash.ValueKeyIteratee): LodashPickBy1x1; + (predicate: lodash.__, object: T | null | undefined): LodashPickBy1x2; + (predicate: lodash.ValueKeyIteratee, object: T | null | undefined): lodash.PartialObject; + } + type LodashPickBy1x1 = (object: T1 | null | undefined) => lodash.PartialObject; + type LodashPickBy1x2 = (predicate: lodash.ValueKeyIteratee) => lodash.PartialObject; + interface LodashProp { + (path: TKey | [TKey]): LodashProp1x1; + (path: lodash.__, object: TObject): LodashProp1x2; + (path: TKey | [TKey], object: TObject): TObject[TKey]; + (path: lodash.__, object: TObject | null | undefined): LodashProp2x2; + (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; + (path: number): LodashProp3x1; + (path: lodash.__, object: lodash.NumericDictionary): LodashProp3x2; + (path: number, object: lodash.NumericDictionary): T; + (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashProp4x2; + (path: number, object: lodash.NumericDictionary | null | undefined): T | undefined; + (path: lodash.PropertyPath): LodashProp5x1; + (path: lodash.__, object: null | undefined): LodashProp5x2; + (path: lodash.PropertyPath, object: null | undefined): undefined; + (path: lodash.__, object: any): LodashProp6x2; + (path: lodash.PropertyPath, object: any): any; + } + interface LodashProp1x1 { + (object: TObject): TObject[TKey]; + (object: TObject | null | undefined): TObject[TKey] | undefined; + } + type LodashProp1x2 = (path: TKey | [TKey]) => TObject[TKey]; + type LodashProp2x2 = (path: TKey | [TKey]) => TObject[TKey] | undefined; + interface LodashProp3x1 { + (object: lodash.NumericDictionary): T; + (object: lodash.NumericDictionary | null | undefined): T | undefined; + } + type LodashProp3x2 = (path: number) => T; + type LodashProp4x2 = (path: number) => T | undefined; + interface LodashProp5x1 { + (object: null | undefined): undefined; + (object: any): any; + } + type LodashProp5x2 = (path: lodash.PropertyPath) => undefined; + type LodashProp6x2 = (path: lodash.PropertyPath) => any; + interface LodashProperty { + (path: TKey | [TKey]): LodashProperty1x1; + (path: lodash.__, object: TObject): LodashProperty1x2; + (path: TKey | [TKey], object: TObject): TObject[TKey]; + (path: lodash.__, object: TObject | null | undefined): LodashProperty2x2; + (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; + (path: number): LodashProperty3x1; + (path: lodash.__, object: lodash.NumericDictionary): LodashProperty3x2; + (path: number, object: lodash.NumericDictionary): T; + (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashProperty4x2; + (path: number, object: lodash.NumericDictionary | null | undefined): T | undefined; + (path: lodash.PropertyPath): LodashProperty5x1; + (path: lodash.__, object: null | undefined): LodashProperty5x2; + (path: lodash.PropertyPath, object: null | undefined): undefined; + (path: lodash.__, object: any): LodashProperty6x2; + (path: lodash.PropertyPath, object: any): any; + } + interface LodashProperty1x1 { + (object: TObject): TObject[TKey]; + (object: TObject | null | undefined): TObject[TKey] | undefined; + } + type LodashProperty1x2 = (path: TKey | [TKey]) => TObject[TKey]; + type LodashProperty2x2 = (path: TKey | [TKey]) => TObject[TKey] | undefined; + interface LodashProperty3x1 { + (object: lodash.NumericDictionary): T; + (object: lodash.NumericDictionary | null | undefined): T | undefined; + } + type LodashProperty3x2 = (path: number) => T; + type LodashProperty4x2 = (path: number) => T | undefined; + interface LodashProperty5x1 { + (object: null | undefined): undefined; + (object: any): any; + } + type LodashProperty5x2 = (path: lodash.PropertyPath) => undefined; + type LodashProperty6x2 = (path: lodash.PropertyPath) => any; + interface LodashPropertyOf { + (path: TKey | [TKey]): LodashPropertyOf1x1; + (path: lodash.__, object: TObject): LodashPropertyOf1x2; + (path: TKey | [TKey], object: TObject): TObject[TKey]; + (path: lodash.__, object: TObject | null | undefined): LodashPropertyOf2x2; + (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; + (path: number): LodashPropertyOf3x1; + (path: lodash.__, object: lodash.NumericDictionary): LodashPropertyOf3x2; + (path: number, object: lodash.NumericDictionary): T; + (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPropertyOf4x2; + (path: number, object: lodash.NumericDictionary | null | undefined): T | undefined; + (path: lodash.PropertyPath): LodashPropertyOf5x1; + (path: lodash.__, object: null | undefined): LodashPropertyOf5x2; + (path: lodash.PropertyPath, object: null | undefined): undefined; + (path: lodash.__, object: any): LodashPropertyOf6x2; + (path: lodash.PropertyPath, object: any): any; + } + interface LodashPropertyOf1x1 { + (object: TObject): TObject[TKey]; + (object: TObject | null | undefined): TObject[TKey] | undefined; + } + type LodashPropertyOf1x2 = (path: TKey | [TKey]) => TObject[TKey]; + type LodashPropertyOf2x2 = (path: TKey | [TKey]) => TObject[TKey] | undefined; + interface LodashPropertyOf3x1 { + (object: lodash.NumericDictionary): T; + (object: lodash.NumericDictionary | null | undefined): T | undefined; + } + type LodashPropertyOf3x2 = (path: number) => T; + type LodashPropertyOf4x2 = (path: number) => T | undefined; + interface LodashPropertyOf5x1 { + (object: null | undefined): undefined; + (object: any): any; + } + type LodashPropertyOf5x2 = (path: lodash.PropertyPath) => undefined; + type LodashPropertyOf6x2 = (path: lodash.PropertyPath) => any; + interface LodashPropOr { + (defaultValue: TDefault): LodashPropOr1x1; + (defaultValue: lodash.__, path: TKey | [TKey]): LodashPropOr1x2; + (defaultValue: TDefault, path: TKey | [TKey]): LodashPropOr1x3; + (defaultValue: lodash.__, path: lodash.__, object: TObject | null | undefined): LodashPropOr1x4; + (defaultValue: TDefault, path: lodash.__, object: TObject | null | undefined): LodashPropOr1x5; + (defaultValue: lodash.__, path: TKey | [TKey], object: TObject | null | undefined): LodashPropOr1x6; + (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (defaultValue: lodash.__, path: number): LodashPropOr2x2; + (defaultValue: TDefault, path: number): LodashPropOr2x3; + (defaultValue: lodash.__, path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPropOr2x4; + (defaultValue: TDefault, path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPropOr2x5; + (defaultValue: lodash.__, path: number, object: lodash.NumericDictionary | null | undefined): LodashPropOr2x6; + (defaultValue: TDefault, path: number, object: lodash.NumericDictionary | null | undefined): T | TDefault; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashPropOr3x2; + (defaultValue: TDefault, path: lodash.PropertyPath): LodashPropOr3x3; + (defaultValue: lodash.__, path: lodash.__, object: null | undefined): LodashPropOr3x4; + (defaultValue: TDefault, path: lodash.__, object: null | undefined): LodashPropOr3x5; + (defaultValue: lodash.__, path: lodash.PropertyPath, object: null | undefined): LodashPropOr3x6; + (defaultValue: TDefault, path: lodash.PropertyPath, object: null | undefined): TDefault; + (defaultValue: any): LodashPropOr4x1; + (defaultValue: any, path: lodash.PropertyPath): LodashPropOr4x3; + (defaultValue: lodash.__, path: lodash.__, object: any): LodashPropOr4x4; + (defaultValue: any, path: lodash.__, object: any): LodashPropOr4x5; + (defaultValue: lodash.__, path: lodash.PropertyPath, object: any): LodashPropOr4x6; + (defaultValue: any, path: lodash.PropertyPath, object: any): any; + } + interface LodashPropOr1x1 { + (path: TKey | [TKey]): LodashPropOr1x3; + (path: lodash.__, object: TObject | null | undefined): LodashPropOr1x5; + (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (path: number): LodashPropOr2x3; + (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPropOr2x5; + (path: number, object: lodash.NumericDictionary | null | undefined): T | TDefault; + (path: lodash.PropertyPath): LodashPropOr3x3; + (path: lodash.__, object: null | undefined): LodashPropOr3x5; + (path: lodash.PropertyPath, object: null | undefined): TDefault; + } + interface LodashPropOr1x2 { + (defaultValue: TDefault): LodashPropOr1x3; + (defaultValue: lodash.__, object: TObject | null | undefined): LodashPropOr1x6; + (defaultValue: TDefault, object: TObject | null | undefined): TObject[TKey] | TDefault; + } + type LodashPropOr1x3 = (object: TObject | null | undefined) => TObject[TKey] | TDefault; + interface LodashPropOr1x4 { + (defaultValue: TDefault): LodashPropOr1x5; + (defaultValue: lodash.__, path: TKey | [TKey]): LodashPropOr1x6; + (defaultValue: TDefault, path: TKey | [TKey]): TObject[TKey] | TDefault; + } + type LodashPropOr1x5 = (path: TKey | [TKey]) => TObject[TKey] | TDefault; + type LodashPropOr1x6 = (defaultValue: TDefault) => TObject[TKey] | TDefault; + interface LodashPropOr2x2 { + (defaultValue: TDefault): LodashPropOr2x3; + (defaultValue: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPropOr2x6; + (defaultValue: TDefault, object: lodash.NumericDictionary | null | undefined): T | TDefault; + } + type LodashPropOr2x3 = (object: lodash.NumericDictionary | null | undefined) => T | TDefault; + interface LodashPropOr2x4 { + (defaultValue: TDefault): LodashPropOr2x5; + (defaultValue: lodash.__, path: number): LodashPropOr2x6; + (defaultValue: TDefault, path: number): T | TDefault; + } + type LodashPropOr2x5 = (path: number) => T | TDefault; + type LodashPropOr2x6 = (defaultValue: TDefault) => T | TDefault; + interface LodashPropOr3x2 { + (defaultValue: TDefault): LodashPropOr3x3; + (defaultValue: lodash.__, object: null | undefined): LodashPropOr3x6; + (defaultValue: TDefault, object: null | undefined): TDefault; + (defaultValue: any): LodashPropOr4x3; + (defaultValue: lodash.__, object: any): LodashPropOr4x6; + (defaultValue: any, object: any): any; + } + type LodashPropOr3x3 = (object: null | undefined) => TDefault; + interface LodashPropOr3x4 { + (defaultValue: TDefault): LodashPropOr3x5; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashPropOr3x6; + (defaultValue: TDefault, path: lodash.PropertyPath): TDefault; + } + type LodashPropOr3x5 = (path: lodash.PropertyPath) => TDefault; + type LodashPropOr3x6 = (defaultValue: TDefault) => TDefault; + interface LodashPropOr4x1 { + (path: lodash.PropertyPath): LodashPropOr4x3; + (path: lodash.__, object: any): LodashPropOr4x5; + (path: lodash.PropertyPath, object: any): any; + } + type LodashPropOr4x3 = (object: any) => any; + interface LodashPropOr4x4 { + (defaultValue: any): LodashPropOr4x5; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashPropOr4x6; + (defaultValue: any, path: lodash.PropertyPath): any; + } + type LodashPropOr4x5 = (path: lodash.PropertyPath) => any; + type LodashPropOr4x6 = (defaultValue: any) => any; + interface LodashPull { + (values: T): LodashPull1x1; + (values: lodash.__, array: ReadonlyArray): LodashPull1x2; + (values: T, array: ReadonlyArray): T[]; + (values: lodash.__, array: lodash.List): LodashPull2x2; + (values: T, array: lodash.List): lodash.List; + } + interface LodashPull1x1 { + (array: ReadonlyArray): T[]; + (array: lodash.List): lodash.List; + } + type LodashPull1x2 = (values: T) => T[]; + type LodashPull2x2 = (values: T) => lodash.List; + interface LodashPullAll { + (values: lodash.List): LodashPullAll1x1; + (values: lodash.__, array: ReadonlyArray): LodashPullAll1x2; + (values: lodash.List, array: ReadonlyArray): T[]; + (values: lodash.__, array: lodash.List): LodashPullAll2x2; + (values: lodash.List, array: lodash.List): lodash.List; + } + interface LodashPullAll1x1 { + (array: ReadonlyArray): T[]; + (array: lodash.List): lodash.List; + } + type LodashPullAll1x2 = (values: lodash.List) => T[]; + type LodashPullAll2x2 = (values: lodash.List) => lodash.List; + interface LodashPullAllBy { + (iteratee: lodash.ValueIteratee): LodashPullAllBy1x1; + (iteratee: lodash.__, values: lodash.List): LodashPullAllBy1x2; + (iteratee: lodash.ValueIteratee, values: lodash.List): LodashPullAllBy1x3; + (iteratee: lodash.__, values: lodash.__, array: ReadonlyArray): LodashPullAllBy1x4; + (iteratee: lodash.ValueIteratee, values: lodash.__, array: ReadonlyArray): LodashPullAllBy1x5; + (iteratee: lodash.__, values: lodash.List, array: ReadonlyArray): LodashPullAllBy1x6; + (iteratee: lodash.ValueIteratee, values: lodash.List, array: ReadonlyArray): T[]; + (iteratee: lodash.__, values: lodash.__, array: lodash.List): LodashPullAllBy2x4; + (iteratee: lodash.ValueIteratee, values: lodash.__, array: lodash.List): LodashPullAllBy2x5; + (iteratee: lodash.__, values: lodash.List, array: lodash.List): LodashPullAllBy2x6; + (iteratee: lodash.ValueIteratee, values: lodash.List, array: lodash.List): lodash.List; + (iteratee: lodash.ValueIteratee): LodashPullAllBy3x1; + (iteratee: lodash.__, values: lodash.List): LodashPullAllBy3x2; + (iteratee: lodash.ValueIteratee, values: lodash.List): LodashPullAllBy3x3; + (iteratee: lodash.__, values: lodash.__, array: ReadonlyArray): LodashPullAllBy3x4; + (iteratee: lodash.ValueIteratee, values: lodash.__, array: ReadonlyArray): LodashPullAllBy3x5; + (iteratee: lodash.__, values: lodash.List, array: ReadonlyArray): LodashPullAllBy3x6; + (iteratee: lodash.ValueIteratee, values: lodash.List, array: ReadonlyArray): T1[]; + (iteratee: lodash.__, values: lodash.__, array: lodash.List): LodashPullAllBy4x4; + (iteratee: lodash.ValueIteratee, values: lodash.__, array: lodash.List): LodashPullAllBy4x5; + (iteratee: lodash.__, values: lodash.List, array: lodash.List): LodashPullAllBy4x6; + (iteratee: lodash.ValueIteratee, values: lodash.List, array: lodash.List): lodash.List; + } + interface LodashPullAllBy1x1 { + (values: lodash.List): LodashPullAllBy1x3; + (values: lodash.__, array: ReadonlyArray): LodashPullAllBy1x5; + (values: lodash.List, array: ReadonlyArray): T[]; + (values: lodash.__, array: lodash.List): LodashPullAllBy2x5; + (values: lodash.List, array: lodash.List): lodash.List; + } + interface LodashPullAllBy1x2 { + (iteratee: lodash.ValueIteratee): LodashPullAllBy1x3; + (iteratee: lodash.__, array: ReadonlyArray): LodashPullAllBy1x6; + (iteratee: lodash.ValueIteratee, array: ReadonlyArray): T[]; + (iteratee: lodash.__, array: lodash.List): LodashPullAllBy2x6; + (iteratee: lodash.ValueIteratee, array: lodash.List): lodash.List; + } + interface LodashPullAllBy1x3 { + (array: ReadonlyArray): T[]; + (array: lodash.List): lodash.List; + } + interface LodashPullAllBy1x4 { + (iteratee: lodash.ValueIteratee): LodashPullAllBy1x5; + (iteratee: lodash.__, values: lodash.List): LodashPullAllBy1x6; + (iteratee: lodash.ValueIteratee, values: lodash.List): T[]; + } + type LodashPullAllBy1x5 = (values: lodash.List) => T[]; + type LodashPullAllBy1x6 = (iteratee: lodash.ValueIteratee) => T[]; + interface LodashPullAllBy2x4 { + (iteratee: lodash.ValueIteratee): LodashPullAllBy2x5; + (iteratee: lodash.__, values: lodash.List): LodashPullAllBy2x6; + (iteratee: lodash.ValueIteratee, values: lodash.List): lodash.List; + } + type LodashPullAllBy2x5 = (values: lodash.List) => lodash.List; + type LodashPullAllBy2x6 = (iteratee: lodash.ValueIteratee) => lodash.List; + interface LodashPullAllBy3x1 { + (values: lodash.List): LodashPullAllBy3x3; + (values: lodash.__, array: ReadonlyArray): LodashPullAllBy3x5; + (values: lodash.List, array: ReadonlyArray): T1[]; + (values: lodash.__, array: lodash.List): LodashPullAllBy4x5; + (values: lodash.List, array: lodash.List): lodash.List; + } + interface LodashPullAllBy3x2 { + (iteratee: lodash.ValueIteratee): LodashPullAllBy3x3; + (iteratee: lodash.__, array: ReadonlyArray): LodashPullAllBy3x6; + (iteratee: lodash.ValueIteratee, array: ReadonlyArray): T1[]; + (iteratee: lodash.__, array: lodash.List): LodashPullAllBy4x6; + (iteratee: lodash.ValueIteratee, array: lodash.List): lodash.List; + } + interface LodashPullAllBy3x3 { + (array: ReadonlyArray): T1[]; + (array: lodash.List): lodash.List; + } + interface LodashPullAllBy3x4 { + (iteratee: lodash.ValueIteratee): LodashPullAllBy3x5; + (iteratee: lodash.__, values: lodash.List): LodashPullAllBy3x6; + (iteratee: lodash.ValueIteratee, values: lodash.List): T1[]; + } + type LodashPullAllBy3x5 = (values: lodash.List) => T1[]; + type LodashPullAllBy3x6 = (iteratee: lodash.ValueIteratee) => T1[]; + interface LodashPullAllBy4x4 { + (iteratee: lodash.ValueIteratee): LodashPullAllBy4x5; + (iteratee: lodash.__, values: lodash.List): LodashPullAllBy4x6; + (iteratee: lodash.ValueIteratee, values: lodash.List): lodash.List; + } + type LodashPullAllBy4x5 = (values: lodash.List) => lodash.List; + type LodashPullAllBy4x6 = (iteratee: lodash.ValueIteratee) => lodash.List; + interface LodashPullAllWith { + (comparator: lodash.Comparator): LodashPullAllWith1x1; + (comparator: lodash.__, values: lodash.List): LodashPullAllWith1x2; + (comparator: lodash.Comparator, values: lodash.List): LodashPullAllWith1x3; + (comparator: lodash.__, values: lodash.__, array: ReadonlyArray): LodashPullAllWith1x4; + (comparator: lodash.Comparator, values: lodash.__, array: ReadonlyArray): LodashPullAllWith1x5; + (comparator: lodash.__, values: lodash.List, array: ReadonlyArray): LodashPullAllWith1x6; + (comparator: lodash.Comparator, values: lodash.List, array: ReadonlyArray): T[]; + (comparator: lodash.__, values: lodash.__, array: lodash.List): LodashPullAllWith2x4; + (comparator: lodash.Comparator, values: lodash.__, array: lodash.List): LodashPullAllWith2x5; + (comparator: lodash.__, values: lodash.List, array: lodash.List): LodashPullAllWith2x6; + (comparator: lodash.Comparator, values: lodash.List, array: lodash.List): lodash.List; + (comparator: lodash.Comparator2): LodashPullAllWith3x1; + (comparator: lodash.__, values: lodash.List): LodashPullAllWith3x2; + (comparator: lodash.Comparator2, values: lodash.List): LodashPullAllWith3x3; + (comparator: lodash.__, values: lodash.__, array: ReadonlyArray): LodashPullAllWith3x4; + (comparator: lodash.Comparator2, values: lodash.__, array: ReadonlyArray): LodashPullAllWith3x5; + (comparator: lodash.__, values: lodash.List, array: ReadonlyArray): LodashPullAllWith3x6; + (comparator: lodash.Comparator2, values: lodash.List, array: ReadonlyArray): T1[]; + (comparator: lodash.__, values: lodash.__, array: lodash.List): LodashPullAllWith4x4; + (comparator: lodash.Comparator2, values: lodash.__, array: lodash.List): LodashPullAllWith4x5; + (comparator: lodash.__, values: lodash.List, array: lodash.List): LodashPullAllWith4x6; + (comparator: lodash.Comparator2, values: lodash.List, array: lodash.List): lodash.List; + } + interface LodashPullAllWith1x1 { + (values: lodash.List): LodashPullAllWith1x3; + (values: lodash.__, array: ReadonlyArray): LodashPullAllWith1x5; + (values: lodash.List, array: ReadonlyArray): T[]; + (values: lodash.__, array: lodash.List): LodashPullAllWith2x5; + (values: lodash.List, array: lodash.List): lodash.List; + } + interface LodashPullAllWith1x2 { + (comparator: lodash.Comparator): LodashPullAllWith1x3; + (comparator: lodash.__, array: ReadonlyArray): LodashPullAllWith1x6; + (comparator: lodash.Comparator, array: ReadonlyArray): T[]; + (comparator: lodash.__, array: lodash.List): LodashPullAllWith2x6; + (comparator: lodash.Comparator, array: lodash.List): lodash.List; + } + interface LodashPullAllWith1x3 { + (array: ReadonlyArray): T[]; + (array: lodash.List): lodash.List; + } + interface LodashPullAllWith1x4 { + (comparator: lodash.Comparator): LodashPullAllWith1x5; + (comparator: lodash.__, values: lodash.List): LodashPullAllWith1x6; + (comparator: lodash.Comparator, values: lodash.List): T[]; + } + type LodashPullAllWith1x5 = (values: lodash.List) => T[]; + type LodashPullAllWith1x6 = (comparator: lodash.Comparator) => T[]; + interface LodashPullAllWith2x4 { + (comparator: lodash.Comparator): LodashPullAllWith2x5; + (comparator: lodash.__, values: lodash.List): LodashPullAllWith2x6; + (comparator: lodash.Comparator, values: lodash.List): lodash.List; + } + type LodashPullAllWith2x5 = (values: lodash.List) => lodash.List; + type LodashPullAllWith2x6 = (comparator: lodash.Comparator) => lodash.List; + interface LodashPullAllWith3x1 { + (values: lodash.List): LodashPullAllWith3x3; + (values: lodash.__, array: ReadonlyArray): LodashPullAllWith3x5; + (values: lodash.List, array: ReadonlyArray): T1[]; + (values: lodash.__, array: lodash.List): LodashPullAllWith4x5; + (values: lodash.List, array: lodash.List): lodash.List; + } + interface LodashPullAllWith3x2 { + (comparator: lodash.Comparator2): LodashPullAllWith3x3; + (comparator: lodash.__, array: ReadonlyArray): LodashPullAllWith3x6; + (comparator: lodash.Comparator2, array: ReadonlyArray): T1[]; + (comparator: lodash.__, array: lodash.List): LodashPullAllWith4x6; + (comparator: lodash.Comparator2, array: lodash.List): lodash.List; + } + interface LodashPullAllWith3x3 { + (array: ReadonlyArray): T1[]; + (array: lodash.List): lodash.List; + } + interface LodashPullAllWith3x4 { + (comparator: lodash.Comparator2): LodashPullAllWith3x5; + (comparator: lodash.__, values: lodash.List): LodashPullAllWith3x6; + (comparator: lodash.Comparator2, values: lodash.List): T1[]; + } + type LodashPullAllWith3x5 = (values: lodash.List) => T1[]; + type LodashPullAllWith3x6 = (comparator: lodash.Comparator2) => T1[]; + interface LodashPullAllWith4x4 { + (comparator: lodash.Comparator2): LodashPullAllWith4x5; + (comparator: lodash.__, values: lodash.List): LodashPullAllWith4x6; + (comparator: lodash.Comparator2, values: lodash.List): lodash.List; + } + type LodashPullAllWith4x5 = (values: lodash.List) => lodash.List; + type LodashPullAllWith4x6 = (comparator: lodash.Comparator2) => lodash.List; + interface LodashPullAt { + (indexes: lodash.Many): LodashPullAt1x1; + (indexes: lodash.__, array: ReadonlyArray): LodashPullAt1x2; + (indexes: lodash.Many, array: ReadonlyArray): T[]; + (indexes: lodash.__, array: lodash.List): LodashPullAt2x2; + (indexes: lodash.Many, array: lodash.List): lodash.List; + } + interface LodashPullAt1x1 { + (array: ReadonlyArray): T[]; + (array: lodash.List): lodash.List; + } + type LodashPullAt1x2 = (indexes: lodash.Many) => T[]; + type LodashPullAt2x2 = (indexes: lodash.Many) => lodash.List; + interface LodashRandom { + (maxOrMin: number): LodashRandom1x1; + (max: lodash.__, floating: boolean): LodashRandom1x2; + (maxOrMin: number, floatingOrMax: boolean | number): number; + (min: lodash.__, max: number): LodashRandom2x2; + } + type LodashRandom1x1 = (floatingOrMax: boolean | number) => number; + type LodashRandom1x2 = (max: number) => number; + type LodashRandom2x2 = (min: number) => number; + interface LodashRange { + (start: number): LodashRange1x1; + (start: lodash.__, end: number): LodashRange1x2; + (start: number, end: number): number[]; + } + type LodashRange1x1 = (end: number) => number[]; + type LodashRange1x2 = (start: number) => number[]; + interface LodashRangeRight { + (start: number): LodashRangeRight1x1; + (start: lodash.__, end: number): LodashRangeRight1x2; + (start: number, end: number): number[]; + } + type LodashRangeRight1x1 = (end: number) => number[]; + type LodashRangeRight1x2 = (start: number) => number[]; + interface LodashRangeStep { + (start: number): LodashRangeStep1x1; + (start: lodash.__, end: number): LodashRangeStep1x2; + (start: number, end: number): LodashRangeStep1x3; + (start: lodash.__, end: lodash.__, step: number): LodashRangeStep1x4; + (start: number, end: lodash.__, step: number): LodashRangeStep1x5; + (start: lodash.__, end: number, step: number): LodashRangeStep1x6; + (start: number, end: number, step: number): number[]; + } + interface LodashRangeStep1x1 { + (end: number): LodashRangeStep1x3; + (end: lodash.__, step: number): LodashRangeStep1x5; + (end: number, step: number): number[]; + } + interface LodashRangeStep1x2 { + (start: number): LodashRangeStep1x3; + (start: lodash.__, step: number): LodashRangeStep1x6; + (start: number, step: number): number[]; + } + type LodashRangeStep1x3 = (step: number) => number[]; + interface LodashRangeStep1x4 { + (start: number): LodashRangeStep1x5; + (start: lodash.__, end: number): LodashRangeStep1x6; + (start: number, end: number): number[]; + } + type LodashRangeStep1x5 = (end: number) => number[]; + type LodashRangeStep1x6 = (start: number) => number[]; + interface LodashRangeStepRight { + (start: number): LodashRangeStepRight1x1; + (start: lodash.__, end: number): LodashRangeStepRight1x2; + (start: number, end: number): LodashRangeStepRight1x3; + (start: lodash.__, end: lodash.__, step: number): LodashRangeStepRight1x4; + (start: number, end: lodash.__, step: number): LodashRangeStepRight1x5; + (start: lodash.__, end: number, step: number): LodashRangeStepRight1x6; + (start: number, end: number, step: number): number[]; + } + interface LodashRangeStepRight1x1 { + (end: number): LodashRangeStepRight1x3; + (end: lodash.__, step: number): LodashRangeStepRight1x5; + (end: number, step: number): number[]; + } + interface LodashRangeStepRight1x2 { + (start: number): LodashRangeStepRight1x3; + (start: lodash.__, step: number): LodashRangeStepRight1x6; + (start: number, step: number): number[]; + } + type LodashRangeStepRight1x3 = (step: number) => number[]; + interface LodashRangeStepRight1x4 { + (start: number): LodashRangeStepRight1x5; + (start: lodash.__, end: number): LodashRangeStepRight1x6; + (start: number, end: number): number[]; + } + type LodashRangeStepRight1x5 = (end: number) => number[]; + type LodashRangeStepRight1x6 = (start: number) => number[]; + interface LodashRearg { + (indexes: lodash.Many): LodashRearg1x1; + (indexes: lodash.__, func: (...args: any[]) => any): LodashRearg1x2; + (indexes: lodash.Many, func: (...args: any[]) => any): (...args: any[]) => any; + } + type LodashRearg1x1 = (func: (...args: any[]) => any) => (...args: any[]) => any; + type LodashRearg1x2 = (indexes: lodash.Many) => (...args: any[]) => any; + interface LodashReduce { + (callback: lodash.MemoIteratorCapped): LodashReduce1x1; + (callback: lodash.__, accumulator: TResult): LodashReduce1x2; + (callback: lodash.MemoIteratorCapped, accumulator: TResult): LodashReduce1x3; + (callback: lodash.__, accumulator: lodash.__, collection: T[] | null | undefined): LodashReduce1x4; + (callback: lodash.MemoIteratorCapped, accumulator: lodash.__, collection: T[] | null | undefined): LodashReduce1x5; + (callback: lodash.__, accumulator: TResult, collection: T[] | null | undefined): LodashReduce1x6; + (callback: lodash.MemoIteratorCapped, accumulator: TResult, collection: T[] | lodash.List | null | undefined): TResult; + (callback: lodash.__, accumulator: lodash.__, collection: lodash.List | null | undefined): LodashReduce2x4; + (callback: lodash.MemoIteratorCapped, accumulator: lodash.__, collection: lodash.List | null | undefined): LodashReduce2x5; + (callback: lodash.__, accumulator: TResult, collection: lodash.List | null | undefined): LodashReduce2x6; + (callback: lodash.MemoIteratorCapped): LodashReduce3x1; + (callback: lodash.MemoIteratorCapped, accumulator: TResult): LodashReduce3x3; + (callback: lodash.__, accumulator: lodash.__, collection: T | null | undefined): LodashReduce3x4; + (callback: lodash.MemoIteratorCapped, accumulator: lodash.__, collection: T | null | undefined): LodashReduce3x5; + (callback: lodash.__, accumulator: TResult, collection: T | null | undefined): LodashReduce3x6; + (callback: lodash.MemoIteratorCapped, accumulator: TResult, collection: T | null | undefined): TResult; + } + interface LodashReduce1x1 { + (accumulator: TResult): LodashReduce1x3; + (accumulator: lodash.__, collection: T[] | null | undefined): LodashReduce1x5; + (accumulator: TResult, collection: T[] | lodash.List | null | undefined): TResult; + (accumulator: lodash.__, collection: lodash.List | null | undefined): LodashReduce2x5; + } + interface LodashReduce1x2 { + (callback: lodash.MemoIteratorCapped): LodashReduce1x3; + (callback: lodash.__, collection: T[] | null | undefined): LodashReduce1x6; + (callback: lodash.MemoIteratorCapped, collection: T[] | lodash.List | null | undefined): TResult; + (callback: lodash.__, collection: lodash.List | null | undefined): LodashReduce2x6; + (callback: lodash.MemoIteratorCapped): LodashReduce3x3; + (callback: lodash.__, collection: T | null | undefined): LodashReduce3x6; + (callback: lodash.MemoIteratorCapped, collection: T | null | undefined): TResult; + } + type LodashReduce1x3 = (collection: T[] | lodash.List | null | undefined) => TResult; + interface LodashReduce1x4 { + (callback: lodash.MemoIteratorCapped): LodashReduce1x5; + (callback: lodash.__, accumulator: TResult): LodashReduce1x6; + (callback: lodash.MemoIteratorCapped, accumulator: TResult): TResult; + } + type LodashReduce1x5 = (accumulator: TResult) => TResult; + type LodashReduce1x6 = (callback: lodash.MemoIteratorCapped) => TResult; + interface LodashReduce2x4 { + (callback: lodash.MemoIteratorCapped): LodashReduce2x5; + (callback: lodash.__, accumulator: TResult): LodashReduce2x6; + (callback: lodash.MemoIteratorCapped, accumulator: TResult): TResult; + } + type LodashReduce2x5 = (accumulator: TResult) => TResult; + type LodashReduce2x6 = (callback: lodash.MemoIteratorCapped) => TResult; + interface LodashReduce3x1 { + (accumulator: TResult): LodashReduce3x3; + (accumulator: lodash.__, collection: T | null | undefined): LodashReduce3x5; + (accumulator: TResult, collection: T | null | undefined): TResult; + } + type LodashReduce3x3 = (collection: T | null | undefined) => TResult; + interface LodashReduce3x4 { + (callback: lodash.MemoIteratorCapped): LodashReduce3x5; + (callback: lodash.__, accumulator: TResult): LodashReduce3x6; + (callback: lodash.MemoIteratorCapped, accumulator: TResult): TResult; + } + type LodashReduce3x5 = (accumulator: TResult) => TResult; + type LodashReduce3x6 = (callback: lodash.MemoIteratorCapped) => TResult; + interface LodashReduceRight { + (callback: lodash.MemoIteratorCappedRight): LodashReduceRight1x1; + (callback: lodash.__, accumulator: TResult): LodashReduceRight1x2; + (callback: lodash.MemoIteratorCappedRight, accumulator: TResult): LodashReduceRight1x3; + (callback: lodash.__, accumulator: lodash.__, collection: T[] | null | undefined): LodashReduceRight1x4; + (callback: lodash.MemoIteratorCappedRight, accumulator: lodash.__, collection: T[] | null | undefined): LodashReduceRight1x5; + (callback: lodash.__, accumulator: TResult, collection: T[] | null | undefined): LodashReduceRight1x6; + (callback: lodash.MemoIteratorCappedRight, accumulator: TResult, collection: T[] | lodash.List | null | undefined): TResult; + (callback: lodash.__, accumulator: lodash.__, collection: lodash.List | null | undefined): LodashReduceRight2x4; + (callback: lodash.MemoIteratorCappedRight, accumulator: lodash.__, collection: lodash.List | null | undefined): LodashReduceRight2x5; + (callback: lodash.__, accumulator: TResult, collection: lodash.List | null | undefined): LodashReduceRight2x6; + (callback: lodash.MemoIteratorCappedRight): LodashReduceRight3x1; + (callback: lodash.MemoIteratorCappedRight, accumulator: TResult): LodashReduceRight3x3; + (callback: lodash.__, accumulator: lodash.__, collection: T | null | undefined): LodashReduceRight3x4; + (callback: lodash.MemoIteratorCappedRight, accumulator: lodash.__, collection: T | null | undefined): LodashReduceRight3x5; + (callback: lodash.__, accumulator: TResult, collection: T | null | undefined): LodashReduceRight3x6; + (callback: lodash.MemoIteratorCappedRight, accumulator: TResult, collection: T | null | undefined): TResult; + } + interface LodashReduceRight1x1 { + (accumulator: TResult): LodashReduceRight1x3; + (accumulator: lodash.__, collection: T[] | null | undefined): LodashReduceRight1x5; + (accumulator: TResult, collection: T[] | lodash.List | null | undefined): TResult; + (accumulator: lodash.__, collection: lodash.List | null | undefined): LodashReduceRight2x5; + } + interface LodashReduceRight1x2 { + (callback: lodash.MemoIteratorCappedRight): LodashReduceRight1x3; + (callback: lodash.__, collection: T[] | null | undefined): LodashReduceRight1x6; + (callback: lodash.MemoIteratorCappedRight, collection: T[] | lodash.List | null | undefined): TResult; + (callback: lodash.__, collection: lodash.List | null | undefined): LodashReduceRight2x6; + (callback: lodash.MemoIteratorCappedRight): LodashReduceRight3x3; + (callback: lodash.__, collection: T | null | undefined): LodashReduceRight3x6; + (callback: lodash.MemoIteratorCappedRight, collection: T | null | undefined): TResult; + } + type LodashReduceRight1x3 = (collection: T[] | lodash.List | null | undefined) => TResult; + interface LodashReduceRight1x4 { + (callback: lodash.MemoIteratorCappedRight): LodashReduceRight1x5; + (callback: lodash.__, accumulator: TResult): LodashReduceRight1x6; + (callback: lodash.MemoIteratorCappedRight, accumulator: TResult): TResult; + } + type LodashReduceRight1x5 = (accumulator: TResult) => TResult; + type LodashReduceRight1x6 = (callback: lodash.MemoIteratorCappedRight) => TResult; + interface LodashReduceRight2x4 { + (callback: lodash.MemoIteratorCappedRight): LodashReduceRight2x5; + (callback: lodash.__, accumulator: TResult): LodashReduceRight2x6; + (callback: lodash.MemoIteratorCappedRight, accumulator: TResult): TResult; + } + type LodashReduceRight2x5 = (accumulator: TResult) => TResult; + type LodashReduceRight2x6 = (callback: lodash.MemoIteratorCappedRight) => TResult; + interface LodashReduceRight3x1 { + (accumulator: TResult): LodashReduceRight3x3; + (accumulator: lodash.__, collection: T | null | undefined): LodashReduceRight3x5; + (accumulator: TResult, collection: T | null | undefined): TResult; + } + type LodashReduceRight3x3 = (collection: T | null | undefined) => TResult; + interface LodashReduceRight3x4 { + (callback: lodash.MemoIteratorCappedRight): LodashReduceRight3x5; + (callback: lodash.__, accumulator: TResult): LodashReduceRight3x6; + (callback: lodash.MemoIteratorCappedRight, accumulator: TResult): TResult; + } + type LodashReduceRight3x5 = (accumulator: TResult) => TResult; + type LodashReduceRight3x6 = (callback: lodash.MemoIteratorCappedRight) => TResult; + interface LodashReject { + (predicate: (value: string) => boolean): LodashReject1x1; + (predicate: lodash.__, collection: string | null | undefined): LodashReject1x2; + (predicate: (value: string) => boolean, collection: string | null | undefined): string[]; + (predicate: lodash.ValueIterateeCustom): LodashReject2x1; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashReject2x2; + (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): T[]; + (predicate: lodash.__, collection: T | null | undefined): LodashReject3x2; + (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): Array; + } + type LodashReject1x1 = (collection: string | null | undefined) => string[]; + type LodashReject1x2 = (predicate: (value: string) => boolean) => string[]; + type LodashReject2x1 = (collection: lodash.List | object | null | undefined) => T[]; + type LodashReject2x2 = (predicate: lodash.ValueIterateeCustom) => T[]; + type LodashReject3x2 = (predicate: lodash.ValueIterateeCustom) => Array; + interface LodashRemove { + (predicate: lodash.ValueIteratee): LodashRemove1x1; + (predicate: lodash.__, array: lodash.List): LodashRemove1x2; + (predicate: lodash.ValueIteratee, array: lodash.List): T[]; + } + type LodashRemove1x1 = (array: lodash.List) => T[]; + type LodashRemove1x2 = (predicate: lodash.ValueIteratee) => T[]; + interface LodashRepeat { + (n: number): LodashRepeat1x1; + (n: lodash.__, string: string): LodashRepeat1x2; + (n: number, string: string): string; + } + type LodashRepeat1x1 = (string: string) => string; + type LodashRepeat1x2 = (n: number) => string; + interface LodashReplace { + (pattern: RegExp | string): LodashReplace1x1; + (pattern: lodash.__, replacement: lodash.ReplaceFunction | string): LodashReplace1x2; + (pattern: RegExp | string, replacement: lodash.ReplaceFunction | string): LodashReplace1x3; + (pattern: lodash.__, replacement: lodash.__, string: string): LodashReplace1x4; + (pattern: RegExp | string, replacement: lodash.__, string: string): LodashReplace1x5; + (pattern: lodash.__, replacement: lodash.ReplaceFunction | string, string: string): LodashReplace1x6; + (pattern: RegExp | string, replacement: lodash.ReplaceFunction | string, string: string): string; + } + interface LodashReplace1x1 { + (replacement: lodash.ReplaceFunction | string): LodashReplace1x3; + (replacement: lodash.__, string: string): LodashReplace1x5; + (replacement: lodash.ReplaceFunction | string, string: string): string; + } + interface LodashReplace1x2 { + (pattern: RegExp | string): LodashReplace1x3; + (pattern: lodash.__, string: string): LodashReplace1x6; + (pattern: RegExp | string, string: string): string; + } + type LodashReplace1x3 = (string: string) => string; + interface LodashReplace1x4 { + (pattern: RegExp | string): LodashReplace1x5; + (pattern: lodash.__, replacement: lodash.ReplaceFunction | string): LodashReplace1x6; + (pattern: RegExp | string, replacement: lodash.ReplaceFunction | string): string; + } + type LodashReplace1x5 = (replacement: lodash.ReplaceFunction | string) => string; + type LodashReplace1x6 = (pattern: RegExp | string) => string; + type LodashRest = (func: (...args: any[]) => any) => (...args: any[]) => any; + interface LodashRestFrom { + (start: number): LodashRestFrom1x1; + (start: lodash.__, func: (...args: any[]) => any): LodashRestFrom1x2; + (start: number, func: (...args: any[]) => any): (...args: any[]) => any; + } + type LodashRestFrom1x1 = (func: (...args: any[]) => any) => (...args: any[]) => any; + type LodashRestFrom1x2 = (start: number) => (...args: any[]) => any; + interface LodashResult { + (path: lodash.PropertyPath): LodashResult1x1; + (path: lodash.__, object: any): LodashResult1x2; + (path: lodash.PropertyPath, object: any): TResult; + } + type LodashResult1x1 = (object: any) => TResult; + type LodashResult1x2 = (path: lodash.PropertyPath) => TResult; + type LodashReverse = >(array: TList) => TList; + type LodashRound = (n: number) => number; + type LodashRunInContext = (context: object) => lodash.LoDashStatic; + interface LodashSample { + (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): T | undefined; + (collection: T | null | undefined): T[keyof T] | undefined; + } + interface LodashSampleSize { + (n: number): LodashSampleSize1x1; + (n: lodash.__, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashSampleSize1x2; + (n: number, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): T[]; + (n: lodash.__, collection: T | null | undefined): LodashSampleSize2x2; + (n: number, collection: T | null | undefined): Array; + } + interface LodashSampleSize1x1 { + (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): T[]; + (collection: T | null | undefined): Array; + } + type LodashSampleSize1x2 = (n: number) => T[]; + type LodashSampleSize2x2 = (n: number) => Array; + interface LodashSetWith { + (customizer: lodash.SetWithCustomizer): LodashSetWith1x1; + (customizer: lodash.__, path: lodash.PropertyPath): LodashSetWith1x2; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath): LodashSetWith1x3; + (customizer: lodash.__, path: lodash.__, value: any): LodashSetWith1x4; + (customizer: lodash.SetWithCustomizer, path: lodash.__, value: any): LodashSetWith1x5; + (customizer: lodash.__, path: lodash.PropertyPath, value: any): LodashSetWith1x6; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, value: any): LodashSetWith1x7; + (customizer: lodash.__, path: lodash.__, value: lodash.__, object: T): LodashSetWith1x8; + (customizer: lodash.SetWithCustomizer, path: lodash.__, value: lodash.__, object: T): LodashSetWith1x9; + (customizer: lodash.__, path: lodash.PropertyPath, value: lodash.__, object: T): LodashSetWith1x10; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, value: lodash.__, object: T): LodashSetWith1x11; + (customizer: lodash.__, path: lodash.__, value: any, object: T): LodashSetWith1x12; + (customizer: lodash.SetWithCustomizer, path: lodash.__, value: any, object: T): LodashSetWith1x13; + (customizer: lodash.__, path: lodash.PropertyPath, value: any, object: T): LodashSetWith1x14; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, value: any, object: T): T; + } + interface LodashSetWith1x1 { + (path: lodash.PropertyPath): LodashSetWith1x3; + (path: lodash.__, value: any): LodashSetWith1x5; + (path: lodash.PropertyPath, value: any): LodashSetWith1x7; + (path: lodash.__, value: lodash.__, object: T): LodashSetWith1x9; + (path: lodash.PropertyPath, value: lodash.__, object: T): LodashSetWith1x11; + (path: lodash.__, value: any, object: T): LodashSetWith1x13; + (path: lodash.PropertyPath, value: any, object: T): T; + } + interface LodashSetWith1x2 { + (customizer: lodash.SetWithCustomizer): LodashSetWith1x3; + (customizer: lodash.__, value: any): LodashSetWith1x6; + (customizer: lodash.SetWithCustomizer, value: any): LodashSetWith1x7; + (customizer: lodash.__, value: lodash.__, object: T): LodashSetWith1x10; + (customizer: lodash.SetWithCustomizer, value: lodash.__, object: T): LodashSetWith1x11; + (customizer: lodash.__, value: any, object: T): LodashSetWith1x14; + (customizer: lodash.SetWithCustomizer, value: any, object: T): T; + } + interface LodashSetWith1x3 { + (value: any): LodashSetWith1x7; + (value: lodash.__, object: T): LodashSetWith1x11; + (value: any, object: T): T; + } + interface LodashSetWith1x4 { + (customizer: lodash.SetWithCustomizer): LodashSetWith1x5; + (customizer: lodash.__, path: lodash.PropertyPath): LodashSetWith1x6; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath): LodashSetWith1x7; + (customizer: lodash.__, path: lodash.__, object: T): LodashSetWith1x12; + (customizer: lodash.SetWithCustomizer, path: lodash.__, object: T): LodashSetWith1x13; + (customizer: lodash.__, path: lodash.PropertyPath, object: T): LodashSetWith1x14; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, object: T): T; + } + interface LodashSetWith1x5 { + (path: lodash.PropertyPath): LodashSetWith1x7; + (path: lodash.__, object: T): LodashSetWith1x13; + (path: lodash.PropertyPath, object: T): T; + } + interface LodashSetWith1x6 { + (customizer: lodash.SetWithCustomizer): LodashSetWith1x7; + (customizer: lodash.__, object: T): LodashSetWith1x14; + (customizer: lodash.SetWithCustomizer, object: T): T; + } + type LodashSetWith1x7 = (object: T) => T; + interface LodashSetWith1x8 { + (customizer: lodash.SetWithCustomizer): LodashSetWith1x9; + (customizer: lodash.__, path: lodash.PropertyPath): LodashSetWith1x10; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath): LodashSetWith1x11; + (customizer: lodash.__, path: lodash.__, value: any): LodashSetWith1x12; + (customizer: lodash.SetWithCustomizer, path: lodash.__, value: any): LodashSetWith1x13; + (customizer: lodash.__, path: lodash.PropertyPath, value: any): LodashSetWith1x14; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, value: any): T; + } + interface LodashSetWith1x9 { + (path: lodash.PropertyPath): LodashSetWith1x11; + (path: lodash.__, value: any): LodashSetWith1x13; + (path: lodash.PropertyPath, value: any): T; + } + interface LodashSetWith1x10 { + (customizer: lodash.SetWithCustomizer): LodashSetWith1x11; + (customizer: lodash.__, value: any): LodashSetWith1x14; + (customizer: lodash.SetWithCustomizer, value: any): T; + } + type LodashSetWith1x11 = (value: any) => T; + interface LodashSetWith1x12 { + (customizer: lodash.SetWithCustomizer): LodashSetWith1x13; + (customizer: lodash.__, path: lodash.PropertyPath): LodashSetWith1x14; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath): T; + } + type LodashSetWith1x13 = (path: lodash.PropertyPath) => T; + type LodashSetWith1x14 = (customizer: lodash.SetWithCustomizer) => T; + interface LodashShuffle { + (collection: lodash.List | null | undefined): T[]; + (collection: T | null | undefined): Array; + } + type LodashSize = (collection: object | string | null | undefined) => number; + interface LodashSlice { + (start: number): LodashSlice1x1; + (start: lodash.__, end: number): LodashSlice1x2; + (start: number, end: number): LodashSlice1x3; + (start: lodash.__, end: lodash.__, array: lodash.List | null | undefined): LodashSlice1x4; + (start: number, end: lodash.__, array: lodash.List | null | undefined): LodashSlice1x5; + (start: lodash.__, end: number, array: lodash.List | null | undefined): LodashSlice1x6; + (start: number, end: number, array: lodash.List | null | undefined): T[]; + } + interface LodashSlice1x1 { + (end: number): LodashSlice1x3; + (end: lodash.__, array: lodash.List | null | undefined): LodashSlice1x5; + (end: number, array: lodash.List | null | undefined): T[]; + } + interface LodashSlice1x2 { + (start: number): LodashSlice1x3; + (start: lodash.__, array: lodash.List | null | undefined): LodashSlice1x6; + (start: number, array: lodash.List | null | undefined): T[]; + } + type LodashSlice1x3 = (array: lodash.List | null | undefined) => T[]; + interface LodashSlice1x4 { + (start: number): LodashSlice1x5; + (start: lodash.__, end: number): LodashSlice1x6; + (start: number, end: number): T[]; + } + type LodashSlice1x5 = (end: number) => T[]; + type LodashSlice1x6 = (start: number) => T[]; + type LodashSnakeCase = (string: string) => string; + interface LodashSortBy { + (iteratees: lodash.Many>): LodashSortBy1x1; + (iteratees: lodash.__, collection: lodash.List | null | undefined): LodashSortBy1x2; + (iteratees: lodash.Many>, collection: lodash.List | null | undefined): T[]; + (iteratees: lodash.__, collection: T | null | undefined): LodashSortBy2x2; + (iteratees: lodash.Many>, collection: T | null | undefined): Array; + } + type LodashSortBy1x1 = (collection: lodash.List | object | null | undefined) => T[]; + type LodashSortBy1x2 = (iteratees: lodash.Many>) => T[]; + type LodashSortBy2x2 = (iteratees: lodash.Many>) => Array; + interface LodashSortedIndex { + (value: T): LodashSortedIndex1x1; + (value: lodash.__, array: lodash.List | null | undefined): LodashSortedIndex1x2; + (value: T, array: lodash.List | null | undefined): number; + } + type LodashSortedIndex1x1 = (array: lodash.List | null | undefined) => number; + type LodashSortedIndex1x2 = (value: T) => number; + interface LodashSortedIndexBy { + (iteratee: lodash.ValueIteratee): LodashSortedIndexBy1x1; + (iteratee: lodash.__, value: T): LodashSortedIndexBy1x2; + (iteratee: lodash.ValueIteratee, value: T): LodashSortedIndexBy1x3; + (iteratee: lodash.__, value: lodash.__, array: lodash.List | null | undefined): LodashSortedIndexBy1x4; + (iteratee: lodash.ValueIteratee, value: lodash.__, array: lodash.List | null | undefined): LodashSortedIndexBy1x5; + (iteratee: lodash.__, value: T, array: lodash.List | null | undefined): LodashSortedIndexBy1x6; + (iteratee: lodash.ValueIteratee, value: T, array: lodash.List | null | undefined): number; + } + interface LodashSortedIndexBy1x1 { + (value: T): LodashSortedIndexBy1x3; + (value: lodash.__, array: lodash.List | null | undefined): LodashSortedIndexBy1x5; + (value: T, array: lodash.List | null | undefined): number; + } + interface LodashSortedIndexBy1x2 { + (iteratee: lodash.ValueIteratee): LodashSortedIndexBy1x3; + (iteratee: lodash.__, array: lodash.List | null | undefined): LodashSortedIndexBy1x6; + (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined): number; + } + type LodashSortedIndexBy1x3 = (array: lodash.List | null | undefined) => number; + interface LodashSortedIndexBy1x4 { + (iteratee: lodash.ValueIteratee): LodashSortedIndexBy1x5; + (iteratee: lodash.__, value: T): LodashSortedIndexBy1x6; + (iteratee: lodash.ValueIteratee, value: T): number; + } + type LodashSortedIndexBy1x5 = (value: T) => number; + type LodashSortedIndexBy1x6 = (iteratee: lodash.ValueIteratee) => number; + interface LodashSortedIndexOf { + (value: T): LodashSortedIndexOf1x1; + (value: lodash.__, array: lodash.List | null | undefined): LodashSortedIndexOf1x2; + (value: T, array: lodash.List | null | undefined): number; + } + type LodashSortedIndexOf1x1 = (array: lodash.List | null | undefined) => number; + type LodashSortedIndexOf1x2 = (value: T) => number; + interface LodashSortedLastIndex { + (value: T): LodashSortedLastIndex1x1; + (value: lodash.__, array: lodash.List | null | undefined): LodashSortedLastIndex1x2; + (value: T, array: lodash.List | null | undefined): number; + } + type LodashSortedLastIndex1x1 = (array: lodash.List | null | undefined) => number; + type LodashSortedLastIndex1x2 = (value: T) => number; + interface LodashSortedLastIndexBy { + (iteratee: lodash.ValueIteratee): LodashSortedLastIndexBy1x1; + (iteratee: lodash.__, value: T): LodashSortedLastIndexBy1x2; + (iteratee: lodash.ValueIteratee, value: T): LodashSortedLastIndexBy1x3; + (iteratee: lodash.__, value: lodash.__, array: lodash.List | null | undefined): LodashSortedLastIndexBy1x4; + (iteratee: lodash.ValueIteratee, value: lodash.__, array: lodash.List | null | undefined): LodashSortedLastIndexBy1x5; + (iteratee: lodash.__, value: T, array: lodash.List | null | undefined): LodashSortedLastIndexBy1x6; + (iteratee: lodash.ValueIteratee, value: T, array: lodash.List | null | undefined): number; + } + interface LodashSortedLastIndexBy1x1 { + (value: T): LodashSortedLastIndexBy1x3; + (value: lodash.__, array: lodash.List | null | undefined): LodashSortedLastIndexBy1x5; + (value: T, array: lodash.List | null | undefined): number; + } + interface LodashSortedLastIndexBy1x2 { + (iteratee: lodash.ValueIteratee): LodashSortedLastIndexBy1x3; + (iteratee: lodash.__, array: lodash.List | null | undefined): LodashSortedLastIndexBy1x6; + (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined): number; + } + type LodashSortedLastIndexBy1x3 = (array: lodash.List | null | undefined) => number; + interface LodashSortedLastIndexBy1x4 { + (iteratee: lodash.ValueIteratee): LodashSortedLastIndexBy1x5; + (iteratee: lodash.__, value: T): LodashSortedLastIndexBy1x6; + (iteratee: lodash.ValueIteratee, value: T): number; + } + type LodashSortedLastIndexBy1x5 = (value: T) => number; + type LodashSortedLastIndexBy1x6 = (iteratee: lodash.ValueIteratee) => number; + interface LodashSortedLastIndexOf { + (value: T): LodashSortedLastIndexOf1x1; + (value: lodash.__, array: lodash.List | null | undefined): LodashSortedLastIndexOf1x2; + (value: T, array: lodash.List | null | undefined): number; + } + type LodashSortedLastIndexOf1x1 = (array: lodash.List | null | undefined) => number; + type LodashSortedLastIndexOf1x2 = (value: T) => number; + type LodashSortedUniq = (array: lodash.List | null | undefined) => T[]; + interface LodashSortedUniqBy { + (iteratee: (value: string) => lodash.NotVoid): LodashSortedUniqBy1x1; + (iteratee: lodash.__, array: string | null | undefined): LodashSortedUniqBy1x2; + (iteratee: (value: string) => lodash.NotVoid, array: string | null | undefined): string[]; + (iteratee: lodash.ValueIteratee): LodashSortedUniqBy2x1; + (iteratee: lodash.__, array: lodash.List | null | undefined): LodashSortedUniqBy2x2; + (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined): T[]; + } + type LodashSortedUniqBy1x1 = (array: string | null | undefined) => string[]; + type LodashSortedUniqBy1x2 = (iteratee: (value: string) => lodash.NotVoid) => string[]; + type LodashSortedUniqBy2x1 = (array: lodash.List | null | undefined) => T[]; + type LodashSortedUniqBy2x2 = (iteratee: lodash.ValueIteratee) => T[]; + interface LodashSplit { + (separator: RegExp|string): LodashSplit1x1; + (separator: lodash.__, string: string): LodashSplit1x2; + (separator: RegExp|string, string: string): string[]; + } + type LodashSplit1x1 = (string: string) => string[]; + type LodashSplit1x2 = (separator: RegExp|string) => string[]; + type LodashSpread = (func: (...args: any[]) => TResult) => (...args: any[]) => TResult; + interface LodashSpreadFrom { + (start: number): LodashSpreadFrom1x1; + (start: lodash.__, func: (...args: any[]) => TResult): LodashSpreadFrom1x2; + (start: number, func: (...args: any[]) => TResult): (...args: any[]) => TResult; + } + type LodashSpreadFrom1x1 = (func: (...args: any[]) => TResult) => (...args: any[]) => TResult; + type LodashSpreadFrom1x2 = (start: number) => (...args: any[]) => TResult; + type LodashStartCase = (string: string) => string; + interface LodashStartsWith { + (target: string): LodashStartsWith1x1; + (target: lodash.__, string: string): LodashStartsWith1x2; + (target: string, string: string): boolean; + } + type LodashStartsWith1x1 = (string: string) => boolean; + type LodashStartsWith1x2 = (target: string) => boolean; + type LodashStubArray = () => any[]; + type LodashStubObject = () => any; + type LodashStubString = () => string; + type LodashStubTrue = () => boolean; + interface LodashSubtract { + (minuend: number): LodashSubtract1x1; + (minuend: lodash.__, subtrahend: number): LodashSubtract1x2; + (minuend: number, subtrahend: number): number; + } + type LodashSubtract1x1 = (subtrahend: number) => number; + type LodashSubtract1x2 = (minuend: number) => number; + type LodashSum = (collection: lodash.List | null | undefined) => number; + interface LodashSumBy { + (iteratee: ((value: T) => number) | string): LodashSumBy1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashSumBy1x2; + (iteratee: ((value: T) => number) | string, collection: lodash.List | null | undefined): number; + } + type LodashSumBy1x1 = (collection: lodash.List | null | undefined) => number; + type LodashSumBy1x2 = (iteratee: ((value: T) => number) | string) => number; + interface LodashXor { + (arrays2: lodash.List | null | undefined): LodashXor1x1; + (arrays2: lodash.__, arrays: lodash.List | null | undefined): LodashXor1x2; + (arrays2: lodash.List | null | undefined, arrays: lodash.List | null | undefined): T[]; + } + type LodashXor1x1 = (arrays: lodash.List | null | undefined) => T[]; + type LodashXor1x2 = (arrays2: lodash.List | null | undefined) => T[]; + interface LodashXorBy { + (iteratee: lodash.ValueIteratee): LodashXorBy1x1; + (iteratee: lodash.__, arrays: lodash.List | null | undefined): LodashXorBy1x2; + (iteratee: lodash.ValueIteratee, arrays: lodash.List | null | undefined): LodashXorBy1x3; + (iteratee: lodash.__, arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashXorBy1x4; + (iteratee: lodash.ValueIteratee, arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashXorBy1x5; + (iteratee: lodash.__, arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): LodashXorBy1x6; + (iteratee: lodash.ValueIteratee, arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): T[]; + } + interface LodashXorBy1x1 { + (arrays: lodash.List | null | undefined): LodashXorBy1x3; + (arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashXorBy1x5; + (arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): T[]; + } + interface LodashXorBy1x2 { + (iteratee: lodash.ValueIteratee): LodashXorBy1x3; + (iteratee: lodash.__, arrays2: lodash.List | null | undefined): LodashXorBy1x6; + (iteratee: lodash.ValueIteratee, arrays2: lodash.List | null | undefined): T[]; + } + type LodashXorBy1x3 = (arrays2: lodash.List | null | undefined) => T[]; + interface LodashXorBy1x4 { + (iteratee: lodash.ValueIteratee): LodashXorBy1x5; + (iteratee: lodash.__, arrays: lodash.List | null | undefined): LodashXorBy1x6; + (iteratee: lodash.ValueIteratee, arrays: lodash.List | null | undefined): T[]; + } + type LodashXorBy1x5 = (arrays: lodash.List | null | undefined) => T[]; + type LodashXorBy1x6 = (iteratee: lodash.ValueIteratee) => T[]; + interface LodashXorWith { + (comparator: lodash.Comparator): LodashXorWith1x1; + (comparator: lodash.__, arrays: lodash.List | null | undefined): LodashXorWith1x2; + (comparator: lodash.Comparator, arrays: lodash.List | null | undefined): LodashXorWith1x3; + (comparator: lodash.__, arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashXorWith1x4; + (comparator: lodash.Comparator, arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashXorWith1x5; + (comparator: lodash.__, arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): LodashXorWith1x6; + (comparator: lodash.Comparator, arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): T[]; + } + interface LodashXorWith1x1 { + (arrays: lodash.List | null | undefined): LodashXorWith1x3; + (arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashXorWith1x5; + (arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): T[]; + } + interface LodashXorWith1x2 { + (comparator: lodash.Comparator): LodashXorWith1x3; + (comparator: lodash.__, arrays2: lodash.List | null | undefined): LodashXorWith1x6; + (comparator: lodash.Comparator, arrays2: lodash.List | null | undefined): T[]; + } + type LodashXorWith1x3 = (arrays2: lodash.List | null | undefined) => T[]; + interface LodashXorWith1x4 { + (comparator: lodash.Comparator): LodashXorWith1x5; + (comparator: lodash.__, arrays: lodash.List | null | undefined): LodashXorWith1x6; + (comparator: lodash.Comparator, arrays: lodash.List | null | undefined): T[]; + } + type LodashXorWith1x5 = (arrays: lodash.List | null | undefined) => T[]; + type LodashXorWith1x6 = (comparator: lodash.Comparator) => T[]; + type LodashTail = (array: lodash.List | null | undefined) => T[]; + interface LodashTake { + (n: number): LodashTake1x1; + (n: lodash.__, array: lodash.List | null | undefined): LodashTake1x2; + (n: number, array: lodash.List | null | undefined): T[]; + } + type LodashTake1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashTake1x2 = (n: number) => T[]; + interface LodashTakeRight { + (n: number): LodashTakeRight1x1; + (n: lodash.__, array: lodash.List | null | undefined): LodashTakeRight1x2; + (n: number, array: lodash.List | null | undefined): T[]; + } + type LodashTakeRight1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashTakeRight1x2 = (n: number) => T[]; + interface LodashTakeRightWhile { + (predicate: lodash.ValueIteratee): LodashTakeRightWhile1x1; + (predicate: lodash.__, array: lodash.List | null | undefined): LodashTakeRightWhile1x2; + (predicate: lodash.ValueIteratee, array: lodash.List | null | undefined): T[]; + } + type LodashTakeRightWhile1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashTakeRightWhile1x2 = (predicate: lodash.ValueIteratee) => T[]; + interface LodashTakeWhile { + (predicate: lodash.ValueIteratee): LodashTakeWhile1x1; + (predicate: lodash.__, array: lodash.List | null | undefined): LodashTakeWhile1x2; + (predicate: lodash.ValueIteratee, array: lodash.List | null | undefined): T[]; + } + type LodashTakeWhile1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashTakeWhile1x2 = (predicate: lodash.ValueIteratee) => T[]; + interface LodashTap { + (interceptor: (value: T) => void): LodashTap1x1; + (interceptor: lodash.__, value: T): LodashTap1x2; + (interceptor: (value: T) => void, value: T): T; + } + type LodashTap1x1 = (value: T) => T; + type LodashTap1x2 = (interceptor: (value: T) => void) => T; + type LodashTemplate = (string: string) => lodash.TemplateExecutor; + interface LodashThrottle { + (wait: number): LodashThrottle1x1; + any>(wait: lodash.__, func: T): LodashThrottle1x2; + any>(wait: number, func: T): T & lodash.Cancelable; + } + type LodashThrottle1x1 = any>(func: T) => T & lodash.Cancelable; + type LodashThrottle1x2 = (wait: number) => T & lodash.Cancelable; + interface LodashThru { + (interceptor: (value: T) => TResult): LodashThru1x1; + (interceptor: lodash.__, value: T): LodashThru1x2; + (interceptor: (value: T) => TResult, value: T): TResult; + } + type LodashThru1x1 = (value: T) => TResult; + type LodashThru1x2 = (interceptor: (value: T) => TResult) => TResult; + interface LodashTimes { + (iteratee: (num: number) => TResult): LodashTimes1x1; + (iteratee: lodash.__, n: number): LodashTimes1x2; + (iteratee: (num: number) => TResult, n: number): TResult[]; + } + type LodashTimes1x1 = (n: number) => TResult[]; + type LodashTimes1x2 = (iteratee: (num: number) => TResult) => TResult[]; + interface LodashToArray { + (value: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): T[]; + (value: T): Array; + (): any[]; + } + type LodashToFinite = (value: any) => number; + type LodashToInteger = (value: any) => number; + type LodashToLength = (value: any) => number; + type LodashToLower = (string: string) => string; + type LodashToNumber = (value: any) => number; + type LodashToPath = (value: any) => string[]; + type LodashToPlainObject = (value: any) => any; + type LodashToSafeInteger = (value: any) => number; + type LodashToString = (value: any) => string; + type LodashToUpper = (string: string) => string; + interface LodashTransform { + (iteratee: lodash.MemoVoidIteratorCapped): LodashTransform1x1; + (iteratee: lodash.__, accumulator: ReadonlyArray): LodashTransform1x2; + (iteratee: lodash.MemoVoidIteratorCapped, accumulator: ReadonlyArray): LodashTransform1x3; + (iteratee: lodash.__, accumulator: lodash.__, object: ReadonlyArray): LodashTransform1x4; + (iteratee: lodash.MemoVoidIteratorCapped, accumulator: lodash.__, object: ReadonlyArray): LodashTransform1x5; + (iteratee: lodash.__, accumulator: ReadonlyArray, object: ReadonlyArray): LodashTransform1x6; + (iteratee: lodash.MemoVoidIteratorCapped, accumulator: ReadonlyArray, object: ReadonlyArray | lodash.Dictionary): TResult[]; + (iteratee: lodash.MemoVoidIteratorCapped>): LodashTransform2x1; + (iteratee: lodash.__, accumulator: lodash.Dictionary): LodashTransform2x2; + (iteratee: lodash.MemoVoidIteratorCapped>, accumulator: lodash.Dictionary): LodashTransform2x3; + (iteratee: lodash.MemoVoidIteratorCapped>, accumulator: lodash.__, object: ReadonlyArray): LodashTransform2x5; + (iteratee: lodash.__, accumulator: lodash.Dictionary, object: ReadonlyArray): LodashTransform2x6; + (iteratee: lodash.MemoVoidIteratorCapped>, accumulator: lodash.Dictionary, object: ReadonlyArray | lodash.Dictionary): lodash.Dictionary; + (iteratee: lodash.__, accumulator: lodash.__, object: lodash.Dictionary): LodashTransform3x4; + (iteratee: lodash.MemoVoidIteratorCapped>, accumulator: lodash.__, object: lodash.Dictionary): LodashTransform3x5; + (iteratee: lodash.__, accumulator: lodash.Dictionary, object: lodash.Dictionary): LodashTransform3x6; + (iteratee: lodash.MemoVoidIteratorCapped, accumulator: lodash.__, object: lodash.Dictionary): LodashTransform4x5; + (iteratee: lodash.__, accumulator: ReadonlyArray, object: lodash.Dictionary): LodashTransform4x6; + } + interface LodashTransform1x1 { + (accumulator: ReadonlyArray): LodashTransform1x3; + (accumulator: lodash.__, object: ReadonlyArray): LodashTransform1x5; + (accumulator: ReadonlyArray, object: ReadonlyArray | lodash.Dictionary): TResult[]; + (accumulator: lodash.__, object: lodash.Dictionary): LodashTransform4x5; + } + interface LodashTransform1x2 { + (iteratee: lodash.MemoVoidIteratorCapped): LodashTransform1x3; + (iteratee: lodash.__, object: ReadonlyArray): LodashTransform1x6; + (iteratee: lodash.MemoVoidIteratorCapped, object: ReadonlyArray | lodash.Dictionary): TResult[]; + (iteratee: lodash.__, object: lodash.Dictionary): LodashTransform4x6; + } + type LodashTransform1x3 = (object: ReadonlyArray | lodash.Dictionary) => TResult[]; + interface LodashTransform1x4 { + (iteratee: lodash.MemoVoidIteratorCapped): LodashTransform1x5; + (iteratee: lodash.__, accumulator: ReadonlyArray): LodashTransform1x6; + (iteratee: lodash.MemoVoidIteratorCapped, accumulator: ReadonlyArray): TResult[]; + (iteratee: lodash.MemoVoidIteratorCapped>): LodashTransform2x5; + (iteratee: lodash.__, accumulator: lodash.Dictionary): LodashTransform2x6; + (iteratee: lodash.MemoVoidIteratorCapped>, accumulator: lodash.Dictionary): lodash.Dictionary; + } + type LodashTransform1x5 = (accumulator: ReadonlyArray) => TResult[]; + type LodashTransform1x6 = (iteratee: lodash.MemoVoidIteratorCapped) => TResult[]; + interface LodashTransform2x1 { + (accumulator: lodash.Dictionary): LodashTransform2x3; + (accumulator: lodash.__, object: ReadonlyArray): LodashTransform2x5; + (accumulator: lodash.Dictionary, object: ReadonlyArray | lodash.Dictionary): lodash.Dictionary; + (accumulator: lodash.__, object: lodash.Dictionary): LodashTransform3x5; + } + interface LodashTransform2x2 { + (iteratee: lodash.MemoVoidIteratorCapped>): LodashTransform2x3; + (iteratee: lodash.__, object: ReadonlyArray): LodashTransform2x6; + (iteratee: lodash.MemoVoidIteratorCapped>, object: ReadonlyArray | lodash.Dictionary): lodash.Dictionary; + (iteratee: lodash.__, object: lodash.Dictionary): LodashTransform3x6; + } + type LodashTransform2x3 = (object: ReadonlyArray | lodash.Dictionary) => lodash.Dictionary; + type LodashTransform2x5 = (accumulator: lodash.Dictionary) => lodash.Dictionary; + type LodashTransform2x6 = (iteratee: lodash.MemoVoidIteratorCapped>) => lodash.Dictionary; + interface LodashTransform3x4 { + (iteratee: lodash.MemoVoidIteratorCapped>): LodashTransform3x5; + (iteratee: lodash.__, accumulator: lodash.Dictionary): LodashTransform3x6; + (iteratee: lodash.MemoVoidIteratorCapped>, accumulator: lodash.Dictionary): lodash.Dictionary; + (iteratee: lodash.MemoVoidIteratorCapped): LodashTransform4x5; + (iteratee: lodash.__, accumulator: ReadonlyArray): LodashTransform4x6; + (iteratee: lodash.MemoVoidIteratorCapped, accumulator: ReadonlyArray): TResult[]; + } + type LodashTransform3x5 = (accumulator: lodash.Dictionary) => lodash.Dictionary; + type LodashTransform3x6 = (iteratee: lodash.MemoVoidIteratorCapped>) => lodash.Dictionary; + type LodashTransform4x5 = (accumulator: ReadonlyArray) => TResult[]; + type LodashTransform4x6 = (iteratee: lodash.MemoVoidIteratorCapped) => TResult[]; + type LodashTrim = (string: string) => string; + interface LodashTrimChars { + (chars: string): LodashTrimChars1x1; + (chars: lodash.__, string: string): LodashTrimChars1x2; + (chars: string, string: string): string; + } + type LodashTrimChars1x1 = (string: string) => string; + type LodashTrimChars1x2 = (chars: string) => string; + interface LodashTrimCharsEnd { + (chars: string): LodashTrimCharsEnd1x1; + (chars: lodash.__, string: string): LodashTrimCharsEnd1x2; + (chars: string, string: string): string; + } + type LodashTrimCharsEnd1x1 = (string: string) => string; + type LodashTrimCharsEnd1x2 = (chars: string) => string; + interface LodashTrimCharsStart { + (chars: string): LodashTrimCharsStart1x1; + (chars: lodash.__, string: string): LodashTrimCharsStart1x2; + (chars: string, string: string): string; + } + type LodashTrimCharsStart1x1 = (string: string) => string; + type LodashTrimCharsStart1x2 = (chars: string) => string; + type LodashTrimEnd = (string: string) => string; + type LodashTrimStart = (string: string) => string; + interface LodashTruncate { + (options: lodash.TruncateOptions): LodashTruncate1x1; + (options: lodash.__, string: string): LodashTruncate1x2; + (options: lodash.TruncateOptions, string: string): string; + } + type LodashTruncate1x1 = (string: string) => string; + type LodashTruncate1x2 = (options: lodash.TruncateOptions) => string; + type LodashUnapply = (func: (...args: any[]) => any) => (...args: any[]) => any; + type LodashUnary = (func: (arg1: T, ...args: any[]) => TResult) => (arg1: T) => TResult; + type LodashUnescape = (string: string) => string; + interface LodashUnion { + (arrays2: lodash.List | null | undefined): LodashUnion1x1; + (arrays2: lodash.__, arrays: lodash.List | null | undefined): LodashUnion1x2; + (arrays2: lodash.List | null | undefined, arrays: lodash.List | null | undefined): T[]; + } + type LodashUnion1x1 = (arrays: lodash.List | null | undefined) => T[]; + type LodashUnion1x2 = (arrays2: lodash.List | null | undefined) => T[]; + interface LodashUnionBy { + (iteratee: lodash.ValueIteratee): LodashUnionBy1x1; + (iteratee: lodash.__, arrays1: lodash.List | null | undefined): LodashUnionBy1x2; + (iteratee: lodash.ValueIteratee, arrays1: lodash.List | null | undefined): LodashUnionBy1x3; + (iteratee: lodash.__, arrays1: lodash.__, arrays2: lodash.List | null | undefined): LodashUnionBy1x4; + (iteratee: lodash.ValueIteratee, arrays1: lodash.__, arrays2: lodash.List | null | undefined): LodashUnionBy1x5; + (iteratee: lodash.__, arrays1: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): LodashUnionBy1x6; + (iteratee: lodash.ValueIteratee, arrays1: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): T[]; + } + interface LodashUnionBy1x1 { + (arrays1: lodash.List | null | undefined): LodashUnionBy1x3; + (arrays1: lodash.__, arrays2: lodash.List | null | undefined): LodashUnionBy1x5; + (arrays1: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): T[]; + } + interface LodashUnionBy1x2 { + (iteratee: lodash.ValueIteratee): LodashUnionBy1x3; + (iteratee: lodash.__, arrays2: lodash.List | null | undefined): LodashUnionBy1x6; + (iteratee: lodash.ValueIteratee, arrays2: lodash.List | null | undefined): T[]; + } + type LodashUnionBy1x3 = (arrays2: lodash.List | null | undefined) => T[]; + interface LodashUnionBy1x4 { + (iteratee: lodash.ValueIteratee): LodashUnionBy1x5; + (iteratee: lodash.__, arrays1: lodash.List | null | undefined): LodashUnionBy1x6; + (iteratee: lodash.ValueIteratee, arrays1: lodash.List | null | undefined): T[]; + } + type LodashUnionBy1x5 = (arrays1: lodash.List | null | undefined) => T[]; + type LodashUnionBy1x6 = (iteratee: lodash.ValueIteratee) => T[]; + interface LodashUnionWith { + (comparator: lodash.Comparator): LodashUnionWith1x1; + (comparator: lodash.__, arrays: lodash.List | null | undefined): LodashUnionWith1x2; + (comparator: lodash.Comparator, arrays: lodash.List | null | undefined): LodashUnionWith1x3; + (comparator: lodash.__, arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashUnionWith1x4; + (comparator: lodash.Comparator, arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashUnionWith1x5; + (comparator: lodash.__, arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): LodashUnionWith1x6; + (comparator: lodash.Comparator, arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): T[]; + } + interface LodashUnionWith1x1 { + (arrays: lodash.List | null | undefined): LodashUnionWith1x3; + (arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashUnionWith1x5; + (arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): T[]; + } + interface LodashUnionWith1x2 { + (comparator: lodash.Comparator): LodashUnionWith1x3; + (comparator: lodash.__, arrays2: lodash.List | null | undefined): LodashUnionWith1x6; + (comparator: lodash.Comparator, arrays2: lodash.List | null | undefined): T[]; + } + type LodashUnionWith1x3 = (arrays2: lodash.List | null | undefined) => T[]; + interface LodashUnionWith1x4 { + (comparator: lodash.Comparator): LodashUnionWith1x5; + (comparator: lodash.__, arrays: lodash.List | null | undefined): LodashUnionWith1x6; + (comparator: lodash.Comparator, arrays: lodash.List | null | undefined): T[]; + } + type LodashUnionWith1x5 = (arrays: lodash.List | null | undefined) => T[]; + type LodashUnionWith1x6 = (comparator: lodash.Comparator) => T[]; + type LodashUniq = (array: lodash.List | null | undefined) => T[]; + interface LodashUniqBy { + (iteratee: (value: string) => lodash.NotVoid): LodashUniqBy1x1; + (iteratee: lodash.__, array: string | null | undefined): LodashUniqBy1x2; + (iteratee: (value: string) => lodash.NotVoid, array: string | null | undefined): string[]; + (iteratee: lodash.ValueIteratee): LodashUniqBy2x1; + (iteratee: lodash.__, array: lodash.List | null | undefined): LodashUniqBy2x2; + (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined): T[]; + } + type LodashUniqBy1x1 = (array: string | null | undefined) => string[]; + type LodashUniqBy1x2 = (iteratee: (value: string) => lodash.NotVoid) => string[]; + type LodashUniqBy2x1 = (array: lodash.List | null | undefined) => T[]; + type LodashUniqBy2x2 = (iteratee: lodash.ValueIteratee) => T[]; + type LodashUniqueId = (prefix: string) => string; + interface LodashUniqWith { + (comparator: lodash.Comparator): LodashUniqWith1x1; + (comparator: lodash.__, array: lodash.List | null | undefined): LodashUniqWith1x2; + (comparator: lodash.Comparator, array: lodash.List | null | undefined): T[]; + } + type LodashUniqWith1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashUniqWith1x2 = (comparator: lodash.Comparator) => T[]; + type LodashUnzip = (array: T[][] | lodash.List> | null | undefined) => T[][]; + interface LodashUnzipWith { + (iteratee: (...values: T[]) => TResult): LodashUnzipWith1x1; + (iteratee: lodash.__, array: lodash.List> | null | undefined): LodashUnzipWith1x2; + (iteratee: (...values: T[]) => TResult, array: lodash.List> | null | undefined): TResult[]; + } + type LodashUnzipWith1x1 = (array: lodash.List> | null | undefined) => TResult[]; + type LodashUnzipWith1x2 = (iteratee: (...values: T[]) => TResult) => TResult[]; + interface LodashUpdate { + (path: lodash.PropertyPath): LodashUpdate1x1; + (path: lodash.__, updater: (value: any) => any): LodashUpdate1x2; + (path: lodash.PropertyPath, updater: (value: any) => any): LodashUpdate1x3; + (path: lodash.__, updater: lodash.__, object: object): LodashUpdate1x4; + (path: lodash.PropertyPath, updater: lodash.__, object: object): LodashUpdate1x5; + (path: lodash.__, updater: (value: any) => any, object: object): LodashUpdate1x6; + (path: lodash.PropertyPath, updater: (value: any) => any, object: object): any; + } + interface LodashUpdate1x1 { + (updater: (value: any) => any): LodashUpdate1x3; + (updater: lodash.__, object: object): LodashUpdate1x5; + (updater: (value: any) => any, object: object): any; + } + interface LodashUpdate1x2 { + (path: lodash.PropertyPath): LodashUpdate1x3; + (path: lodash.__, object: object): LodashUpdate1x6; + (path: lodash.PropertyPath, object: object): any; + } + type LodashUpdate1x3 = (object: object) => any; + interface LodashUpdate1x4 { + (path: lodash.PropertyPath): LodashUpdate1x5; + (path: lodash.__, updater: (value: any) => any): LodashUpdate1x6; + (path: lodash.PropertyPath, updater: (value: any) => any): any; + } + type LodashUpdate1x5 = (updater: (value: any) => any) => any; + type LodashUpdate1x6 = (path: lodash.PropertyPath) => any; + interface LodashUpdateWith { + (customizer: lodash.SetWithCustomizer): LodashUpdateWith1x1; + (customizer: lodash.__, path: lodash.PropertyPath): LodashUpdateWith1x2; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath): LodashUpdateWith1x3; + (customizer: lodash.__, path: lodash.__, updater: (oldValue: any) => any): LodashUpdateWith1x4; + (customizer: lodash.SetWithCustomizer, path: lodash.__, updater: (oldValue: any) => any): LodashUpdateWith1x5; + (customizer: lodash.__, path: lodash.PropertyPath, updater: (oldValue: any) => any): LodashUpdateWith1x6; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, updater: (oldValue: any) => any): LodashUpdateWith1x7; + (customizer: lodash.__, path: lodash.__, updater: lodash.__, object: T): LodashUpdateWith1x8; + (customizer: lodash.SetWithCustomizer, path: lodash.__, updater: lodash.__, object: T): LodashUpdateWith1x9; + (customizer: lodash.__, path: lodash.PropertyPath, updater: lodash.__, object: T): LodashUpdateWith1x10; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, updater: lodash.__, object: T): LodashUpdateWith1x11; + (customizer: lodash.__, path: lodash.__, updater: (oldValue: any) => any, object: T): LodashUpdateWith1x12; + (customizer: lodash.SetWithCustomizer, path: lodash.__, updater: (oldValue: any) => any, object: T): LodashUpdateWith1x13; + (customizer: lodash.__, path: lodash.PropertyPath, updater: (oldValue: any) => any, object: T): LodashUpdateWith1x14; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, updater: (oldValue: any) => any, object: T): T; + } + interface LodashUpdateWith1x1 { + (path: lodash.PropertyPath): LodashUpdateWith1x3; + (path: lodash.__, updater: (oldValue: any) => any): LodashUpdateWith1x5; + (path: lodash.PropertyPath, updater: (oldValue: any) => any): LodashUpdateWith1x7; + (path: lodash.__, updater: lodash.__, object: T): LodashUpdateWith1x9; + (path: lodash.PropertyPath, updater: lodash.__, object: T): LodashUpdateWith1x11; + (path: lodash.__, updater: (oldValue: any) => any, object: T): LodashUpdateWith1x13; + (path: lodash.PropertyPath, updater: (oldValue: any) => any, object: T): T; + } + interface LodashUpdateWith1x2 { + (customizer: lodash.SetWithCustomizer): LodashUpdateWith1x3; + (customizer: lodash.__, updater: (oldValue: any) => any): LodashUpdateWith1x6; + (customizer: lodash.SetWithCustomizer, updater: (oldValue: any) => any): LodashUpdateWith1x7; + (customizer: lodash.__, updater: lodash.__, object: T): LodashUpdateWith1x10; + (customizer: lodash.SetWithCustomizer, updater: lodash.__, object: T): LodashUpdateWith1x11; + (customizer: lodash.__, updater: (oldValue: any) => any, object: T): LodashUpdateWith1x14; + (customizer: lodash.SetWithCustomizer, updater: (oldValue: any) => any, object: T): T; + } + interface LodashUpdateWith1x3 { + (updater: (oldValue: any) => any): LodashUpdateWith1x7; + (updater: lodash.__, object: T): LodashUpdateWith1x11; + (updater: (oldValue: any) => any, object: T): T; + } + interface LodashUpdateWith1x4 { + (customizer: lodash.SetWithCustomizer): LodashUpdateWith1x5; + (customizer: lodash.__, path: lodash.PropertyPath): LodashUpdateWith1x6; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath): LodashUpdateWith1x7; + (customizer: lodash.__, path: lodash.__, object: T): LodashUpdateWith1x12; + (customizer: lodash.SetWithCustomizer, path: lodash.__, object: T): LodashUpdateWith1x13; + (customizer: lodash.__, path: lodash.PropertyPath, object: T): LodashUpdateWith1x14; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, object: T): T; + } + interface LodashUpdateWith1x5 { + (path: lodash.PropertyPath): LodashUpdateWith1x7; + (path: lodash.__, object: T): LodashUpdateWith1x13; + (path: lodash.PropertyPath, object: T): T; + } + interface LodashUpdateWith1x6 { + (customizer: lodash.SetWithCustomizer): LodashUpdateWith1x7; + (customizer: lodash.__, object: T): LodashUpdateWith1x14; + (customizer: lodash.SetWithCustomizer, object: T): T; + } + type LodashUpdateWith1x7 = (object: T) => T; + interface LodashUpdateWith1x8 { + (customizer: lodash.SetWithCustomizer): LodashUpdateWith1x9; + (customizer: lodash.__, path: lodash.PropertyPath): LodashUpdateWith1x10; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath): LodashUpdateWith1x11; + (customizer: lodash.__, path: lodash.__, updater: (oldValue: any) => any): LodashUpdateWith1x12; + (customizer: lodash.SetWithCustomizer, path: lodash.__, updater: (oldValue: any) => any): LodashUpdateWith1x13; + (customizer: lodash.__, path: lodash.PropertyPath, updater: (oldValue: any) => any): LodashUpdateWith1x14; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, updater: (oldValue: any) => any): T; + } + interface LodashUpdateWith1x9 { + (path: lodash.PropertyPath): LodashUpdateWith1x11; + (path: lodash.__, updater: (oldValue: any) => any): LodashUpdateWith1x13; + (path: lodash.PropertyPath, updater: (oldValue: any) => any): T; + } + interface LodashUpdateWith1x10 { + (customizer: lodash.SetWithCustomizer): LodashUpdateWith1x11; + (customizer: lodash.__, updater: (oldValue: any) => any): LodashUpdateWith1x14; + (customizer: lodash.SetWithCustomizer, updater: (oldValue: any) => any): T; + } + type LodashUpdateWith1x11 = (updater: (oldValue: any) => any) => T; + interface LodashUpdateWith1x12 { + (customizer: lodash.SetWithCustomizer): LodashUpdateWith1x13; + (customizer: lodash.__, path: lodash.PropertyPath): LodashUpdateWith1x14; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath): T; + } + type LodashUpdateWith1x13 = (path: lodash.PropertyPath) => T; + type LodashUpdateWith1x14 = (customizer: lodash.SetWithCustomizer) => T; + type LodashUpperCase = (string: string) => string; + type LodashUpperFirst = (string: string) => string; + interface LodashValues { + (object: lodash.Dictionary | lodash.NumericDictionary | lodash.List | null | undefined): T[]; + (object: T | null | undefined): Array; + (object: any): any[]; + } + interface LodashValuesIn { + (object: lodash.Dictionary|lodash.NumericDictionary|lodash.List | null | undefined): T[]; + (object: T | null | undefined): Array; + } + interface LodashWithout { + (values: ReadonlyArray): LodashWithout1x1; + (values: lodash.__, array: lodash.List | null | undefined): LodashWithout1x2; + (values: ReadonlyArray, array: lodash.List | null | undefined): T[]; + } + type LodashWithout1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashWithout1x2 = (values: ReadonlyArray) => T[]; + type LodashWords = (string: string) => string[]; + interface LodashWrap { + (wrapper: (value: T, ...args: TArgs[]) => TResult): LodashWrap1x1; + (wrapper: lodash.__, value: T): LodashWrap1x2; + (wrapper: (value: T, ...args: TArgs[]) => TResult, value: T): (...args: TArgs[]) => TResult; + (wrapper: (value: T, ...args: any[]) => TResult): LodashWrap2x1; + (wrapper: (value: T, ...args: any[]) => TResult, value: T): (...args: any[]) => TResult; + } + type LodashWrap1x1 = (value: T) => (...args: TArgs[]) => TResult; + interface LodashWrap1x2 { + (wrapper: (value: T, ...args: TArgs[]) => TResult): (...args: TArgs[]) => TResult; + (wrapper: (value: T, ...args: any[]) => TResult): (...args: any[]) => TResult; + } + type LodashWrap2x1 = (value: T) => (...args: any[]) => TResult; + interface LodashZip { + (arrays1: lodash.List): LodashZip1x1; + (arrays1: lodash.__, arrays2: lodash.List): LodashZip1x2; + (arrays1: lodash.List, arrays2: lodash.List): Array<[T1 | undefined, T2 | undefined]>; + } + type LodashZip1x1 = (arrays2: lodash.List) => Array<[T1 | undefined, T2 | undefined]>; + type LodashZip1x2 = (arrays1: lodash.List) => Array<[T1 | undefined, T2 | undefined]>; + type LodashZipAll = (arrays: ReadonlyArray | null | undefined>) => Array>; + interface LodashZipObject { + (props: lodash.List): LodashZipObject1x1; + (props: lodash.__, values: lodash.List): LodashZipObject1x2; + (props: lodash.List, values: lodash.List): lodash.Dictionary; + } + type LodashZipObject1x1 = (values: lodash.List) => lodash.Dictionary; + type LodashZipObject1x2 = (props: lodash.List) => lodash.Dictionary; + interface LodashZipObjectDeep { + (paths: lodash.List): LodashZipObjectDeep1x1; + (paths: lodash.__, values: lodash.List): LodashZipObjectDeep1x2; + (paths: lodash.List, values: lodash.List): object; + } + type LodashZipObjectDeep1x1 = (values: lodash.List) => object; + type LodashZipObjectDeep1x2 = (paths: lodash.List) => object; + interface LodashZipWith { + (iteratee: (value1: T1, value2: T2) => TResult): LodashZipWith1x1; + (iteratee: lodash.__, arrays1: lodash.List): LodashZipWith1x2; + (iteratee: (value1: T1, value2: T2) => TResult, arrays1: lodash.List): LodashZipWith1x3; + (iteratee: lodash.__, arrays1: lodash.__, arrays2: lodash.List): LodashZipWith1x4; + (iteratee: (value1: T1, value2: T2) => TResult, arrays1: lodash.__, arrays2: lodash.List): LodashZipWith1x5; + (iteratee: lodash.__, arrays1: lodash.List, arrays2: lodash.List): LodashZipWith1x6; + (iteratee: (value1: T1, value2: T2) => TResult, arrays1: lodash.List, arrays2: lodash.List): TResult[]; + } + interface LodashZipWith1x1 { + (arrays1: lodash.List): LodashZipWith1x3; + (arrays1: lodash.__, arrays2: lodash.List): LodashZipWith1x5; + (arrays1: lodash.List, arrays2: lodash.List): TResult[]; + } + interface LodashZipWith1x2 { + (iteratee: (value1: T1, value2: T2) => TResult): LodashZipWith1x3; + (iteratee: lodash.__, arrays2: lodash.List): LodashZipWith1x6; + (iteratee: (value1: T1, value2: T2) => TResult, arrays2: lodash.List): TResult[]; + } + type LodashZipWith1x3 = (arrays2: lodash.List) => TResult[]; + interface LodashZipWith1x4 { + (iteratee: (value1: T1, value2: T2) => TResult): LodashZipWith1x5; + (iteratee: lodash.__, arrays1: lodash.List): LodashZipWith1x6; + (iteratee: (value1: T1, value2: T2) => TResult, arrays1: lodash.List): TResult[]; + } + type LodashZipWith1x5 = (arrays1: lodash.List) => TResult[]; + type LodashZipWith1x6 = (iteratee: (value1: T1, value2: T2) => TResult) => TResult[]; + interface LoDashFp { - add: typeof add; - after: typeof after; - all: typeof all; - allPass: typeof allPass; - always: typeof always; - any: typeof any; - anyPass: typeof anyPass; - apply: typeof apply; - ary: typeof ary; - assign: typeof assign; - assignAll: typeof assignAll; - assignAllWith: typeof assignAllWith; - assignIn: typeof assignIn; - assignInAll: typeof assignInAll; - assignInAllWith: typeof assignInAllWith; - assignInWith: typeof assignInWith; - assignWith: typeof assignWith; - assoc: typeof assoc; - assocPath: typeof assocPath; - at: typeof at; - attempt: typeof attempt; - before: typeof before; - bind: typeof bind; - bindAll: typeof bindAll; - bindKey: typeof bindKey; - camelCase: typeof camelCase; - capitalize: typeof capitalize; - castArray: typeof castArray; - ceil: typeof ceil; - chunk: typeof chunk; - clamp: typeof clamp; - clone: typeof clone; - cloneDeep: typeof cloneDeep; - cloneDeepWith: typeof cloneDeepWith; - cloneWith: typeof cloneWith; - compact: typeof compact; - complement: typeof complement; - compose: typeof compose; - concat: typeof concat; - cond: typeof cond; - conforms: typeof conforms; - conformsTo: typeof conformsTo; - constant: typeof constant; - contains: typeof contains; - countBy: typeof countBy; - create: typeof create; - curry: typeof curry; - curryN: typeof curryN; - curryRight: typeof curryRight; - curryRightN: typeof curryRightN; - debounce: typeof debounce; - deburr: typeof deburr; - defaults: typeof defaults; - defaultsAll: typeof defaultsAll; - defaultsDeep: typeof defaultsDeep; - defaultsDeepAll: typeof defaultsDeepAll; - defaultTo: typeof defaultTo; - defer: typeof defer; - delay: typeof delay; - difference: typeof difference; - differenceBy: typeof differenceBy; - differenceWith: typeof differenceWith; - dissoc: typeof dissoc; - dissocPath: typeof dissocPath; - divide: typeof divide; - drop: typeof drop; - dropLast: typeof dropLast; - dropLastWhile: typeof dropLastWhile; - dropRight: typeof dropRight; - dropRightWhile: typeof dropRightWhile; - dropWhile: typeof dropWhile; - each: typeof each; - eachRight: typeof eachRight; - endsWith: typeof endsWith; - entries: typeof entries; - entriesIn: typeof entriesIn; - eq: typeof eq; - equals: typeof equals; - escape: typeof escape; - escapeRegExp: typeof escapeRegExp; - every: typeof every; - extend: typeof extend; - extendAll: typeof extendAll; - extendAllWith: typeof extendAllWith; - extendWith: typeof extendWith; - F: typeof F; - fill: typeof fill; - filter: typeof filter; - find: typeof find; - findFrom: typeof findFrom; - findIndex: typeof findIndex; - findIndexFrom: typeof findIndexFrom; - findKey: typeof findKey; - findLast: typeof findLast; - findLastFrom: typeof findLastFrom; - findLastIndex: typeof findLastIndex; - findLastIndexFrom: typeof findLastIndexFrom; - findLastKey: typeof findLastKey; - first: typeof first; - flatMap: typeof flatMap; - flatMapDeep: typeof flatMapDeep; - flatMapDepth: typeof flatMapDepth; - flatten: typeof flatten; - flattenDeep: typeof flattenDeep; - flattenDepth: typeof flattenDepth; - flip: typeof flip; - floor: typeof floor; - flow: typeof flow; - flowRight: typeof flowRight; - forEach: typeof forEach; - forEachRight: typeof forEachRight; - forIn: typeof forIn; - forInRight: typeof forInRight; - forOwn: typeof forOwn; - forOwnRight: typeof forOwnRight; - fromPairs: typeof fromPairs; - functions: typeof functions; - functionsIn: typeof functionsIn; - get: typeof get; - getOr: typeof getOr; - groupBy: typeof groupBy; - gt: typeof gt; - gte: typeof gte; - has: typeof has; - hasIn: typeof hasIn; - head: typeof head; - identical: typeof identical; - identity: typeof identity; - includes: typeof includes; - includesFrom: typeof includesFrom; - indexBy: typeof indexBy; - indexOf: typeof indexOf; - indexOfFrom: typeof indexOfFrom; - init: typeof init; - initial: typeof initial; - inRange: typeof inRange; - intersection: typeof intersection; - intersectionBy: typeof intersectionBy; - intersectionWith: typeof intersectionWith; - invert: typeof invert; - invertBy: typeof invertBy; - invertObj: typeof invertObj; - invoke: typeof invoke; - invokeArgs: typeof invokeArgs; - invokeArgsMap: typeof invokeArgsMap; - invokeMap: typeof invokeMap; - isArguments: typeof isArguments; - isArray: typeof isArray; - isArrayBuffer: typeof isArrayBuffer; - isArrayLike: typeof isArrayLike; - isArrayLikeObject: typeof isArrayLikeObject; - isBoolean: typeof isBoolean; - isBuffer: typeof isBuffer; - isDate: typeof isDate; - isElement: typeof isElement; - isEmpty: typeof isEmpty; - isEqual: typeof isEqual; - isEqualWith: typeof isEqualWith; - isError: typeof isError; - isFinite: typeof isFinite; - isFunction: typeof isFunction; - isInteger: typeof isInteger; - isLength: typeof isLength; - isMap: typeof isMap; - isMatch: typeof isMatch; - isMatchWith: typeof isMatchWith; - isNaN: typeof isNaN; - isNative: typeof isNative; - isNil: typeof isNil; - isNull: typeof isNull; - isNumber: typeof isNumber; - isObject: typeof isObject; - isObjectLike: typeof isObjectLike; - isPlainObject: typeof isPlainObject; - isRegExp: typeof isRegExp; - isSafeInteger: typeof isSafeInteger; - isSet: typeof isSet; - isString: typeof isString; - isSymbol: typeof isSymbol; - isTypedArray: typeof isTypedArray; - isUndefined: typeof isUndefined; - isWeakMap: typeof isWeakMap; - isWeakSet: typeof isWeakSet; - iteratee: typeof iteratee; - join: typeof join; - juxt: typeof juxt; - kebabCase: typeof kebabCase; - keyBy: typeof keyBy; - keys: typeof keys; - keysIn: typeof keysIn; - last: typeof last; - lastIndexOf: typeof lastIndexOf; - lastIndexOfFrom: typeof lastIndexOfFrom; - lowerCase: typeof lowerCase; - lowerFirst: typeof lowerFirst; - lt: typeof lt; - lte: typeof lte; - map: typeof map; - mapKeys: typeof mapKeys; - mapValues: typeof mapValues; - matches: typeof matches; - matchesProperty: typeof matchesProperty; - max: typeof max; - maxBy: typeof maxBy; - mean: typeof mean; - meanBy: typeof meanBy; - memoize: typeof memoize; - merge: typeof merge; - mergeAll: typeof mergeAll; - mergeAllWith: typeof mergeAllWith; - mergeWith: typeof mergeWith; - method: typeof method; - methodOf: typeof methodOf; - min: typeof min; - minBy: typeof minBy; - multiply: typeof multiply; - nAry: typeof nAry; - negate: typeof negate; - noConflict: typeof noConflict; - noop: typeof noop; - now: typeof now; - nth: typeof nth; - nthArg: typeof nthArg; - omit: typeof omit; - omitAll: typeof omitAll; - omitBy: typeof omitBy; - once: typeof once; - orderBy: typeof orderBy; - over: typeof over; - overArgs: typeof overArgs; - overEvery: typeof overEvery; - overSome: typeof overSome; - pad: typeof pad; - padChars: typeof padChars; - padCharsEnd: typeof padCharsEnd; - padCharsStart: typeof padCharsStart; - padEnd: typeof padEnd; - padStart: typeof padStart; - parseInt: typeof parseInt; - partial: typeof partial; - partialRight: typeof partialRight; - partition: typeof partition; - path: typeof path; - pathEq: typeof pathEq; - pathOr: typeof pathOr; - paths: typeof paths; - pick: typeof pick; - pickAll: typeof pickAll; - pickBy: typeof pickBy; - pipe: typeof pipe; - pluck: typeof pluck; - prop: typeof prop; - propEq: typeof propEq; - property: typeof property; - propertyOf: typeof propertyOf; - propOr: typeof propOr; - props: typeof props; - pull: typeof pull; - pullAll: typeof pullAll; - pullAllBy: typeof pullAllBy; - pullAllWith: typeof pullAllWith; - pullAt: typeof pullAt; - random: typeof random; - range: typeof range; - rangeRight: typeof rangeRight; - rangeStep: typeof rangeStep; - rangeStepRight: typeof rangeStepRight; - rearg: typeof rearg; - reduce: typeof reduce; - reduceRight: typeof reduceRight; - reject: typeof reject; - remove: typeof remove; - repeat: typeof repeat; - replace: typeof replace; - rest: typeof rest; - restFrom: typeof restFrom; - result: typeof result; - reverse: typeof reverse; - round: typeof round; - runInContext: typeof runInContext; - sample: typeof sample; - sampleSize: typeof sampleSize; - set: typeof set; - setWith: typeof setWith; - shuffle: typeof shuffle; - size: typeof size; - slice: typeof slice; - snakeCase: typeof snakeCase; - some: typeof some; - sortBy: typeof sortBy; - sortedIndex: typeof sortedIndex; - sortedIndexBy: typeof sortedIndexBy; - sortedIndexOf: typeof sortedIndexOf; - sortedLastIndex: typeof sortedLastIndex; - sortedLastIndexBy: typeof sortedLastIndexBy; - sortedLastIndexOf: typeof sortedLastIndexOf; - sortedUniq: typeof sortedUniq; - sortedUniqBy: typeof sortedUniqBy; - split: typeof split; - spread: typeof spread; - spreadFrom: typeof spreadFrom; - startCase: typeof startCase; - startsWith: typeof startsWith; - stubArray: typeof stubArray; - stubFalse: typeof stubFalse; - stubObject: typeof stubObject; - stubString: typeof stubString; - stubTrue: typeof stubTrue; - subtract: typeof subtract; - sum: typeof sum; - sumBy: typeof sumBy; - symmetricDifference: typeof symmetricDifference; - symmetricDifferenceBy: typeof symmetricDifferenceBy; - symmetricDifferenceWith: typeof symmetricDifferenceWith; - T: typeof T; - tail: typeof tail; - take: typeof take; - takeLast: typeof takeLast; - takeLastWhile: typeof takeLastWhile; - takeRight: typeof takeRight; - takeRightWhile: typeof takeRightWhile; - takeWhile: typeof takeWhile; - tap: typeof tap; - template: typeof template; - throttle: typeof throttle; - thru: typeof thru; - times: typeof times; - toArray: typeof toArray; - toFinite: typeof toFinite; - toInteger: typeof toInteger; - toLength: typeof toLength; - toLower: typeof toLower; - toNumber: typeof toNumber; - toPairs: typeof toPairs; - toPairsIn: typeof toPairsIn; - toPath: typeof toPath; - toPlainObject: typeof toPlainObject; - toSafeInteger: typeof toSafeInteger; - toString: typeof toString; - toUpper: typeof toUpper; - transform: typeof transform; - trim: typeof trim; - trimChars: typeof trimChars; - trimCharsEnd: typeof trimCharsEnd; - trimCharsStart: typeof trimCharsStart; - trimEnd: typeof trimEnd; - trimStart: typeof trimStart; - truncate: typeof truncate; - unapply: typeof unapply; - unary: typeof unary; - unescape: typeof unescape; - union: typeof union; - unionBy: typeof unionBy; - unionWith: typeof unionWith; - uniq: typeof uniq; - uniqBy: typeof uniqBy; - uniqueId: typeof uniqueId; - uniqWith: typeof uniqWith; - unnest: typeof unnest; - unset: typeof unset; - unzip: typeof unzip; - unzipWith: typeof unzipWith; - update: typeof update; - updateWith: typeof updateWith; - upperCase: typeof upperCase; - upperFirst: typeof upperFirst; - useWith: typeof useWith; - values: typeof values; - valuesIn: typeof valuesIn; - where: typeof where; - whereEq: typeof whereEq; - without: typeof without; - words: typeof words; - wrap: typeof wrap; - xor: typeof xor; - xorBy: typeof xorBy; - xorWith: typeof xorWith; - zip: typeof zip; - zipAll: typeof zipAll; - zipObj: typeof zipObj; - zipObject: typeof zipObject; - zipObjectDeep: typeof zipObjectDeep; - zipWith: typeof zipWith; + add: LodashAdd; + after: LodashAfter; + all: LodashEvery; + allPass: LodashOverEvery; + always: LodashConstant; + any: LodashSome; + anyPass: LodashOverSome; + apply: LodashApply; + ary: LodashAry; + assign: LodashAssign; + assignAll: LodashAssignAll; + assignAllWith: LodashAssignAllWith; + assignIn: LodashAssignIn; + assignInAll: LodashAssignInAll; + assignInAllWith: LodashAssignInAllWith; + assignInWith: LodashAssignInWith; + assignWith: LodashAssignWith; + assoc: LodashSet; + assocPath: LodashSet; + at: LodashAt; + attempt: LodashAttempt; + before: LodashBefore; + bind: LodashBind; + bindAll: LodashBindAll; + bindKey: LodashBindKey; + camelCase: LodashCamelCase; + capitalize: LodashCapitalize; + castArray: LodashCastArray; + ceil: LodashCeil; + chunk: LodashChunk; + clamp: LodashClamp; + clone: LodashClone; + cloneDeep: LodashCloneDeep; + cloneDeepWith: LodashCloneDeepWith; + cloneWith: LodashCloneWith; + compact: LodashCompact; + complement: LodashNegate; + compose: LodashFlowRight; + concat: LodashConcat; + cond: LodashCond; + conforms: LodashConformsTo; + conformsTo: LodashConformsTo; + constant: LodashConstant; + contains: LodashContains; + countBy: LodashCountBy; + create: LodashCreate; + curry: LodashCurry; + curryN: LodashCurryN; + curryRight: LodashCurryRight; + curryRightN: LodashCurryRightN; + debounce: LodashDebounce; + deburr: LodashDeburr; + defaults: LodashDefaults; + defaultsAll: LodashDefaultsAll; + defaultsDeep: LodashDefaultsDeep; + defaultsDeepAll: LodashDefaultsDeepAll; + defaultTo: LodashDefaultTo; + defer: LodashDefer; + delay: LodashDelay; + difference: LodashDifference; + differenceBy: LodashDifferenceBy; + differenceWith: LodashDifferenceWith; + dissoc: LodashUnset; + dissocPath: LodashUnset; + divide: LodashDivide; + drop: LodashDrop; + dropLast: LodashDropRight; + dropLastWhile: LodashDropRightWhile; + dropRight: LodashDropRight; + dropRightWhile: LodashDropRightWhile; + dropWhile: LodashDropWhile; + each: LodashForEach; + eachRight: LodashForEachRight; + endsWith: LodashEndsWith; + entries: LodashToPairs; + entriesIn: LodashToPairsIn; + eq: LodashEq; + equals: LodashIsEqual; + escape: LodashEscape; + escapeRegExp: LodashEscapeRegExp; + every: LodashEvery; + extend: LodashExtend; + extendAll: LodashExtendAll; + extendAllWith: LodashExtendAllWith; + extendWith: LodashExtendWith; + F: LodashStubFalse; + fill: LodashFill; + filter: LodashFilter; + find: LodashFind; + findFrom: LodashFindFrom; + findIndex: LodashFindIndex; + findIndexFrom: LodashFindIndexFrom; + findKey: LodashFindKey; + findLast: LodashFindLast; + findLastFrom: LodashFindLastFrom; + findLastIndex: LodashFindLastIndex; + findLastIndexFrom: LodashFindLastIndexFrom; + findLastKey: LodashFindLastKey; + first: LodashHead; + flatMap: LodashFlatMap; + flatMapDeep: LodashFlatMapDeep; + flatMapDepth: LodashFlatMapDepth; + flatten: LodashFlatten; + flattenDeep: LodashFlattenDeep; + flattenDepth: LodashFlattenDepth; + flip: LodashFlip; + floor: LodashFloor; + flow: LodashFlow; + flowRight: LodashFlowRight; + forEach: LodashForEach; + forEachRight: LodashForEachRight; + forIn: LodashForIn; + forInRight: LodashForInRight; + forOwn: LodashForOwn; + forOwnRight: LodashForOwnRight; + fromPairs: LodashFromPairs; + functions: LodashFunctions; + functionsIn: LodashFunctionsIn; + get: LodashGet; + getOr: LodashGetOr; + groupBy: LodashGroupBy; + gt: LodashGt; + gte: LodashGte; + has: LodashHas; + hasIn: LodashHasIn; + head: LodashHead; + identical: LodashEq; + identity: LodashIdentity; + includes: LodashIncludes; + includesFrom: LodashIncludesFrom; + indexBy: LodashKeyBy; + indexOf: LodashIndexOf; + indexOfFrom: LodashIndexOfFrom; + init: LodashInitial; + initial: LodashInitial; + inRange: LodashInRange; + intersection: LodashIntersection; + intersectionBy: LodashIntersectionBy; + intersectionWith: LodashIntersectionWith; + invert: LodashInvert; + invertBy: LodashInvertBy; + invertObj: LodashInvert; + invoke: LodashInvoke; + invokeArgs: LodashInvokeArgs; + invokeArgsMap: LodashInvokeArgsMap; + invokeMap: LodashInvokeMap; + isArguments: LodashIsArguments; + isArray: LodashIsArray; + isArrayBuffer: LodashIsArrayBuffer; + isArrayLike: LodashIsArrayLike; + isArrayLikeObject: LodashIsArrayLikeObject; + isBoolean: LodashIsBoolean; + isBuffer: LodashIsBuffer; + isDate: LodashIsDate; + isElement: LodashIsElement; + isEmpty: LodashIsEmpty; + isEqual: LodashIsEqual; + isEqualWith: LodashIsEqualWith; + isError: LodashIsError; + isFinite: LodashIsFinite; + isFunction: LodashIsFunction; + isInteger: LodashIsInteger; + isLength: LodashIsLength; + isMap: LodashIsMap; + isMatch: LodashIsMatch; + isMatchWith: LodashIsMatchWith; + isNaN: LodashIsNaN; + isNative: LodashIsNative; + isNil: LodashIsNil; + isNull: LodashIsNull; + isNumber: LodashIsNumber; + isObject: LodashIsObject; + isObjectLike: LodashIsObjectLike; + isPlainObject: LodashIsPlainObject; + isRegExp: LodashIsRegExp; + isSafeInteger: LodashIsSafeInteger; + isSet: LodashIsSet; + isString: LodashIsString; + isSymbol: LodashIsSymbol; + isTypedArray: LodashIsTypedArray; + isUndefined: LodashIsUndefined; + isWeakMap: LodashIsWeakMap; + isWeakSet: LodashIsWeakSet; + iteratee: LodashIteratee; + join: LodashJoin; + juxt: LodashOver; + kebabCase: LodashKebabCase; + keyBy: LodashKeyBy; + keys: LodashKeys; + keysIn: LodashKeysIn; + last: LodashLast; + lastIndexOf: LodashLastIndexOf; + lastIndexOfFrom: LodashLastIndexOfFrom; + lowerCase: LodashLowerCase; + lowerFirst: LodashLowerFirst; + lt: LodashLt; + lte: LodashLte; + map: LodashMap; + mapKeys: LodashMapKeys; + mapValues: LodashMapValues; + matches: LodashIsMatch; + matchesProperty: LodashMatchesProperty; + max: LodashMax; + maxBy: LodashMaxBy; + mean: LodashMean; + meanBy: LodashMeanBy; + memoize: LodashMemoize; + merge: LodashMerge; + mergeAll: LodashMergeAll; + mergeAllWith: LodashMergeAllWith; + mergeWith: LodashMergeWith; + method: LodashMethod; + methodOf: LodashMethodOf; + min: LodashMin; + minBy: LodashMinBy; + multiply: LodashMultiply; + nAry: LodashAry; + negate: LodashNegate; + noConflict: LodashNoConflict; + noop: LodashNoop; + now: LodashNow; + nth: LodashNth; + nthArg: LodashNthArg; + omit: LodashOmit; + omitAll: LodashOmit; + omitBy: LodashOmitBy; + once: LodashOnce; + orderBy: LodashOrderBy; + over: LodashOver; + overArgs: LodashOverArgs; + overEvery: LodashOverEvery; + overSome: LodashOverSome; + pad: LodashPad; + padChars: LodashPadChars; + padCharsEnd: LodashPadCharsEnd; + padCharsStart: LodashPadCharsStart; + padEnd: LodashPadEnd; + padStart: LodashPadStart; + parseInt: LodashParseInt; + partial: LodashPartial; + partialRight: LodashPartialRight; + partition: LodashPartition; + path: LodashPath; + pathEq: LodashMatchesProperty; + pathOr: LodashPathOr; + paths: LodashAt; + pick: LodashPick; + pickAll: LodashPick; + pickBy: LodashPickBy; + pipe: LodashFlow; + pluck: LodashMap; + prop: LodashProp; + propEq: LodashMatchesProperty; + property: LodashProperty; + propertyOf: LodashPropertyOf; + propOr: LodashPropOr; + props: LodashAt; + pull: LodashPull; + pullAll: LodashPullAll; + pullAllBy: LodashPullAllBy; + pullAllWith: LodashPullAllWith; + pullAt: LodashPullAt; + random: LodashRandom; + range: LodashRange; + rangeRight: LodashRangeRight; + rangeStep: LodashRangeStep; + rangeStepRight: LodashRangeStepRight; + rearg: LodashRearg; + reduce: LodashReduce; + reduceRight: LodashReduceRight; + reject: LodashReject; + remove: LodashRemove; + repeat: LodashRepeat; + replace: LodashReplace; + rest: LodashRest; + restFrom: LodashRestFrom; + result: LodashResult; + reverse: LodashReverse; + round: LodashRound; + runInContext: LodashRunInContext; + sample: LodashSample; + sampleSize: LodashSampleSize; + set: LodashSet; + setWith: LodashSetWith; + shuffle: LodashShuffle; + size: LodashSize; + slice: LodashSlice; + snakeCase: LodashSnakeCase; + some: LodashSome; + sortBy: LodashSortBy; + sortedIndex: LodashSortedIndex; + sortedIndexBy: LodashSortedIndexBy; + sortedIndexOf: LodashSortedIndexOf; + sortedLastIndex: LodashSortedLastIndex; + sortedLastIndexBy: LodashSortedLastIndexBy; + sortedLastIndexOf: LodashSortedLastIndexOf; + sortedUniq: LodashSortedUniq; + sortedUniqBy: LodashSortedUniqBy; + split: LodashSplit; + spread: LodashSpread; + spreadFrom: LodashSpreadFrom; + startCase: LodashStartCase; + startsWith: LodashStartsWith; + stubArray: LodashStubArray; + stubFalse: LodashStubFalse; + stubObject: LodashStubObject; + stubString: LodashStubString; + stubTrue: LodashStubTrue; + subtract: LodashSubtract; + sum: LodashSum; + sumBy: LodashSumBy; + symmetricDifference: LodashXor; + symmetricDifferenceBy: LodashXorBy; + symmetricDifferenceWith: LodashXorWith; + T: LodashStubTrue; + tail: LodashTail; + take: LodashTake; + takeLast: LodashTakeRight; + takeLastWhile: LodashTakeRightWhile; + takeRight: LodashTakeRight; + takeRightWhile: LodashTakeRightWhile; + takeWhile: LodashTakeWhile; + tap: LodashTap; + template: LodashTemplate; + throttle: LodashThrottle; + thru: LodashThru; + times: LodashTimes; + toArray: LodashToArray; + toFinite: LodashToFinite; + toInteger: LodashToInteger; + toLength: LodashToLength; + toLower: LodashToLower; + toNumber: LodashToNumber; + toPairs: LodashToPairs; + toPairsIn: LodashToPairsIn; + toPath: LodashToPath; + toPlainObject: LodashToPlainObject; + toSafeInteger: LodashToSafeInteger; + toString: LodashToString; + toUpper: LodashToUpper; + transform: LodashTransform; + trim: LodashTrim; + trimChars: LodashTrimChars; + trimCharsEnd: LodashTrimCharsEnd; + trimCharsStart: LodashTrimCharsStart; + trimEnd: LodashTrimEnd; + trimStart: LodashTrimStart; + truncate: LodashTruncate; + unapply: LodashUnapply; + unary: LodashUnary; + unescape: LodashUnescape; + union: LodashUnion; + unionBy: LodashUnionBy; + unionWith: LodashUnionWith; + uniq: LodashUniq; + uniqBy: LodashUniqBy; + uniqueId: LodashUniqueId; + uniqWith: LodashUniqWith; + unnest: LodashFlatten; + unset: LodashUnset; + unzip: LodashUnzip; + unzipWith: LodashUnzipWith; + update: LodashUpdate; + updateWith: LodashUpdateWith; + upperCase: LodashUpperCase; + upperFirst: LodashUpperFirst; + useWith: LodashOverArgs; + values: LodashValues; + valuesIn: LodashValuesIn; + where: LodashConformsTo; + whereEq: LodashIsMatch; + without: LodashWithout; + words: LodashWords; + wrap: LodashWrap; + xor: LodashXor; + xorBy: LodashXorBy; + xorWith: LodashXorWith; + zip: LodashZip; + zipAll: LodashZipAll; + zipObj: LodashZipObject; + zipObject: LodashZipObject; + zipObjectDeep: LodashZipObjectDeep; + zipWith: LodashZipWith; + __: lodash.__; + placehodler: lodash.__; } } - -// Backward compatibility with --target es5 -declare global { - // tslint:disable-next-line:no-empty-interface - interface Set { } - // tslint:disable-next-line:no-empty-interface - interface Map { } - // tslint:disable-next-line:no-empty-interface - interface WeakSet { } - // tslint:disable-next-line:no-empty-interface - interface WeakMap { } -} diff --git a/types/lodash/fp/F.d.ts b/types/lodash/fp/F.d.ts index 8d7802efd8..33fc57930d 100644 --- a/types/lodash/fp/F.d.ts +++ b/types/lodash/fp/F.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type StubFalse = - /** - * This method returns `false`. - * - * @returns Returns `false`. - */ - () => boolean; - -declare const F: StubFalse; +import { F } from "../fp"; export = F; diff --git a/types/lodash/fp/T.d.ts b/types/lodash/fp/T.d.ts index ea1dc32ee8..886606ef6f 100644 --- a/types/lodash/fp/T.d.ts +++ b/types/lodash/fp/T.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type StubTrue = - /** - * This method returns `true`. - * - * @returns Returns `true`. - */ - () => boolean; - -declare const T: StubTrue; +import { T } from "../fp"; export = T; diff --git a/types/lodash/fp/__.d.ts b/types/lodash/fp/__.d.ts new file mode 100644 index 0000000000..aec0a51422 --- /dev/null +++ b/types/lodash/fp/__.d.ts @@ -0,0 +1,3 @@ +import _ = require("../index"); +declare const __: _.__; +export = __; diff --git a/types/lodash/fp/add.d.ts b/types/lodash/fp/add.d.ts index 2977814de9..47c9c6a1a4 100644 --- a/types/lodash/fp/add.d.ts +++ b/types/lodash/fp/add.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Add { - /** - * Adds two numbers. - * - * @param augend The first number to add. - * @param addend The second number to add. - * @return Returns the sum. - */ - (): Add; - /** - * Adds two numbers. - * - * @param augend The first number to add. - * @param addend The second number to add. - * @return Returns the sum. - */ - (augend: number): Add1x1; - /** - * Adds two numbers. - * - * @param augend The first number to add. - * @param addend The second number to add. - * @return Returns the sum. - */ - (augend: number, addend: number): number; -} -interface Add1x1 { - /** - * Adds two numbers. - * - * @param augend The first number to add. - * @param addend The second number to add. - * @return Returns the sum. - */ - (): Add1x1; - /** - * Adds two numbers. - * - * @param augend The first number to add. - * @param addend The second number to add. - * @return Returns the sum. - */ - (addend: number): number; -} - -declare const add: Add; +import { add } from "../fp"; export = add; diff --git a/types/lodash/fp/after.d.ts b/types/lodash/fp/after.d.ts index c6b21973d0..93863a5613 100644 --- a/types/lodash/fp/after.d.ts +++ b/types/lodash/fp/after.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface After { - /** - * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. - * - * @param n The number of calls before func is invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - (): After; - /** - * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. - * - * @param n The number of calls before func is invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - any>(func: TFunc): After1x1; - /** - * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. - * - * @param n The number of calls before func is invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - any>(func: TFunc, n: number): TFunc; -} -interface After1x1 any> { - /** - * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. - * - * @param n The number of calls before func is invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - (): After1x1; - /** - * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. - * - * @param n The number of calls before func is invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - (n: number): TFunc; -} - -declare const after: After; +import { after } from "../fp"; export = after; diff --git a/types/lodash/fp/all.d.ts b/types/lodash/fp/all.d.ts index 15f37bae09..5ca0f70736 100644 --- a/types/lodash/fp/all.d.ts +++ b/types/lodash/fp/all.d.ts @@ -1,67 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Every { - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (): Every; - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom): Every1x1; - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom, collection: _.List | null | undefined): boolean; - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom, collection: T | null | undefined): boolean; -} -interface Every1x1 { - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (): Every1x1; - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (collection: _.List | object | null | undefined): boolean; -} - -declare const all: Every; +import { all } from "../fp"; export = all; diff --git a/types/lodash/fp/allPass.d.ts b/types/lodash/fp/allPass.d.ts index 564484494e..5013913efc 100644 --- a/types/lodash/fp/allPass.d.ts +++ b/types/lodash/fp/allPass.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type OverEvery = - /** - * Creates a function that checks if all of the predicates return truthy when invoked with the arguments - * provided to the created function. - * - * @param predicates The predicates to check. - * @return Returns the new function. - */ - (predicates: _.Many<(...args: T[]) => boolean>) => (...args: T[]) => boolean; - -declare const allPass: OverEvery; +import { allPass } from "../fp"; export = allPass; diff --git a/types/lodash/fp/always.d.ts b/types/lodash/fp/always.d.ts index bd22aed21f..07bd82d47c 100644 --- a/types/lodash/fp/always.d.ts +++ b/types/lodash/fp/always.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Constant = - /** - * Creates a function that returns value. - * - * @param value The value to return from the new function. - * @return Returns the new function. - */ - (value: T) => () => T; - -declare const always: Constant; +import { always } from "../fp"; export = always; diff --git a/types/lodash/fp/any.d.ts b/types/lodash/fp/any.d.ts index 32cf83d382..5d8c38f27c 100644 --- a/types/lodash/fp/any.d.ts +++ b/types/lodash/fp/any.d.ts @@ -1,67 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Some { - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (): Some; - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom): Some1x1; - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom, collection: _.List | null | undefined): boolean; - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom, collection: T | null | undefined): boolean; -} -interface Some1x1 { - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (): Some1x1; - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (collection: _.List | object | null | undefined): boolean; -} - -declare const any: Some; +import { any } from "../fp"; export = any; diff --git a/types/lodash/fp/anyPass.d.ts b/types/lodash/fp/anyPass.d.ts index 0666de68ba..b69becfaf3 100644 --- a/types/lodash/fp/anyPass.d.ts +++ b/types/lodash/fp/anyPass.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type OverSome = - /** - * Creates a function that checks if any of the predicates return truthy when invoked with the arguments - * provided to the created function. - * - * @param predicates The predicates to check. - * @return Returns the new function. - */ - (predicates: _.Many<(...args: T[]) => boolean>) => (...args: T[]) => boolean; - -declare const anyPass: OverSome; +import { anyPass } from "../fp"; export = anyPass; diff --git a/types/lodash/fp/apply.d.ts b/types/lodash/fp/apply.d.ts index 6a052218aa..e13c42c5de 100644 --- a/types/lodash/fp/apply.d.ts +++ b/types/lodash/fp/apply.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Spread = - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - (func: (...args: any[]) => TResult) => (...args: any[]) => TResult; - -declare const apply: Spread; +import { apply } from "../fp"; export = apply; diff --git a/types/lodash/fp/ary.d.ts b/types/lodash/fp/ary.d.ts index c241921795..932d7f45f3 100644 --- a/types/lodash/fp/ary.d.ts +++ b/types/lodash/fp/ary.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Ary { - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (): Ary; - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (n: number): Ary1x1; - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (n: number, func: (...args: any[]) => any): (...args: any[]) => any; -} -interface Ary1x1 { - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (): Ary1x1; - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const ary: Ary; +import { ary } from "../fp"; export = ary; diff --git a/types/lodash/fp/assign.d.ts b/types/lodash/fp/assign.d.ts index df05fbe118..cf173104ab 100644 --- a/types/lodash/fp/assign.d.ts +++ b/types/lodash/fp/assign.d.ts @@ -1,156 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Assign { - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - (): Assign; - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - (object: TObject): Assign1x1; - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - (object: TObject, source: TSource): TObject & TSource; -} -interface Assign1x1 { - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - (): Assign1x1; - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - (source: TSource): TObject & TSource; -} - -declare const assign: Assign; +import { assign } from "../fp"; export = assign; diff --git a/types/lodash/fp/assignAll.d.ts b/types/lodash/fp/assignAll.d.ts index b6ba1dfba9..f95b06b475 100644 --- a/types/lodash/fp/assignAll.d.ts +++ b/types/lodash/fp/assignAll.d.ts @@ -1,37 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Assign = - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - (object: ReadonlyArray) => any; - -declare const assignAll: Assign; +import { assignAll } from "../fp"; export = assignAll; diff --git a/types/lodash/fp/assignAllWith.d.ts b/types/lodash/fp/assignAllWith.d.ts index 0f8d2d07ed..c2695a07a6 100644 --- a/types/lodash/fp/assignAllWith.d.ts +++ b/types/lodash/fp/assignAllWith.d.ts @@ -1,138 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface AssignWith { - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignWith; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer): AssignWith1x1; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, args: ReadonlyArray): any; -} -interface AssignWith1x1 { - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignWith1x1; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (args: ReadonlyArray): any; -} - -declare const assignAllWith: AssignWith; +import { assignAllWith } from "../fp"; export = assignAllWith; diff --git a/types/lodash/fp/assignIn.d.ts b/types/lodash/fp/assignIn.d.ts index fcd201f901..f6cdee768b 100644 --- a/types/lodash/fp/assignIn.d.ts +++ b/types/lodash/fp/assignIn.d.ts @@ -1,151 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface AssignIn { - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (): AssignIn; - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (object: TObject): AssignIn1x1; - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (object: TObject, source: TSource): TObject & TSource; -} -interface AssignIn1x1 { - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (): AssignIn1x1; - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (source: TSource): TObject & TSource; -} - -declare const assignIn: AssignIn; +import { assignIn } from "../fp"; export = assignIn; diff --git a/types/lodash/fp/assignInAll.d.ts b/types/lodash/fp/assignInAll.d.ts index 32290cc6cd..539344b67b 100644 --- a/types/lodash/fp/assignInAll.d.ts +++ b/types/lodash/fp/assignInAll.d.ts @@ -1,36 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type AssignIn = - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (object: ReadonlyArray) => TResult; - -declare const assignInAll: AssignIn; +import { assignInAll } from "../fp"; export = assignInAll; diff --git a/types/lodash/fp/assignInAllWith.d.ts b/types/lodash/fp/assignInAllWith.d.ts index 631b28218a..3b421fb332 100644 --- a/types/lodash/fp/assignInAllWith.d.ts +++ b/types/lodash/fp/assignInAllWith.d.ts @@ -1,143 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface AssignInWith { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer): AssignInWith1x1; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, args: ReadonlyArray): any; -} -interface AssignInWith1x1 { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith1x1; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (args: ReadonlyArray): any; -} - -declare const assignInAllWith: AssignInWith; +import { assignInAllWith } from "../fp"; export = assignInAllWith; diff --git a/types/lodash/fp/assignInWith.d.ts b/types/lodash/fp/assignInWith.d.ts index d2f9dbba6f..c410091c62 100644 --- a/types/lodash/fp/assignInWith.d.ts +++ b/types/lodash/fp/assignInWith.d.ts @@ -1,249 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface AssignInWith { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer): AssignInWith1x1; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, object: TObject): AssignInWith1x2; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, object: TObject, source: TSource): TObject & TSource; -} -interface AssignInWith1x1 { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith1x1; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (object: TObject): AssignInWith1x2; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (object: TObject, source: TSource): TObject & TSource; -} -interface AssignInWith1x2 { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith1x2; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (source: TSource): TObject & TSource; -} - -declare const assignInWith: AssignInWith; +import { assignInWith } from "../fp"; export = assignInWith; diff --git a/types/lodash/fp/assignWith.d.ts b/types/lodash/fp/assignWith.d.ts index 2313bd2614..2205db0119 100644 --- a/types/lodash/fp/assignWith.d.ts +++ b/types/lodash/fp/assignWith.d.ts @@ -1,240 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface AssignWith { - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignWith; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer): AssignWith1x1; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, object: TObject): AssignWith1x2; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, object: TObject, source: TSource): TObject & TSource; -} -interface AssignWith1x1 { - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignWith1x1; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (object: TObject): AssignWith1x2; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (object: TObject, source: TSource): TObject & TSource; -} -interface AssignWith1x2 { - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignWith1x2; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (source: TSource): TObject & TSource; -} - -declare const assignWith: AssignWith; +import { assignWith } from "../fp"; export = assignWith; diff --git a/types/lodash/fp/assoc.d.ts b/types/lodash/fp/assoc.d.ts index 41f176aaa9..2a2e29c6f0 100644 --- a/types/lodash/fp/assoc.d.ts +++ b/types/lodash/fp/assoc.d.ts @@ -1,147 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Set { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath): Set1x1; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any, object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any, object: object): TResult; -} -interface Set1x1 { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set1x1; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any, object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any, object: object): TResult; -} -interface Set1x2 { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (object: object): TResult; -} - -declare const assoc: Set; +import { assoc } from "../fp"; export = assoc; diff --git a/types/lodash/fp/assocPath.d.ts b/types/lodash/fp/assocPath.d.ts index ebd0a30a6e..e2dd5179e3 100644 --- a/types/lodash/fp/assocPath.d.ts +++ b/types/lodash/fp/assocPath.d.ts @@ -1,147 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Set { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath): Set1x1; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any, object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any, object: object): TResult; -} -interface Set1x1 { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set1x1; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any, object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any, object: object): TResult; -} -interface Set1x2 { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (object: object): TResult; -} - -declare const assocPath: Set; +import { assocPath } from "../fp"; export = assocPath; diff --git a/types/lodash/fp/at.d.ts b/types/lodash/fp/at.d.ts index c8777af286..beefa3343b 100644 --- a/types/lodash/fp/at.d.ts +++ b/types/lodash/fp/at.d.ts @@ -1,96 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface At { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.PropertyPath): At1x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.PropertyPath, object: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.Many): At2x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.Many, object: T | null | undefined): Array; -} -interface At1x1 { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At1x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (object: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; -} -interface At2x1 { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At2x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (object: T | null | undefined): Array; -} - -declare const at: At; +import { at } from "../fp"; export = at; diff --git a/types/lodash/fp/attempt.d.ts b/types/lodash/fp/attempt.d.ts index b2626b6112..72d60af08f 100644 --- a/types/lodash/fp/attempt.d.ts +++ b/types/lodash/fp/attempt.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Attempt = - /** - * Attempts to invoke func, returning either the result or the caught error object. Any additional arguments - * are provided to func when it’s invoked. - * - * @param func The function to attempt. - * @return Returns the func result or error object. - */ - (func: (...args: any[]) => TResult) => TResult|Error; - -declare const attempt: Attempt; +import { attempt } from "../fp"; export = attempt; diff --git a/types/lodash/fp/before.d.ts b/types/lodash/fp/before.d.ts index f3e4591275..ead2869093 100644 --- a/types/lodash/fp/before.d.ts +++ b/types/lodash/fp/before.d.ts @@ -1,61 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Before { - /** - * Creates a function that invokes func, with the this binding and arguments of the created function, while - * it’s called less than n times. Subsequent calls to the created function return the result of the last func - * invocation. - * - * @param n The number of calls at which func is no longer invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - (): Before; - /** - * Creates a function that invokes func, with the this binding and arguments of the created function, while - * it’s called less than n times. Subsequent calls to the created function return the result of the last func - * invocation. - * - * @param n The number of calls at which func is no longer invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - any>(func: TFunc): Before1x1; - /** - * Creates a function that invokes func, with the this binding and arguments of the created function, while - * it’s called less than n times. Subsequent calls to the created function return the result of the last func - * invocation. - * - * @param n The number of calls at which func is no longer invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - any>(func: TFunc, n: number): TFunc; -} -interface Before1x1 any> { - /** - * Creates a function that invokes func, with the this binding and arguments of the created function, while - * it’s called less than n times. Subsequent calls to the created function return the result of the last func - * invocation. - * - * @param n The number of calls at which func is no longer invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - (): Before1x1; - /** - * Creates a function that invokes func, with the this binding and arguments of the created function, while - * it’s called less than n times. Subsequent calls to the created function return the result of the last func - * invocation. - * - * @param n The number of calls at which func is no longer invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - (n: number): TFunc; -} - -declare const before: Before; +import { before } from "../fp"; export = before; diff --git a/types/lodash/fp/bind.d.ts b/types/lodash/fp/bind.d.ts index b62fb3de1f..a312192a31 100644 --- a/types/lodash/fp/bind.d.ts +++ b/types/lodash/fp/bind.d.ts @@ -1,86 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Bind { - /** - * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind - * arguments to those provided to the bound function. - * - * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for - * partially applied arguments. - * - * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. - * - * @param func The function to bind. - * @param thisArg The this binding of func. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (): Bind; - /** - * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind - * arguments to those provided to the bound function. - * - * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for - * partially applied arguments. - * - * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. - * - * @param func The function to bind. - * @param thisArg The this binding of func. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (func: (...args: any[]) => any): Bind1x1; - /** - * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind - * arguments to those provided to the bound function. - * - * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for - * partially applied arguments. - * - * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. - * - * @param func The function to bind. - * @param thisArg The this binding of func. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (func: (...args: any[]) => any, thisArg: any): (...args: any[]) => any; -} -interface Bind1x1 { - /** - * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind - * arguments to those provided to the bound function. - * - * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for - * partially applied arguments. - * - * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. - * - * @param func The function to bind. - * @param thisArg The this binding of func. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (): Bind1x1; - /** - * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind - * arguments to those provided to the bound function. - * - * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for - * partially applied arguments. - * - * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. - * - * @param func The function to bind. - * @param thisArg The this binding of func. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (thisArg: any): (...args: any[]) => any; -} - -declare const bind: Bind; +import { bind } from "../fp"; export = bind; diff --git a/types/lodash/fp/bindAll.d.ts b/types/lodash/fp/bindAll.d.ts index 98275d8d79..4f7c7dbffc 100644 --- a/types/lodash/fp/bindAll.d.ts +++ b/types/lodash/fp/bindAll.d.ts @@ -1,78 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface BindAll { - /** - * Binds methods of an object to the object itself, overwriting the existing method. Method names may be - * specified as individual arguments or as arrays of method names. If no method names are provided all - * enumerable function properties, own and inherited, of object are bound. - * - * Note: This method does not set the "length" property of bound functions. - * - * @param object The object to bind and assign the bound methods to. - * @param methodNames The object method names to bind, specified as individual method names or arrays of - * method names. - * @return Returns object. - */ - (): BindAll; - /** - * Binds methods of an object to the object itself, overwriting the existing method. Method names may be - * specified as individual arguments or as arrays of method names. If no method names are provided all - * enumerable function properties, own and inherited, of object are bound. - * - * Note: This method does not set the "length" property of bound functions. - * - * @param object The object to bind and assign the bound methods to. - * @param methodNames The object method names to bind, specified as individual method names or arrays of - * method names. - * @return Returns object. - */ - (methodNames: _.Many): BindAll1x1; - /** - * Binds methods of an object to the object itself, overwriting the existing method. Method names may be - * specified as individual arguments or as arrays of method names. If no method names are provided all - * enumerable function properties, own and inherited, of object are bound. - * - * Note: This method does not set the "length" property of bound functions. - * - * @param object The object to bind and assign the bound methods to. - * @param methodNames The object method names to bind, specified as individual method names or arrays of - * method names. - * @return Returns object. - */ - (methodNames: _.Many, object: T): T; -} -interface BindAll1x1 { - /** - * Binds methods of an object to the object itself, overwriting the existing method. Method names may be - * specified as individual arguments or as arrays of method names. If no method names are provided all - * enumerable function properties, own and inherited, of object are bound. - * - * Note: This method does not set the "length" property of bound functions. - * - * @param object The object to bind and assign the bound methods to. - * @param methodNames The object method names to bind, specified as individual method names or arrays of - * method names. - * @return Returns object. - */ - (): BindAll1x1; - /** - * Binds methods of an object to the object itself, overwriting the existing method. Method names may be - * specified as individual arguments or as arrays of method names. If no method names are provided all - * enumerable function properties, own and inherited, of object are bound. - * - * Note: This method does not set the "length" property of bound functions. - * - * @param object The object to bind and assign the bound methods to. - * @param methodNames The object method names to bind, specified as individual method names or arrays of - * method names. - * @return Returns object. - */ - (object: T): T; -} - -declare const bindAll: BindAll; +import { bindAll } from "../fp"; export = bindAll; diff --git a/types/lodash/fp/bindKey.d.ts b/types/lodash/fp/bindKey.d.ts index c20c5b1901..8986b2f3a5 100644 --- a/types/lodash/fp/bindKey.d.ts +++ b/types/lodash/fp/bindKey.d.ts @@ -1,91 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface BindKey { - /** - * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments - * to those provided to the bound function. - * - * This method differs from _.bind by allowing bound functions to reference methods that may be redefined - * or don’t yet exist. See Peter Michaux’s article for more details. - * - * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder - * for partially applied arguments. - * - * @param object The object the method belongs to. - * @param key The key of the method. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (): BindKey; - /** - * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments - * to those provided to the bound function. - * - * This method differs from _.bind by allowing bound functions to reference methods that may be redefined - * or don’t yet exist. See Peter Michaux’s article for more details. - * - * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder - * for partially applied arguments. - * - * @param object The object the method belongs to. - * @param key The key of the method. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (object: object): BindKey1x1; - /** - * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments - * to those provided to the bound function. - * - * This method differs from _.bind by allowing bound functions to reference methods that may be redefined - * or don’t yet exist. See Peter Michaux’s article for more details. - * - * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder - * for partially applied arguments. - * - * @param object The object the method belongs to. - * @param key The key of the method. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (object: object, key: string): (...args: any[]) => any; -} -interface BindKey1x1 { - /** - * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments - * to those provided to the bound function. - * - * This method differs from _.bind by allowing bound functions to reference methods that may be redefined - * or don’t yet exist. See Peter Michaux’s article for more details. - * - * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder - * for partially applied arguments. - * - * @param object The object the method belongs to. - * @param key The key of the method. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (): BindKey1x1; - /** - * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments - * to those provided to the bound function. - * - * This method differs from _.bind by allowing bound functions to reference methods that may be redefined - * or don’t yet exist. See Peter Michaux’s article for more details. - * - * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder - * for partially applied arguments. - * - * @param object The object the method belongs to. - * @param key The key of the method. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (key: string): (...args: any[]) => any; -} - -declare const bindKey: BindKey; +import { bindKey } from "../fp"; export = bindKey; diff --git a/types/lodash/fp/camelCase.d.ts b/types/lodash/fp/camelCase.d.ts index 81d33d61c7..be6628dd27 100644 --- a/types/lodash/fp/camelCase.d.ts +++ b/types/lodash/fp/camelCase.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type CamelCase = - /** - * Converts string to camel case. - * - * @param string The string to convert. - * @return Returns the camel cased string. - */ - (string: string) => string; - -declare const camelCase: CamelCase; +import { camelCase } from "../fp"; export = camelCase; diff --git a/types/lodash/fp/capitalize.d.ts b/types/lodash/fp/capitalize.d.ts index 988421b101..7dc552f9e4 100644 --- a/types/lodash/fp/capitalize.d.ts +++ b/types/lodash/fp/capitalize.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Capitalize = - /** - * Converts the first character of string to upper case and the remaining to lower case. - * - * @param string The string to capitalize. - * @return Returns the capitalized string. - */ - (string: string) => string; - -declare const capitalize: Capitalize; +import { capitalize } from "../fp"; export = capitalize; diff --git a/types/lodash/fp/castArray.d.ts b/types/lodash/fp/castArray.d.ts index 9d5b5fc11b..a431805adf 100644 --- a/types/lodash/fp/castArray.d.ts +++ b/types/lodash/fp/castArray.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type CastArray = - /** - * Casts value as an array if it’s not one. - * - * @param value The value to inspect. - * @return Returns the cast array. - */ - (value: _.Many) => T[]; - -declare const castArray: CastArray; +import { castArray } from "../fp"; export = castArray; diff --git a/types/lodash/fp/ceil.d.ts b/types/lodash/fp/ceil.d.ts index e360c5bc08..13cd7317b1 100644 --- a/types/lodash/fp/ceil.d.ts +++ b/types/lodash/fp/ceil.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Ceil = - /** - * Calculates n rounded up to precision. - * - * @param n The number to round up. - * @param precision The precision to round up to. - * @return Returns the rounded up number. - */ - (n: number) => number; - -declare const ceil: Ceil; +import { ceil } from "../fp"; export = ceil; diff --git a/types/lodash/fp/chunk.d.ts b/types/lodash/fp/chunk.d.ts index 8506a60c56..2e4066660b 100644 --- a/types/lodash/fp/chunk.d.ts +++ b/types/lodash/fp/chunk.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Chunk { - /** - * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the - * final chunk will be the remaining elements. - * - * @param array The array to process. - * @param size The length of each chunk. - * @return Returns the new array containing chunks. - */ - (): Chunk; - /** - * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the - * final chunk will be the remaining elements. - * - * @param array The array to process. - * @param size The length of each chunk. - * @return Returns the new array containing chunks. - */ - (size: number): Chunk1x1; - /** - * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the - * final chunk will be the remaining elements. - * - * @param array The array to process. - * @param size The length of each chunk. - * @return Returns the new array containing chunks. - */ - (size: number, array: _.List | null | undefined): T[][]; -} -interface Chunk1x1 { - /** - * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the - * final chunk will be the remaining elements. - * - * @param array The array to process. - * @param size The length of each chunk. - * @return Returns the new array containing chunks. - */ - (): Chunk1x1; - /** - * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the - * final chunk will be the remaining elements. - * - * @param array The array to process. - * @param size The length of each chunk. - * @return Returns the new array containing chunks. - */ - (array: _.List | null | undefined): T[][]; -} - -declare const chunk: Chunk; +import { chunk } from "../fp"; export = chunk; diff --git a/types/lodash/fp/clamp.d.ts b/types/lodash/fp/clamp.d.ts index 7683abc761..121c6f9b9c 100644 --- a/types/lodash/fp/clamp.d.ts +++ b/types/lodash/fp/clamp.d.ts @@ -1,166 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Clamp { - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (): Clamp; - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (lower: number): Clamp1x1; - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (lower: number, upper: number): Clamp1x2; - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (lower: number, upper: number, number: number): number; -} -interface Clamp1x1 { - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (): Clamp1x1; - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (upper: number): Clamp1x2; - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (upper: number, number: number): number; -} -interface Clamp1x2 { - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (): Clamp1x2; - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (number: number): number; -} - -declare const clamp: Clamp; +import { clamp } from "../fp"; export = clamp; diff --git a/types/lodash/fp/clone.d.ts b/types/lodash/fp/clone.d.ts index b6b00ae301..9edf0c8d13 100644 --- a/types/lodash/fp/clone.d.ts +++ b/types/lodash/fp/clone.d.ts @@ -1,20 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Clone = - /** - * Creates a shallow clone of value. - * - * Note: This method is loosely based on the structured clone algorithm and supports cloning arrays, - * array buffers, booleans, date objects, maps, numbers, Object objects, regexes, sets, strings, symbols, - * and typed arrays. The own enumerable properties of arguments objects are cloned as plain objects. An empty - * object is returned for uncloneable values such as error objects, functions, DOM nodes, and WeakMaps. - * - * @param value The value to clone. - * @return Returns the cloned value. - */ - (value: T) => T; - -declare const clone: Clone; +import { clone } from "../fp"; export = clone; diff --git a/types/lodash/fp/cloneDeep.d.ts b/types/lodash/fp/cloneDeep.d.ts index 85d7137e57..3bdab159ac 100644 --- a/types/lodash/fp/cloneDeep.d.ts +++ b/types/lodash/fp/cloneDeep.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type CloneDeep = - /** - * This method is like _.clone except that it recursively clones value. - * - * @param value The value to recursively clone. - * @return Returns the deep cloned value. - */ - (value: T) => T; - -declare const cloneDeep: CloneDeep; +import { cloneDeep } from "../fp"; export = cloneDeep; diff --git a/types/lodash/fp/cloneDeepWith.d.ts b/types/lodash/fp/cloneDeepWith.d.ts index caaeb278a7..57cf5af8bd 100644 --- a/types/lodash/fp/cloneDeepWith.d.ts +++ b/types/lodash/fp/cloneDeepWith.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface CloneDeepWith { - /** - * This method is like _.cloneWith except that it recursively clones value. - * - * @param value The value to recursively clone. - * @param customizer The function to customize cloning. - * @return Returns the deep cloned value. - */ - (): CloneDeepWith; - /** - * This method is like _.cloneWith except that it recursively clones value. - * - * @param value The value to recursively clone. - * @param customizer The function to customize cloning. - * @return Returns the deep cloned value. - */ - (customizer: _.CloneDeepWithCustomizer): CloneDeepWith1x1; - /** - * This method is like _.cloneWith except that it recursively clones value. - * - * @param value The value to recursively clone. - * @param customizer The function to customize cloning. - * @return Returns the deep cloned value. - */ - (customizer: _.CloneDeepWithCustomizer, value: T): any; -} -interface CloneDeepWith1x1 { - /** - * This method is like _.cloneWith except that it recursively clones value. - * - * @param value The value to recursively clone. - * @param customizer The function to customize cloning. - * @return Returns the deep cloned value. - */ - (): CloneDeepWith1x1; - /** - * This method is like _.cloneWith except that it recursively clones value. - * - * @param value The value to recursively clone. - * @param customizer The function to customize cloning. - * @return Returns the deep cloned value. - */ - (value: T): any; -} - -declare const cloneDeepWith: CloneDeepWith; +import { cloneDeepWith } from "../fp"; export = cloneDeepWith; diff --git a/types/lodash/fp/cloneWith.d.ts b/types/lodash/fp/cloneWith.d.ts index de29399631..9c63e13693 100644 --- a/types/lodash/fp/cloneWith.d.ts +++ b/types/lodash/fp/cloneWith.d.ts @@ -1,96 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface CloneWith { - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (): CloneWith; - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (customizer: _.CloneWithCustomizer): CloneWith1x1; - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (customizer: _.CloneWithCustomizer, value: T): TResult; - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (customizer: _.CloneWithCustomizer): CloneWith2x1; - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (customizer: _.CloneWithCustomizer, value: T): TResult | T; -} -interface CloneWith1x1 { - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (): CloneWith1x1; - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (value: T): TResult; -} -interface CloneWith2x1 { - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (): CloneWith2x1; - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (value: T): TResult | T; -} - -declare const cloneWith: CloneWith; +import { cloneWith } from "../fp"; export = cloneWith; diff --git a/types/lodash/fp/compact.d.ts b/types/lodash/fp/compact.d.ts index 4b1c509117..6ca1547040 100644 --- a/types/lodash/fp/compact.d.ts +++ b/types/lodash/fp/compact.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Compact = - /** - * Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are - * falsey. - * - * @param array The array to compact. - * @return Returns the new array of filtered values. - */ - (array: _.List | null | undefined) => T[]; - -declare const compact: Compact; +import { compact } from "../fp"; export = compact; diff --git a/types/lodash/fp/complement.d.ts b/types/lodash/fp/complement.d.ts index 397bab4997..e4c3112534 100644 --- a/types/lodash/fp/complement.d.ts +++ b/types/lodash/fp/complement.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Negate = - /** - * Creates a function that negates the result of the predicate func. The func predicate is invoked with - * the this binding and arguments of the created function. - * - * @param predicate The predicate to negate. - * @return Returns the new function. - */ - any>(predicate: T) => T; - -declare const complement: Negate; +import { complement } from "../fp"; export = complement; diff --git a/types/lodash/fp/compose.d.ts b/types/lodash/fp/compose.d.ts index 6d626496ae..7950c7c585 100644 --- a/types/lodash/fp/compose.d.ts +++ b/types/lodash/fp/compose.d.ts @@ -1,315 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FlowRight { - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: () => R1): () => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: any) => any, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array<_.Many<(...args: any[]) => any>>): (...args: any[]) => any; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (funcs: Array<_.Many<(...args: any[]) => any>>): (...args: any[]) => any; -} - -declare const compose: FlowRight; +import { compose } from "../fp"; export = compose; diff --git a/types/lodash/fp/concat.d.ts b/types/lodash/fp/concat.d.ts index a68dce878a..5e109d1daa 100644 --- a/types/lodash/fp/concat.d.ts +++ b/types/lodash/fp/concat.d.ts @@ -1,113 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Concat { - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @category Array - * @param array The array to concatenate. - * @param [values] The values to concatenate. - * @returns Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - (): Concat; - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @category Array - * @param array The array to concatenate. - * @param [values] The values to concatenate. - * @returns Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - (array: _.Many): Concat1x1; - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @category Array - * @param array The array to concatenate. - * @param [values] The values to concatenate. - * @returns Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - (array: _.Many, values: _.Many): T[]; -} -interface Concat1x1 { - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @category Array - * @param array The array to concatenate. - * @param [values] The values to concatenate. - * @returns Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - (): Concat1x1; - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @category Array - * @param array The array to concatenate. - * @param [values] The values to concatenate. - * @returns Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - (values: _.Many): T[]; -} - -declare const concat: Concat; +import { concat } from "../fp"; export = concat; diff --git a/types/lodash/fp/cond.d.ts b/types/lodash/fp/cond.d.ts index c5a18575a6..b9216e308f 100644 --- a/types/lodash/fp/cond.d.ts +++ b/types/lodash/fp/cond.d.ts @@ -1,38 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Cond = - /** - * Creates a function that iterates over `pairs` and invokes the corresponding - * function of the first predicate to return truthy. The predicate-function - * pairs are invoked with the `this` binding and arguments of the created - * function. - * - * @since 4.0.0 - * @category Util - * @param pairs The predicate-function pairs. - * @returns Returns the new composite function. - * @example - * - * var func = _.cond([ - * [_.matches({ 'a': 1 }), _.constant('matches A')], - * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], - * [_.stubTrue, _.constant('no match')] - * ]); - * - * func({ 'a': 1, 'b': 2 }); - * // => 'matches A' - * - * func({ 'a': 0, 'b': 1 }); - * // => 'matches B' - * - * func({ 'a': '1', 'b': '2' }); - * // => 'no match' - */ - (pairs: Array<_.CondPair>) => (Target: T) => R; - -declare const cond: Cond; +import { cond } from "../fp"; export = cond; diff --git a/types/lodash/fp/conforms.d.ts b/types/lodash/fp/conforms.d.ts index 6499cccf55..9bd3353f44 100644 --- a/types/lodash/fp/conforms.d.ts +++ b/types/lodash/fp/conforms.d.ts @@ -1,48 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ConformsTo { - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (): ConformsTo; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (source: _.ConformsPredicateObject): ConformsTo1x1; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (source: _.ConformsPredicateObject, object: T): boolean; -} -interface ConformsTo1x1 { - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (): ConformsTo1x1; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (object: T): boolean; -} - -declare const conforms: ConformsTo; +import { conforms } from "../fp"; export = conforms; diff --git a/types/lodash/fp/conformsTo.d.ts b/types/lodash/fp/conformsTo.d.ts index 9512e4adf6..ad1728006d 100644 --- a/types/lodash/fp/conformsTo.d.ts +++ b/types/lodash/fp/conformsTo.d.ts @@ -1,48 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ConformsTo { - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (): ConformsTo; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (source: _.ConformsPredicateObject): ConformsTo1x1; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (source: _.ConformsPredicateObject, object: T): boolean; -} -interface ConformsTo1x1 { - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (): ConformsTo1x1; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (object: T): boolean; -} - -declare const conformsTo: ConformsTo; +import { conformsTo } from "../fp"; export = conformsTo; diff --git a/types/lodash/fp/constant.d.ts b/types/lodash/fp/constant.d.ts index 718805e17f..ef80ff57c3 100644 --- a/types/lodash/fp/constant.d.ts +++ b/types/lodash/fp/constant.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Constant = - /** - * Creates a function that returns value. - * - * @param value The value to return from the new function. - * @return Returns the new function. - */ - (value: T) => () => T; - -declare const constant: Constant; +import { constant } from "../fp"; export = constant; diff --git a/types/lodash/fp/contains.d.ts b/types/lodash/fp/contains.d.ts index b80ca7f1fa..6c29e95f1a 100644 --- a/types/lodash/fp/contains.d.ts +++ b/types/lodash/fp/contains.d.ts @@ -1,63 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Includes { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (): Includes; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (target: T): Includes1x1; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (target: T, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean; -} -interface Includes1x1 { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (): Includes1x1; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean; -} - -declare const contains: Includes; +import { contains } from "../fp"; export = contains; diff --git a/types/lodash/fp/countBy.d.ts b/types/lodash/fp/countBy.d.ts index cca0ac3b02..e3725c3521 100644 --- a/types/lodash/fp/countBy.d.ts +++ b/types/lodash/fp/countBy.d.ts @@ -1,225 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface CountBy { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): CountBy; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: (value: string) => T): CountBy1x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: (value: string) => T, collection: string | null | undefined): _.Dictionary; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIteratee): CountBy2x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIteratee, collection: _.List | null | undefined): _.Dictionary; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIteratee, collection: T | null | undefined): _.Dictionary; -} -interface CountBy1x1 { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): CountBy1x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (collection: string | null | undefined): _.Dictionary; -} -interface CountBy2x1 { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): CountBy2x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (collection: _.List | object | null | undefined): _.Dictionary; -} - -declare const countBy: CountBy; +import { countBy } from "../fp"; export = countBy; diff --git a/types/lodash/fp/create.d.ts b/types/lodash/fp/create.d.ts index 6025931062..2818e10e8d 100644 --- a/types/lodash/fp/create.d.ts +++ b/types/lodash/fp/create.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Create = - /** - * Creates an object that inherits from the given prototype object. If a properties object is provided its own - * enumerable properties are assigned to the created object. - * - * @param prototype The object to inherit from. - * @param properties The properties to assign to the object. - * @return Returns the new object. - */ - (prototype: T) => T & U; - -declare const create: Create; +import { create } from "../fp"; export = create; diff --git a/types/lodash/fp/curry.d.ts b/types/lodash/fp/curry.d.ts index 6c946bbf67..e8fcf1ded7 100644 --- a/types/lodash/fp/curry.d.ts +++ b/types/lodash/fp/curry.d.ts @@ -1,65 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Curry { - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1) => R): _.CurriedFunction1; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2) => R): _.CurriedFunction2; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3) => R): _.CurriedFunction3; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): _.CurriedFunction4; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): _.CurriedFunction5; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const curry: Curry; +import { curry } from "../fp"; export = curry; diff --git a/types/lodash/fp/curryN.d.ts b/types/lodash/fp/curryN.d.ts index 4acbd81811..55b579b716 100644 --- a/types/lodash/fp/curryN.d.ts +++ b/types/lodash/fp/curryN.d.ts @@ -1,148 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Curry { - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (): Curry; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number): Curry1x1; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1) => R): _.CurriedFunction1; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1, t2: T2) => R): _.CurriedFunction2; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1, t2: T2, t3: T3) => R): _.CurriedFunction3; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): _.CurriedFunction4; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): _.CurriedFunction5; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (...args: any[]) => any): (...args: any[]) => any; -} -interface Curry1x1 { - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (): Curry1x1; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1) => R): _.CurriedFunction1; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2) => R): _.CurriedFunction2; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3) => R): _.CurriedFunction3; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): _.CurriedFunction4; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): _.CurriedFunction5; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const curryN: Curry; +import { curryN } from "../fp"; export = curryN; diff --git a/types/lodash/fp/curryRight.d.ts b/types/lodash/fp/curryRight.d.ts index 5ff81e2004..d431f3c673 100644 --- a/types/lodash/fp/curryRight.d.ts +++ b/types/lodash/fp/curryRight.d.ts @@ -1,59 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface CurryRight { - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1) => R): _.RightCurriedFunction1; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2) => R): _.RightCurriedFunction2; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3) => R): _.RightCurriedFunction3; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): _.RightCurriedFunction4; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): _.RightCurriedFunction5; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const curryRight: CurryRight; +import { curryRight } from "../fp"; export = curryRight; diff --git a/types/lodash/fp/curryRightN.d.ts b/types/lodash/fp/curryRightN.d.ts index 98694df731..89866d16ae 100644 --- a/types/lodash/fp/curryRightN.d.ts +++ b/types/lodash/fp/curryRightN.d.ts @@ -1,133 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface CurryRight { - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (): CurryRight; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number): CurryRight1x1; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1) => R): _.RightCurriedFunction1; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1, t2: T2) => R): _.RightCurriedFunction2; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1, t2: T2, t3: T3) => R): _.RightCurriedFunction3; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): _.RightCurriedFunction4; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): _.RightCurriedFunction5; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (...args: any[]) => any): (...args: any[]) => any; -} -interface CurryRight1x1 { - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (): CurryRight1x1; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1) => R): _.RightCurriedFunction1; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2) => R): _.RightCurriedFunction2; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3) => R): _.RightCurriedFunction3; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): _.RightCurriedFunction4; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): _.RightCurriedFunction5; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const curryRightN: CurryRight; +import { curryRightN } from "../fp"; export = curryRightN; diff --git a/types/lodash/fp/debounce.d.ts b/types/lodash/fp/debounce.d.ts index 6aa4ca891b..88b003cbb0 100644 --- a/types/lodash/fp/debounce.d.ts +++ b/types/lodash/fp/debounce.d.ts @@ -1,118 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Debounce { - /** - * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since - * the last time the debounced function was invoked. The debounced function comes with a cancel method to - * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to - * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent - * calls to the debounced function return the result of the last func invocation. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only - * if the the debounced function is invoked more than once during the wait timeout. - * - * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. - * - * @param func The function to debounce. - * @param wait The number of milliseconds to delay. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new debounced function. - */ - (): Debounce; - /** - * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since - * the last time the debounced function was invoked. The debounced function comes with a cancel method to - * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to - * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent - * calls to the debounced function return the result of the last func invocation. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only - * if the the debounced function is invoked more than once during the wait timeout. - * - * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. - * - * @param func The function to debounce. - * @param wait The number of milliseconds to delay. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new debounced function. - */ - (wait: number): Debounce1x1; - /** - * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since - * the last time the debounced function was invoked. The debounced function comes with a cancel method to - * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to - * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent - * calls to the debounced function return the result of the last func invocation. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only - * if the the debounced function is invoked more than once during the wait timeout. - * - * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. - * - * @param func The function to debounce. - * @param wait The number of milliseconds to delay. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new debounced function. - */ - any>(wait: number, func: T): T & _.Cancelable; -} -interface Debounce1x1 { - /** - * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since - * the last time the debounced function was invoked. The debounced function comes with a cancel method to - * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to - * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent - * calls to the debounced function return the result of the last func invocation. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only - * if the the debounced function is invoked more than once during the wait timeout. - * - * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. - * - * @param func The function to debounce. - * @param wait The number of milliseconds to delay. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new debounced function. - */ - (): Debounce1x1; - /** - * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since - * the last time the debounced function was invoked. The debounced function comes with a cancel method to - * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to - * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent - * calls to the debounced function return the result of the last func invocation. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only - * if the the debounced function is invoked more than once during the wait timeout. - * - * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. - * - * @param func The function to debounce. - * @param wait The number of milliseconds to delay. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new debounced function. - */ - any>(func: T): T & _.Cancelable; -} - -declare const debounce: Debounce; +import { debounce } from "../fp"; export = debounce; diff --git a/types/lodash/fp/deburr.d.ts b/types/lodash/fp/deburr.d.ts index 582ef58205..769abfb504 100644 --- a/types/lodash/fp/deburr.d.ts +++ b/types/lodash/fp/deburr.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Deburr = - /** - * Deburrs string by converting latin-1 supplementary letters to basic latin letters and removing combining - * diacritical marks. - * - * @param string The string to deburr. - * @return Returns the deburred string. - */ - (string: string) => string; - -declare const deburr: Deburr; +import { deburr } from "../fp"; export = deburr; diff --git a/types/lodash/fp/defaultTo.d.ts b/types/lodash/fp/defaultTo.d.ts index 2137ee3307..e02cc46fed 100644 --- a/types/lodash/fp/defaultTo.d.ts +++ b/types/lodash/fp/defaultTo.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface DefaultTo { - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (): DefaultTo; - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (defaultValue: T): DefaultTo1x1; - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (defaultValue: T, value: T | null | undefined): T; - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (defaultValue: TDefault): DefaultTo2x1; - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (defaultValue: TDefault, value: T | null | undefined): T | TDefault; -} -interface DefaultTo1x1 { - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (): DefaultTo1x1; - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (value: T | null | undefined): T; -} -interface DefaultTo2x1 { - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (): DefaultTo2x1; - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (value: T | null | undefined): T | TDefault; -} - -declare const defaultTo: DefaultTo; +import { defaultTo } from "../fp"; export = defaultTo; diff --git a/types/lodash/fp/defaults.d.ts b/types/lodash/fp/defaults.d.ts index 306534d374..132e47ba2e 100644 --- a/types/lodash/fp/defaults.d.ts +++ b/types/lodash/fp/defaults.d.ts @@ -1,71 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Defaults { - /** - * Assigns own enumerable properties of source object(s) to the destination object for all destination - * properties that resolve to undefined. Once a property is set, additional values of the same property are - * ignored. - * - * Note: This method mutates object. - * - * @param object The destination object. - * @param sources The source objects. - * @return The destination object. - */ - (): Defaults; - /** - * Assigns own enumerable properties of source object(s) to the destination object for all destination - * properties that resolve to undefined. Once a property is set, additional values of the same property are - * ignored. - * - * Note: This method mutates object. - * - * @param object The destination object. - * @param sources The source objects. - * @return The destination object. - */ - (source: TSource): Defaults1x1; - /** - * Assigns own enumerable properties of source object(s) to the destination object for all destination - * properties that resolve to undefined. Once a property is set, additional values of the same property are - * ignored. - * - * Note: This method mutates object. - * - * @param object The destination object. - * @param sources The source objects. - * @return The destination object. - */ - (source: TSource, object: TObject): TSource & TObject; -} -interface Defaults1x1 { - /** - * Assigns own enumerable properties of source object(s) to the destination object for all destination - * properties that resolve to undefined. Once a property is set, additional values of the same property are - * ignored. - * - * Note: This method mutates object. - * - * @param object The destination object. - * @param sources The source objects. - * @return The destination object. - */ - (): Defaults1x1; - /** - * Assigns own enumerable properties of source object(s) to the destination object for all destination - * properties that resolve to undefined. Once a property is set, additional values of the same property are - * ignored. - * - * Note: This method mutates object. - * - * @param object The destination object. - * @param sources The source objects. - * @return The destination object. - */ - (object: TObject): TSource & TObject; -} - -declare const defaults: Defaults; +import { defaults } from "../fp"; export = defaults; diff --git a/types/lodash/fp/defaultsAll.d.ts b/types/lodash/fp/defaultsAll.d.ts index 371f6db282..1f2a3309e7 100644 --- a/types/lodash/fp/defaultsAll.d.ts +++ b/types/lodash/fp/defaultsAll.d.ts @@ -1,20 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Defaults = - /** - * Assigns own enumerable properties of source object(s) to the destination object for all destination - * properties that resolve to undefined. Once a property is set, additional values of the same property are - * ignored. - * - * Note: This method mutates object. - * - * @param object The destination object. - * @param sources The source objects. - * @return The destination object. - */ - (object: ReadonlyArray) => any; - -declare const defaultsAll: Defaults; +import { defaultsAll } from "../fp"; export = defaultsAll; diff --git a/types/lodash/fp/defaultsDeep.d.ts b/types/lodash/fp/defaultsDeep.d.ts index 86eace1bb9..6268a02594 100644 --- a/types/lodash/fp/defaultsDeep.d.ts +++ b/types/lodash/fp/defaultsDeep.d.ts @@ -1,46 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface DefaultsDeep { - /** - * This method is like _.defaults except that it recursively assigns default properties. - * @param object The destination object. - * @param sources The source objects. - * @return Returns object. - **/ - (): DefaultsDeep; - /** - * This method is like _.defaults except that it recursively assigns default properties. - * @param object The destination object. - * @param sources The source objects. - * @return Returns object. - **/ - (sources: any): DefaultsDeep1x1; - /** - * This method is like _.defaults except that it recursively assigns default properties. - * @param object The destination object. - * @param sources The source objects. - * @return Returns object. - **/ - (sources: any, object: any): any; -} -interface DefaultsDeep1x1 { - /** - * This method is like _.defaults except that it recursively assigns default properties. - * @param object The destination object. - * @param sources The source objects. - * @return Returns object. - **/ - (): DefaultsDeep1x1; - /** - * This method is like _.defaults except that it recursively assigns default properties. - * @param object The destination object. - * @param sources The source objects. - * @return Returns object. - **/ - (object: any): any; -} - -declare const defaultsDeep: DefaultsDeep; +import { defaultsDeep } from "../fp"; export = defaultsDeep; diff --git a/types/lodash/fp/defaultsDeepAll.d.ts b/types/lodash/fp/defaultsDeepAll.d.ts index cb6157662d..7791666232 100644 --- a/types/lodash/fp/defaultsDeepAll.d.ts +++ b/types/lodash/fp/defaultsDeepAll.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type DefaultsDeep = - /** - * This method is like _.defaults except that it recursively assigns default properties. - * @param object The destination object. - * @param sources The source objects. - * @return Returns object. - **/ - (object: ReadonlyArray) => any; - -declare const defaultsDeepAll: DefaultsDeep; +import { defaultsDeepAll } from "../fp"; export = defaultsDeepAll; diff --git a/types/lodash/fp/defer.d.ts b/types/lodash/fp/defer.d.ts index a9bab80092..f8be4ae8e2 100644 --- a/types/lodash/fp/defer.d.ts +++ b/types/lodash/fp/defer.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Defer = - /** - * Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to - * func when it’s invoked. - * - * @param func The function to defer. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - (func: (...args: any[]) => any, ...args: any[]) => number; - -declare const defer: Defer; +import { defer } from "../fp"; export = defer; diff --git a/types/lodash/fp/delay.d.ts b/types/lodash/fp/delay.d.ts index 8709a9c0e2..2f0c39909f 100644 --- a/types/lodash/fp/delay.d.ts +++ b/types/lodash/fp/delay.d.ts @@ -1,56 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Delay { - /** - * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. - * - * @param func The function to delay. - * @param wait The number of milliseconds to delay invocation. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - (): Delay; - /** - * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. - * - * @param func The function to delay. - * @param wait The number of milliseconds to delay invocation. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - (wait: number): Delay1x1; - /** - * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. - * - * @param func The function to delay. - * @param wait The number of milliseconds to delay invocation. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - (wait: number, func: (...args: any[]) => any): number; -} -interface Delay1x1 { - /** - * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. - * - * @param func The function to delay. - * @param wait The number of milliseconds to delay invocation. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - (): Delay1x1; - /** - * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. - * - * @param func The function to delay. - * @param wait The number of milliseconds to delay invocation. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - (func: (...args: any[]) => any): number; -} - -declare const delay: Delay; +import { delay } from "../fp"; export = delay; diff --git a/types/lodash/fp/difference.d.ts b/types/lodash/fp/difference.d.ts index 774539bba7..9448085041 100644 --- a/types/lodash/fp/difference.d.ts +++ b/types/lodash/fp/difference.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Difference { - /** - * Creates an array of unique array values not included in the other provided arrays using SameValueZero for - * equality comparisons. - * - * @param array The array to inspect. - * @param values The arrays of values to exclude. - * @return Returns the new array of filtered values. - */ - (): Difference; - /** - * Creates an array of unique array values not included in the other provided arrays using SameValueZero for - * equality comparisons. - * - * @param array The array to inspect. - * @param values The arrays of values to exclude. - * @return Returns the new array of filtered values. - */ - (array: _.List | null | undefined): Difference1x1; - /** - * Creates an array of unique array values not included in the other provided arrays using SameValueZero for - * equality comparisons. - * - * @param array The array to inspect. - * @param values The arrays of values to exclude. - * @return Returns the new array of filtered values. - */ - (array: _.List | null | undefined, values: _.List): T[]; -} -interface Difference1x1 { - /** - * Creates an array of unique array values not included in the other provided arrays using SameValueZero for - * equality comparisons. - * - * @param array The array to inspect. - * @param values The arrays of values to exclude. - * @return Returns the new array of filtered values. - */ - (): Difference1x1; - /** - * Creates an array of unique array values not included in the other provided arrays using SameValueZero for - * equality comparisons. - * - * @param array The array to inspect. - * @param values The arrays of values to exclude. - * @return Returns the new array of filtered values. - */ - (values: _.List): T[]; -} - -declare const difference: Difference; +import { difference } from "../fp"; export = difference; diff --git a/types/lodash/fp/differenceBy.d.ts b/types/lodash/fp/differenceBy.d.ts index 64975c1b17..52ba5b80ac 100644 --- a/types/lodash/fp/differenceBy.d.ts +++ b/types/lodash/fp/differenceBy.d.ts @@ -1,114 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface DifferenceBy { - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (): DifferenceBy; - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (iteratee: _.ValueIteratee): DifferenceBy1x1; - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (iteratee: _.ValueIteratee, array: _.List | null | undefined): DifferenceBy1x2; - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (iteratee: _.ValueIteratee, array: _.List | null | undefined, values: _.List): T1[]; -} -interface DifferenceBy1x1 { - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (): DifferenceBy1x1; - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (array: _.List | null | undefined): DifferenceBy1x2; - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (array: _.List | null | undefined, values: _.List): T1[]; -} -interface DifferenceBy1x2 { - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (): DifferenceBy1x2; - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (values: _.List): T1[]; -} - -declare const differenceBy: DifferenceBy; +import { differenceBy } from "../fp"; export = differenceBy; diff --git a/types/lodash/fp/differenceWith.d.ts b/types/lodash/fp/differenceWith.d.ts index 2ef1961ff7..fd3c9a2cd4 100644 --- a/types/lodash/fp/differenceWith.d.ts +++ b/types/lodash/fp/differenceWith.d.ts @@ -1,168 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface DifferenceWith { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (): DifferenceWith; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (comparator: _.Comparator2): DifferenceWith1x1; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (comparator: _.Comparator2, array: _.List | null | undefined): DifferenceWith1x2; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (comparator: _.Comparator2, array: _.List | null | undefined, values: _.List): T1[]; -} -interface DifferenceWith1x1 { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (): DifferenceWith1x1; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (array: _.List | null | undefined): DifferenceWith1x2; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (array: _.List | null | undefined, values: _.List): T1[]; -} -interface DifferenceWith1x2 { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (): DifferenceWith1x2; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (values: _.List): T1[]; -} - -declare const differenceWith: DifferenceWith; +import { differenceWith } from "../fp"; export = differenceWith; diff --git a/types/lodash/fp/dissoc.d.ts b/types/lodash/fp/dissoc.d.ts index ad931b90da..9b0fd6bb90 100644 --- a/types/lodash/fp/dissoc.d.ts +++ b/types/lodash/fp/dissoc.d.ts @@ -1,63 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Unset { - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (): Unset; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (path: _.PropertyPath): Unset1x1; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (path: _.PropertyPath, object: any): boolean; -} -interface Unset1x1 { - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (): Unset1x1; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (object: any): boolean; -} - -declare const dissoc: Unset; +import { dissoc } from "../fp"; export = dissoc; diff --git a/types/lodash/fp/dissocPath.d.ts b/types/lodash/fp/dissocPath.d.ts index 8d98858a6c..a201aa4b88 100644 --- a/types/lodash/fp/dissocPath.d.ts +++ b/types/lodash/fp/dissocPath.d.ts @@ -1,63 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Unset { - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (): Unset; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (path: _.PropertyPath): Unset1x1; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (path: _.PropertyPath, object: any): boolean; -} -interface Unset1x1 { - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (): Unset1x1; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (object: any): boolean; -} - -declare const dissocPath: Unset; +import { dissocPath } from "../fp"; export = dissocPath; diff --git a/types/lodash/fp/divide.d.ts b/types/lodash/fp/divide.d.ts index 293acebb68..5cd02e49dc 100644 --- a/types/lodash/fp/divide.d.ts +++ b/types/lodash/fp/divide.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Divide { - /** - * Divide two numbers. - * - * @param dividend The first number in a division. - * @param divisor The second number in a division. - * @returns Returns the quotient. - */ - (): Divide; - /** - * Divide two numbers. - * - * @param dividend The first number in a division. - * @param divisor The second number in a division. - * @returns Returns the quotient. - */ - (dividend: number): Divide1x1; - /** - * Divide two numbers. - * - * @param dividend The first number in a division. - * @param divisor The second number in a division. - * @returns Returns the quotient. - */ - (dividend: number, divisor: number): number; -} -interface Divide1x1 { - /** - * Divide two numbers. - * - * @param dividend The first number in a division. - * @param divisor The second number in a division. - * @returns Returns the quotient. - */ - (): Divide1x1; - /** - * Divide two numbers. - * - * @param dividend The first number in a division. - * @param divisor The second number in a division. - * @returns Returns the quotient. - */ - (divisor: number): number; -} - -declare const divide: Divide; +import { divide } from "../fp"; export = divide; diff --git a/types/lodash/fp/drop.d.ts b/types/lodash/fp/drop.d.ts index 3c524f1321..bc3b9b2049 100644 --- a/types/lodash/fp/drop.d.ts +++ b/types/lodash/fp/drop.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Drop { - /** - * Creates a slice of array with n elements dropped from the beginning. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (): Drop; - /** - * Creates a slice of array with n elements dropped from the beginning. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (n: number): Drop1x1; - /** - * Creates a slice of array with n elements dropped from the beginning. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (n: number, array: _.List | null | undefined): T[]; -} -interface Drop1x1 { - /** - * Creates a slice of array with n elements dropped from the beginning. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (): Drop1x1; - /** - * Creates a slice of array with n elements dropped from the beginning. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const drop: Drop; +import { drop } from "../fp"; export = drop; diff --git a/types/lodash/fp/dropLast.d.ts b/types/lodash/fp/dropLast.d.ts index e0fb5db69e..1dd388ae15 100644 --- a/types/lodash/fp/dropLast.d.ts +++ b/types/lodash/fp/dropLast.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface DropRight { - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (): DropRight; - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (n: number): DropRight1x1; - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (n: number, array: _.List | null | undefined): T[]; -} -interface DropRight1x1 { - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (): DropRight1x1; - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const dropLast: DropRight; +import { dropLast } from "../fp"; export = dropLast; diff --git a/types/lodash/fp/dropLastWhile.d.ts b/types/lodash/fp/dropLastWhile.d.ts index 3d0d5634ef..97529a6a49 100644 --- a/types/lodash/fp/dropLastWhile.d.ts +++ b/types/lodash/fp/dropLastWhile.d.ts @@ -1,108 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface DropRightWhile { - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): DropRightWhile; - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee): DropRightWhile1x1; - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee, array: _.List | null | undefined): T[]; -} -interface DropRightWhile1x1 { - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): DropRightWhile1x1; - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const dropLastWhile: DropRightWhile; +import { dropLastWhile } from "../fp"; export = dropLastWhile; diff --git a/types/lodash/fp/dropRight.d.ts b/types/lodash/fp/dropRight.d.ts index 4c07c3c8a5..a2740ff029 100644 --- a/types/lodash/fp/dropRight.d.ts +++ b/types/lodash/fp/dropRight.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface DropRight { - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (): DropRight; - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (n: number): DropRight1x1; - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (n: number, array: _.List | null | undefined): T[]; -} -interface DropRight1x1 { - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (): DropRight1x1; - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const dropRight: DropRight; +import { dropRight } from "../fp"; export = dropRight; diff --git a/types/lodash/fp/dropRightWhile.d.ts b/types/lodash/fp/dropRightWhile.d.ts index e346a77e97..1a5aa5fe3e 100644 --- a/types/lodash/fp/dropRightWhile.d.ts +++ b/types/lodash/fp/dropRightWhile.d.ts @@ -1,108 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface DropRightWhile { - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): DropRightWhile; - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee): DropRightWhile1x1; - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee, array: _.List | null | undefined): T[]; -} -interface DropRightWhile1x1 { - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): DropRightWhile1x1; - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const dropRightWhile: DropRightWhile; +import { dropRightWhile } from "../fp"; export = dropRightWhile; diff --git a/types/lodash/fp/dropWhile.d.ts b/types/lodash/fp/dropWhile.d.ts index 056a06bc3e..2cab8d8698 100644 --- a/types/lodash/fp/dropWhile.d.ts +++ b/types/lodash/fp/dropWhile.d.ts @@ -1,108 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface DropWhile { - /** - * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): DropWhile; - /** - * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee): DropWhile1x1; - /** - * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee, array: _.List | null | undefined): T[]; -} -interface DropWhile1x1 { - /** - * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): DropWhile1x1; - /** - * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const dropWhile: DropWhile; +import { dropWhile } from "../fp"; export = dropWhile; diff --git a/types/lodash/fp/each.d.ts b/types/lodash/fp/each.d.ts index df0afae30f..af1d3b20a6 100644 --- a/types/lodash/fp/each.d.ts +++ b/types/lodash/fp/each.d.ts @@ -1,330 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ForEach { - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (): ForEach; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T) => any): ForEach1x1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T) => any, collection: ReadonlyArray): T[]; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: string) => any): ForEach2x1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: string) => any, collection: string): string; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T) => any, collection: _.List): _.List; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T[keyof T]) => any, collection: T): T; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T) => any, collection: TArray & (T[] | null | undefined)): TArray; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: string) => any, collection: TString): TString; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - | null | undefined>(iteratee: (value: T) => any, collection: TList & (_.List | null | undefined)): TList; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T[keyof T]) => any, collection: T | null | undefined): T | null | undefined; -} -interface ForEach1x1 { - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (): ForEach1x1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: ReadonlyArray): T[]; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: _.List): _.List; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: T1): T1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: TArray & (T[] | null | undefined)): TArray; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - | null | undefined>(collection: TList & (_.List | null | undefined)): TList; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: T1 | null | undefined): T1 | null | undefined; -} -interface ForEach2x1 { - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (): ForEach2x1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: string): string; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: TString): TString; -} - -declare const each: ForEach; +import { each } from "../fp"; export = each; diff --git a/types/lodash/fp/eachRight.d.ts b/types/lodash/fp/eachRight.d.ts index 06af73ca68..5ca2934abd 100644 --- a/types/lodash/fp/eachRight.d.ts +++ b/types/lodash/fp/eachRight.d.ts @@ -1,225 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ForEachRight { - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (): ForEachRight; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T) => any): ForEachRight1x1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T) => any, collection: ReadonlyArray): T[]; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: string) => any): ForEachRight2x1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: string) => any, collection: string): string; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T) => any, collection: _.List): _.List; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T[keyof T]) => any, collection: T): T; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T) => any, collection: TArray & (T[] | null | undefined)): TArray; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: string) => any, collection: TString): TString; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - | null | undefined>(iteratee: (value: T) => any, collection: TList & (_.List | null | undefined)): TList; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T[keyof T]) => any, collection: T | null | undefined): T | null | undefined; -} -interface ForEachRight1x1 { - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (): ForEachRight1x1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: ReadonlyArray): T[]; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: _.List): _.List; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: T1): T1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: TArray & (T[] | null | undefined)): TArray; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - | null | undefined>(collection: TList & (_.List | null | undefined)): TList; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: T1 | null | undefined): T1 | null | undefined; -} -interface ForEachRight2x1 { - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (): ForEachRight2x1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: string): string; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: TString): TString; -} - -declare const eachRight: ForEachRight; +import { eachRight } from "../fp"; export = eachRight; diff --git a/types/lodash/fp/endsWith.d.ts b/types/lodash/fp/endsWith.d.ts index 5808870c50..7e1b243d6f 100644 --- a/types/lodash/fp/endsWith.d.ts +++ b/types/lodash/fp/endsWith.d.ts @@ -1,56 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface EndsWith { - /** - * Checks if string ends with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string ends with target, else false. - */ - (): EndsWith; - /** - * Checks if string ends with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string ends with target, else false. - */ - (target: string): EndsWith1x1; - /** - * Checks if string ends with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string ends with target, else false. - */ - (target: string, string: string): boolean; -} -interface EndsWith1x1 { - /** - * Checks if string ends with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string ends with target, else false. - */ - (): EndsWith1x1; - /** - * Checks if string ends with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string ends with target, else false. - */ - (string: string): boolean; -} - -declare const endsWith: EndsWith; +import { endsWith } from "../fp"; export = endsWith; diff --git a/types/lodash/fp/entries.d.ts b/types/lodash/fp/entries.d.ts index 99b04076c7..534c7bda3d 100644 --- a/types/lodash/fp/entries.d.ts +++ b/types/lodash/fp/entries.d.ts @@ -1,25 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ToPairs { - /** - * Creates an array of own enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - (object: _.Dictionary | _.NumericDictionary): Array<[string, T]>; - /** - * Creates an array of own enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - (object: object): Array<[string, any]>; -} - -declare const entries: ToPairs; +import { entries } from "../fp"; export = entries; diff --git a/types/lodash/fp/entriesIn.d.ts b/types/lodash/fp/entriesIn.d.ts index 3579959f84..932b17f625 100644 --- a/types/lodash/fp/entriesIn.d.ts +++ b/types/lodash/fp/entriesIn.d.ts @@ -1,25 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ToPairsIn { - /** - * Creates an array of own and inherited enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - (object: _.Dictionary | _.NumericDictionary): Array<[string, T]>; - /** - * Creates an array of own and inherited enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - (object: object): Array<[string, any]>; -} - -declare const entriesIn: ToPairsIn; +import { entriesIn } from "../fp"; export = entriesIn; diff --git a/types/lodash/fp/eq.d.ts b/types/lodash/fp/eq.d.ts index 4c3278ae3d..4778846a30 100644 --- a/types/lodash/fp/eq.d.ts +++ b/types/lodash/fp/eq.d.ts @@ -1,156 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Eq { - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (): Eq; - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (value: any): Eq1x1; - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (value: any, other: any): boolean; -} -interface Eq1x1 { - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (): Eq1x1; - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (other: any): boolean; -} - -declare const eq: Eq; +import { eq } from "../fp"; export = eq; diff --git a/types/lodash/fp/equals.d.ts b/types/lodash/fp/equals.d.ts index 3e3f9b1853..18ec108d66 100644 --- a/types/lodash/fp/equals.d.ts +++ b/types/lodash/fp/equals.d.ts @@ -1,141 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface IsEqual { - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (): IsEqual; - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (value: any): IsEqual1x1; - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (value: any, other: any): boolean; -} -interface IsEqual1x1 { - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (): IsEqual1x1; - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (other: any): boolean; -} - -declare const equals: IsEqual; +import { equals } from "../fp"; export = equals; diff --git a/types/lodash/fp/escape.d.ts b/types/lodash/fp/escape.d.ts index 18f704928d..36e7e87556 100644 --- a/types/lodash/fp/escape.d.ts +++ b/types/lodash/fp/escape.d.ts @@ -1,26 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Escape = - /** - * Converts the characters "&", "<", ">", '"', "'", and "`" in string to their corresponding HTML entities. - * - * Note: No other characters are escaped. To escape additional characters use a third-party library like he. - * - * hough the ">" character is escaped for symmetry, characters like ">" and "/" don’t need escaping in HTML - * and have no special meaning unless they're part of a tag or unquoted attribute value. See Mathias Bynens’s - * article (under "semi-related fun fact") for more details. - * - * Backticks are escaped because in IE < 9, they can break out of attribute values or HTML comments. See #59, - * #102, #108, and #133 of the HTML5 Security Cheatsheet for more details. - * - * When working with HTML you should always quote attribute values to reduce XSS vectors. - * - * @param string The string to escape. - * @return Returns the escaped string. - */ - (string: string) => string; - -declare const escape: Escape; +import { escape } from "../fp"; export = escape; diff --git a/types/lodash/fp/escapeRegExp.d.ts b/types/lodash/fp/escapeRegExp.d.ts index f66fa150c8..6adc20e806 100644 --- a/types/lodash/fp/escapeRegExp.d.ts +++ b/types/lodash/fp/escapeRegExp.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type EscapeRegExp = - /** - * Escapes the RegExp special characters "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", - * "{", "}", and "|" in string. - * - * @param string The string to escape. - * @return Returns the escaped string. - */ - (string: string) => string; - -declare const escapeRegExp: EscapeRegExp; +import { escapeRegExp } from "../fp"; export = escapeRegExp; diff --git a/types/lodash/fp/every.d.ts b/types/lodash/fp/every.d.ts index fc60615c96..7fbeaf7b15 100644 --- a/types/lodash/fp/every.d.ts +++ b/types/lodash/fp/every.d.ts @@ -1,67 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Every { - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (): Every; - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom): Every1x1; - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom, collection: _.List | null | undefined): boolean; - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom, collection: T | null | undefined): boolean; -} -interface Every1x1 { - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (): Every1x1; - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (collection: _.List | object | null | undefined): boolean; -} - -declare const every: Every; +import { every } from "../fp"; export = every; diff --git a/types/lodash/fp/extend.d.ts b/types/lodash/fp/extend.d.ts index ee0889f8ae..cbe294ee0b 100644 --- a/types/lodash/fp/extend.d.ts +++ b/types/lodash/fp/extend.d.ts @@ -1,151 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface AssignIn { - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (): AssignIn; - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (object: TObject): AssignIn1x1; - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (object: TObject, source: TSource): TObject & TSource; -} -interface AssignIn1x1 { - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (): AssignIn1x1; - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (source: TSource): TObject & TSource; -} - -declare const extend: AssignIn; +import { extend } from "../fp"; export = extend; diff --git a/types/lodash/fp/extendAll.d.ts b/types/lodash/fp/extendAll.d.ts index a8168d774d..92cb3d6e0c 100644 --- a/types/lodash/fp/extendAll.d.ts +++ b/types/lodash/fp/extendAll.d.ts @@ -1,36 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type AssignIn = - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (object: ReadonlyArray) => TResult; - -declare const extendAll: AssignIn; +import { extendAll } from "../fp"; export = extendAll; diff --git a/types/lodash/fp/extendAllWith.d.ts b/types/lodash/fp/extendAllWith.d.ts index 6e2d7602d3..712d1d8eea 100644 --- a/types/lodash/fp/extendAllWith.d.ts +++ b/types/lodash/fp/extendAllWith.d.ts @@ -1,143 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface AssignInWith { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer): AssignInWith1x1; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, args: ReadonlyArray): any; -} -interface AssignInWith1x1 { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith1x1; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (args: ReadonlyArray): any; -} - -declare const extendAllWith: AssignInWith; +import { extendAllWith } from "../fp"; export = extendAllWith; diff --git a/types/lodash/fp/extendWith.d.ts b/types/lodash/fp/extendWith.d.ts index 39b50e9ebf..9681360bbf 100644 --- a/types/lodash/fp/extendWith.d.ts +++ b/types/lodash/fp/extendWith.d.ts @@ -1,249 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface AssignInWith { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer): AssignInWith1x1; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, object: TObject): AssignInWith1x2; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, object: TObject, source: TSource): TObject & TSource; -} -interface AssignInWith1x1 { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith1x1; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (object: TObject): AssignInWith1x2; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (object: TObject, source: TSource): TObject & TSource; -} -interface AssignInWith1x2 { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith1x2; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (source: TSource): TObject & TSource; -} - -declare const extendWith: AssignInWith; +import { extendWith } from "../fp"; export = extendWith; diff --git a/types/lodash/fp/fill.d.ts b/types/lodash/fp/fill.d.ts index 5349e8e067..577801504d 100644 --- a/types/lodash/fp/fill.d.ts +++ b/types/lodash/fp/fill.d.ts @@ -1,233 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Fill { - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (): Fill; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (start: number): Fill1x1; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (start: number, end: number): Fill1x2; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (start: number, end: number, value: T): Fill1x3; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (start: number, end: number, value: T, array: U[] | null | undefined): Array; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (start: number, end: number, value: T, array: _.List | null | undefined): _.List; -} -interface Fill1x1 { - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (): Fill1x1; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (end: number): Fill1x2; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (end: number, value: T): Fill1x3; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (end: number, value: T, array: U[] | null | undefined): Array; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (end: number, value: T, array: _.List | null | undefined): _.List; -} -interface Fill1x2 { - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (): Fill1x2; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (value: T): Fill1x3; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (value: T, array: U[] | null | undefined): Array; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (value: T, array: _.List | null | undefined): _.List; -} -interface Fill1x3 { - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (): Fill1x3; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (array: U[] | null | undefined): Array; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (array: _.List | null | undefined): _.List; -} - -declare const fill: Fill; +import { fill } from "../fp"; export = fill; diff --git a/types/lodash/fp/filter.d.ts b/types/lodash/fp/filter.d.ts index 289c0edcd5..8619741343 100644 --- a/types/lodash/fp/filter.d.ts +++ b/types/lodash/fp/filter.d.ts @@ -1,361 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Filter { - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (): Filter; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: (value: string) => boolean): Filter1x1; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: (value: string) => boolean, collection: string | null | undefined): string[]; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIteratorTypeGuard): Filter2x1; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIteratorTypeGuard, collection: _.List | null | undefined): S[]; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIterateeCustom): Filter3x1; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIterateeCustom, collection: _.List | null | undefined): T[]; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIteratorTypeGuard): Filter4x1; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIteratorTypeGuard, collection: T | null | undefined): S[]; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIterateeCustom, collection: T | null | undefined): Array; -} -interface Filter1x1 { - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (): Filter1x1; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (collection: string | null | undefined): string[]; -} -interface Filter2x1 { - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (): Filter2x1; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (collection: _.List | null | undefined): S[]; -} -interface Filter3x1 { - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (): Filter3x1; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (collection: _.List | object | null | undefined): T[]; -} -interface Filter4x1 { - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (): Filter4x1; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (collection: T | null | undefined): S[]; -} - -declare const filter: Filter; +import { filter } from "../fp"; export = filter; diff --git a/types/lodash/fp/find.d.ts b/types/lodash/fp/find.d.ts index d562ef3894..06418fb456 100644 --- a/types/lodash/fp/find.d.ts +++ b/types/lodash/fp/find.d.ts @@ -1,283 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Find { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard): Find1x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, collection: _.List | null | undefined): S|undefined; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIterateeCustom): Find2x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIterateeCustom, collection: _.List | null | undefined): T|undefined; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard): Find3x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, collection: T | null | undefined): S|undefined; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIterateeCustom, collection: T | null | undefined): T[keyof T]|undefined; -} -interface Find1x1 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find1x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (collection: _.List | null | undefined): S|undefined; -} -interface Find2x1 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find2x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (collection: _.List | object | null | undefined): T|undefined; -} -interface Find3x1 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find3x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (collection: T | null | undefined): S|undefined; -} - -declare const find: Find; +import { find } from "../fp"; export = find; diff --git a/types/lodash/fp/findFrom.d.ts b/types/lodash/fp/findFrom.d.ts index c2c83b5644..64275d0c83 100644 --- a/types/lodash/fp/findFrom.d.ts +++ b/types/lodash/fp/findFrom.d.ts @@ -1,517 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Find { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard): Find1x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, fromIndex: number): Find1x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, fromIndex: number, collection: _.List | null | undefined): S|undefined; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIterateeCustom): Find2x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number): Find2x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number, collection: _.List | null | undefined): T|undefined; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard): Find3x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, fromIndex: number): Find3x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, fromIndex: number, collection: T | null | undefined): S|undefined; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number, collection: T | null | undefined): T[keyof T]|undefined; -} -interface Find1x1 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find1x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (fromIndex: number): Find1x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (fromIndex: number, collection: _.List | null | undefined): S|undefined; -} -interface Find1x2 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find1x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (collection: _.List | null | undefined): S|undefined; -} -interface Find2x1 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find2x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (fromIndex: number): Find2x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (fromIndex: number, collection: _.List | object | null | undefined): T|undefined; -} -interface Find2x2 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find2x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (collection: _.List | object | null | undefined): T|undefined; -} -interface Find3x1 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find3x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (fromIndex: number): Find3x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (fromIndex: number, collection: T | null | undefined): S|undefined; -} -interface Find3x2 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find3x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (collection: T | null | undefined): S|undefined; -} - -declare const findFrom: Find; +import { findFrom } from "../fp"; export = findFrom; diff --git a/types/lodash/fp/findIndex.d.ts b/types/lodash/fp/findIndex.d.ts index 18842b2513..77d1f7b6be 100644 --- a/types/lodash/fp/findIndex.d.ts +++ b/types/lodash/fp/findIndex.d.ts @@ -1,108 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FindIndex { - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindIndex; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom): FindIndex1x1; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom, array: _.List | null | undefined): number; -} -interface FindIndex1x1 { - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindIndex1x1; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (array: _.List | null | undefined): number; -} - -declare const findIndex: FindIndex; +import { findIndex } from "../fp"; export = findIndex; diff --git a/types/lodash/fp/findIndexFrom.d.ts b/types/lodash/fp/findIndexFrom.d.ts index fbc5f7bac1..22330adc53 100644 --- a/types/lodash/fp/findIndexFrom.d.ts +++ b/types/lodash/fp/findIndexFrom.d.ts @@ -1,186 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FindIndex { - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindIndex; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom): FindIndex1x1; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number): FindIndex1x2; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number, array: _.List | null | undefined): number; -} -interface FindIndex1x1 { - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindIndex1x1; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (fromIndex: number): FindIndex1x2; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (fromIndex: number, array: _.List | null | undefined): number; -} -interface FindIndex1x2 { - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindIndex1x2; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (array: _.List | null | undefined): number; -} - -declare const findIndexFrom: FindIndex; +import { findIndexFrom } from "../fp"; export = findIndexFrom; diff --git a/types/lodash/fp/findKey.d.ts b/types/lodash/fp/findKey.d.ts index a776272bc0..c5a225a776 100644 --- a/types/lodash/fp/findKey.d.ts +++ b/types/lodash/fp/findKey.d.ts @@ -1,108 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FindKey { - /** - * This method is like _.find except that it returns the key of the first element predicate returns truthy for - * instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (): FindKey; - /** - * This method is like _.find except that it returns the key of the first element predicate returns truthy for - * instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (predicate: _.ValueIteratee): FindKey1x1; - /** - * This method is like _.find except that it returns the key of the first element predicate returns truthy for - * instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (predicate: _.ValueIteratee, object: T | null | undefined): string | undefined; -} -interface FindKey1x1 { - /** - * This method is like _.find except that it returns the key of the first element predicate returns truthy for - * instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (): FindKey1x1; - /** - * This method is like _.find except that it returns the key of the first element predicate returns truthy for - * instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (object: object | null | undefined): string | undefined; -} - -declare const findKey: FindKey; +import { findKey } from "../fp"; export = findKey; diff --git a/types/lodash/fp/findLast.d.ts b/types/lodash/fp/findLast.d.ts index fb8c822bdf..b400c946b0 100644 --- a/types/lodash/fp/findLast.d.ts +++ b/types/lodash/fp/findLast.d.ts @@ -1,143 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FindLast { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard): FindLast1x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, collection: _.List | null | undefined): S|undefined; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIterateeCustom): FindLast2x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIterateeCustom, collection: _.List | null | undefined): T|undefined; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard): FindLast3x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, collection: T | null | undefined): S|undefined; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIterateeCustom, collection: T | null | undefined): T[keyof T]|undefined; -} -interface FindLast1x1 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast1x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (collection: _.List | null | undefined): S|undefined; -} -interface FindLast2x1 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast2x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (collection: _.List | object | null | undefined): T|undefined; -} -interface FindLast3x1 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast3x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (collection: T | null | undefined): S|undefined; -} - -declare const findLast: FindLast; +import { findLast } from "../fp"; export = findLast; diff --git a/types/lodash/fp/findLastFrom.d.ts b/types/lodash/fp/findLastFrom.d.ts index bd6bed3043..1f034dfa88 100644 --- a/types/lodash/fp/findLastFrom.d.ts +++ b/types/lodash/fp/findLastFrom.d.ts @@ -1,257 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FindLast { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard): FindLast1x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, fromIndex: number): FindLast1x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, fromIndex: number, collection: _.List | null | undefined): S|undefined; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIterateeCustom): FindLast2x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number): FindLast2x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number, collection: _.List | null | undefined): T|undefined; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard): FindLast3x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, fromIndex: number): FindLast3x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, fromIndex: number, collection: T | null | undefined): S|undefined; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number, collection: T | null | undefined): T[keyof T]|undefined; -} -interface FindLast1x1 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast1x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (fromIndex: number): FindLast1x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (fromIndex: number, collection: _.List | null | undefined): S|undefined; -} -interface FindLast1x2 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast1x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (collection: _.List | null | undefined): S|undefined; -} -interface FindLast2x1 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast2x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (fromIndex: number): FindLast2x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (fromIndex: number, collection: _.List | object | null | undefined): T|undefined; -} -interface FindLast2x2 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast2x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (collection: _.List | object | null | undefined): T|undefined; -} -interface FindLast3x1 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast3x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (fromIndex: number): FindLast3x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (fromIndex: number, collection: T | null | undefined): S|undefined; -} -interface FindLast3x2 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast3x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (collection: T | null | undefined): S|undefined; -} - -declare const findLastFrom: FindLast; +import { findLastFrom } from "../fp"; export = findLastFrom; diff --git a/types/lodash/fp/findLastIndex.d.ts b/types/lodash/fp/findLastIndex.d.ts index 230736f814..51ee410fb1 100644 --- a/types/lodash/fp/findLastIndex.d.ts +++ b/types/lodash/fp/findLastIndex.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FindLastIndex { - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindLastIndex; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom): FindLastIndex1x1; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom, array: _.List | null | undefined): number; -} -interface FindLastIndex1x1 { - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindLastIndex1x1; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (array: _.List | null | undefined): number; -} - -declare const findLastIndex: FindLastIndex; +import { findLastIndex } from "../fp"; export = findLastIndex; diff --git a/types/lodash/fp/findLastIndexFrom.d.ts b/types/lodash/fp/findLastIndexFrom.d.ts index df28dc685e..08bd53a087 100644 --- a/types/lodash/fp/findLastIndexFrom.d.ts +++ b/types/lodash/fp/findLastIndexFrom.d.ts @@ -1,177 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FindLastIndex { - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindLastIndex; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom): FindLastIndex1x1; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number): FindLastIndex1x2; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number, array: _.List | null | undefined): number; -} -interface FindLastIndex1x1 { - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindLastIndex1x1; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (fromIndex: number): FindLastIndex1x2; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (fromIndex: number, array: _.List | null | undefined): number; -} -interface FindLastIndex1x2 { - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindLastIndex1x2; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (array: _.List | null | undefined): number; -} - -declare const findLastIndexFrom: FindLastIndex; +import { findLastIndexFrom } from "../fp"; export = findLastIndexFrom; diff --git a/types/lodash/fp/findLastKey.d.ts b/types/lodash/fp/findLastKey.d.ts index 51e8d52ce1..7437a9ddda 100644 --- a/types/lodash/fp/findLastKey.d.ts +++ b/types/lodash/fp/findLastKey.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FindLastKey { - /** - * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (): FindLastKey; - /** - * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (predicate: _.ValueIteratee): FindLastKey1x1; - /** - * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (predicate: _.ValueIteratee, object: T | null | undefined): string | undefined; -} -interface FindLastKey1x1 { - /** - * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (): FindLastKey1x1; - /** - * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (object: object | null | undefined): string | undefined; -} - -declare const findLastKey: FindLastKey; +import { findLastKey } from "../fp"; export = findLastKey; diff --git a/types/lodash/fp/first.d.ts b/types/lodash/fp/first.d.ts index e93bdf4e4e..4554ad0e92 100644 --- a/types/lodash/fp/first.d.ts +++ b/types/lodash/fp/first.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Head = - /** - * Gets the first element of array. - * - * @alias _.first - * - * @param array The array to query. - * @return Returns the first element of array. - */ - (array: _.List | null | undefined) => T | undefined; - -declare const first: Head; +import { first } from "../fp"; export = first; diff --git a/types/lodash/fp/flatMap.d.ts b/types/lodash/fp/flatMap.d.ts index a6713fe34d..eb6d80434f 100644 --- a/types/lodash/fp/flatMap.d.ts +++ b/types/lodash/fp/flatMap.d.ts @@ -1,189 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FlatMap { - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (): FlatMap; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (iteratee: (value: T) => _.Many): FlatMap1x1; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (iteratee: (value: T) => _.Many, collection: _.List | null | undefined): TResult[]; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (iteratee: (value: T[keyof T]) => _.Many): FlatMap2x1; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (iteratee: (value: T[keyof T]) => _.Many, collection: T | null | undefined): TResult[]; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (iteratee: string): FlatMap3x1; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (iteratee: string, collection: object | null | undefined): any[]; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (iteratee: object): FlatMap4x1; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (iteratee: object, collection: object | null | undefined): boolean[]; -} -interface FlatMap1x1 { - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (): FlatMap1x1; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (collection: _.List | null | undefined): TResult[]; -} -interface FlatMap2x1 { - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (): FlatMap2x1; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (collection: T | null | undefined): TResult[]; -} -interface FlatMap3x1 { - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (): FlatMap3x1; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (collection: object | null | undefined): any[]; -} -interface FlatMap4x1 { - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (): FlatMap4x1; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (collection: object | null | undefined): boolean[]; -} - -declare const flatMap: FlatMap; +import { flatMap } from "../fp"; export = flatMap; diff --git a/types/lodash/fp/flatMapDeep.d.ts b/types/lodash/fp/flatMapDeep.d.ts index 9dad165793..0ce4db4801 100644 --- a/types/lodash/fp/flatMapDeep.d.ts +++ b/types/lodash/fp/flatMapDeep.d.ts @@ -1,342 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FlatMapDeep { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (): FlatMapDeep; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (iteratee: (value: T) => _.ListOfRecursiveArraysOrValues | TResult): FlatMapDeep1x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (iteratee: (value: T) => _.ListOfRecursiveArraysOrValues | TResult, collection: _.List | null | undefined): TResult[]; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (iteratee: (value: T[keyof T]) => _.ListOfRecursiveArraysOrValues | TResult): FlatMapDeep2x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (iteratee: (value: T[keyof T]) => _.ListOfRecursiveArraysOrValues | TResult, collection: T | null | undefined): TResult[]; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (iteratee: string): FlatMapDeep3x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (iteratee: string, collection: object | null | undefined): any[]; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (iteratee: object): FlatMapDeep4x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (iteratee: object, collection: object | null | undefined): boolean[]; -} -interface FlatMapDeep1x1 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (): FlatMapDeep1x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (collection: _.List | null | undefined): TResult[]; -} -interface FlatMapDeep2x1 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (): FlatMapDeep2x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (collection: T | null | undefined): TResult[]; -} -interface FlatMapDeep3x1 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (): FlatMapDeep3x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (collection: object | null | undefined): any[]; -} -interface FlatMapDeep4x1 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (): FlatMapDeep4x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (collection: object | null | undefined): boolean[]; -} - -declare const flatMapDeep: FlatMapDeep; +import { flatMapDeep } from "../fp"; export = flatMapDeep; diff --git a/types/lodash/fp/flatMapDepth.d.ts b/types/lodash/fp/flatMapDepth.d.ts index d576c2a322..b60af92cc4 100644 --- a/types/lodash/fp/flatMapDepth.d.ts +++ b/types/lodash/fp/flatMapDepth.d.ts @@ -1,687 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FlatMapDepth { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: (value: T) => _.ListOfRecursiveArraysOrValues | TResult): FlatMapDepth1x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: (value: T) => _.ListOfRecursiveArraysOrValues | TResult, depth: number): FlatMapDepth1x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: (value: T) => _.ListOfRecursiveArraysOrValues | TResult, depth: number, collection: _.List | null | undefined): TResult[]; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: (value: T[keyof T]) => _.ListOfRecursiveArraysOrValues | TResult): FlatMapDepth2x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: (value: T[keyof T]) => _.ListOfRecursiveArraysOrValues | TResult, depth: number): FlatMapDepth2x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: (value: T[keyof T]) => _.ListOfRecursiveArraysOrValues | TResult, depth: number, collection: T | null | undefined): TResult[]; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: string): FlatMapDepth3x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: string, depth: number): FlatMapDepth3x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: string, depth: number, collection: object | null | undefined): any[]; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: object): FlatMapDepth4x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: object, depth: number): FlatMapDepth4x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: object, depth: number, collection: object | null | undefined): boolean[]; -} -interface FlatMapDepth1x1 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth1x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (depth: number): FlatMapDepth1x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (depth: number, collection: _.List | null | undefined): TResult[]; -} -interface FlatMapDepth1x2 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth1x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (collection: _.List | null | undefined): TResult[]; -} -interface FlatMapDepth2x1 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth2x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (depth: number): FlatMapDepth2x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (depth: number, collection: T | null | undefined): TResult[]; -} -interface FlatMapDepth2x2 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth2x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (collection: T | null | undefined): TResult[]; -} -interface FlatMapDepth3x1 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth3x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (depth: number): FlatMapDepth3x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (depth: number, collection: object | null | undefined): any[]; -} -interface FlatMapDepth3x2 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth3x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (collection: object | null | undefined): any[]; -} -interface FlatMapDepth4x1 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth4x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (depth: number): FlatMapDepth4x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (depth: number, collection: object | null | undefined): boolean[]; -} -interface FlatMapDepth4x2 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth4x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (collection: object | null | undefined): boolean[]; -} - -declare const flatMapDepth: FlatMapDepth; +import { flatMapDepth } from "../fp"; export = flatMapDepth; diff --git a/types/lodash/fp/flatten.d.ts b/types/lodash/fp/flatten.d.ts index 88c928c7b0..02c051ff0b 100644 --- a/types/lodash/fp/flatten.d.ts +++ b/types/lodash/fp/flatten.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Flatten = - /** - * Flattens `array` a single level deep. - * - * @param array The array to flatten. - * @return Returns the new flattened array. - */ - (array: _.List<_.Many> | null | undefined) => T[]; - -declare const flatten: Flatten; +import { flatten } from "../fp"; export = flatten; diff --git a/types/lodash/fp/flattenDeep.d.ts b/types/lodash/fp/flattenDeep.d.ts index 4cfb955e6b..44b40e3a1f 100644 --- a/types/lodash/fp/flattenDeep.d.ts +++ b/types/lodash/fp/flattenDeep.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type FlattenDeep = - /** - * Recursively flattens a nested array. - * - * @param array The array to recursively flatten. - * @return Returns the new flattened array. - */ - (array: _.ListOfRecursiveArraysOrValues | null | undefined) => T[]; - -declare const flattenDeep: FlattenDeep; +import { flattenDeep } from "../fp"; export = flattenDeep; diff --git a/types/lodash/fp/flattenDepth.d.ts b/types/lodash/fp/flattenDepth.d.ts index f5516cf82e..f046f2086a 100644 --- a/types/lodash/fp/flattenDepth.d.ts +++ b/types/lodash/fp/flattenDepth.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FlattenDepth { - /** - * Recursively flatten array up to depth times. - * - * @param array The array to recursively flatten. - * @param number The maximum recursion depth. - * @return Returns the new flattened array. - */ - (): FlattenDepth; - /** - * Recursively flatten array up to depth times. - * - * @param array The array to recursively flatten. - * @param number The maximum recursion depth. - * @return Returns the new flattened array. - */ - (depth: number): FlattenDepth1x1; - /** - * Recursively flatten array up to depth times. - * - * @param array The array to recursively flatten. - * @param number The maximum recursion depth. - * @return Returns the new flattened array. - */ - (depth: number, array: _.ListOfRecursiveArraysOrValues | null | undefined): T[]; -} -interface FlattenDepth1x1 { - /** - * Recursively flatten array up to depth times. - * - * @param array The array to recursively flatten. - * @param number The maximum recursion depth. - * @return Returns the new flattened array. - */ - (): FlattenDepth1x1; - /** - * Recursively flatten array up to depth times. - * - * @param array The array to recursively flatten. - * @param number The maximum recursion depth. - * @return Returns the new flattened array. - */ - (array: _.ListOfRecursiveArraysOrValues | null | undefined): T[]; -} - -declare const flattenDepth: FlattenDepth; +import { flattenDepth } from "../fp"; export = flattenDepth; diff --git a/types/lodash/fp/flip.d.ts b/types/lodash/fp/flip.d.ts index db73a17b1a..e5b3b7d4f9 100644 --- a/types/lodash/fp/flip.d.ts +++ b/types/lodash/fp/flip.d.ts @@ -1,24 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Flip = - /** - * Creates a function that invokes `func` with arguments reversed. - * - * @category Function - * @param func The function to flip arguments for. - * @returns Returns the new function. - * @example - * - * var flipped = _.flip(function() { - * return _.toArray(arguments); - * }); - * - * flipped('a', 'b', 'c', 'd'); - * // => ['d', 'c', 'b', 'a'] - */ - any>(func: T) => T; - -declare const flip: Flip; +import { flip } from "../fp"; export = flip; diff --git a/types/lodash/fp/floor.d.ts b/types/lodash/fp/floor.d.ts index 3275466204..167ab95438 100644 --- a/types/lodash/fp/floor.d.ts +++ b/types/lodash/fp/floor.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Floor = - /** - * Calculates n rounded down to precision. - * - * @param n The number to round down. - * @param precision The precision to round down to. - * @return Returns the rounded down number. - */ - (n: number) => number; - -declare const floor: Floor; +import { floor } from "../fp"; export = floor; diff --git a/types/lodash/fp/flow.d.ts b/types/lodash/fp/flow.d.ts index 843b0180f8..97f0fb82b2 100644 --- a/types/lodash/fp/flow.d.ts +++ b/types/lodash/fp/flow.d.ts @@ -1,355 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Flow { - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: () => R1, f2: (a: R1) => R2): () => R2; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): () => R3; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): () => R4; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): () => R5; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): () => R6; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): () => R7; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): () => any; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2): (a1: A1) => R2; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1) => R3; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1) => R4; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1) => R5; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1) => R6; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1) => R7; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1) => any; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2) => R2; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2) => R3; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2) => R4; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2) => R5; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2) => R6; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2) => R7; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1, a2: A2) => any; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3) => R2; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3) => R3; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3) => R4; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3) => R5; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3) => R6; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3) => R7; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1, a2: A2, a3: A3) => any; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1, a2: A2, a3: A3, a4: A4) => any; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (funcs: Array<_.Many<(...args: any[]) => any>>): (...args: any[]) => any; -} - -declare const flow: Flow; +import { flow } from "../fp"; export = flow; diff --git a/types/lodash/fp/flowRight.d.ts b/types/lodash/fp/flowRight.d.ts index 16f5f2f031..f148feaad9 100644 --- a/types/lodash/fp/flowRight.d.ts +++ b/types/lodash/fp/flowRight.d.ts @@ -1,315 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FlowRight { - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: () => R1): () => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: any) => any, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array<_.Many<(...args: any[]) => any>>): (...args: any[]) => any; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (funcs: Array<_.Many<(...args: any[]) => any>>): (...args: any[]) => any; -} - -declare const flowRight: FlowRight; +import { flowRight } from "../fp"; export = flowRight; diff --git a/types/lodash/fp/forEach.d.ts b/types/lodash/fp/forEach.d.ts index 50b4a45bf4..f8aa7a4a1a 100644 --- a/types/lodash/fp/forEach.d.ts +++ b/types/lodash/fp/forEach.d.ts @@ -1,330 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ForEach { - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (): ForEach; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T) => any): ForEach1x1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T) => any, collection: ReadonlyArray): T[]; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: string) => any): ForEach2x1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: string) => any, collection: string): string; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T) => any, collection: _.List): _.List; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T[keyof T]) => any, collection: T): T; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T) => any, collection: TArray & (T[] | null | undefined)): TArray; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: string) => any, collection: TString): TString; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - | null | undefined>(iteratee: (value: T) => any, collection: TList & (_.List | null | undefined)): TList; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T[keyof T]) => any, collection: T | null | undefined): T | null | undefined; -} -interface ForEach1x1 { - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (): ForEach1x1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: ReadonlyArray): T[]; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: _.List): _.List; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: T1): T1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: TArray & (T[] | null | undefined)): TArray; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - | null | undefined>(collection: TList & (_.List | null | undefined)): TList; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: T1 | null | undefined): T1 | null | undefined; -} -interface ForEach2x1 { - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (): ForEach2x1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: string): string; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: TString): TString; -} - -declare const forEach: ForEach; +import { forEach } from "../fp"; export = forEach; diff --git a/types/lodash/fp/forEachRight.d.ts b/types/lodash/fp/forEachRight.d.ts index 75ed3e7fab..135a4243a9 100644 --- a/types/lodash/fp/forEachRight.d.ts +++ b/types/lodash/fp/forEachRight.d.ts @@ -1,225 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ForEachRight { - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (): ForEachRight; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T) => any): ForEachRight1x1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T) => any, collection: ReadonlyArray): T[]; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: string) => any): ForEachRight2x1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: string) => any, collection: string): string; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T) => any, collection: _.List): _.List; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T[keyof T]) => any, collection: T): T; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T) => any, collection: TArray & (T[] | null | undefined)): TArray; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: string) => any, collection: TString): TString; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - | null | undefined>(iteratee: (value: T) => any, collection: TList & (_.List | null | undefined)): TList; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T[keyof T]) => any, collection: T | null | undefined): T | null | undefined; -} -interface ForEachRight1x1 { - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (): ForEachRight1x1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: ReadonlyArray): T[]; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: _.List): _.List; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: T1): T1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: TArray & (T[] | null | undefined)): TArray; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - | null | undefined>(collection: TList & (_.List | null | undefined)): TList; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: T1 | null | undefined): T1 | null | undefined; -} -interface ForEachRight2x1 { - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (): ForEachRight2x1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: string): string; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: TString): TString; -} - -declare const forEachRight: ForEachRight; +import { forEachRight } from "../fp"; export = forEachRight; diff --git a/types/lodash/fp/forIn.d.ts b/types/lodash/fp/forIn.d.ts index added8f66b..dab37b1075 100644 --- a/types/lodash/fp/forIn.d.ts +++ b/types/lodash/fp/forIn.d.ts @@ -1,88 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface ForIn { - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (): ForIn; - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T) => any): ForIn1x1; - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T[keyof T]) => any, object: T): T; - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T[keyof T]) => any, object: T | null | undefined): T | null | undefined; -} -interface ForIn1x1 { - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (): ForIn1x1; - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (object: T1): T1; - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (object: T1 | null | undefined): T1 | null | undefined; -} - -declare const forIn: ForIn; +import { forIn } from "../fp"; export = forIn; diff --git a/types/lodash/fp/forInRight.d.ts b/types/lodash/fp/forInRight.d.ts index 0525b46d07..c560df0cef 100644 --- a/types/lodash/fp/forInRight.d.ts +++ b/types/lodash/fp/forInRight.d.ts @@ -1,74 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface ForInRight { - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (): ForInRight; - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T) => any): ForInRight1x1; - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T[keyof T]) => any, object: T): T; - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T[keyof T]) => any, object: T | null | undefined): T | null | undefined; -} -interface ForInRight1x1 { - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (): ForInRight1x1; - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (object: T1): T1; - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (object: T1 | null | undefined): T1 | null | undefined; -} - -declare const forInRight: ForInRight; +import { forInRight } from "../fp"; export = forInRight; diff --git a/types/lodash/fp/forOwn.d.ts b/types/lodash/fp/forOwn.d.ts index 222463960f..7099c48a9d 100644 --- a/types/lodash/fp/forOwn.d.ts +++ b/types/lodash/fp/forOwn.d.ts @@ -1,88 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface ForOwn { - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (): ForOwn; - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T) => any): ForOwn1x1; - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T[keyof T]) => any, object: T): T; - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T[keyof T]) => any, object: T | null | undefined): T | null | undefined; -} -interface ForOwn1x1 { - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (): ForOwn1x1; - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (object: T1): T1; - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (object: T1 | null | undefined): T1 | null | undefined; -} - -declare const forOwn: ForOwn; +import { forOwn } from "../fp"; export = forOwn; diff --git a/types/lodash/fp/forOwnRight.d.ts b/types/lodash/fp/forOwnRight.d.ts index 310b720ace..f1e3928866 100644 --- a/types/lodash/fp/forOwnRight.d.ts +++ b/types/lodash/fp/forOwnRight.d.ts @@ -1,74 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface ForOwnRight { - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (): ForOwnRight; - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T) => any): ForOwnRight1x1; - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T[keyof T]) => any, object: T): T; - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T[keyof T]) => any, object: T | null | undefined): T | null | undefined; -} -interface ForOwnRight1x1 { - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (): ForOwnRight1x1; - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (object: T1): T1; - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (object: T1 | null | undefined): T1 | null | undefined; -} - -declare const forOwnRight: ForOwnRight; +import { forOwnRight } from "../fp"; export = forOwnRight; diff --git a/types/lodash/fp/fromPairs.d.ts b/types/lodash/fp/fromPairs.d.ts index 5412865d75..b0d0082a59 100644 --- a/types/lodash/fp/fromPairs.d.ts +++ b/types/lodash/fp/fromPairs.d.ts @@ -1,37 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FromPairs { - /** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @category Array - * @param pairs The key-value pairs. - * @returns Returns the new object. - * @example - * - * _.fromPairs([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } - */ - (pairs: _.List<[_.PropertyName, T]> | null | undefined): _.Dictionary; - /** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @category Array - * @param pairs The key-value pairs. - * @returns Returns the new object. - * @example - * - * _.fromPairs([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } - */ - (pairs: _.List | null | undefined): _.Dictionary; -} - -declare const fromPairs: FromPairs; +import { fromPairs } from "../fp"; export = fromPairs; diff --git a/types/lodash/fp/functions.d.ts b/types/lodash/fp/functions.d.ts index bc5cb94ab1..727d68e138 100644 --- a/types/lodash/fp/functions.d.ts +++ b/types/lodash/fp/functions.d.ts @@ -1,28 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Functions = - /** - * Creates an array of function property names from own enumerable properties - * of `object`. - * - * @category Object - * @param object The object to inspect. - * @returns Returns the new array of property names. - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functions(new Foo); - * // => ['a', 'b'] - */ - (object: any) => string[]; - -declare const functions: Functions; +import { functions } from "../fp"; export = functions; diff --git a/types/lodash/fp/functionsIn.d.ts b/types/lodash/fp/functionsIn.d.ts index 0189c213d6..448746e619 100644 --- a/types/lodash/fp/functionsIn.d.ts +++ b/types/lodash/fp/functionsIn.d.ts @@ -1,28 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type FunctionsIn = - /** - * Creates an array of function property names from own and inherited - * enumerable properties of `object`. - * - * @category Object - * @param object The object to inspect. - * @returns Returns the new array of property names. - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functionsIn(new Foo); - * // => ['a', 'b', 'c'] - */ - (object: any) => string[]; - -declare const functionsIn: FunctionsIn; +import { functionsIn } from "../fp"; export = functionsIn; diff --git a/types/lodash/fp/get.d.ts b/types/lodash/fp/get.d.ts index 085f3d935f..ff3ab8b09d 100644 --- a/types/lodash/fp/get.d.ts +++ b/types/lodash/fp/get.d.ts @@ -1,207 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Get { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey]): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary | null | undefined): T | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): any; -} -interface Get1x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject | null | undefined): TObject[TKey] | undefined; -} -interface Get3x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary | null | undefined): T | undefined; -} -interface Get5x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): any; -} - -declare const get: Get; +import { get } from "../fp"; export = get; diff --git a/types/lodash/fp/getOr.d.ts b/types/lodash/fp/getOr.d.ts index db63bd4b1a..ce3d5bba31 100644 --- a/types/lodash/fp/getOr.d.ts +++ b/types/lodash/fp/getOr.d.ts @@ -1,313 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Get { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: TKey | [TKey]): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: number): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: number, object: _.NumericDictionary | null | undefined): T | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: _.PropertyPath): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: _.PropertyPath, object: null | undefined): TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any): Get4x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any, path: _.PropertyPath): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any, path: _.PropertyPath, object: any): any; -} -interface Get1x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey]): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary | null | undefined): T | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: null | undefined): TDefault; -} -interface Get1x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject | null | undefined): TObject[TKey] | TDefault; -} -interface Get2x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary | null | undefined): T | TDefault; -} -interface Get3x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: null | undefined): TDefault; -} -interface Get4x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get4x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): any; -} -interface Get4x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): any; -} - -declare const getOr: Get; +import { getOr } from "../fp"; export = getOr; diff --git a/types/lodash/fp/groupBy.d.ts b/types/lodash/fp/groupBy.d.ts index 49f6946225..813830aa0e 100644 --- a/types/lodash/fp/groupBy.d.ts +++ b/types/lodash/fp/groupBy.d.ts @@ -1,225 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface GroupBy { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): GroupBy; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: (value: string) => _.NotVoid): GroupBy1x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: (value: string) => _.NotVoid, collection: string | null | undefined): _.Dictionary; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIteratee): GroupBy2x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIteratee, collection: _.List | null | undefined): _.Dictionary; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIteratee, collection: T | null | undefined): _.Dictionary>; -} -interface GroupBy1x1 { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): GroupBy1x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (collection: string | null | undefined): _.Dictionary; -} -interface GroupBy2x1 { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): GroupBy2x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (collection: _.List | object | null | undefined): _.Dictionary; -} - -declare const groupBy: GroupBy; +import { groupBy } from "../fp"; export = groupBy; diff --git a/types/lodash/fp/gt.d.ts b/types/lodash/fp/gt.d.ts index 8102922aee..517071f511 100644 --- a/types/lodash/fp/gt.d.ts +++ b/types/lodash/fp/gt.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Gt { - /** - * Checks if value is greater than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than other, else false. - */ - (): Gt; - /** - * Checks if value is greater than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than other, else false. - */ - (value: any): Gt1x1; - /** - * Checks if value is greater than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than other, else false. - */ - (value: any, other: any): boolean; -} -interface Gt1x1 { - /** - * Checks if value is greater than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than other, else false. - */ - (): Gt1x1; - /** - * Checks if value is greater than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than other, else false. - */ - (other: any): boolean; -} - -declare const gt: Gt; +import { gt } from "../fp"; export = gt; diff --git a/types/lodash/fp/gte.d.ts b/types/lodash/fp/gte.d.ts index df663c4438..5f6d85c7f0 100644 --- a/types/lodash/fp/gte.d.ts +++ b/types/lodash/fp/gte.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Gte { - /** - * Checks if value is greater than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than or equal to other, else false. - */ - (): Gte; - /** - * Checks if value is greater than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than or equal to other, else false. - */ - (value: any): Gte1x1; - /** - * Checks if value is greater than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than or equal to other, else false. - */ - (value: any, other: any): boolean; -} -interface Gte1x1 { - /** - * Checks if value is greater than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than or equal to other, else false. - */ - (): Gte1x1; - /** - * Checks if value is greater than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than or equal to other, else false. - */ - (other: any): boolean; -} - -declare const gte: Gte; +import { gte } from "../fp"; export = gte; diff --git a/types/lodash/fp/has.d.ts b/types/lodash/fp/has.d.ts index 950a57a43b..8cbda7fb8c 100644 --- a/types/lodash/fp/has.d.ts +++ b/types/lodash/fp/has.d.ts @@ -1,138 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Has { - /** - * Checks if `path` is a direct property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - (): Has; - /** - * Checks if `path` is a direct property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - (path: _.PropertyPath): Has1x1; - /** - * Checks if `path` is a direct property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - (path: _.PropertyPath, object: T): boolean; -} -interface Has1x1 { - /** - * Checks if `path` is a direct property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - (): Has1x1; - /** - * Checks if `path` is a direct property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - (object: T): boolean; -} - -declare const has: Has; +import { has } from "../fp"; export = has; diff --git a/types/lodash/fp/hasIn.d.ts b/types/lodash/fp/hasIn.d.ts index a5ffb7ae4e..7e06a87ae3 100644 --- a/types/lodash/fp/hasIn.d.ts +++ b/types/lodash/fp/hasIn.d.ts @@ -1,133 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface HasIn { - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - (): HasIn; - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - (path: _.PropertyPath): HasIn1x1; - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - (path: _.PropertyPath, object: T): boolean; -} -interface HasIn1x1 { - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - (): HasIn1x1; - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - (object: T): boolean; -} - -declare const hasIn: HasIn; +import { hasIn } from "../fp"; export = hasIn; diff --git a/types/lodash/fp/head.d.ts b/types/lodash/fp/head.d.ts index 618e7ca561..4a7d5e59cd 100644 --- a/types/lodash/fp/head.d.ts +++ b/types/lodash/fp/head.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Head = - /** - * Gets the first element of array. - * - * @alias _.first - * - * @param array The array to query. - * @return Returns the first element of array. - */ - (array: _.List | null | undefined) => T | undefined; - -declare const head: Head; +import { head } from "../fp"; export = head; diff --git a/types/lodash/fp/identical.d.ts b/types/lodash/fp/identical.d.ts index 689227ac95..954dff5569 100644 --- a/types/lodash/fp/identical.d.ts +++ b/types/lodash/fp/identical.d.ts @@ -1,156 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Eq { - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (): Eq; - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (value: any): Eq1x1; - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (value: any, other: any): boolean; -} -interface Eq1x1 { - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (): Eq1x1; - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (other: any): boolean; -} - -declare const identical: Eq; +import { identical } from "../fp"; export = identical; diff --git a/types/lodash/fp/identity.d.ts b/types/lodash/fp/identity.d.ts index 46411f1db1..97e613c6c8 100644 --- a/types/lodash/fp/identity.d.ts +++ b/types/lodash/fp/identity.d.ts @@ -1,23 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Identity { - /** - * This method returns the first argument provided to it. - * - * @param value Any value. - * @return Returns value. - */ - (value: T): T; - /** - * This method returns the first argument provided to it. - * - * @param value Any value. - * @return Returns value. - */ - (): undefined; -} - -declare const identity: Identity; +import { identity } from "../fp"; export = identity; diff --git a/types/lodash/fp/inRange.d.ts b/types/lodash/fp/inRange.d.ts index 564ed81a4e..06ed312687 100644 --- a/types/lodash/fp/inRange.d.ts +++ b/types/lodash/fp/inRange.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface InRange { - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (): InRange; - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (start: number): InRange1x1; - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (start: number, end: number): InRange1x2; - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (start: number, end: number, n: number): boolean; -} -interface InRange1x1 { - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (): InRange1x1; - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (end: number): InRange1x2; - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (end: number, n: number): boolean; -} -interface InRange1x2 { - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (): InRange1x2; - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (n: number): boolean; -} - -declare const inRange: InRange; +import { inRange } from "../fp"; export = inRange; diff --git a/types/lodash/fp/includes.d.ts b/types/lodash/fp/includes.d.ts index b498f0e8aa..afc9984286 100644 --- a/types/lodash/fp/includes.d.ts +++ b/types/lodash/fp/includes.d.ts @@ -1,63 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Includes { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (): Includes; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (target: T): Includes1x1; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (target: T, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean; -} -interface Includes1x1 { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (): Includes1x1; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean; -} - -declare const includes: Includes; +import { includes } from "../fp"; export = includes; diff --git a/types/lodash/fp/includesFrom.d.ts b/types/lodash/fp/includesFrom.d.ts index 45d2f6bab8..13042d029a 100644 --- a/types/lodash/fp/includesFrom.d.ts +++ b/types/lodash/fp/includesFrom.d.ts @@ -1,105 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Includes { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (): Includes; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (target: T): Includes1x1; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (target: T, fromIndex: number): Includes1x2; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (target: T, fromIndex: number, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean; -} -interface Includes1x1 { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (): Includes1x1; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (fromIndex: number): Includes1x2; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (fromIndex: number, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean; -} -interface Includes1x2 { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (): Includes1x2; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean; -} - -declare const includesFrom: Includes; +import { includesFrom } from "../fp"; export = includesFrom; diff --git a/types/lodash/fp/indexBy.d.ts b/types/lodash/fp/indexBy.d.ts index 22a9e62a3b..f3f75a41fa 100644 --- a/types/lodash/fp/indexBy.d.ts +++ b/types/lodash/fp/indexBy.d.ts @@ -1,225 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface KeyBy { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): KeyBy; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: (value: string) => _.PropertyName): KeyBy1x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: (value: string) => _.PropertyName, collection: string | null | undefined): _.Dictionary; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIterateeCustom): KeyBy2x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIterateeCustom, collection: _.List | null | undefined): _.Dictionary; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIterateeCustom, collection: T | null | undefined): _.Dictionary; -} -interface KeyBy1x1 { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): KeyBy1x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (collection: string | null | undefined): _.Dictionary; -} -interface KeyBy2x1 { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): KeyBy2x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (collection: _.List | object | null | undefined): _.Dictionary; -} - -declare const indexBy: KeyBy; +import { indexBy } from "../fp"; export = indexBy; diff --git a/types/lodash/fp/indexOf.d.ts b/types/lodash/fp/indexOf.d.ts index 71c684508f..8078c468fd 100644 --- a/types/lodash/fp/indexOf.d.ts +++ b/types/lodash/fp/indexOf.d.ts @@ -1,118 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface IndexOf { - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (): IndexOf; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (value: T): IndexOf1x1; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (value: T, array: _.List | null | undefined): number; -} -interface IndexOf1x1 { - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (): IndexOf1x1; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (array: _.List | null | undefined): number; -} - -declare const indexOf: IndexOf; +import { indexOf } from "../fp"; export = indexOf; diff --git a/types/lodash/fp/indexOfFrom.d.ts b/types/lodash/fp/indexOfFrom.d.ts index 22c8315ae5..fe66609f7a 100644 --- a/types/lodash/fp/indexOfFrom.d.ts +++ b/types/lodash/fp/indexOfFrom.d.ts @@ -1,204 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface IndexOf { - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (): IndexOf; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (value: T): IndexOf1x1; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (value: T, fromIndex: number): IndexOf1x2; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (value: T, fromIndex: number, array: _.List | null | undefined): number; -} -interface IndexOf1x1 { - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (): IndexOf1x1; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (fromIndex: number): IndexOf1x2; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (fromIndex: number, array: _.List | null | undefined): number; -} -interface IndexOf1x2 { - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (): IndexOf1x2; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (array: _.List | null | undefined): number; -} - -declare const indexOfFrom: IndexOf; +import { indexOfFrom } from "../fp"; export = indexOfFrom; diff --git a/types/lodash/fp/init.d.ts b/types/lodash/fp/init.d.ts index 3c22717976..2f37ecd284 100644 --- a/types/lodash/fp/init.d.ts +++ b/types/lodash/fp/init.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Initial = - /** - * Gets all but the last element of array. - * - * @param array The array to query. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined) => T[]; - -declare const init: Initial; +import { init } from "../fp"; export = init; diff --git a/types/lodash/fp/initial.d.ts b/types/lodash/fp/initial.d.ts index e4d10ae946..446da0678b 100644 --- a/types/lodash/fp/initial.d.ts +++ b/types/lodash/fp/initial.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Initial = - /** - * Gets all but the last element of array. - * - * @param array The array to query. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined) => T[]; - -declare const initial: Initial; +import { initial } from "../fp"; export = initial; diff --git a/types/lodash/fp/intersection.d.ts b/types/lodash/fp/intersection.d.ts index ad290ebd3e..41d7915841 100644 --- a/types/lodash/fp/intersection.d.ts +++ b/types/lodash/fp/intersection.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Intersection { - /** - * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of shared values. - */ - (): Intersection; - /** - * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of shared values. - */ - (arrays2: _.List): Intersection1x1; - /** - * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of shared values. - */ - (arrays2: _.List, arrays: _.List): T[]; -} -interface Intersection1x1 { - /** - * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of shared values. - */ - (): Intersection1x1; - /** - * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of shared values. - */ - (arrays: _.List): T[]; -} - -declare const intersection: Intersection; +import { intersection } from "../fp"; export = intersection; diff --git a/types/lodash/fp/intersectionBy.d.ts b/types/lodash/fp/intersectionBy.d.ts index 6b94ad98f7..a123ddda0d 100644 --- a/types/lodash/fp/intersectionBy.d.ts +++ b/types/lodash/fp/intersectionBy.d.ts @@ -1,186 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface IntersectionBy { - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (): IntersectionBy; - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (iteratee: _.ValueIteratee): IntersectionBy1x1; - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (iteratee: _.ValueIteratee, array: _.List | null): IntersectionBy1x2; - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (iteratee: _.ValueIteratee, array: _.List | null, values: _.List): T1[]; -} -interface IntersectionBy1x1 { - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (): IntersectionBy1x1; - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (array: _.List | null): IntersectionBy1x2; - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (array: _.List | null, values: _.List): T1[]; -} -interface IntersectionBy1x2 { - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (): IntersectionBy1x2; - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (values: _.List): T1[]; -} - -declare const intersectionBy: IntersectionBy; +import { intersectionBy } from "../fp"; export = intersectionBy; diff --git a/types/lodash/fp/intersectionWith.d.ts b/types/lodash/fp/intersectionWith.d.ts index 275d2fb3a9..9ad9941570 100644 --- a/types/lodash/fp/intersectionWith.d.ts +++ b/types/lodash/fp/intersectionWith.d.ts @@ -1,177 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface IntersectionWith { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (): IntersectionWith; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (comparator: _.Comparator2): IntersectionWith1x1; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (comparator: _.Comparator2, array: _.List | null | undefined): IntersectionWith1x2; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (comparator: _.Comparator2, array: _.List | null | undefined, values: _.List): T1[]; -} -interface IntersectionWith1x1 { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (): IntersectionWith1x1; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (array: _.List | null | undefined): IntersectionWith1x2; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (array: _.List | null | undefined, values: _.List): T1[]; -} -interface IntersectionWith1x2 { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (): IntersectionWith1x2; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (values: _.List): T1[]; -} - -declare const intersectionWith: IntersectionWith; +import { intersectionWith } from "../fp"; export = intersectionWith; diff --git a/types/lodash/fp/invert.d.ts b/types/lodash/fp/invert.d.ts index fa6e62340e..a41c2bc244 100644 --- a/types/lodash/fp/invert.d.ts +++ b/types/lodash/fp/invert.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Invert = - /** - * Creates an object composed of the inverted keys and values of object. If object contains duplicate values, - * subsequent values overwrite property assignments of previous values unless multiValue is true. - * - * @param object The object to invert. - * @param multiValue Allow multiple values per key. - * @return Returns the new inverted object. - */ - (object: object) => _.Dictionary; - -declare const invert: Invert; +import { invert } from "../fp"; export = invert; diff --git a/types/lodash/fp/invertBy.d.ts b/types/lodash/fp/invertBy.d.ts index 5a386385ae..e28f7135f4 100644 --- a/types/lodash/fp/invertBy.d.ts +++ b/types/lodash/fp/invertBy.d.ts @@ -1,73 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface InvertBy { - /** - * This method is like _.invert except that the inverted object is generated from the results of running each - * element of object through iteratee. The corresponding inverted value of each inverted key is an array of - * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). - * - * @param object The object to invert. - * @param interatee The iteratee invoked per element. - * @return Returns the new inverted object. - */ - (): InvertBy; - /** - * This method is like _.invert except that the inverted object is generated from the results of running each - * element of object through iteratee. The corresponding inverted value of each inverted key is an array of - * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). - * - * @param object The object to invert. - * @param interatee The iteratee invoked per element. - * @return Returns the new inverted object. - */ - (interatee: _.ValueIteratee): InvertBy1x1; - /** - * This method is like _.invert except that the inverted object is generated from the results of running each - * element of object through iteratee. The corresponding inverted value of each inverted key is an array of - * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). - * - * @param object The object to invert. - * @param interatee The iteratee invoked per element. - * @return Returns the new inverted object. - */ - (interatee: _.ValueIteratee, object: _.List | _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; - /** - * This method is like _.invert except that the inverted object is generated from the results of running each - * element of object through iteratee. The corresponding inverted value of each inverted key is an array of - * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). - * - * @param object The object to invert. - * @param interatee The iteratee invoked per element. - * @return Returns the new inverted object. - */ - (interatee: _.ValueIteratee, object: T | null | undefined): _.Dictionary; -} -interface InvertBy1x1 { - /** - * This method is like _.invert except that the inverted object is generated from the results of running each - * element of object through iteratee. The corresponding inverted value of each inverted key is an array of - * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). - * - * @param object The object to invert. - * @param interatee The iteratee invoked per element. - * @return Returns the new inverted object. - */ - (): InvertBy1x1; - /** - * This method is like _.invert except that the inverted object is generated from the results of running each - * element of object through iteratee. The corresponding inverted value of each inverted key is an array of - * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). - * - * @param object The object to invert. - * @param interatee The iteratee invoked per element. - * @return Returns the new inverted object. - */ - (object: _.List | _.Dictionary | _.NumericDictionary | object | null | undefined): _.Dictionary; -} - -declare const invertBy: InvertBy; +import { invertBy } from "../fp"; export = invertBy; diff --git a/types/lodash/fp/invertObj.d.ts b/types/lodash/fp/invertObj.d.ts index aeeb28ca48..2e16c4f8fb 100644 --- a/types/lodash/fp/invertObj.d.ts +++ b/types/lodash/fp/invertObj.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Invert = - /** - * Creates an object composed of the inverted keys and values of object. If object contains duplicate values, - * subsequent values overwrite property assignments of previous values unless multiValue is true. - * - * @param object The object to invert. - * @param multiValue Allow multiple values per key. - * @return Returns the new inverted object. - */ - (object: object) => _.Dictionary; - -declare const invertObj: Invert; +import { invertObj } from "../fp"; export = invertObj; diff --git a/types/lodash/fp/invoke.d.ts b/types/lodash/fp/invoke.d.ts index 9a72390f8e..1a9ce3b355 100644 --- a/types/lodash/fp/invoke.d.ts +++ b/types/lodash/fp/invoke.d.ts @@ -1,48 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Invoke { - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (): Invoke; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (path: _.PropertyPath): Invoke1x1; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (path: _.PropertyPath, object: any): any; -} -interface Invoke1x1 { - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (): Invoke1x1; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (object: any): any; -} - -declare const invoke: Invoke; +import { invoke } from "../fp"; export = invoke; diff --git a/types/lodash/fp/invokeArgs.d.ts b/types/lodash/fp/invokeArgs.d.ts index 5c385579fd..8b498e0ec1 100644 --- a/types/lodash/fp/invokeArgs.d.ts +++ b/types/lodash/fp/invokeArgs.d.ts @@ -1,78 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Invoke { - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (): Invoke; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (path: _.PropertyPath): Invoke1x1; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (path: _.PropertyPath, args: ReadonlyArray): Invoke1x2; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (path: _.PropertyPath, args: ReadonlyArray, object: any): any; -} -interface Invoke1x1 { - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (): Invoke1x1; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (args: ReadonlyArray): Invoke1x2; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (args: ReadonlyArray, object: any): any; -} -interface Invoke1x2 { - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (): Invoke1x2; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (object: any): any; -} - -declare const invokeArgs: Invoke; +import { invokeArgs } from "../fp"; export = invokeArgs; diff --git a/types/lodash/fp/invokeArgsMap.d.ts b/types/lodash/fp/invokeArgsMap.d.ts index 59e6170594..f5ba3e7ec5 100644 --- a/types/lodash/fp/invokeArgsMap.d.ts +++ b/types/lodash/fp/invokeArgsMap.d.ts @@ -1,187 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface InvokeMap { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (): InvokeMap; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (methodName: string): InvokeMap1x1; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (methodName: string, args: ReadonlyArray): InvokeMap1x2; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (methodName: string, args: ReadonlyArray, collection: object | null | undefined): any[]; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (method: (...args: any[]) => TResult): InvokeMap2x1; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (method: (...args: any[]) => TResult, args: ReadonlyArray): InvokeMap2x2; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (method: (...args: any[]) => TResult, args: ReadonlyArray, collection: object | null | undefined): TResult[]; -} -interface InvokeMap1x1 { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (): InvokeMap1x1; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (args: ReadonlyArray): InvokeMap1x2; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (args: ReadonlyArray, collection: object | null | undefined): any[]; -} -interface InvokeMap1x2 { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (): InvokeMap1x2; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (collection: object | null | undefined): any[]; -} -interface InvokeMap2x1 { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (): InvokeMap2x1; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (args: ReadonlyArray): InvokeMap2x2; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (args: ReadonlyArray, collection: object | null | undefined): TResult[]; -} -interface InvokeMap2x2 { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (): InvokeMap2x2; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (collection: object | null | undefined): TResult[]; -} - -declare const invokeArgsMap: InvokeMap; +import { invokeArgsMap } from "../fp"; export = invokeArgsMap; diff --git a/types/lodash/fp/invokeMap.d.ts b/types/lodash/fp/invokeMap.d.ts index 3bb1072954..9f0aea9c11 100644 --- a/types/lodash/fp/invokeMap.d.ts +++ b/types/lodash/fp/invokeMap.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface InvokeMap { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (): InvokeMap; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (methodName: string): InvokeMap1x1; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (methodName: string, collection: object | null | undefined): any[]; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (method: (...args: any[]) => TResult): InvokeMap2x1; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (method: (...args: any[]) => TResult, collection: object | null | undefined): TResult[]; -} -interface InvokeMap1x1 { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (): InvokeMap1x1; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (collection: object | null | undefined): any[]; -} -interface InvokeMap2x1 { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (): InvokeMap2x1; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (collection: object | null | undefined): TResult[]; -} - -declare const invokeMap: InvokeMap; +import { invokeMap } from "../fp"; export = invokeMap; diff --git a/types/lodash/fp/isArguments.d.ts b/types/lodash/fp/isArguments.d.ts index 53841e17fc..23c438c0a5 100644 --- a/types/lodash/fp/isArguments.d.ts +++ b/types/lodash/fp/isArguments.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsArguments = - /** - * Checks if value is classified as an arguments object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => value is IArguments; - -declare const isArguments: IsArguments; +import { isArguments } from "../fp"; export = isArguments; diff --git a/types/lodash/fp/isArray.d.ts b/types/lodash/fp/isArray.d.ts index 6f96cdbe55..dadecce65f 100644 --- a/types/lodash/fp/isArray.d.ts +++ b/types/lodash/fp/isArray.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsArray = - /** - * Checks if value is classified as an Array object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => value is any[]; - -declare const isArray: IsArray; +import { isArray } from "../fp"; export = isArray; diff --git a/types/lodash/fp/isArrayBuffer.d.ts b/types/lodash/fp/isArrayBuffer.d.ts index a9fab817ec..32018346ba 100644 --- a/types/lodash/fp/isArrayBuffer.d.ts +++ b/types/lodash/fp/isArrayBuffer.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsArrayBuffer = - /** - * Checks if value is classified as an ArrayBuffer object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => value is ArrayBuffer; - -declare const isArrayBuffer: IsArrayBuffer; +import { isArrayBuffer } from "../fp"; export = isArrayBuffer; diff --git a/types/lodash/fp/isArrayLike.d.ts b/types/lodash/fp/isArrayLike.d.ts index 4d99172433..2be9b54c93 100644 --- a/types/lodash/fp/isArrayLike.d.ts +++ b/types/lodash/fp/isArrayLike.d.ts @@ -1,78 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface IsArrayLike { - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - (value: T & string & number): boolean; - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - (value: ((...args: any[]) => any) | null | undefined): value is never; - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - (value: any): value is { length: number }; -} - -declare const isArrayLike: IsArrayLike; +import { isArrayLike } from "../fp"; export = isArrayLike; diff --git a/types/lodash/fp/isArrayLikeObject.d.ts b/types/lodash/fp/isArrayLikeObject.d.ts index f21c1f6836..709f5135fe 100644 --- a/types/lodash/fp/isArrayLikeObject.d.ts +++ b/types/lodash/fp/isArrayLikeObject.d.ts @@ -1,77 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface IsArrayLikeObject { - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - (value: T & string & number): boolean; - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - // tslint:disable-next-line:ban-types (type guard doesn't seem to work correctly without the Function type) - (value: ((...args: any[]) => any) | Function | string | boolean | number | null | undefined): value is never; - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - // tslint:disable-next-line:ban-types (type guard doesn't seem to work correctly without the Function type) - (value: T | ((...args: any[]) => any) | Function | string | boolean | number | null | undefined): value is T & { length: number }; -} - -declare const isArrayLikeObject: IsArrayLikeObject; +import { isArrayLikeObject } from "../fp"; export = isArrayLikeObject; diff --git a/types/lodash/fp/isBoolean.d.ts b/types/lodash/fp/isBoolean.d.ts index 45aaa6d2f9..605cb2cb7e 100644 --- a/types/lodash/fp/isBoolean.d.ts +++ b/types/lodash/fp/isBoolean.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsBoolean = - /** - * Checks if value is classified as a boolean primitive or object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => value is boolean; - -declare const isBoolean: IsBoolean; +import { isBoolean } from "../fp"; export = isBoolean; diff --git a/types/lodash/fp/isBuffer.d.ts b/types/lodash/fp/isBuffer.d.ts index a603cf2d68..3d06b548c1 100644 --- a/types/lodash/fp/isBuffer.d.ts +++ b/types/lodash/fp/isBuffer.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsBuffer = - /** - * Checks if value is a buffer. - * - * @param value The value to check. - * @return Returns true if value is a buffer, else false. - */ - (value: any) => boolean; - -declare const isBuffer: IsBuffer; +import { isBuffer } from "../fp"; export = isBuffer; diff --git a/types/lodash/fp/isDate.d.ts b/types/lodash/fp/isDate.d.ts index a602131f26..979594f995 100644 --- a/types/lodash/fp/isDate.d.ts +++ b/types/lodash/fp/isDate.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsDate = - /** - * Checks if value is classified as a Date object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => value is Date; - -declare const isDate: IsDate; +import { isDate } from "../fp"; export = isDate; diff --git a/types/lodash/fp/isElement.d.ts b/types/lodash/fp/isElement.d.ts index 56fe27d3a6..26739ad952 100644 --- a/types/lodash/fp/isElement.d.ts +++ b/types/lodash/fp/isElement.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsElement = - /** - * Checks if value is a DOM element. - * - * @param value The value to check. - * @return Returns true if value is a DOM element, else false. - */ - (value: any) => boolean; - -declare const isElement: IsElement; +import { isElement } from "../fp"; export = isElement; diff --git a/types/lodash/fp/isEmpty.d.ts b/types/lodash/fp/isEmpty.d.ts index b24d33f88e..ed9b33f822 100644 --- a/types/lodash/fp/isEmpty.d.ts +++ b/types/lodash/fp/isEmpty.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsEmpty = - /** - * Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or - * jQuery-like collection with a length greater than 0 or an object with own enumerable properties. - * - * @param value The value to inspect. - * @return Returns true if value is empty, else false. - */ - (value: any) => boolean; - -declare const isEmpty: IsEmpty; +import { isEmpty } from "../fp"; export = isEmpty; diff --git a/types/lodash/fp/isEqual.d.ts b/types/lodash/fp/isEqual.d.ts index 225f90f914..0a51c5c80d 100644 --- a/types/lodash/fp/isEqual.d.ts +++ b/types/lodash/fp/isEqual.d.ts @@ -1,141 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface IsEqual { - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (): IsEqual; - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (value: any): IsEqual1x1; - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (value: any, other: any): boolean; -} -interface IsEqual1x1 { - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (): IsEqual1x1; - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (other: any): boolean; -} - -declare const isEqual: IsEqual; +import { isEqual } from "../fp"; export = isEqual; diff --git a/types/lodash/fp/isEqualWith.d.ts b/types/lodash/fp/isEqualWith.d.ts index 832c80829c..27fa4414cb 100644 --- a/types/lodash/fp/isEqualWith.d.ts +++ b/types/lodash/fp/isEqualWith.d.ts @@ -1,285 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface IsEqualWith { - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (): IsEqualWith; - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (customizer: _.IsEqualCustomizer): IsEqualWith1x1; - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (customizer: _.IsEqualCustomizer, value: any): IsEqualWith1x2; - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (customizer: _.IsEqualCustomizer, value: any, other: any): boolean; -} -interface IsEqualWith1x1 { - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (): IsEqualWith1x1; - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (value: any): IsEqualWith1x2; - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (value: any, other: any): boolean; -} -interface IsEqualWith1x2 { - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (): IsEqualWith1x2; - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (other: any): boolean; -} - -declare const isEqualWith: IsEqualWith; +import { isEqualWith } from "../fp"; export = isEqualWith; diff --git a/types/lodash/fp/isError.d.ts b/types/lodash/fp/isError.d.ts index 6c6f429fdf..4adb9885ca 100644 --- a/types/lodash/fp/isError.d.ts +++ b/types/lodash/fp/isError.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsError = - /** - * Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError - * object. - * - * @param value The value to check. - * @return Returns true if value is an error object, else false. - */ - (value: any) => value is Error; - -declare const isError: IsError; +import { isError } from "../fp"; export = isError; diff --git a/types/lodash/fp/isFinite.d.ts b/types/lodash/fp/isFinite.d.ts index 544f4c3fd5..5641edc0ae 100644 --- a/types/lodash/fp/isFinite.d.ts +++ b/types/lodash/fp/isFinite.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsFinite = - /** - * Checks if value is a finite primitive number. - * - * Note: This method is based on Number.isFinite. - * - * @param value The value to check. - * @return Returns true if value is a finite number, else false. - */ - (value: any) => boolean; - -declare const isFinite: IsFinite; +import { isFinite } from "../fp"; export = isFinite; diff --git a/types/lodash/fp/isFunction.d.ts b/types/lodash/fp/isFunction.d.ts index 7a85054a1f..3404e74871 100644 --- a/types/lodash/fp/isFunction.d.ts +++ b/types/lodash/fp/isFunction.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsFunction = - /** - * Checks if value is a callable function. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => value is (...args: any[]) => any; - -declare const isFunction: IsFunction; +import { isFunction } from "../fp"; export = isFunction; diff --git a/types/lodash/fp/isInteger.d.ts b/types/lodash/fp/isInteger.d.ts index d04a6f5cce..310df93478 100644 --- a/types/lodash/fp/isInteger.d.ts +++ b/types/lodash/fp/isInteger.d.ts @@ -1,31 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsInteger = - /** - * Checks if `value` is an integer. - * - * **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger). - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is an integer, else `false`. - * @example - * - * _.isInteger(3); - * // => true - * - * _.isInteger(Number.MIN_VALUE); - * // => false - * - * _.isInteger(Infinity); - * // => false - * - * _.isInteger('3'); - * // => false - */ - (value: any) => boolean; - -declare const isInteger: IsInteger; +import { isInteger } from "../fp"; export = isInteger; diff --git a/types/lodash/fp/isLength.d.ts b/types/lodash/fp/isLength.d.ts index a48a867820..3073b672b6 100644 --- a/types/lodash/fp/isLength.d.ts +++ b/types/lodash/fp/isLength.d.ts @@ -1,31 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsLength = - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - (value: any) => boolean; - -declare const isLength: IsLength; +import { isLength } from "../fp"; export = isLength; diff --git a/types/lodash/fp/isMap.d.ts b/types/lodash/fp/isMap.d.ts index 940cb8a4ad..e76745c1e2 100644 --- a/types/lodash/fp/isMap.d.ts +++ b/types/lodash/fp/isMap.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsMap = - /** - * Checks if value is classified as a Map object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - (value: any) => value is Map; - -declare const isMap: IsMap; +import { isMap } from "../fp"; export = isMap; diff --git a/types/lodash/fp/isMatch.d.ts b/types/lodash/fp/isMatch.d.ts index 231362c358..58a0a2db95 100644 --- a/types/lodash/fp/isMatch.d.ts +++ b/types/lodash/fp/isMatch.d.ts @@ -1,116 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface IsMatch { - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (): IsMatch; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (source: object): IsMatch1x1; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (source: object, object: object): boolean; -} -interface IsMatch1x1 { - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (): IsMatch1x1; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (object: object): boolean; -} - -declare const isMatch: IsMatch; +import { isMatch } from "../fp"; export = isMatch; diff --git a/types/lodash/fp/isMatchWith.d.ts b/types/lodash/fp/isMatchWith.d.ts index 5345ad3863..40ff3a691b 100644 --- a/types/lodash/fp/isMatchWith.d.ts +++ b/types/lodash/fp/isMatchWith.d.ts @@ -1,285 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface IsMatchWith { - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (): IsMatchWith; - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (customizer: _.isMatchWithCustomizer): IsMatchWith1x1; - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (customizer: _.isMatchWithCustomizer, source: object): IsMatchWith1x2; - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (customizer: _.isMatchWithCustomizer, source: object, object: object): boolean; -} -interface IsMatchWith1x1 { - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (): IsMatchWith1x1; - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (source: object): IsMatchWith1x2; - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (source: object, object: object): boolean; -} -interface IsMatchWith1x2 { - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (): IsMatchWith1x2; - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (object: object): boolean; -} - -declare const isMatchWith: IsMatchWith; +import { isMatchWith } from "../fp"; export = isMatchWith; diff --git a/types/lodash/fp/isNaN.d.ts b/types/lodash/fp/isNaN.d.ts index f227cd2061..2f92885d09 100644 --- a/types/lodash/fp/isNaN.d.ts +++ b/types/lodash/fp/isNaN.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsNaN = - /** - * Checks if value is NaN. - * - * Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values. - * - * @param value The value to check. - * @return Returns true if value is NaN, else false. - */ - (value: any) => boolean; - -declare const isNaN: IsNaN; +import { isNaN } from "../fp"; export = isNaN; diff --git a/types/lodash/fp/isNative.d.ts b/types/lodash/fp/isNative.d.ts index 9dd6543388..6e189a8e52 100644 --- a/types/lodash/fp/isNative.d.ts +++ b/types/lodash/fp/isNative.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsNative = - /** - * Checks if value is a native function. - * @param value The value to check. - * - * @retrun Returns true if value is a native function, else false. - */ - (value: any) => value is (...args: any[]) => any; - -declare const isNative: IsNative; +import { isNative } from "../fp"; export = isNative; diff --git a/types/lodash/fp/isNil.d.ts b/types/lodash/fp/isNil.d.ts index 07005f1fa1..0baee7ff8b 100644 --- a/types/lodash/fp/isNil.d.ts +++ b/types/lodash/fp/isNil.d.ts @@ -1,26 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsNil = - /** - * Checks if `value` is `null` or `undefined`. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is nullish, else `false`. - * @example - * - * _.isNil(null); - * // => true - * - * _.isNil(void 0); - * // => true - * - * _.isNil(NaN); - * // => false - */ - (value: any) => value is null | undefined; - -declare const isNil: IsNil; +import { isNil } from "../fp"; export = isNil; diff --git a/types/lodash/fp/isNull.d.ts b/types/lodash/fp/isNull.d.ts index b1d5b53e0b..5e5fad5575 100644 --- a/types/lodash/fp/isNull.d.ts +++ b/types/lodash/fp/isNull.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsNull = - /** - * Checks if value is null. - * - * @param value The value to check. - * @return Returns true if value is null, else false. - */ - (value: any) => value is null; - -declare const isNull: IsNull; +import { isNull } from "../fp"; export = isNull; diff --git a/types/lodash/fp/isNumber.d.ts b/types/lodash/fp/isNumber.d.ts index fda5cca1b8..93368f1726 100644 --- a/types/lodash/fp/isNumber.d.ts +++ b/types/lodash/fp/isNumber.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsNumber = - /** - * Checks if value is classified as a Number primitive or object. - * - * Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => value is number; - -declare const isNumber: IsNumber; +import { isNumber } from "../fp"; export = isNumber; diff --git a/types/lodash/fp/isObject.d.ts b/types/lodash/fp/isObject.d.ts index 9f55786107..7e9e2575ab 100644 --- a/types/lodash/fp/isObject.d.ts +++ b/types/lodash/fp/isObject.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsObject = - /** - * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0), - * and new String('')) - * - * @param value The value to check. - * @return Returns true if value is an object, else false. - */ - (value: any) => boolean; - -declare const isObject: IsObject; +import { isObject } from "../fp"; export = isObject; diff --git a/types/lodash/fp/isObjectLike.d.ts b/types/lodash/fp/isObjectLike.d.ts index 17fc948a2d..ba03ddc0f7 100644 --- a/types/lodash/fp/isObjectLike.d.ts +++ b/types/lodash/fp/isObjectLike.d.ts @@ -1,30 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsObjectLike = - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - (value: any) => boolean; - -declare const isObjectLike: IsObjectLike; +import { isObjectLike } from "../fp"; export = isObjectLike; diff --git a/types/lodash/fp/isPlainObject.d.ts b/types/lodash/fp/isPlainObject.d.ts index e4cadb9806..87da4bdb47 100644 --- a/types/lodash/fp/isPlainObject.d.ts +++ b/types/lodash/fp/isPlainObject.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsPlainObject = - /** - * Checks if value is a plain object, that is, an object created by the Object constructor or one with a - * [[Prototype]] of null. - * - * Note: This method assumes objects created by the Object constructor have no inherited enumerable properties. - * - * @param value The value to check. - * @return Returns true if value is a plain object, else false. - */ - (value: any) => boolean; - -declare const isPlainObject: IsPlainObject; +import { isPlainObject } from "../fp"; export = isPlainObject; diff --git a/types/lodash/fp/isRegExp.d.ts b/types/lodash/fp/isRegExp.d.ts index 98adef2e36..47edf50a1f 100644 --- a/types/lodash/fp/isRegExp.d.ts +++ b/types/lodash/fp/isRegExp.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsRegExp = - /** - * Checks if value is classified as a RegExp object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => value is RegExp; - -declare const isRegExp: IsRegExp; +import { isRegExp } from "../fp"; export = isRegExp; diff --git a/types/lodash/fp/isSafeInteger.d.ts b/types/lodash/fp/isSafeInteger.d.ts index 60d49e1be8..a32b12cfd8 100644 --- a/types/lodash/fp/isSafeInteger.d.ts +++ b/types/lodash/fp/isSafeInteger.d.ts @@ -1,32 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsSafeInteger = - /** - * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 - * double precision number which isn't the result of a rounded unsafe integer. - * - * **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is a safe integer, else `false`. - * @example - * - * _.isSafeInteger(3); - * // => true - * - * _.isSafeInteger(Number.MIN_VALUE); - * // => false - * - * _.isSafeInteger(Infinity); - * // => false - * - * _.isSafeInteger('3'); - * // => false - */ - (value: any) => boolean; - -declare const isSafeInteger: IsSafeInteger; +import { isSafeInteger } from "../fp"; export = isSafeInteger; diff --git a/types/lodash/fp/isSet.d.ts b/types/lodash/fp/isSet.d.ts index 7be7de7600..85e493338e 100644 --- a/types/lodash/fp/isSet.d.ts +++ b/types/lodash/fp/isSet.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsSet = - /** - * Checks if value is classified as a Set object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - (value: any) => value is Set; - -declare const isSet: IsSet; +import { isSet } from "../fp"; export = isSet; diff --git a/types/lodash/fp/isString.d.ts b/types/lodash/fp/isString.d.ts index fea109178e..9a2149451d 100644 --- a/types/lodash/fp/isString.d.ts +++ b/types/lodash/fp/isString.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsString = - /** - * Checks if value is classified as a String primitive or object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => value is string; - -declare const isString: IsString; +import { isString } from "../fp"; export = isString; diff --git a/types/lodash/fp/isSymbol.d.ts b/types/lodash/fp/isSymbol.d.ts index fe30bad576..3d82e9719c 100644 --- a/types/lodash/fp/isSymbol.d.ts +++ b/types/lodash/fp/isSymbol.d.ts @@ -1,23 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsSymbol = - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - (value: any) => boolean; - -declare const isSymbol: IsSymbol; +import { isSymbol } from "../fp"; export = isSymbol; diff --git a/types/lodash/fp/isTypedArray.d.ts b/types/lodash/fp/isTypedArray.d.ts index 076fb84e05..fce6c44a69 100644 --- a/types/lodash/fp/isTypedArray.d.ts +++ b/types/lodash/fp/isTypedArray.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsTypedArray = - /** - * Checks if value is classified as a typed array. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => boolean; - -declare const isTypedArray: IsTypedArray; +import { isTypedArray } from "../fp"; export = isTypedArray; diff --git a/types/lodash/fp/isUndefined.d.ts b/types/lodash/fp/isUndefined.d.ts index 3980dd5742..ccb010033b 100644 --- a/types/lodash/fp/isUndefined.d.ts +++ b/types/lodash/fp/isUndefined.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsUndefined = - /** - * Checks if value is undefined. - * - * @param value The value to check. - * @return Returns true if value is undefined, else false. - */ - (value: any) => value is undefined; - -declare const isUndefined: IsUndefined; +import { isUndefined } from "../fp"; export = isUndefined; diff --git a/types/lodash/fp/isWeakMap.d.ts b/types/lodash/fp/isWeakMap.d.ts index 9edb2fbb71..11edaab05d 100644 --- a/types/lodash/fp/isWeakMap.d.ts +++ b/types/lodash/fp/isWeakMap.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsWeakMap = - /** - * Checks if value is classified as a WeakMap object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - (value: any) => value is WeakMap; - -declare const isWeakMap: IsWeakMap; +import { isWeakMap } from "../fp"; export = isWeakMap; diff --git a/types/lodash/fp/isWeakSet.d.ts b/types/lodash/fp/isWeakSet.d.ts index cf7bd7cf01..6d877e9e23 100644 --- a/types/lodash/fp/isWeakSet.d.ts +++ b/types/lodash/fp/isWeakSet.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsWeakSet = - /** - * Checks if value is classified as a WeakSet object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - (value: any) => value is WeakSet; - -declare const isWeakSet: IsWeakSet; +import { isWeakSet } from "../fp"; export = isWeakSet; diff --git a/types/lodash/fp/iteratee.d.ts b/types/lodash/fp/iteratee.d.ts index 669d1d92d5..0ec2832c84 100644 --- a/types/lodash/fp/iteratee.d.ts +++ b/types/lodash/fp/iteratee.d.ts @@ -1,65 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Iteratee { - /** - * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name the created callback returns the - * property value for a given element. If `func` is an object the created - * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`. - * - * @category Util - * @param [func=_.identity] The value to convert to a callback. - * @returns Returns the callback. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // create custom iteratee shorthands - * _.iteratee = _.wrap(_.iteratee, function(callback, func) { - * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); - * return !p ? callback(func) : function(object) { - * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); - * }; - * }); - * - * _.filter(users, 'age > 36'); - * // => [{ 'user': 'fred', 'age': 40 }] - */ - any>(func: TFunction): TFunction; - /** - * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name the created callback returns the - * property value for a given element. If `func` is an object the created - * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`. - * - * @category Util - * @param [func=_.identity] The value to convert to a callback. - * @returns Returns the callback. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // create custom iteratee shorthands - * _.iteratee = _.wrap(_.iteratee, function(callback, func) { - * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); - * return !p ? callback(func) : function(object) { - * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); - * }; - * }); - * - * _.filter(users, 'age > 36'); - * // => [{ 'user': 'fred', 'age': 40 }] - */ - (func: string | object): (...args: any[]) => any; -} - -declare const iteratee: Iteratee; +import { iteratee } from "../fp"; export = iteratee; diff --git a/types/lodash/fp/join.d.ts b/types/lodash/fp/join.d.ts index 7b678d0738..beee04ccf5 100644 --- a/types/lodash/fp/join.d.ts +++ b/types/lodash/fp/join.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Join { - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @param array The array to convert. - * @param separator The element separator. - * @returns Returns the joined string. - */ - (): Join; - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @param array The array to convert. - * @param separator The element separator. - * @returns Returns the joined string. - */ - (separator: string): Join1x1; - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @param array The array to convert. - * @param separator The element separator. - * @returns Returns the joined string. - */ - (separator: string, array: _.List | null | undefined): string; -} -interface Join1x1 { - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @param array The array to convert. - * @param separator The element separator. - * @returns Returns the joined string. - */ - (): Join1x1; - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @param array The array to convert. - * @param separator The element separator. - * @returns Returns the joined string. - */ - (array: _.List | null | undefined): string; -} - -declare const join: Join; +import { join } from "../fp"; export = join; diff --git a/types/lodash/fp/juxt.d.ts b/types/lodash/fp/juxt.d.ts index 9131ad7914..5e972d4488 100644 --- a/types/lodash/fp/juxt.d.ts +++ b/types/lodash/fp/juxt.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Over = - /** - * Creates a function that invokes iteratees with the arguments provided to the created function and returns - * their results. - * - * @param iteratees The iteratees to invoke. - * @return Returns the new function. - */ - (iteratees: _.Many<(...args: any[]) => TResult>) => (...args: any[]) => TResult[]; - -declare const juxt: Over; +import { juxt } from "../fp"; export = juxt; diff --git a/types/lodash/fp/kebabCase.d.ts b/types/lodash/fp/kebabCase.d.ts index 6a46ada134..8231b1593a 100644 --- a/types/lodash/fp/kebabCase.d.ts +++ b/types/lodash/fp/kebabCase.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type KebabCase = - /** - * Converts string to kebab case. - * - * @param string The string to convert. - * @return Returns the kebab cased string. - */ - (string: string) => string; - -declare const kebabCase: KebabCase; +import { kebabCase } from "../fp"; export = kebabCase; diff --git a/types/lodash/fp/keyBy.d.ts b/types/lodash/fp/keyBy.d.ts index d9ebba52bf..e4b1381096 100644 --- a/types/lodash/fp/keyBy.d.ts +++ b/types/lodash/fp/keyBy.d.ts @@ -1,225 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface KeyBy { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): KeyBy; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: (value: string) => _.PropertyName): KeyBy1x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: (value: string) => _.PropertyName, collection: string | null | undefined): _.Dictionary; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIterateeCustom): KeyBy2x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIterateeCustom, collection: _.List | null | undefined): _.Dictionary; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIterateeCustom, collection: T | null | undefined): _.Dictionary; -} -interface KeyBy1x1 { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): KeyBy1x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (collection: string | null | undefined): _.Dictionary; -} -interface KeyBy2x1 { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): KeyBy2x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (collection: _.List | object | null | undefined): _.Dictionary; -} - -declare const keyBy: KeyBy; +import { keyBy } from "../fp"; export = keyBy; diff --git a/types/lodash/fp/keys.d.ts b/types/lodash/fp/keys.d.ts index 0cfa0ac21e..0323484453 100644 --- a/types/lodash/fp/keys.d.ts +++ b/types/lodash/fp/keys.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Keys = - /** - * Creates an array of the own enumerable property names of object. - * - * Note: Non-object values are coerced to objects. See the ES spec for more details. - * - * @param object The object to query. - * @return Returns the array of property names. - */ - (object: any) => string[]; - -declare const keys: Keys; +import { keys } from "../fp"; export = keys; diff --git a/types/lodash/fp/keysIn.d.ts b/types/lodash/fp/keysIn.d.ts index 827f1edbaa..f6f3482852 100644 --- a/types/lodash/fp/keysIn.d.ts +++ b/types/lodash/fp/keysIn.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type KeysIn = - /** - * Creates an array of the own and inherited enumerable property names of object. - * - * Note: Non-object values are coerced to objects. - * - * @param object The object to query. - * @return An array of property names. - */ - (object: any) => string[]; - -declare const keysIn: KeysIn; +import { keysIn } from "../fp"; export = keysIn; diff --git a/types/lodash/fp/last.d.ts b/types/lodash/fp/last.d.ts index 4473a221f9..f74171a309 100644 --- a/types/lodash/fp/last.d.ts +++ b/types/lodash/fp/last.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Last = - /** - * Gets the last element of array. - * - * @param array The array to query. - * @return Returns the last element of array. - */ - (array: _.List | null | undefined) => T | undefined; - -declare const last: Last; +import { last } from "../fp"; export = last; diff --git a/types/lodash/fp/lastIndexOf.d.ts b/types/lodash/fp/lastIndexOf.d.ts index a21af0a596..2d60e64837 100644 --- a/types/lodash/fp/lastIndexOf.d.ts +++ b/types/lodash/fp/lastIndexOf.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface LastIndexOf { - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (): LastIndexOf; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (value: T): LastIndexOf1x1; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (value: T, array: _.List | null | undefined): number; -} -interface LastIndexOf1x1 { - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (): LastIndexOf1x1; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (array: _.List | null | undefined): number; -} - -declare const lastIndexOf: LastIndexOf; +import { lastIndexOf } from "../fp"; export = lastIndexOf; diff --git a/types/lodash/fp/lastIndexOfFrom.d.ts b/types/lodash/fp/lastIndexOfFrom.d.ts index 0bea8e22c7..7a2f23e5ae 100644 --- a/types/lodash/fp/lastIndexOfFrom.d.ts +++ b/types/lodash/fp/lastIndexOfFrom.d.ts @@ -1,96 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface LastIndexOf { - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (): LastIndexOf; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (value: T): LastIndexOf1x1; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (value: T, fromIndex: true|number): LastIndexOf1x2; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (value: T, fromIndex: true|number, array: _.List | null | undefined): number; -} -interface LastIndexOf1x1 { - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (): LastIndexOf1x1; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (fromIndex: true|number): LastIndexOf1x2; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (fromIndex: true|number, array: _.List | null | undefined): number; -} -interface LastIndexOf1x2 { - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (): LastIndexOf1x2; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (array: _.List | null | undefined): number; -} - -declare const lastIndexOfFrom: LastIndexOf; +import { lastIndexOfFrom } from "../fp"; export = lastIndexOfFrom; diff --git a/types/lodash/fp/lowerCase.d.ts b/types/lodash/fp/lowerCase.d.ts index 628744e48b..1a5360fdbc 100644 --- a/types/lodash/fp/lowerCase.d.ts +++ b/types/lodash/fp/lowerCase.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type LowerCase = - /** - * Converts `string`, as space separated words, to lower case. - * - * @param string The string to convert. - * @return Returns the lower cased string. - */ - (string: string) => string; - -declare const lowerCase: LowerCase; +import { lowerCase } from "../fp"; export = lowerCase; diff --git a/types/lodash/fp/lowerFirst.d.ts b/types/lodash/fp/lowerFirst.d.ts index a88e572706..23ce92585d 100644 --- a/types/lodash/fp/lowerFirst.d.ts +++ b/types/lodash/fp/lowerFirst.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type LowerFirst = - /** - * Converts the first character of `string` to lower case. - * - * @param string The string to convert. - * @return Returns the converted string. - */ - (string: string) => string; - -declare const lowerFirst: LowerFirst; +import { lowerFirst } from "../fp"; export = lowerFirst; diff --git a/types/lodash/fp/lt.d.ts b/types/lodash/fp/lt.d.ts index 8259c6d845..a309bdce1a 100644 --- a/types/lodash/fp/lt.d.ts +++ b/types/lodash/fp/lt.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Lt { - /** - * Checks if value is less than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than other, else false. - */ - (): Lt; - /** - * Checks if value is less than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than other, else false. - */ - (value: any): Lt1x1; - /** - * Checks if value is less than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than other, else false. - */ - (value: any, other: any): boolean; -} -interface Lt1x1 { - /** - * Checks if value is less than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than other, else false. - */ - (): Lt1x1; - /** - * Checks if value is less than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than other, else false. - */ - (other: any): boolean; -} - -declare const lt: Lt; +import { lt } from "../fp"; export = lt; diff --git a/types/lodash/fp/lte.d.ts b/types/lodash/fp/lte.d.ts index e3ac6503f7..0d4af2cbe3 100644 --- a/types/lodash/fp/lte.d.ts +++ b/types/lodash/fp/lte.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Lte { - /** - * Checks if value is less than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than or equal to other, else false. - */ - (): Lte; - /** - * Checks if value is less than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than or equal to other, else false. - */ - (value: any): Lte1x1; - /** - * Checks if value is less than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than or equal to other, else false. - */ - (value: any, other: any): boolean; -} -interface Lte1x1 { - /** - * Checks if value is less than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than or equal to other, else false. - */ - (): Lte1x1; - /** - * Checks if value is less than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than or equal to other, else false. - */ - (other: any): boolean; -} - -declare const lte: Lte; +import { lte } from "../fp"; export = lte; diff --git a/types/lodash/fp/map.d.ts b/types/lodash/fp/map.d.ts index 900e11d0d0..17d014caf4 100644 --- a/types/lodash/fp/map.d.ts +++ b/types/lodash/fp/map.d.ts @@ -1,588 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Map { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: (value: T) => TResult): Map1x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: (value: T) => TResult, collection: T[] | _.List | null | undefined): TResult[]; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: (value: T[keyof T]) => TResult): Map3x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: (value: T[keyof T]) => TResult, collection: T | null | undefined): TResult[]; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: K): Map4x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: K, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): Array; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: string): Map5x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: string, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): any[]; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: object): Map6x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: object, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean[]; -} -interface Map1x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map1x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: T[] | _.List | null | undefined): TResult[]; -} -interface Map3x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map3x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: T | null | undefined): TResult[]; -} -interface Map4x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map4x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): Array; -} -interface Map5x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map5x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): any[]; -} -interface Map6x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map6x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean[]; -} - -declare const map: Map; +import { map } from "../fp"; export = map; diff --git a/types/lodash/fp/mapKeys.d.ts b/types/lodash/fp/mapKeys.d.ts index 348fdff591..acc6d752d8 100644 --- a/types/lodash/fp/mapKeys.d.ts +++ b/types/lodash/fp/mapKeys.d.ts @@ -1,105 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MapKeys { - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (): MapKeys; - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (iteratee: _.ValueIteratee): MapKeys1x1; - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (iteratee: _.ValueIteratee, object: _.List | null | undefined): _.Dictionary; - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (iteratee: _.ValueIteratee): MapKeys2x1; - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (iteratee: _.ValueIteratee, object: T | null | undefined): _.Dictionary; -} -interface MapKeys1x1 { - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (): MapKeys1x1; - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (object: _.List | null | undefined): _.Dictionary; -} -interface MapKeys2x1 { - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (): MapKeys2x1; - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (object: T | null | undefined): _.Dictionary; -} - -declare const mapKeys: MapKeys; +import { mapKeys } from "../fp"; export = mapKeys; diff --git a/types/lodash/fp/mapValues.d.ts b/types/lodash/fp/mapValues.d.ts index ce44dda737..abef821aab 100644 --- a/types/lodash/fp/mapValues.d.ts +++ b/types/lodash/fp/mapValues.d.ts @@ -1,603 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MapValues { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (): MapValues; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (callback: (value: string) => TResult): MapValues1x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (callback: (value: string) => TResult, obj: string | null | undefined): _.NumericDictionary; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (callback: (value: T) => TResult): MapValues2x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (callback: (value: T) => TResult, obj: _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (callback: (value: T[keyof T]) => TResult): MapValues3x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (callback: (value: T[keyof T]) => TResult, obj: T | null | undefined): { [P in keyof T]: TResult }; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (iteratee: object): MapValues4x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (iteratee: object, obj: _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (iteratee: object, obj: T | null | undefined): { [P in keyof T]: boolean }; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (iteratee: TKey): MapValues6x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (iteratee: TKey, obj: _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (iteratee: string): MapValues7x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (iteratee: string, obj: _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (iteratee: string, obj: T | null | undefined): { [P in keyof T]: any }; -} -interface MapValues1x1 { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (): MapValues1x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (obj: string | null | undefined): _.NumericDictionary; -} -interface MapValues2x1 { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (): MapValues2x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (obj: _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; -} -interface MapValues3x1 { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (): MapValues3x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (obj: T | null | undefined): { [P in keyof T]: TResult }; -} -interface MapValues4x1 { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (): MapValues4x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (obj: _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (obj: T | null | undefined): { [P in keyof T]: boolean }; -} -interface MapValues6x1 { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (): MapValues6x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (obj: _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; -} -interface MapValues7x1 { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (): MapValues7x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (obj: _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (obj: T | null | undefined): { [P in keyof T]: any }; -} - -declare const mapValues: MapValues; +import { mapValues } from "../fp"; export = mapValues; diff --git a/types/lodash/fp/matches.d.ts b/types/lodash/fp/matches.d.ts index e197d6b711..e9796de4fb 100644 --- a/types/lodash/fp/matches.d.ts +++ b/types/lodash/fp/matches.d.ts @@ -1,116 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface IsMatch { - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (): IsMatch; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (source: object): IsMatch1x1; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (source: object, object: object): boolean; -} -interface IsMatch1x1 { - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (): IsMatch1x1; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (object: object): boolean; -} - -declare const matches: IsMatch; +import { matches } from "../fp"; export = matches; diff --git a/types/lodash/fp/matchesProperty.d.ts b/types/lodash/fp/matchesProperty.d.ts index 8fec785733..81db8f75da 100644 --- a/types/lodash/fp/matchesProperty.d.ts +++ b/types/lodash/fp/matchesProperty.d.ts @@ -1,90 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MatchesProperty { - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (): MatchesProperty; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath): MatchesProperty1x1; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath, srcValue: T): (value: any) => boolean; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath, srcValue: T): (value: V) => boolean; -} -interface MatchesProperty1x1 { - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (): MatchesProperty1x1; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (srcValue: T): (value: any) => boolean; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (srcValue: T): (value: V) => boolean; -} - -declare const matchesProperty: MatchesProperty; +import { matchesProperty } from "../fp"; export = matchesProperty; diff --git a/types/lodash/fp/max.d.ts b/types/lodash/fp/max.d.ts index 138dba542d..7b08dc52c6 100644 --- a/types/lodash/fp/max.d.ts +++ b/types/lodash/fp/max.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Max = - /** - * Computes the maximum value of `array`. If `array` is empty or falsey - * `undefined` is returned. - * - * @category Math - * @param array The array to iterate over. - * @returns Returns the maximum value. - */ - (collection: _.List | null | undefined) => T | undefined; - -declare const max: Max; +import { max } from "../fp"; export = max; diff --git a/types/lodash/fp/maxBy.d.ts b/types/lodash/fp/maxBy.d.ts index 44fb2ff7b1..68f30dd896 100644 --- a/types/lodash/fp/maxBy.d.ts +++ b/types/lodash/fp/maxBy.d.ts @@ -1,118 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MaxBy { - /** - * This method is like `_.max` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the maximum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.maxBy(objects, function(o) { return o.a; }); - * // => { 'n': 2 } - * - * // using the `_.property` iteratee shorthand - * _.maxBy(objects, 'n'); - * // => { 'n': 2 } - */ - (): MaxBy; - /** - * This method is like `_.max` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the maximum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.maxBy(objects, function(o) { return o.a; }); - * // => { 'n': 2 } - * - * // using the `_.property` iteratee shorthand - * _.maxBy(objects, 'n'); - * // => { 'n': 2 } - */ - (iteratee: _.ValueIteratee): MaxBy1x1; - /** - * This method is like `_.max` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the maximum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.maxBy(objects, function(o) { return o.a; }); - * // => { 'n': 2 } - * - * // using the `_.property` iteratee shorthand - * _.maxBy(objects, 'n'); - * // => { 'n': 2 } - */ - (iteratee: _.ValueIteratee, collection: _.List | null | undefined): T | undefined; -} -interface MaxBy1x1 { - /** - * This method is like `_.max` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the maximum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.maxBy(objects, function(o) { return o.a; }); - * // => { 'n': 2 } - * - * // using the `_.property` iteratee shorthand - * _.maxBy(objects, 'n'); - * // => { 'n': 2 } - */ - (): MaxBy1x1; - /** - * This method is like `_.max` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the maximum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.maxBy(objects, function(o) { return o.a; }); - * // => { 'n': 2 } - * - * // using the `_.property` iteratee shorthand - * _.maxBy(objects, 'n'); - * // => { 'n': 2 } - */ - (collection: _.List | null | undefined): T | undefined; -} - -declare const maxBy: MaxBy; +import { maxBy } from "../fp"; export = maxBy; diff --git a/types/lodash/fp/mean.d.ts b/types/lodash/fp/mean.d.ts index 0e37afaeaf..a0b7e22e5b 100644 --- a/types/lodash/fp/mean.d.ts +++ b/types/lodash/fp/mean.d.ts @@ -1,22 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Mean = - /** - * Computes the mean of the values in `array`. - * - * @category Math - * @param array The array to iterate over. - * @returns Returns the mean. - * @example - * - * _.mean([4, 2, 8, 6]); - * // => 5 - */ - (collection: _.List | null | undefined) => number; - -declare const mean: Mean; +import { mean } from "../fp"; export = mean; diff --git a/types/lodash/fp/meanBy.d.ts b/types/lodash/fp/meanBy.d.ts index 7ae670a7b5..d76afd77c1 100644 --- a/types/lodash/fp/meanBy.d.ts +++ b/types/lodash/fp/meanBy.d.ts @@ -1,78 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MeanBy { - /** - * Computes the mean of the provided propties of the objects in the `array` - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the mean. - * @example - * - * _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n'); - * // => 5 - */ - (): MeanBy; - /** - * Computes the mean of the provided propties of the objects in the `array` - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the mean. - * @example - * - * _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n'); - * // => 5 - */ - (iteratee: _.ValueIteratee): MeanBy1x1; - /** - * Computes the mean of the provided propties of the objects in the `array` - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the mean. - * @example - * - * _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n'); - * // => 5 - */ - (iteratee: _.ValueIteratee, collection: _.List | null | undefined): number; -} -interface MeanBy1x1 { - /** - * Computes the mean of the provided propties of the objects in the `array` - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the mean. - * @example - * - * _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n'); - * // => 5 - */ - (): MeanBy1x1; - /** - * Computes the mean of the provided propties of the objects in the `array` - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the mean. - * @example - * - * _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n'); - * // => 5 - */ - (collection: _.List | null | undefined): number; -} - -declare const meanBy: MeanBy; +import { meanBy } from "../fp"; export = meanBy; diff --git a/types/lodash/fp/memoize.d.ts b/types/lodash/fp/memoize.d.ts index c694ae0909..a60b79cafa 100644 --- a/types/lodash/fp/memoize.d.ts +++ b/types/lodash/fp/memoize.d.ts @@ -1,21 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Memoize = - /** - * Creates a function that memoizes the result of func. If resolver is provided it determines the cache key for - * storing the result based on the arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is coerced to a string and used as the cache key. The func is invoked with - * the this binding of the memoized function. - * - * @param func The function to have its output memoized. - * @param resolver The function to resolve the cache key. - * @return Returns the new memoizing function. - */ - any>(func: T) => T & _.MemoizedFunction; - -declare const memoize: Memoize; +import { memoize } from "../fp"; export = memoize; diff --git a/types/lodash/fp/merge.d.ts b/types/lodash/fp/merge.d.ts index fe05c22488..f80117b7e9 100644 --- a/types/lodash/fp/merge.d.ts +++ b/types/lodash/fp/merge.d.ts @@ -1,151 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Merge { - /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - */ - (): Merge; - /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - */ - (object: TObject): Merge1x1; - /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - */ - (object: TObject, source: TSource): TObject & TSource; -} -interface Merge1x1 { - /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - */ - (): Merge1x1; - /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - */ - (source: TSource): TObject & TSource; -} - -declare const merge: Merge; +import { merge } from "../fp"; export = merge; diff --git a/types/lodash/fp/mergeAll.d.ts b/types/lodash/fp/mergeAll.d.ts index 350ef6110c..6b462d85cb 100644 --- a/types/lodash/fp/mergeAll.d.ts +++ b/types/lodash/fp/mergeAll.d.ts @@ -1,36 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Merge = - /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - */ - (object: ReadonlyArray) => any; - -declare const mergeAll: Merge; +import { mergeAll } from "../fp"; export = mergeAll; diff --git a/types/lodash/fp/mergeAllWith.d.ts b/types/lodash/fp/mergeAllWith.d.ts index 96be3f4db9..3d2f7f296e 100644 --- a/types/lodash/fp/mergeAllWith.d.ts +++ b/types/lodash/fp/mergeAllWith.d.ts @@ -1,183 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MergeWith { - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (): MergeWith; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (customizer: _.MergeWithCustomizer): MergeWith1x1; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (customizer: _.MergeWithCustomizer, args: ReadonlyArray): any; -} -interface MergeWith1x1 { - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (): MergeWith1x1; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (args: ReadonlyArray): any; -} - -declare const mergeAllWith: MergeWith; +import { mergeAllWith } from "../fp"; export = mergeAllWith; diff --git a/types/lodash/fp/mergeWith.d.ts b/types/lodash/fp/mergeWith.d.ts index 64556114df..d1f541e81b 100644 --- a/types/lodash/fp/mergeWith.d.ts +++ b/types/lodash/fp/mergeWith.d.ts @@ -1,321 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MergeWith { - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (): MergeWith; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (customizer: _.MergeWithCustomizer): MergeWith1x1; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (customizer: _.MergeWithCustomizer, object: TObject): MergeWith1x2; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (customizer: _.MergeWithCustomizer, object: TObject, source: TSource): TObject & TSource; -} -interface MergeWith1x1 { - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (): MergeWith1x1; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (object: TObject): MergeWith1x2; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (object: TObject, source: TSource): TObject & TSource; -} -interface MergeWith1x2 { - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (): MergeWith1x2; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (source: TSource): TObject & TSource; -} - -declare const mergeWith: MergeWith; +import { mergeWith } from "../fp"; export = mergeWith; diff --git a/types/lodash/fp/method.d.ts b/types/lodash/fp/method.d.ts index e44efd9f07..f9f2ee8795 100644 --- a/types/lodash/fp/method.d.ts +++ b/types/lodash/fp/method.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Method = - /** - * Creates a function that invokes the method at path on a given object. Any additional arguments are provided - * to the invoked method. - * - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - * @return Returns the new function. - */ - (path: _.PropertyPath) => (object: any) => any; - -declare const method: Method; +import { method } from "../fp"; export = method; diff --git a/types/lodash/fp/methodOf.d.ts b/types/lodash/fp/methodOf.d.ts index 6a1a908de7..a9e0e4fe14 100644 --- a/types/lodash/fp/methodOf.d.ts +++ b/types/lodash/fp/methodOf.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type MethodOf = - /** - * The opposite of _.method; this method creates a function that invokes the method at a given path on object. - * Any additional arguments are provided to the invoked method. - * - * @param object The object to query. - * @param args The arguments to invoke the method with. - * @return Returns the new function. - */ - (object: object) => (path: _.PropertyPath) => any; - -declare const methodOf: MethodOf; +import { methodOf } from "../fp"; export = methodOf; diff --git a/types/lodash/fp/min.d.ts b/types/lodash/fp/min.d.ts index f637f397ac..7c80ab0ff9 100644 --- a/types/lodash/fp/min.d.ts +++ b/types/lodash/fp/min.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Min = - /** - * Computes the minimum value of `array`. If `array` is empty or falsey - * `undefined` is returned. - * - * @category Math - * @param array The array to iterate over. - * @returns Returns the minimum value. - */ - (collection: _.List | null | undefined) => T | undefined; - -declare const min: Min; +import { min } from "../fp"; export = min; diff --git a/types/lodash/fp/minBy.d.ts b/types/lodash/fp/minBy.d.ts index b9bdebecd8..020a8f506c 100644 --- a/types/lodash/fp/minBy.d.ts +++ b/types/lodash/fp/minBy.d.ts @@ -1,118 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MinBy { - /** - * This method is like `_.min` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the minimum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.minBy(objects, function(o) { return o.a; }); - * // => { 'n': 1 } - * - * // using the `_.property` iteratee shorthand - * _.minBy(objects, 'n'); - * // => { 'n': 1 } - */ - (): MinBy; - /** - * This method is like `_.min` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the minimum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.minBy(objects, function(o) { return o.a; }); - * // => { 'n': 1 } - * - * // using the `_.property` iteratee shorthand - * _.minBy(objects, 'n'); - * // => { 'n': 1 } - */ - (iteratee: _.ValueIteratee): MinBy1x1; - /** - * This method is like `_.min` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the minimum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.minBy(objects, function(o) { return o.a; }); - * // => { 'n': 1 } - * - * // using the `_.property` iteratee shorthand - * _.minBy(objects, 'n'); - * // => { 'n': 1 } - */ - (iteratee: _.ValueIteratee, collection: _.List | null | undefined): T | undefined; -} -interface MinBy1x1 { - /** - * This method is like `_.min` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the minimum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.minBy(objects, function(o) { return o.a; }); - * // => { 'n': 1 } - * - * // using the `_.property` iteratee shorthand - * _.minBy(objects, 'n'); - * // => { 'n': 1 } - */ - (): MinBy1x1; - /** - * This method is like `_.min` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the minimum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.minBy(objects, function(o) { return o.a; }); - * // => { 'n': 1 } - * - * // using the `_.property` iteratee shorthand - * _.minBy(objects, 'n'); - * // => { 'n': 1 } - */ - (collection: _.List | null | undefined): T | undefined; -} - -declare const minBy: MinBy; +import { minBy } from "../fp"; export = minBy; diff --git a/types/lodash/fp/multiply.d.ts b/types/lodash/fp/multiply.d.ts index a335372aac..b3e5f3abd9 100644 --- a/types/lodash/fp/multiply.d.ts +++ b/types/lodash/fp/multiply.d.ts @@ -1,46 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Multiply { - /** - * Multiply two numbers. - * @param multiplier The first number in a multiplication. - * @param multiplicand The second number in a multiplication. - * @returns Returns the product. - */ - (): Multiply; - /** - * Multiply two numbers. - * @param multiplier The first number in a multiplication. - * @param multiplicand The second number in a multiplication. - * @returns Returns the product. - */ - (multiplier: number): Multiply1x1; - /** - * Multiply two numbers. - * @param multiplier The first number in a multiplication. - * @param multiplicand The second number in a multiplication. - * @returns Returns the product. - */ - (multiplier: number, multiplicand: number): number; -} -interface Multiply1x1 { - /** - * Multiply two numbers. - * @param multiplier The first number in a multiplication. - * @param multiplicand The second number in a multiplication. - * @returns Returns the product. - */ - (): Multiply1x1; - /** - * Multiply two numbers. - * @param multiplier The first number in a multiplication. - * @param multiplicand The second number in a multiplication. - * @returns Returns the product. - */ - (multiplicand: number): number; -} - -declare const multiply: Multiply; +import { multiply } from "../fp"; export = multiply; diff --git a/types/lodash/fp/nAry.d.ts b/types/lodash/fp/nAry.d.ts index daede14899..882e4a37d6 100644 --- a/types/lodash/fp/nAry.d.ts +++ b/types/lodash/fp/nAry.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Ary { - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (): Ary; - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (n: number): Ary1x1; - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (n: number, func: (...args: any[]) => any): (...args: any[]) => any; -} -interface Ary1x1 { - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (): Ary1x1; - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const nAry: Ary; +import { nAry } from "../fp"; export = nAry; diff --git a/types/lodash/fp/negate.d.ts b/types/lodash/fp/negate.d.ts index 681c5be961..a7693c1928 100644 --- a/types/lodash/fp/negate.d.ts +++ b/types/lodash/fp/negate.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Negate = - /** - * Creates a function that negates the result of the predicate func. The func predicate is invoked with - * the this binding and arguments of the created function. - * - * @param predicate The predicate to negate. - * @return Returns the new function. - */ - any>(predicate: T) => T; - -declare const negate: Negate; +import { negate } from "../fp"; export = negate; diff --git a/types/lodash/fp/noConflict.d.ts b/types/lodash/fp/noConflict.d.ts index 2b1a6c71c9..7694f5aa5a 100644 --- a/types/lodash/fp/noConflict.d.ts +++ b/types/lodash/fp/noConflict.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type NoConflict = - /** - * Reverts the _ variable to its previous value and returns a reference to the lodash function. - * - * @return Returns the lodash function. - */ - () => typeof _; - -declare const noConflict: NoConflict; +import { noConflict } from "../fp"; export = noConflict; diff --git a/types/lodash/fp/noop.d.ts b/types/lodash/fp/noop.d.ts index 29ce7267ea..5b6a27b61a 100644 --- a/types/lodash/fp/noop.d.ts +++ b/types/lodash/fp/noop.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Noop = - /** - * A no-operation function that returns undefined regardless of the arguments it receives. - * - * @return undefined - */ - (...args: any[]) => void; - -declare const noop: Noop; +import { noop } from "../fp"; export = noop; diff --git a/types/lodash/fp/now.d.ts b/types/lodash/fp/now.d.ts index d450c76116..fdbbd2bcf7 100644 --- a/types/lodash/fp/now.d.ts +++ b/types/lodash/fp/now.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Now = - /** - * Gets the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @return The number of milliseconds. - */ - () => number; - -declare const now: Now; +import { now } from "../fp"; export = now; diff --git a/types/lodash/fp/nth.d.ts b/types/lodash/fp/nth.d.ts index a1fbedb1bf..e3987e17cb 100644 --- a/types/lodash/fp/nth.d.ts +++ b/types/lodash/fp/nth.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Nth { - /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. - * - * @param array array The array to query. - * @param value The index of the element to return. - * @return Returns the nth element of `array`. - */ - (): Nth; - /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. - * - * @param array array The array to query. - * @param value The index of the element to return. - * @return Returns the nth element of `array`. - */ - (n: number): Nth1x1; - /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. - * - * @param array array The array to query. - * @param value The index of the element to return. - * @return Returns the nth element of `array`. - */ - (n: number, array: _.List | null | undefined): T | undefined; -} -interface Nth1x1 { - /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. - * - * @param array array The array to query. - * @param value The index of the element to return. - * @return Returns the nth element of `array`. - */ - (): Nth1x1; - /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. - * - * @param array array The array to query. - * @param value The index of the element to return. - * @return Returns the nth element of `array`. - */ - (array: _.List | null | undefined): T | undefined; -} - -declare const nth: Nth; +import { nth } from "../fp"; export = nth; diff --git a/types/lodash/fp/nthArg.d.ts b/types/lodash/fp/nthArg.d.ts index 5e8335943b..216c9bbab2 100644 --- a/types/lodash/fp/nthArg.d.ts +++ b/types/lodash/fp/nthArg.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type NthArg = - /** - * Creates a function that returns its nth argument. - * - * @param n The index of the argument to return. - * @return Returns the new function. - */ - (n: number) => (...args: any[]) => any; - -declare const nthArg: NthArg; +import { nthArg } from "../fp"; export = nthArg; diff --git a/types/lodash/fp/omit.d.ts b/types/lodash/fp/omit.d.ts index 5c7a553b9f..1cd1b7fcc3 100644 --- a/types/lodash/fp/omit.d.ts +++ b/types/lodash/fp/omit.d.ts @@ -1,132 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Omit { - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (): Omit; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (paths: _.PropertyPath): Omit1x1; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (paths: _.PropertyPath, object: T | null | undefined): T; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (paths: _.PropertyPath, object: T | null | undefined): _.PartialObject; -} -interface Omit1x1 { - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (): Omit1x1; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (object: T | null | undefined): T; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (object: T | null | undefined): _.PartialObject; -} - -declare const omit: Omit; +import { omit } from "../fp"; export = omit; diff --git a/types/lodash/fp/omitAll.d.ts b/types/lodash/fp/omitAll.d.ts index a3aec48c5f..dab5cfa5fc 100644 --- a/types/lodash/fp/omitAll.d.ts +++ b/types/lodash/fp/omitAll.d.ts @@ -1,132 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Omit { - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (): Omit; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (paths: _.PropertyPath): Omit1x1; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (paths: _.PropertyPath, object: T | null | undefined): T; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (paths: _.PropertyPath, object: T | null | undefined): _.PartialObject; -} -interface Omit1x1 { - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (): Omit1x1; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (object: T | null | undefined): T; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (object: T | null | undefined): _.PartialObject; -} - -declare const omitAll: Omit; +import { omitAll } from "../fp"; export = omitAll; diff --git a/types/lodash/fp/omitBy.d.ts b/types/lodash/fp/omitBy.d.ts index b0bf665afc..8be4f5b40b 100644 --- a/types/lodash/fp/omitBy.d.ts +++ b/types/lodash/fp/omitBy.d.ts @@ -1,98 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface OmitBy { - /** - * The opposite of `_.pickBy`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that `predicate` - * doesn't return truthy for. - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - (): OmitBy; - /** - * The opposite of `_.pickBy`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that `predicate` - * doesn't return truthy for. - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - (predicate: _.ValueKeyIteratee): OmitBy1x1; - /** - * The opposite of `_.pickBy`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that `predicate` - * doesn't return truthy for. - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - (predicate: _.ValueKeyIteratee, object: T | null | undefined): _.PartialObject; -} -interface OmitBy1x1 { - /** - * The opposite of `_.pickBy`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that `predicate` - * doesn't return truthy for. - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - (): OmitBy1x1; - /** - * The opposite of `_.pickBy`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that `predicate` - * doesn't return truthy for. - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - (object: T1 | null | undefined): _.PartialObject; -} - -declare const omitBy: OmitBy; +import { omitBy } from "../fp"; export = omitBy; diff --git a/types/lodash/fp/once.d.ts b/types/lodash/fp/once.d.ts index f97a08a13e..24d859cc53 100644 --- a/types/lodash/fp/once.d.ts +++ b/types/lodash/fp/once.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Once = - /** - * Creates a function that is restricted to invoking func once. Repeat calls to the function return the value - * of the first call. The func is invoked with the this binding and arguments of the created function. - * - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - any>(func: T) => T; - -declare const once: Once; +import { once } from "../fp"; export = once; diff --git a/types/lodash/fp/orderBy.d.ts b/types/lodash/fp/orderBy.d.ts index 4cf7048978..9443fcfc22 100644 --- a/types/lodash/fp/orderBy.d.ts +++ b/types/lodash/fp/orderBy.d.ts @@ -1,461 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface OrderBy { - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (): OrderBy; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<(value: T) => _.NotVoid>): OrderBy1x1; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<(value: T) => _.NotVoid>, orders: _.Many): OrderBy1x2; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<(value: T) => _.NotVoid> | _.Many<_.ValueIteratee>, orders: _.Many, collection: _.List | null | undefined): T[]; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<_.ValueIteratee>): OrderBy2x1; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<_.ValueIteratee>, orders: _.Many): OrderBy2x2; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<(value: T[keyof T]) => _.NotVoid> | _.Many<_.ValueIteratee>, orders: _.Many, collection: T | null | undefined): Array; -} -interface OrderBy1x1 { - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (): OrderBy1x1; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (orders: _.Many): OrderBy1x2; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (orders: _.Many, collection: _.List | object | null | undefined): T[]; -} -interface OrderBy1x2 { - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (): OrderBy1x2; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (collection: _.List | object | null | undefined): T[]; -} -interface OrderBy2x1 { - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (): OrderBy2x1; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (orders: _.Many): OrderBy2x2; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (orders: _.Many, collection: _.List | object | null | undefined): T[]; -} -interface OrderBy2x2 { - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (): OrderBy2x2; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (collection: _.List | object | null | undefined): T[]; -} - -declare const orderBy: OrderBy; +import { orderBy } from "../fp"; export = orderBy; diff --git a/types/lodash/fp/over.d.ts b/types/lodash/fp/over.d.ts index 4bd1803827..1bd2502fdc 100644 --- a/types/lodash/fp/over.d.ts +++ b/types/lodash/fp/over.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Over = - /** - * Creates a function that invokes iteratees with the arguments provided to the created function and returns - * their results. - * - * @param iteratees The iteratees to invoke. - * @return Returns the new function. - */ - (iteratees: _.Many<(...args: any[]) => TResult>) => (...args: any[]) => TResult[]; - -declare const over: Over; +import { over } from "../fp"; export = over; diff --git a/types/lodash/fp/overArgs.d.ts b/types/lodash/fp/overArgs.d.ts index 84241e3e58..c054c92707 100644 --- a/types/lodash/fp/overArgs.d.ts +++ b/types/lodash/fp/overArgs.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface OverArgs { - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (): OverArgs; - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (func: (...args: any[]) => any): OverArgs1x1; - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (func: (...args: any[]) => any, transforms: _.Many<(...args: any[]) => any>): (...args: any[]) => any; -} -interface OverArgs1x1 { - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (): OverArgs1x1; - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (transforms: _.Many<(...args: any[]) => any>): (...args: any[]) => any; -} - -declare const overArgs: OverArgs; +import { overArgs } from "../fp"; export = overArgs; diff --git a/types/lodash/fp/overEvery.d.ts b/types/lodash/fp/overEvery.d.ts index 3ebf8e2abf..1cf8b4061b 100644 --- a/types/lodash/fp/overEvery.d.ts +++ b/types/lodash/fp/overEvery.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type OverEvery = - /** - * Creates a function that checks if all of the predicates return truthy when invoked with the arguments - * provided to the created function. - * - * @param predicates The predicates to check. - * @return Returns the new function. - */ - (predicates: _.Many<(...args: T[]) => boolean>) => (...args: T[]) => boolean; - -declare const overEvery: OverEvery; +import { overEvery } from "../fp"; export = overEvery; diff --git a/types/lodash/fp/overSome.d.ts b/types/lodash/fp/overSome.d.ts index 75315b07d0..6b098b73b3 100644 --- a/types/lodash/fp/overSome.d.ts +++ b/types/lodash/fp/overSome.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type OverSome = - /** - * Creates a function that checks if any of the predicates return truthy when invoked with the arguments - * provided to the created function. - * - * @param predicates The predicates to check. - * @return Returns the new function. - */ - (predicates: _.Many<(...args: T[]) => boolean>) => (...args: T[]) => boolean; - -declare const overSome: OverSome; +import { overSome } from "../fp"; export = overSome; diff --git a/types/lodash/fp/pad.d.ts b/types/lodash/fp/pad.d.ts index e6581046a2..a5519771dd 100644 --- a/types/lodash/fp/pad.d.ts +++ b/types/lodash/fp/pad.d.ts @@ -1,61 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Pad { - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): Pad; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number): Pad1x1; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number, string: string): string; -} -interface Pad1x1 { - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): Pad1x1; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (string: string): string; -} - -declare const pad: Pad; +import { pad } from "../fp"; export = pad; diff --git a/types/lodash/fp/padChars.d.ts b/types/lodash/fp/padChars.d.ts index 11d797db06..74d1aabbbf 100644 --- a/types/lodash/fp/padChars.d.ts +++ b/types/lodash/fp/padChars.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Pad { - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): Pad; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string): Pad1x1; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string, length: number): Pad1x2; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string, length: number, string: string): string; -} -interface Pad1x1 { - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): Pad1x1; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number): Pad1x2; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number, string: string): string; -} -interface Pad1x2 { - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): Pad1x2; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (string: string): string; -} - -declare const padChars: Pad; +import { padChars } from "../fp"; export = padChars; diff --git a/types/lodash/fp/padCharsEnd.d.ts b/types/lodash/fp/padCharsEnd.d.ts index 01ec387810..3a468dc11f 100644 --- a/types/lodash/fp/padCharsEnd.d.ts +++ b/types/lodash/fp/padCharsEnd.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface PadEnd { - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadEnd; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string): PadEnd1x1; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string, length: number): PadEnd1x2; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string, length: number, string: string): string; -} -interface PadEnd1x1 { - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadEnd1x1; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number): PadEnd1x2; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number, string: string): string; -} -interface PadEnd1x2 { - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadEnd1x2; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (string: string): string; -} - -declare const padCharsEnd: PadEnd; +import { padCharsEnd } from "../fp"; export = padCharsEnd; diff --git a/types/lodash/fp/padCharsStart.d.ts b/types/lodash/fp/padCharsStart.d.ts index cc760b7d0a..a22523505f 100644 --- a/types/lodash/fp/padCharsStart.d.ts +++ b/types/lodash/fp/padCharsStart.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface PadStart { - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadStart; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string): PadStart1x1; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string, length: number): PadStart1x2; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string, length: number, string: string): string; -} -interface PadStart1x1 { - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadStart1x1; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number): PadStart1x2; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number, string: string): string; -} -interface PadStart1x2 { - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadStart1x2; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (string: string): string; -} - -declare const padCharsStart: PadStart; +import { padCharsStart } from "../fp"; export = padCharsStart; diff --git a/types/lodash/fp/padEnd.d.ts b/types/lodash/fp/padEnd.d.ts index aefc8b35ff..5c4e4d80ba 100644 --- a/types/lodash/fp/padEnd.d.ts +++ b/types/lodash/fp/padEnd.d.ts @@ -1,61 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface PadEnd { - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadEnd; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number): PadEnd1x1; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number, string: string): string; -} -interface PadEnd1x1 { - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadEnd1x1; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (string: string): string; -} - -declare const padEnd: PadEnd; +import { padEnd } from "../fp"; export = padEnd; diff --git a/types/lodash/fp/padStart.d.ts b/types/lodash/fp/padStart.d.ts index a40e611e8c..a4fca5d1ec 100644 --- a/types/lodash/fp/padStart.d.ts +++ b/types/lodash/fp/padStart.d.ts @@ -1,61 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface PadStart { - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadStart; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number): PadStart1x1; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number, string: string): string; -} -interface PadStart1x1 { - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadStart1x1; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (string: string): string; -} - -declare const padStart: PadStart; +import { padStart } from "../fp"; export = padStart; diff --git a/types/lodash/fp/parseInt.d.ts b/types/lodash/fp/parseInt.d.ts index b4257213bd..47aff97b71 100644 --- a/types/lodash/fp/parseInt.d.ts +++ b/types/lodash/fp/parseInt.d.ts @@ -1,66 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface ParseInt { - /** - * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used - * unless value is a hexadecimal, in which case a radix of 16 is used. - * - * Note: This method aligns with the ES5 implementation of parseInt. - * - * @param string The string to convert. - * @param radix The radix to interpret value by. - * @return Returns the converted integer. - */ - (): ParseInt; - /** - * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used - * unless value is a hexadecimal, in which case a radix of 16 is used. - * - * Note: This method aligns with the ES5 implementation of parseInt. - * - * @param string The string to convert. - * @param radix The radix to interpret value by. - * @return Returns the converted integer. - */ - (radix: number): ParseInt1x1; - /** - * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used - * unless value is a hexadecimal, in which case a radix of 16 is used. - * - * Note: This method aligns with the ES5 implementation of parseInt. - * - * @param string The string to convert. - * @param radix The radix to interpret value by. - * @return Returns the converted integer. - */ - (radix: number, string: string): number; -} -interface ParseInt1x1 { - /** - * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used - * unless value is a hexadecimal, in which case a radix of 16 is used. - * - * Note: This method aligns with the ES5 implementation of parseInt. - * - * @param string The string to convert. - * @param radix The radix to interpret value by. - * @return Returns the converted integer. - */ - (): ParseInt1x1; - /** - * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used - * unless value is a hexadecimal, in which case a radix of 16 is used. - * - * Note: This method aligns with the ES5 implementation of parseInt. - * - * @param string The string to convert. - * @param radix The radix to interpret value by. - * @return Returns the converted integer. - */ - (string: string): number; -} - -declare const parseInt: ParseInt; +import { parseInt } from "../fp"; export = parseInt; diff --git a/types/lodash/fp/partial.d.ts b/types/lodash/fp/partial.d.ts index 37c796b0b8..f5ebd726e5 100644 --- a/types/lodash/fp/partial.d.ts +++ b/types/lodash/fp/partial.d.ts @@ -1,56 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Partial { - /** - * Creates a function that, when called, invokes func with any additional partial arguments - * prepended to those provided to the new function. This method is similar to _.bind except - * it does not alter the this binding. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (): Partial; - /** - * Creates a function that, when called, invokes func with any additional partial arguments - * prepended to those provided to the new function. This method is similar to _.bind except - * it does not alter the this binding. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (args: ReadonlyArray): Partial1x1; - /** - * Creates a function that, when called, invokes func with any additional partial arguments - * prepended to those provided to the new function. This method is similar to _.bind except - * it does not alter the this binding. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (args: ReadonlyArray, func: (...args: any[]) => any): (...args: any[]) => any; -} -interface Partial1x1 { - /** - * Creates a function that, when called, invokes func with any additional partial arguments - * prepended to those provided to the new function. This method is similar to _.bind except - * it does not alter the this binding. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (): Partial1x1; - /** - * Creates a function that, when called, invokes func with any additional partial arguments - * prepended to those provided to the new function. This method is similar to _.bind except - * it does not alter the this binding. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const partial: Partial; +import { partial } from "../fp"; export = partial; diff --git a/types/lodash/fp/partialRight.d.ts b/types/lodash/fp/partialRight.d.ts index d148198d3b..bc0fa1b9c6 100644 --- a/types/lodash/fp/partialRight.d.ts +++ b/types/lodash/fp/partialRight.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface PartialRight { - /** - * This method is like _.partial except that partial arguments are appended to those provided - * to the new function. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (): PartialRight; - /** - * This method is like _.partial except that partial arguments are appended to those provided - * to the new function. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (args: ReadonlyArray): PartialRight1x1; - /** - * This method is like _.partial except that partial arguments are appended to those provided - * to the new function. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (args: ReadonlyArray, func: (...args: any[]) => any): (...args: any[]) => any; -} -interface PartialRight1x1 { - /** - * This method is like _.partial except that partial arguments are appended to those provided - * to the new function. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (): PartialRight1x1; - /** - * This method is like _.partial except that partial arguments are appended to those provided - * to the new function. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const partialRight: PartialRight; +import { partialRight } from "../fp"; export = partialRight; diff --git a/types/lodash/fp/partition.d.ts b/types/lodash/fp/partition.d.ts index 5e97fd95de..6ad41cd7db 100644 --- a/types/lodash/fp/partition.d.ts +++ b/types/lodash/fp/partition.d.ts @@ -1,133 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Partition { - /** - * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, - * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the array of grouped elements. - **/ - (): Partition; - /** - * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, - * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the array of grouped elements. - **/ - (callback: _.ValueIteratee): Partition1x1; - /** - * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, - * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the array of grouped elements. - **/ - (callback: _.ValueIteratee, collection: _.List | null | undefined): [T[], T[]]; - /** - * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, - * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the array of grouped elements. - **/ - (callback: _.ValueIteratee, collection: T | null | undefined): [Array, Array]; -} -interface Partition1x1 { - /** - * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, - * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the array of grouped elements. - **/ - (): Partition1x1; - /** - * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, - * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the array of grouped elements. - **/ - (collection: _.List | object | null | undefined): [T[], T[]]; -} - -declare const partition: Partition; +import { partition } from "../fp"; export = partition; diff --git a/types/lodash/fp/path.d.ts b/types/lodash/fp/path.d.ts index cb8b94efaf..db86d6023d 100644 --- a/types/lodash/fp/path.d.ts +++ b/types/lodash/fp/path.d.ts @@ -1,207 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Get { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey]): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary | null | undefined): T | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): any; -} -interface Get1x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject | null | undefined): TObject[TKey] | undefined; -} -interface Get3x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary | null | undefined): T | undefined; -} -interface Get5x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): any; -} - -declare const path: Get; +import { path } from "../fp"; export = path; diff --git a/types/lodash/fp/pathEq.d.ts b/types/lodash/fp/pathEq.d.ts index 569fffabf8..9f328756c3 100644 --- a/types/lodash/fp/pathEq.d.ts +++ b/types/lodash/fp/pathEq.d.ts @@ -1,90 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MatchesProperty { - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (): MatchesProperty; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath): MatchesProperty1x1; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath, srcValue: T): (value: any) => boolean; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath, srcValue: T): (value: V) => boolean; -} -interface MatchesProperty1x1 { - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (): MatchesProperty1x1; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (srcValue: T): (value: any) => boolean; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (srcValue: T): (value: V) => boolean; -} - -declare const pathEq: MatchesProperty; +import { pathEq } from "../fp"; export = pathEq; diff --git a/types/lodash/fp/pathOr.d.ts b/types/lodash/fp/pathOr.d.ts index a62252ce03..6cad6b1836 100644 --- a/types/lodash/fp/pathOr.d.ts +++ b/types/lodash/fp/pathOr.d.ts @@ -1,313 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Get { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: TKey | [TKey]): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: number): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: number, object: _.NumericDictionary | null | undefined): T | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: _.PropertyPath): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: _.PropertyPath, object: null | undefined): TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any): Get4x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any, path: _.PropertyPath): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any, path: _.PropertyPath, object: any): any; -} -interface Get1x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey]): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary | null | undefined): T | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: null | undefined): TDefault; -} -interface Get1x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject | null | undefined): TObject[TKey] | TDefault; -} -interface Get2x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary | null | undefined): T | TDefault; -} -interface Get3x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: null | undefined): TDefault; -} -interface Get4x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get4x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): any; -} -interface Get4x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): any; -} - -declare const pathOr: Get; +import { pathOr } from "../fp"; export = pathOr; diff --git a/types/lodash/fp/paths.d.ts b/types/lodash/fp/paths.d.ts index 6aa6bcb6e5..1e6eb8908f 100644 --- a/types/lodash/fp/paths.d.ts +++ b/types/lodash/fp/paths.d.ts @@ -1,96 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface At { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.PropertyPath): At1x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.PropertyPath, object: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.Many): At2x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.Many, object: T | null | undefined): Array; -} -interface At1x1 { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At1x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (object: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; -} -interface At2x1 { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At2x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (object: T | null | undefined): Array; -} - -declare const paths: At; +import { paths } from "../fp"; export = paths; diff --git a/types/lodash/fp/pick.d.ts b/types/lodash/fp/pick.d.ts index d90def9925..4772ecacc3 100644 --- a/types/lodash/fp/pick.d.ts +++ b/types/lodash/fp/pick.d.ts @@ -1,159 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface LodashPick { - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (): LodashPick; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (props: _.Many): LodashPick1x1; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (props: _.Many, object: T): Pick; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (props: _.PropertyPath): LodashPick2x1; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (props: _.PropertyPath, object: T | null | undefined): _.PartialDeep; -} -interface LodashPick1x1 { - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (): LodashPick1x1; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (object: T): Pick; -} -interface LodashPick2x1 { - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (): LodashPick2x1; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (object: T | null | undefined): _.PartialDeep; -} - -declare const pick: LodashPick; +import { pick } from "../fp"; export = pick; diff --git a/types/lodash/fp/pickAll.d.ts b/types/lodash/fp/pickAll.d.ts index 0b103c02b7..38d2e3fe2b 100644 --- a/types/lodash/fp/pickAll.d.ts +++ b/types/lodash/fp/pickAll.d.ts @@ -1,159 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface LodashPick { - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (): LodashPick; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (props: _.Many): LodashPick1x1; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (props: _.Many, object: T): Pick; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (props: _.PropertyPath): LodashPick2x1; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (props: _.PropertyPath, object: T | null | undefined): _.PartialDeep; -} -interface LodashPick1x1 { - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (): LodashPick1x1; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (object: T): Pick; -} -interface LodashPick2x1 { - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (): LodashPick2x1; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (object: T | null | undefined): _.PartialDeep; -} - -declare const pickAll: LodashPick; +import { pickAll } from "../fp"; export = pickAll; diff --git a/types/lodash/fp/pickBy.d.ts b/types/lodash/fp/pickBy.d.ts index 189084f980..0b192629e0 100644 --- a/types/lodash/fp/pickBy.d.ts +++ b/types/lodash/fp/pickBy.d.ts @@ -1,93 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface PickBy { - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - (): PickBy; - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - (predicate: _.ValueKeyIteratee): PickBy1x1; - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - (predicate: _.ValueKeyIteratee, object: T | null | undefined): _.PartialObject; -} -interface PickBy1x1 { - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - (): PickBy1x1; - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - (object: T1 | null | undefined): _.PartialObject; -} - -declare const pickBy: PickBy; +import { pickBy } from "../fp"; export = pickBy; diff --git a/types/lodash/fp/pipe.d.ts b/types/lodash/fp/pipe.d.ts index d5fae221ec..a53a04823b 100644 --- a/types/lodash/fp/pipe.d.ts +++ b/types/lodash/fp/pipe.d.ts @@ -1,355 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Flow { - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: () => R1, f2: (a: R1) => R2): () => R2; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): () => R3; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): () => R4; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): () => R5; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): () => R6; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): () => R7; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): () => any; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2): (a1: A1) => R2; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1) => R3; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1) => R4; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1) => R5; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1) => R6; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1) => R7; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1) => any; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2) => R2; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2) => R3; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2) => R4; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2) => R5; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2) => R6; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2) => R7; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1, a2: A2) => any; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3) => R2; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3) => R3; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3) => R4; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3) => R5; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3) => R6; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3) => R7; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1, a2: A2, a3: A3) => any; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1, a2: A2, a3: A3, a4: A4) => any; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any; - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (funcs: Array<_.Many<(...args: any[]) => any>>): (...args: any[]) => any; -} - -declare const pipe: Flow; +import { pipe } from "../fp"; export = pipe; diff --git a/types/lodash/fp/placeholder.d.ts b/types/lodash/fp/placeholder.d.ts new file mode 100644 index 0000000000..ddaed8ed1b --- /dev/null +++ b/types/lodash/fp/placeholder.d.ts @@ -0,0 +1,3 @@ +import _ = require("../index"); +declare const placeholder: _.__; +export = placeholder; diff --git a/types/lodash/fp/pluck.d.ts b/types/lodash/fp/pluck.d.ts index eec49c3f59..c5c916f814 100644 --- a/types/lodash/fp/pluck.d.ts +++ b/types/lodash/fp/pluck.d.ts @@ -1,588 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Map { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: (value: T) => TResult): Map1x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: (value: T) => TResult, collection: T[] | _.List | null | undefined): TResult[]; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: (value: T[keyof T]) => TResult): Map3x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: (value: T[keyof T]) => TResult, collection: T | null | undefined): TResult[]; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: K): Map4x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: K, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): Array; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: string): Map5x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: string, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): any[]; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: object): Map6x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: object, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean[]; -} -interface Map1x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map1x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: T[] | _.List | null | undefined): TResult[]; -} -interface Map3x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map3x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: T | null | undefined): TResult[]; -} -interface Map4x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map4x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): Array; -} -interface Map5x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map5x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): any[]; -} -interface Map6x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map6x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean[]; -} - -declare const pluck: Map; +import { pluck } from "../fp"; export = pluck; diff --git a/types/lodash/fp/prop.d.ts b/types/lodash/fp/prop.d.ts index c7d097d000..f2061e7d61 100644 --- a/types/lodash/fp/prop.d.ts +++ b/types/lodash/fp/prop.d.ts @@ -1,207 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Get { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey]): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary | null | undefined): T | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): any; -} -interface Get1x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject | null | undefined): TObject[TKey] | undefined; -} -interface Get3x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary | null | undefined): T | undefined; -} -interface Get5x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): any; -} - -declare const prop: Get; +import { prop } from "../fp"; export = prop; diff --git a/types/lodash/fp/propEq.d.ts b/types/lodash/fp/propEq.d.ts index 64175cc00a..5e3f4b413f 100644 --- a/types/lodash/fp/propEq.d.ts +++ b/types/lodash/fp/propEq.d.ts @@ -1,90 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MatchesProperty { - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (): MatchesProperty; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath): MatchesProperty1x1; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath, srcValue: T): (value: any) => boolean; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath, srcValue: T): (value: V) => boolean; -} -interface MatchesProperty1x1 { - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (): MatchesProperty1x1; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (srcValue: T): (value: any) => boolean; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (srcValue: T): (value: V) => boolean; -} - -declare const propEq: MatchesProperty; +import { propEq } from "../fp"; export = propEq; diff --git a/types/lodash/fp/propOr.d.ts b/types/lodash/fp/propOr.d.ts index cfe67fc51c..feabcf6e95 100644 --- a/types/lodash/fp/propOr.d.ts +++ b/types/lodash/fp/propOr.d.ts @@ -1,313 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Get { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: TKey | [TKey]): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: number): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: number, object: _.NumericDictionary | null | undefined): T | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: _.PropertyPath): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: _.PropertyPath, object: null | undefined): TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any): Get4x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any, path: _.PropertyPath): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any, path: _.PropertyPath, object: any): any; -} -interface Get1x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey]): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary | null | undefined): T | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: null | undefined): TDefault; -} -interface Get1x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject | null | undefined): TObject[TKey] | TDefault; -} -interface Get2x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary | null | undefined): T | TDefault; -} -interface Get3x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: null | undefined): TDefault; -} -interface Get4x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get4x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): any; -} -interface Get4x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): any; -} - -declare const propOr: Get; +import { propOr } from "../fp"; export = propOr; diff --git a/types/lodash/fp/property.d.ts b/types/lodash/fp/property.d.ts index 47a4285028..aaa6c25711 100644 --- a/types/lodash/fp/property.d.ts +++ b/types/lodash/fp/property.d.ts @@ -1,207 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Get { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey]): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary | null | undefined): T | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): any; -} -interface Get1x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject | null | undefined): TObject[TKey] | undefined; -} -interface Get3x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary | null | undefined): T | undefined; -} -interface Get5x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): any; -} - -declare const property: Get; +import { property } from "../fp"; export = property; diff --git a/types/lodash/fp/propertyOf.d.ts b/types/lodash/fp/propertyOf.d.ts index 66e2afdaf8..a4d55130c6 100644 --- a/types/lodash/fp/propertyOf.d.ts +++ b/types/lodash/fp/propertyOf.d.ts @@ -1,207 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Get { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey]): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary | null | undefined): T | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): any; -} -interface Get1x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject | null | undefined): TObject[TKey] | undefined; -} -interface Get3x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary | null | undefined): T | undefined; -} -interface Get5x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): any; -} - -declare const propertyOf: Get; +import { propertyOf } from "../fp"; export = propertyOf; diff --git a/types/lodash/fp/props.d.ts b/types/lodash/fp/props.d.ts index 2b22346229..46addba7ad 100644 --- a/types/lodash/fp/props.d.ts +++ b/types/lodash/fp/props.d.ts @@ -1,96 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface At { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.PropertyPath): At1x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.PropertyPath, object: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.Many): At2x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.Many, object: T | null | undefined): Array; -} -interface At1x1 { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At1x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (object: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; -} -interface At2x1 { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At2x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (object: T | null | undefined): Array; -} - -declare const props: At; +import { props } from "../fp"; export = props; diff --git a/types/lodash/fp/pull.d.ts b/types/lodash/fp/pull.d.ts index 3ae9a76b4c..801cf33771 100644 --- a/types/lodash/fp/pull.d.ts +++ b/types/lodash/fp/pull.d.ts @@ -1,83 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Pull { - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - (): Pull; - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - (values: T): Pull1x1; - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - (values: T, array: ReadonlyArray): T[]; - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - (values: T, array: _.List): _.List; -} -interface Pull1x1 { - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - (): Pull1x1; - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - (array: ReadonlyArray): T[]; - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - (array: _.List): _.List; -} - -declare const pull: Pull; +import { pull } from "../fp"; export = pull; diff --git a/types/lodash/fp/pullAll.d.ts b/types/lodash/fp/pullAll.d.ts index 6df0d3fbe6..042fe89ac1 100644 --- a/types/lodash/fp/pullAll.d.ts +++ b/types/lodash/fp/pullAll.d.ts @@ -1,139 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface PullAll { - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - (): PullAll; - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - (values: _.List): PullAll1x1; - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - (values: _.List, array: ReadonlyArray): T[]; - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - (values: _.List, array: _.List): _.List; -} -interface PullAll1x1 { - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - (): PullAll1x1; - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - (array: ReadonlyArray): T[]; - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - (array: _.List): _.List; -} - -declare const pullAll: PullAll; +import { pullAll } from "../fp"; export = pullAll; diff --git a/types/lodash/fp/pullAllBy.d.ts b/types/lodash/fp/pullAllBy.d.ts index 05a528de2d..5e5de1fc07 100644 --- a/types/lodash/fp/pullAllBy.d.ts +++ b/types/lodash/fp/pullAllBy.d.ts @@ -1,502 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface PullAllBy { - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (): PullAllBy; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee): PullAllBy1x1; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, values: _.List): PullAllBy1x2; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, values: _.List, array: ReadonlyArray): T[]; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, values: _.List, array: _.List): _.List; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee): PullAllBy3x1; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, values: _.List): PullAllBy3x2; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, values: _.List, array: ReadonlyArray): T1[]; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, values: _.List, array: _.List): _.List; -} -interface PullAllBy1x1 { - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (): PullAllBy1x1; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (values: _.List): PullAllBy1x2; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (values: _.List, array: ReadonlyArray): T[]; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (values: _.List, array: _.List): _.List; -} -interface PullAllBy1x2 { - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (): PullAllBy1x2; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (array: ReadonlyArray): T[]; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (array: _.List): _.List; -} -interface PullAllBy3x1 { - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (): PullAllBy3x1; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (values: _.List): PullAllBy3x2; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (values: _.List, array: ReadonlyArray): T1[]; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (values: _.List, array: _.List): _.List; -} -interface PullAllBy3x2 { - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (): PullAllBy3x2; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (array: ReadonlyArray): T1[]; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (array: _.List): _.List; -} - -declare const pullAllBy: PullAllBy; +import { pullAllBy } from "../fp"; export = pullAllBy; diff --git a/types/lodash/fp/pullAllWith.d.ts b/types/lodash/fp/pullAllWith.d.ts index 566eb5ae84..0c448bf8c8 100644 --- a/types/lodash/fp/pullAllWith.d.ts +++ b/types/lodash/fp/pullAllWith.d.ts @@ -1,502 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface PullAllWith { - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (): PullAllWith; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (comparator: _.Comparator): PullAllWith1x1; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (comparator: _.Comparator, values: _.List): PullAllWith1x2; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (comparator: _.Comparator, values: _.List, array: ReadonlyArray): T[]; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (comparator: _.Comparator, values: _.List, array: _.List): _.List; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (comparator: _.Comparator2): PullAllWith3x1; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (comparator: _.Comparator2, values: _.List): PullAllWith3x2; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (comparator: _.Comparator2, values: _.List, array: ReadonlyArray): T1[]; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (comparator: _.Comparator2, values: _.List, array: _.List): _.List; -} -interface PullAllWith1x1 { - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (): PullAllWith1x1; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (values: _.List): PullAllWith1x2; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (values: _.List, array: ReadonlyArray): T[]; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (values: _.List, array: _.List): _.List; -} -interface PullAllWith1x2 { - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (): PullAllWith1x2; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (array: ReadonlyArray): T[]; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (array: _.List): _.List; -} -interface PullAllWith3x1 { - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (): PullAllWith3x1; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (values: _.List): PullAllWith3x2; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (values: _.List, array: ReadonlyArray): T1[]; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (values: _.List, array: _.List): _.List; -} -interface PullAllWith3x2 { - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (): PullAllWith3x2; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (array: ReadonlyArray): T1[]; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (array: _.List): _.List; -} - -declare const pullAllWith: PullAllWith; +import { pullAllWith } from "../fp"; export = pullAllWith; diff --git a/types/lodash/fp/pullAt.d.ts b/types/lodash/fp/pullAt.d.ts index 61d6fd04f0..4bdffd993f 100644 --- a/types/lodash/fp/pullAt.d.ts +++ b/types/lodash/fp/pullAt.d.ts @@ -1,90 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface PullAt { - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - (): PullAt; - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - (indexes: _.Many): PullAt1x1; - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - (indexes: _.Many, array: ReadonlyArray): T[]; - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - (indexes: _.Many, array: _.List): _.List; -} -interface PullAt1x1 { - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - (): PullAt1x1; - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - (array: ReadonlyArray): T[]; - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - (array: _.List): _.List; -} - -declare const pullAt: PullAt; +import { pullAt } from "../fp"; export = pullAt; diff --git a/types/lodash/fp/random.d.ts b/types/lodash/fp/random.d.ts index 075b54b2e4..a69555ca16 100644 --- a/types/lodash/fp/random.d.ts +++ b/types/lodash/fp/random.d.ts @@ -1,66 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Random { - /** - * Produces a random number between min and max (inclusive). If only one argument is provided a number between - * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point - * number is returned instead of an integer. - * - * @param min The minimum possible value. - * @param max The maximum possible value. - * @param floating Specify returning a floating-point number. - * @return Returns the random number. - */ - (): Random; - /** - * Produces a random number between min and max (inclusive). If only one argument is provided a number between - * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point - * number is returned instead of an integer. - * - * @param min The minimum possible value. - * @param max The maximum possible value. - * @param floating Specify returning a floating-point number. - * @return Returns the random number. - */ - (maxOrMin: number): Random1x1; - /** - * Produces a random number between min and max (inclusive). If only one argument is provided a number between - * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point - * number is returned instead of an integer. - * - * @param min The minimum possible value. - * @param max The maximum possible value. - * @param floating Specify returning a floating-point number. - * @return Returns the random number. - */ - (maxOrMin: number, floatingOrMax: boolean | number): number; -} -interface Random1x1 { - /** - * Produces a random number between min and max (inclusive). If only one argument is provided a number between - * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point - * number is returned instead of an integer. - * - * @param min The minimum possible value. - * @param max The maximum possible value. - * @param floating Specify returning a floating-point number. - * @return Returns the random number. - */ - (): Random1x1; - /** - * Produces a random number between min and max (inclusive). If only one argument is provided a number between - * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point - * number is returned instead of an integer. - * - * @param min The minimum possible value. - * @param max The maximum possible value. - * @param floating Specify returning a floating-point number. - * @return Returns the random number. - */ - (floatingOrMax: boolean | number): number; -} - -declare const random: Random; +import { random } from "../fp"; export = random; diff --git a/types/lodash/fp/range.d.ts b/types/lodash/fp/range.d.ts index 7526d40e03..ace50ce46b 100644 --- a/types/lodash/fp/range.d.ts +++ b/types/lodash/fp/range.d.ts @@ -1,66 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Range { - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (): Range; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (start: number): Range1x1; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (start: number, end: number): number[]; -} -interface Range1x1 { - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (): Range1x1; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (end: number): number[]; -} - -declare const range: Range; +import { range } from "../fp"; export = range; diff --git a/types/lodash/fp/rangeRight.d.ts b/types/lodash/fp/rangeRight.d.ts index 89337d055a..20c8baefaa 100644 --- a/types/lodash/fp/rangeRight.d.ts +++ b/types/lodash/fp/rangeRight.d.ts @@ -1,176 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface RangeRight { - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (): RangeRight; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (start: number): RangeRight1x1; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (start: number, end: number): number[]; -} -interface RangeRight1x1 { - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (): RangeRight1x1; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (end: number): number[]; -} - -declare const rangeRight: RangeRight; +import { rangeRight } from "../fp"; export = rangeRight; diff --git a/types/lodash/fp/rangeStep.d.ts b/types/lodash/fp/rangeStep.d.ts index 1bd70ebf55..e5f4c891ce 100644 --- a/types/lodash/fp/rangeStep.d.ts +++ b/types/lodash/fp/rangeStep.d.ts @@ -1,112 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Range { - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (): Range; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (start: number): Range1x1; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (start: number, end: number): Range1x2; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (start: number, end: number, step: number): number[]; -} -interface Range1x1 { - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (): Range1x1; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (end: number): Range1x2; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (end: number, step: number): number[]; -} -interface Range1x2 { - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (): Range1x2; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (step: number): number[]; -} - -declare const rangeStep: Range; +import { rangeStep } from "../fp"; export = rangeStep; diff --git a/types/lodash/fp/rangeStepRight.d.ts b/types/lodash/fp/rangeStepRight.d.ts index dcc223f569..6c7add468d 100644 --- a/types/lodash/fp/rangeStepRight.d.ts +++ b/types/lodash/fp/rangeStepRight.d.ts @@ -1,310 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface RangeRight { - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (): RangeRight; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (start: number): RangeRight1x1; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (start: number, end: number): RangeRight1x2; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (start: number, end: number, step: number): number[]; -} -interface RangeRight1x1 { - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (): RangeRight1x1; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (end: number): RangeRight1x2; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (end: number, step: number): number[]; -} -interface RangeRight1x2 { - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (): RangeRight1x2; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (step: number): number[]; -} - -declare const rangeStepRight: RangeRight; +import { rangeStepRight } from "../fp"; export = rangeStepRight; diff --git a/types/lodash/fp/rearg.d.ts b/types/lodash/fp/rearg.d.ts index 9ff0dbccfb..5c407d13a4 100644 --- a/types/lodash/fp/rearg.d.ts +++ b/types/lodash/fp/rearg.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Rearg { - /** - * Creates a function that invokes func with arguments arranged according to the specified indexes where the - * argument value at the first index is provided as the first argument, the argument value at the second index - * is provided as the second argument, and so on. - * @param func The function to rearrange arguments for. - * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. - * @return Returns the new function. - */ - (): Rearg; - /** - * Creates a function that invokes func with arguments arranged according to the specified indexes where the - * argument value at the first index is provided as the first argument, the argument value at the second index - * is provided as the second argument, and so on. - * @param func The function to rearrange arguments for. - * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. - * @return Returns the new function. - */ - (indexes: _.Many): Rearg1x1; - /** - * Creates a function that invokes func with arguments arranged according to the specified indexes where the - * argument value at the first index is provided as the first argument, the argument value at the second index - * is provided as the second argument, and so on. - * @param func The function to rearrange arguments for. - * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. - * @return Returns the new function. - */ - (indexes: _.Many, func: (...args: any[]) => any): (...args: any[]) => any; -} -interface Rearg1x1 { - /** - * Creates a function that invokes func with arguments arranged according to the specified indexes where the - * argument value at the first index is provided as the first argument, the argument value at the second index - * is provided as the second argument, and so on. - * @param func The function to rearrange arguments for. - * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. - * @return Returns the new function. - */ - (): Rearg1x1; - /** - * Creates a function that invokes func with arguments arranged according to the specified indexes where the - * argument value at the first index is provided as the first argument, the argument value at the second index - * is provided as the second argument, and so on. - * @param func The function to rearrange arguments for. - * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. - * @return Returns the new function. - */ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const rearg: Rearg; +import { rearg } from "../fp"; export = rearg; diff --git a/types/lodash/fp/reduce.d.ts b/types/lodash/fp/reduce.d.ts index 70071a64e3..e262f39370 100644 --- a/types/lodash/fp/reduce.d.ts +++ b/types/lodash/fp/reduce.d.ts @@ -1,223 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Reduce { - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (): Reduce; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (callback: _.MemoIteratorCapped): Reduce1x1; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (callback: _.MemoIteratorCapped, accumulator: TResult): Reduce1x2; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (callback: _.MemoIteratorCapped, accumulator: TResult, collection: T[] | _.List | null | undefined): TResult; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (callback: _.MemoIteratorCapped): Reduce3x1; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (callback: _.MemoIteratorCapped, accumulator: TResult): Reduce3x2; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (callback: _.MemoIteratorCapped, accumulator: TResult, collection: T | null | undefined): TResult; -} -interface Reduce1x1 { - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (): Reduce1x1; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (accumulator: TResult): Reduce1x2; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (accumulator: TResult, collection: T[] | _.List | null | undefined): TResult; -} -interface Reduce1x2 { - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (): Reduce1x2; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (collection: T[] | _.List | null | undefined): TResult; -} -interface Reduce3x1 { - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (): Reduce3x1; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (accumulator: TResult): Reduce3x2; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (accumulator: TResult, collection: T | null | undefined): TResult; -} -interface Reduce3x2 { - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (): Reduce3x2; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (collection: T | null | undefined): TResult; -} - -declare const reduce: Reduce; +import { reduce } from "../fp"; export = reduce; diff --git a/types/lodash/fp/reduceRight.d.ts b/types/lodash/fp/reduceRight.d.ts index 0c8813aa01..fa54fa3a5e 100644 --- a/types/lodash/fp/reduceRight.d.ts +++ b/types/lodash/fp/reduceRight.d.ts @@ -1,172 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ReduceRight { - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (): ReduceRight; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (callback: _.MemoIteratorCappedRight): ReduceRight1x1; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (callback: _.MemoIteratorCappedRight, accumulator: TResult): ReduceRight1x2; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (callback: _.MemoIteratorCappedRight, accumulator: TResult, collection: T[] | _.List | null | undefined): TResult; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (callback: _.MemoIteratorCappedRight): ReduceRight3x1; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (callback: _.MemoIteratorCappedRight, accumulator: TResult): ReduceRight3x2; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (callback: _.MemoIteratorCappedRight, accumulator: TResult, collection: T | null | undefined): TResult; -} -interface ReduceRight1x1 { - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (): ReduceRight1x1; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (accumulator: TResult): ReduceRight1x2; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (accumulator: TResult, collection: T[] | _.List | null | undefined): TResult; -} -interface ReduceRight1x2 { - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (): ReduceRight1x2; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (collection: T[] | _.List | null | undefined): TResult; -} -interface ReduceRight3x1 { - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (): ReduceRight3x1; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (accumulator: TResult): ReduceRight3x2; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (accumulator: TResult, collection: T | null | undefined): TResult; -} -interface ReduceRight3x2 { - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (): ReduceRight3x2; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (collection: T | null | undefined): TResult; -} - -declare const reduceRight: ReduceRight; +import { reduceRight } from "../fp"; export = reduceRight; diff --git a/types/lodash/fp/reject.d.ts b/types/lodash/fp/reject.d.ts index 74a93c3783..d0a12af963 100644 --- a/types/lodash/fp/reject.d.ts +++ b/types/lodash/fp/reject.d.ts @@ -1,115 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Reject { - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (): Reject; - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: (value: string) => boolean): Reject1x1; - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: (value: string) => boolean, collection: string | null | undefined): string[]; - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIterateeCustom): Reject2x1; - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIterateeCustom, collection: _.List | null | undefined): T[]; - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIterateeCustom, collection: T | null | undefined): Array; -} -interface Reject1x1 { - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (): Reject1x1; - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (collection: string | null | undefined): string[]; -} -interface Reject2x1 { - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (): Reject2x1; - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (collection: _.List | object | null | undefined): T[]; -} - -declare const reject: Reject; +import { reject } from "../fp"; export = reject; diff --git a/types/lodash/fp/remove.d.ts b/types/lodash/fp/remove.d.ts index 51ac8aecf8..e0da9b147c 100644 --- a/types/lodash/fp/remove.d.ts +++ b/types/lodash/fp/remove.d.ts @@ -1,118 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Remove { - /** - * Removes all elements from array that predicate returns truthy for and returns an array of the removed - * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Note: Unlike _.filter, this method mutates array. - * - * @param array The array to modify. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new array of removed elements. - */ - (): Remove; - /** - * Removes all elements from array that predicate returns truthy for and returns an array of the removed - * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Note: Unlike _.filter, this method mutates array. - * - * @param array The array to modify. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new array of removed elements. - */ - (predicate: _.ValueIteratee): Remove1x1; - /** - * Removes all elements from array that predicate returns truthy for and returns an array of the removed - * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Note: Unlike _.filter, this method mutates array. - * - * @param array The array to modify. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new array of removed elements. - */ - (predicate: _.ValueIteratee, array: _.List): T[]; -} -interface Remove1x1 { - /** - * Removes all elements from array that predicate returns truthy for and returns an array of the removed - * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Note: Unlike _.filter, this method mutates array. - * - * @param array The array to modify. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new array of removed elements. - */ - (): Remove1x1; - /** - * Removes all elements from array that predicate returns truthy for and returns an array of the removed - * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Note: Unlike _.filter, this method mutates array. - * - * @param array The array to modify. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new array of removed elements. - */ - (array: _.List): T[]; -} - -declare const remove: Remove; +import { remove } from "../fp"; export = remove; diff --git a/types/lodash/fp/repeat.d.ts b/types/lodash/fp/repeat.d.ts index 4ba7cd4e17..1f757a2778 100644 --- a/types/lodash/fp/repeat.d.ts +++ b/types/lodash/fp/repeat.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Repeat { - /** - * Repeats the given string n times. - * - * @param string The string to repeat. - * @param n The number of times to repeat the string. - * @return Returns the repeated string. - */ - (): Repeat; - /** - * Repeats the given string n times. - * - * @param string The string to repeat. - * @param n The number of times to repeat the string. - * @return Returns the repeated string. - */ - (n: number): Repeat1x1; - /** - * Repeats the given string n times. - * - * @param string The string to repeat. - * @param n The number of times to repeat the string. - * @return Returns the repeated string. - */ - (n: number, string: string): string; -} -interface Repeat1x1 { - /** - * Repeats the given string n times. - * - * @param string The string to repeat. - * @param n The number of times to repeat the string. - * @return Returns the repeated string. - */ - (): Repeat1x1; - /** - * Repeats the given string n times. - * - * @param string The string to repeat. - * @param n The number of times to repeat the string. - * @return Returns the repeated string. - */ - (string: string): string; -} - -declare const repeat: Repeat; +import { repeat } from "../fp"; export = repeat; diff --git a/types/lodash/fp/replace.d.ts b/types/lodash/fp/replace.d.ts index 18e76a4388..c7a75d1fa1 100644 --- a/types/lodash/fp/replace.d.ts +++ b/types/lodash/fp/replace.d.ts @@ -1,87 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Replace { - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (): Replace; - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (pattern: RegExp | string): Replace1x1; - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (pattern: RegExp | string, replacement: _.ReplaceFunction | string): Replace1x2; - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (pattern: RegExp | string, replacement: _.ReplaceFunction | string, string: string): string; -} -interface Replace1x1 { - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (): Replace1x1; - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (replacement: _.ReplaceFunction | string): Replace1x2; - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (replacement: _.ReplaceFunction | string, string: string): string; -} -interface Replace1x2 { - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (): Replace1x2; - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (string: string): string; -} - -declare const replace: Replace; +import { replace } from "../fp"; export = replace; diff --git a/types/lodash/fp/rest.d.ts b/types/lodash/fp/rest.d.ts index b92f5adb85..b059d673e1 100644 --- a/types/lodash/fp/rest.d.ts +++ b/types/lodash/fp/rest.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Rest = - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - (func: (...args: any[]) => any) => (...args: any[]) => any; - -declare const rest: Rest; +import { rest } from "../fp"; export = rest; diff --git a/types/lodash/fp/restFrom.d.ts b/types/lodash/fp/restFrom.d.ts index 3ca5389f0e..218edbd5a3 100644 --- a/types/lodash/fp/restFrom.d.ts +++ b/types/lodash/fp/restFrom.d.ts @@ -1,66 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Rest { - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - (): Rest; - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - (start: number): Rest1x1; - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - (start: number, func: (...args: any[]) => any): (...args: any[]) => any; -} -interface Rest1x1 { - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - (): Rest1x1; - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const restFrom: Rest; +import { restFrom } from "../fp"; export = restFrom; diff --git a/types/lodash/fp/result.d.ts b/types/lodash/fp/result.d.ts index de99d91ff9..5a919dd455 100644 --- a/types/lodash/fp/result.d.ts +++ b/types/lodash/fp/result.d.ts @@ -1,63 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Result { - /** - * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding - * of its parent object and its result is returned. - * - * @param object The object to query. - * @param path The path of the property to resolve. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Result; - /** - * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding - * of its parent object and its result is returned. - * - * @param object The object to query. - * @param path The path of the property to resolve. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Result1x1; - /** - * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding - * of its parent object and its result is returned. - * - * @param object The object to query. - * @param path The path of the property to resolve. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): TResult; -} -interface Result1x1 { - /** - * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding - * of its parent object and its result is returned. - * - * @param object The object to query. - * @param path The path of the property to resolve. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Result1x1; - /** - * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding - * of its parent object and its result is returned. - * - * @param object The object to query. - * @param path The path of the property to resolve. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): TResult; -} - -declare const result: Result; +import { result } from "../fp"; export = result; diff --git a/types/lodash/fp/reverse.d.ts b/types/lodash/fp/reverse.d.ts index 5aa826c5eb..f754d6aac6 100644 --- a/types/lodash/fp/reverse.d.ts +++ b/types/lodash/fp/reverse.d.ts @@ -1,30 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Reverse = - /** - * Reverses `array` so that the first element becomes the last, the second - * element becomes the second to last, and so on. - * - * **Note:** This method mutates `array` and is based on - * [`Array#reverse`](https://mdn.io/Array/reverse). - * - * @category Array - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.reverse(array); - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - >(array: TList) => TList; - -declare const reverse: Reverse; +import { reverse } from "../fp"; export = reverse; diff --git a/types/lodash/fp/round.d.ts b/types/lodash/fp/round.d.ts index 359693f99e..02f4e6f300 100644 --- a/types/lodash/fp/round.d.ts +++ b/types/lodash/fp/round.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Round = - /** - * Calculates n rounded to precision. - * - * @param n The number to round. - * @param precision The precision to round to. - * @return Returns the rounded number. - */ - (n: number) => number; - -declare const round: Round; +import { round } from "../fp"; export = round; diff --git a/types/lodash/fp/runInContext.d.ts b/types/lodash/fp/runInContext.d.ts index a09369abec..6041db7053 100644 --- a/types/lodash/fp/runInContext.d.ts +++ b/types/lodash/fp/runInContext.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type RunInContext = - /** - * Create a new pristine lodash function using the given context object. - * - * @param context The context object. - * @return Returns a new lodash function. - */ - (context: object) => typeof _; - -declare const runInContext: RunInContext; +import { runInContext } from "../fp"; export = runInContext; diff --git a/types/lodash/fp/sample.d.ts b/types/lodash/fp/sample.d.ts index 3ba7c5b6e2..f2fcf1ac03 100644 --- a/types/lodash/fp/sample.d.ts +++ b/types/lodash/fp/sample.d.ts @@ -1,25 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Sample { - /** - * Gets a random element from collection. - * - * @param collection The collection to sample. - * @return Returns the random element. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T | undefined; - /** - * Gets a random element from collection. - * - * @param collection The collection to sample. - * @return Returns the random element. - */ - (collection: T | null | undefined): T[keyof T] | undefined; -} - -declare const sample: Sample; +import { sample } from "../fp"; export = sample; diff --git a/types/lodash/fp/sampleSize.d.ts b/types/lodash/fp/sampleSize.d.ts index 17ec045353..41a3cabf92 100644 --- a/types/lodash/fp/sampleSize.d.ts +++ b/types/lodash/fp/sampleSize.d.ts @@ -1,69 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SampleSize { - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - (): SampleSize; - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - (n: number): SampleSize1x1; - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - (n: number, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - (n: number, collection: T | null | undefined): Array; -} -interface SampleSize1x1 { - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - (): SampleSize1x1; - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - (collection: T | null | undefined): Array; -} - -declare const sampleSize: SampleSize; +import { sampleSize } from "../fp"; export = sampleSize; diff --git a/types/lodash/fp/set.d.ts b/types/lodash/fp/set.d.ts index ea13605dcc..57960cba78 100644 --- a/types/lodash/fp/set.d.ts +++ b/types/lodash/fp/set.d.ts @@ -1,147 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Set { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath): Set1x1; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any, object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any, object: object): TResult; -} -interface Set1x1 { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set1x1; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any, object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any, object: object): TResult; -} -interface Set1x2 { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (object: object): TResult; -} - -declare const set: Set; +import { set } from "../fp"; export = set; diff --git a/types/lodash/fp/setWith.d.ts b/types/lodash/fp/setWith.d.ts index d26b1a88a1..800a49429c 100644 --- a/types/lodash/fp/setWith.d.ts +++ b/types/lodash/fp/setWith.d.ts @@ -1,233 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SetWith { - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (): SetWith; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (customizer: _.SetWithCustomizer): SetWith1x1; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (customizer: _.SetWithCustomizer, path: _.PropertyPath): SetWith1x2; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (customizer: _.SetWithCustomizer, path: _.PropertyPath, value: any): SetWith1x3; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (customizer: _.SetWithCustomizer, path: _.PropertyPath, value: any, object: T): T; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (customizer: _.SetWithCustomizer, path: _.PropertyPath, value: any, object: T): TResult; -} -interface SetWith1x1 { - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (): SetWith1x1; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (path: _.PropertyPath): SetWith1x2; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (path: _.PropertyPath, value: any): SetWith1x3; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (path: _.PropertyPath, value: any, object: T): T; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (path: _.PropertyPath, value: any, object: T): TResult; -} -interface SetWith1x2 { - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (): SetWith1x2; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (value: any): SetWith1x3; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (value: any, object: T): T; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (value: any, object: T): TResult; -} -interface SetWith1x3 { - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (): SetWith1x3; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (object: T): T; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (object: T): TResult; -} - -declare const setWith: SetWith; +import { setWith } from "../fp"; export = setWith; diff --git a/types/lodash/fp/shuffle.d.ts b/types/lodash/fp/shuffle.d.ts index b49c3d10dc..7f07282642 100644 --- a/types/lodash/fp/shuffle.d.ts +++ b/types/lodash/fp/shuffle.d.ts @@ -1,25 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Shuffle { - /** - * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. - * - * @param collection The collection to shuffle. - * @return Returns the new shuffled array. - */ - (collection: _.List | null | undefined): T[]; - /** - * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. - * - * @param collection The collection to shuffle. - * @return Returns the new shuffled array. - */ - (collection: T | null | undefined): Array; -} - -declare const shuffle: Shuffle; +import { shuffle } from "../fp"; export = shuffle; diff --git a/types/lodash/fp/size.d.ts b/types/lodash/fp/size.d.ts index cf4ca2d03b..657c8b7c20 100644 --- a/types/lodash/fp/size.d.ts +++ b/types/lodash/fp/size.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Size = - /** - * Gets the size of collection by returning its length for array-like values or the number of own enumerable - * properties for objects. - * - * @param collection The collection to inspect. - * @return Returns the size of collection. - */ - (collection: object | string | null | undefined) => number; - -declare const size: Size; +import { size } from "../fp"; export = size; diff --git a/types/lodash/fp/slice.d.ts b/types/lodash/fp/slice.d.ts index e602154fa1..fabbbe0eeb 100644 --- a/types/lodash/fp/slice.d.ts +++ b/types/lodash/fp/slice.d.ts @@ -1,96 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Slice { - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (): Slice; - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (start: number): Slice1x1; - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (start: number, end: number): Slice1x2; - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (start: number, end: number, array: _.List | null | undefined): T[]; -} -interface Slice1x1 { - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (): Slice1x1; - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (end: number): Slice1x2; - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (end: number, array: _.List | null | undefined): T[]; -} -interface Slice1x2 { - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (): Slice1x2; - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const slice: Slice; +import { slice } from "../fp"; export = slice; diff --git a/types/lodash/fp/snakeCase.d.ts b/types/lodash/fp/snakeCase.d.ts index ef35bad608..a06ac452fe 100644 --- a/types/lodash/fp/snakeCase.d.ts +++ b/types/lodash/fp/snakeCase.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type SnakeCase = - /** - * Converts string to snake case. - * - * @param string The string to convert. - * @return Returns the snake cased string. - */ - (string: string) => string; - -declare const snakeCase: SnakeCase; +import { snakeCase } from "../fp"; export = snakeCase; diff --git a/types/lodash/fp/some.d.ts b/types/lodash/fp/some.d.ts index f554e380c5..870b23160d 100644 --- a/types/lodash/fp/some.d.ts +++ b/types/lodash/fp/some.d.ts @@ -1,67 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Some { - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (): Some; - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom): Some1x1; - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom, collection: _.List | null | undefined): boolean; - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom, collection: T | null | undefined): boolean; -} -interface Some1x1 { - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (): Some1x1; - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (collection: _.List | object | null | undefined): boolean; -} - -declare const some: Some; +import { some } from "../fp"; export = some; diff --git a/types/lodash/fp/sortBy.d.ts b/types/lodash/fp/sortBy.d.ts index 3b0a1c128c..72c5799b36 100644 --- a/types/lodash/fp/sortBy.d.ts +++ b/types/lodash/fp/sortBy.d.ts @@ -1,205 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SortBy { - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (): SortBy; - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<_.ValueIteratee>): SortBy1x1; - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<_.ValueIteratee>, collection: _.List | null | undefined): T[]; - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<_.ValueIteratee>, collection: T | null | undefined): Array; -} -interface SortBy1x1 { - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (): SortBy1x1; - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (collection: _.List | object | null | undefined): T[]; -} - -declare const sortBy: SortBy; +import { sortBy } from "../fp"; export = sortBy; diff --git a/types/lodash/fp/sortedIndex.d.ts b/types/lodash/fp/sortedIndex.d.ts index c230bd6858..35b57feed2 100644 --- a/types/lodash/fp/sortedIndex.d.ts +++ b/types/lodash/fp/sortedIndex.d.ts @@ -1,98 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SortedIndex { - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 5], 4); - * // => 0 - */ - (): SortedIndex; - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 5], 4); - * // => 0 - */ - (value: T): SortedIndex1x1; - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 5], 4); - * // => 0 - */ - (value: T, array: _.List | null | undefined): number; -} -interface SortedIndex1x1 { - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 5], 4); - * // => 0 - */ - (): SortedIndex1x1; - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 5], 4); - * // => 0 - */ - (array: _.List | null | undefined): number; -} - -declare const sortedIndex: SortedIndex; +import { sortedIndex } from "../fp"; export = sortedIndex; diff --git a/types/lodash/fp/sortedIndexBy.d.ts b/types/lodash/fp/sortedIndexBy.d.ts index 02a1ffbae6..f6968df691 100644 --- a/types/lodash/fp/sortedIndexBy.d.ts +++ b/types/lodash/fp/sortedIndexBy.d.ts @@ -1,213 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SortedIndexBy { - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (): SortedIndexBy; - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (iteratee: _.ValueIteratee): SortedIndexBy1x1; - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (iteratee: _.ValueIteratee, value: T): SortedIndexBy1x2; - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (iteratee: _.ValueIteratee, value: T, array: _.List | null | undefined): number; -} -interface SortedIndexBy1x1 { - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (): SortedIndexBy1x1; - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (value: T): SortedIndexBy1x2; - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (value: T, array: _.List | null | undefined): number; -} -interface SortedIndexBy1x2 { - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (): SortedIndexBy1x2; - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (array: _.List | null | undefined): number; -} - -declare const sortedIndexBy: SortedIndexBy; +import { sortedIndexBy } from "../fp"; export = sortedIndexBy; diff --git a/types/lodash/fp/sortedIndexOf.d.ts b/types/lodash/fp/sortedIndexOf.d.ts index 0b9f5503ab..beeb6db0ca 100644 --- a/types/lodash/fp/sortedIndexOf.d.ts +++ b/types/lodash/fp/sortedIndexOf.d.ts @@ -1,83 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SortedIndexOf { - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([1, 1, 2, 2], 2); - * // => 2 - */ - (): SortedIndexOf; - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([1, 1, 2, 2], 2); - * // => 2 - */ - (value: T): SortedIndexOf1x1; - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([1, 1, 2, 2], 2); - * // => 2 - */ - (value: T, array: _.List | null | undefined): number; -} -interface SortedIndexOf1x1 { - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([1, 1, 2, 2], 2); - * // => 2 - */ - (): SortedIndexOf1x1; - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([1, 1, 2, 2], 2); - * // => 2 - */ - (array: _.List | null | undefined): number; -} - -declare const sortedIndexOf: SortedIndexOf; +import { sortedIndexOf } from "../fp"; export = sortedIndexOf; diff --git a/types/lodash/fp/sortedLastIndex.d.ts b/types/lodash/fp/sortedLastIndex.d.ts index 26b45fe1df..eea77a0382 100644 --- a/types/lodash/fp/sortedLastIndex.d.ts +++ b/types/lodash/fp/sortedLastIndex.d.ts @@ -1,88 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SortedLastIndex { - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedLastIndex([4, 5], 4); - * // => 1 - */ - (): SortedLastIndex; - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedLastIndex([4, 5], 4); - * // => 1 - */ - (value: T): SortedLastIndex1x1; - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedLastIndex([4, 5], 4); - * // => 1 - */ - (value: T, array: _.List | null | undefined): number; -} -interface SortedLastIndex1x1 { - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedLastIndex([4, 5], 4); - * // => 1 - */ - (): SortedLastIndex1x1; - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedLastIndex([4, 5], 4); - * // => 1 - */ - (array: _.List | null | undefined): number; -} - -declare const sortedLastIndex: SortedLastIndex; +import { sortedLastIndex } from "../fp"; export = sortedLastIndex; diff --git a/types/lodash/fp/sortedLastIndexBy.d.ts b/types/lodash/fp/sortedLastIndexBy.d.ts index 6f00b9c982..6c8e4ee545 100644 --- a/types/lodash/fp/sortedLastIndexBy.d.ts +++ b/types/lodash/fp/sortedLastIndexBy.d.ts @@ -1,168 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SortedLastIndexBy { - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (): SortedLastIndexBy; - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (iteratee: _.ValueIteratee): SortedLastIndexBy1x1; - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (iteratee: _.ValueIteratee, value: T): SortedLastIndexBy1x2; - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (iteratee: _.ValueIteratee, value: T, array: _.List | null | undefined): number; -} -interface SortedLastIndexBy1x1 { - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (): SortedLastIndexBy1x1; - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (value: T): SortedLastIndexBy1x2; - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (value: T, array: _.List | null | undefined): number; -} -interface SortedLastIndexBy1x2 { - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (): SortedLastIndexBy1x2; - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (array: _.List | null | undefined): number; -} - -declare const sortedLastIndexBy: SortedLastIndexBy; +import { sortedLastIndexBy } from "../fp"; export = sortedLastIndexBy; diff --git a/types/lodash/fp/sortedLastIndexOf.d.ts b/types/lodash/fp/sortedLastIndexOf.d.ts index 3fb6d2d77b..a02caf3ce5 100644 --- a/types/lodash/fp/sortedLastIndexOf.d.ts +++ b/types/lodash/fp/sortedLastIndexOf.d.ts @@ -1,83 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SortedLastIndexOf { - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([1, 1, 2, 2], 2); - * // => 3 - */ - (): SortedLastIndexOf; - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([1, 1, 2, 2], 2); - * // => 3 - */ - (value: T): SortedLastIndexOf1x1; - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([1, 1, 2, 2], 2); - * // => 3 - */ - (value: T, array: _.List | null | undefined): number; -} -interface SortedLastIndexOf1x1 { - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([1, 1, 2, 2], 2); - * // => 3 - */ - (): SortedLastIndexOf1x1; - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([1, 1, 2, 2], 2); - * // => 3 - */ - (array: _.List | null | undefined): number; -} - -declare const sortedLastIndexOf: SortedLastIndexOf; +import { sortedLastIndexOf } from "../fp"; export = sortedLastIndexOf; diff --git a/types/lodash/fp/sortedUniq.d.ts b/types/lodash/fp/sortedUniq.d.ts index ae5c6a826b..03d8e691e0 100644 --- a/types/lodash/fp/sortedUniq.d.ts +++ b/types/lodash/fp/sortedUniq.d.ts @@ -1,23 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type SortedUniq = - /** - * This method is like `_.uniq` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniq([1, 1, 2]); - * // => [1, 2] - */ - (array: _.List | null | undefined) => T[]; - -declare const sortedUniq: SortedUniq; +import { sortedUniq } from "../fp"; export = sortedUniq; diff --git a/types/lodash/fp/sortedUniqBy.d.ts b/types/lodash/fp/sortedUniqBy.d.ts index 9300e80b75..466981a264 100644 --- a/types/lodash/fp/sortedUniqBy.d.ts +++ b/types/lodash/fp/sortedUniqBy.d.ts @@ -1,141 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SortedUniqBy { - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (): SortedUniqBy; - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (iteratee: (value: string) => _.NotVoid): SortedUniqBy1x1; - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (iteratee: (value: string) => _.NotVoid, array: string | null | undefined): string[]; - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (iteratee: _.ValueIteratee): SortedUniqBy2x1; - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (iteratee: _.ValueIteratee, array: _.List | null | undefined): T[]; -} -interface SortedUniqBy1x1 { - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (): SortedUniqBy1x1; - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (array: string | null | undefined): string[]; -} -interface SortedUniqBy2x1 { - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (): SortedUniqBy2x1; - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (array: _.List | null | undefined): T[]; -} - -declare const sortedUniqBy: SortedUniqBy; +import { sortedUniqBy } from "../fp"; export = sortedUniqBy; diff --git a/types/lodash/fp/split.d.ts b/types/lodash/fp/split.d.ts index 50ad820360..8274d4081f 100644 --- a/types/lodash/fp/split.d.ts +++ b/types/lodash/fp/split.d.ts @@ -1,66 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Split { - /** - * Splits string by separator. - * - * Note: This method is based on String#split. - * - * @param string The string to trim. - * @param separator The separator pattern to split by. - * @param limit The length to truncate results to. - * @return Returns the new array of string segments. - */ - (): Split; - /** - * Splits string by separator. - * - * Note: This method is based on String#split. - * - * @param string The string to trim. - * @param separator The separator pattern to split by. - * @param limit The length to truncate results to. - * @return Returns the new array of string segments. - */ - (separator: RegExp|string): Split1x1; - /** - * Splits string by separator. - * - * Note: This method is based on String#split. - * - * @param string The string to trim. - * @param separator The separator pattern to split by. - * @param limit The length to truncate results to. - * @return Returns the new array of string segments. - */ - (separator: RegExp|string, string: string): string[]; -} -interface Split1x1 { - /** - * Splits string by separator. - * - * Note: This method is based on String#split. - * - * @param string The string to trim. - * @param separator The separator pattern to split by. - * @param limit The length to truncate results to. - * @return Returns the new array of string segments. - */ - (): Split1x1; - /** - * Splits string by separator. - * - * Note: This method is based on String#split. - * - * @param string The string to trim. - * @param separator The separator pattern to split by. - * @param limit The length to truncate results to. - * @return Returns the new array of string segments. - */ - (string: string): string[]; -} - -declare const split: Split; +import { split } from "../fp"; export = split; diff --git a/types/lodash/fp/spread.d.ts b/types/lodash/fp/spread.d.ts index 197c49278d..44eb90cd21 100644 --- a/types/lodash/fp/spread.d.ts +++ b/types/lodash/fp/spread.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Spread = - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - (func: (...args: any[]) => TResult) => (...args: any[]) => TResult; - -declare const spread: Spread; +import { spread } from "../fp"; export = spread; diff --git a/types/lodash/fp/spreadFrom.d.ts b/types/lodash/fp/spreadFrom.d.ts index 7ac31bc9fe..7eb840b036 100644 --- a/types/lodash/fp/spreadFrom.d.ts +++ b/types/lodash/fp/spreadFrom.d.ts @@ -1,61 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Spread { - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - (): Spread; - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - (start: number): Spread1x1; - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - (start: number, func: (...args: any[]) => TResult): (...args: any[]) => TResult; -} -interface Spread1x1 { - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - (): Spread1x1; - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - (func: (...args: any[]) => TResult): (...args: any[]) => TResult; -} - -declare const spreadFrom: Spread; +import { spreadFrom } from "../fp"; export = spreadFrom; diff --git a/types/lodash/fp/startCase.d.ts b/types/lodash/fp/startCase.d.ts index ca27b6b47f..4f580aa5d0 100644 --- a/types/lodash/fp/startCase.d.ts +++ b/types/lodash/fp/startCase.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type StartCase = - /** - * Converts string to start case. - * - * @param string The string to convert. - * @return Returns the start cased string. - */ - (string: string) => string; - -declare const startCase: StartCase; +import { startCase } from "../fp"; export = startCase; diff --git a/types/lodash/fp/startsWith.d.ts b/types/lodash/fp/startsWith.d.ts index 962f880742..f84397dc68 100644 --- a/types/lodash/fp/startsWith.d.ts +++ b/types/lodash/fp/startsWith.d.ts @@ -1,56 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface StartsWith { - /** - * Checks if string starts with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string starts with target, else false. - */ - (): StartsWith; - /** - * Checks if string starts with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string starts with target, else false. - */ - (target: string): StartsWith1x1; - /** - * Checks if string starts with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string starts with target, else false. - */ - (target: string, string: string): boolean; -} -interface StartsWith1x1 { - /** - * Checks if string starts with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string starts with target, else false. - */ - (): StartsWith1x1; - /** - * Checks if string starts with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string starts with target, else false. - */ - (string: string): boolean; -} - -declare const startsWith: StartsWith; +import { startsWith } from "../fp"; export = startsWith; diff --git a/types/lodash/fp/stubArray.d.ts b/types/lodash/fp/stubArray.d.ts index 1dd9667827..8ff910e591 100644 --- a/types/lodash/fp/stubArray.d.ts +++ b/types/lodash/fp/stubArray.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type StubArray = - /** - * This method returns a new empty array. - * - * @returns Returns the new empty array. - */ - () => any[]; - -declare const stubArray: StubArray; +import { stubArray } from "../fp"; export = stubArray; diff --git a/types/lodash/fp/stubFalse.d.ts b/types/lodash/fp/stubFalse.d.ts index abea160b5f..4cc041482d 100644 --- a/types/lodash/fp/stubFalse.d.ts +++ b/types/lodash/fp/stubFalse.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type StubFalse = - /** - * This method returns `false`. - * - * @returns Returns `false`. - */ - () => boolean; - -declare const stubFalse: StubFalse; +import { stubFalse } from "../fp"; export = stubFalse; diff --git a/types/lodash/fp/stubObject.d.ts b/types/lodash/fp/stubObject.d.ts index 6765c18b5a..d7c826997f 100644 --- a/types/lodash/fp/stubObject.d.ts +++ b/types/lodash/fp/stubObject.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type StubObject = - /** - * This method returns a new empty object. - * - * @returns Returns the new empty object. - */ - () => any; - -declare const stubObject: StubObject; +import { stubObject } from "../fp"; export = stubObject; diff --git a/types/lodash/fp/stubString.d.ts b/types/lodash/fp/stubString.d.ts index 66da9843e9..cbfa449758 100644 --- a/types/lodash/fp/stubString.d.ts +++ b/types/lodash/fp/stubString.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type StubString = - /** - * This method returns an empty string. - * - * @returns Returns the empty string. - */ - () => string; - -declare const stubString: StubString; +import { stubString } from "../fp"; export = stubString; diff --git a/types/lodash/fp/stubTrue.d.ts b/types/lodash/fp/stubTrue.d.ts index 25cba4fcde..0ed7e5b927 100644 --- a/types/lodash/fp/stubTrue.d.ts +++ b/types/lodash/fp/stubTrue.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type StubTrue = - /** - * This method returns `true`. - * - * @returns Returns `true`. - */ - () => boolean; - -declare const stubTrue: StubTrue; +import { stubTrue } from "../fp"; export = stubTrue; diff --git a/types/lodash/fp/subtract.d.ts b/types/lodash/fp/subtract.d.ts index b19ddb1f7e..201301b300 100644 --- a/types/lodash/fp/subtract.d.ts +++ b/types/lodash/fp/subtract.d.ts @@ -1,76 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Subtract { - /** - * Subtract two numbers. - * - * @category Math - * @param minuend The first number in a subtraction. - * @param subtrahend The second number in a subtraction. - * @returns Returns the difference. - * @example - * - * _.subtract(6, 4); - * // => 2 - */ - (): Subtract; - /** - * Subtract two numbers. - * - * @category Math - * @param minuend The first number in a subtraction. - * @param subtrahend The second number in a subtraction. - * @returns Returns the difference. - * @example - * - * _.subtract(6, 4); - * // => 2 - */ - (minuend: number): Subtract1x1; - /** - * Subtract two numbers. - * - * @category Math - * @param minuend The first number in a subtraction. - * @param subtrahend The second number in a subtraction. - * @returns Returns the difference. - * @example - * - * _.subtract(6, 4); - * // => 2 - */ - (minuend: number, subtrahend: number): number; -} -interface Subtract1x1 { - /** - * Subtract two numbers. - * - * @category Math - * @param minuend The first number in a subtraction. - * @param subtrahend The second number in a subtraction. - * @returns Returns the difference. - * @example - * - * _.subtract(6, 4); - * // => 2 - */ - (): Subtract1x1; - /** - * Subtract two numbers. - * - * @category Math - * @param minuend The first number in a subtraction. - * @param subtrahend The second number in a subtraction. - * @returns Returns the difference. - * @example - * - * _.subtract(6, 4); - * // => 2 - */ - (subtrahend: number): number; -} - -declare const subtract: Subtract; +import { subtract } from "../fp"; export = subtract; diff --git a/types/lodash/fp/sum.d.ts b/types/lodash/fp/sum.d.ts index 84f6849067..6d7d02026e 100644 --- a/types/lodash/fp/sum.d.ts +++ b/types/lodash/fp/sum.d.ts @@ -1,22 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Sum = - /** - * Computes the sum of the values in `array`. - * - * @category Math - * @param array The array to iterate over. - * @returns Returns the sum. - * @example - * - * _.sum([4, 2, 8, 6]); - * // => 20 - */ - (collection: _.List | null | undefined) => number; - -declare const sum: Sum; +import { sum } from "../fp"; export = sum; diff --git a/types/lodash/fp/sumBy.d.ts b/types/lodash/fp/sumBy.d.ts index 93d6be33f7..3f44c3f6c5 100644 --- a/types/lodash/fp/sumBy.d.ts +++ b/types/lodash/fp/sumBy.d.ts @@ -1,118 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SumBy { - /** - * This method is like `_.sum` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the value to be summed. - * The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the sum. - * @example - * - * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; - * - * _.sumBy(objects, function(o) { return o.n; }); - * // => 20 - * - * // using the `_.property` iteratee shorthand - * _.sumBy(objects, 'n'); - * // => 20 - */ - (): SumBy; - /** - * This method is like `_.sum` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the value to be summed. - * The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the sum. - * @example - * - * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; - * - * _.sumBy(objects, function(o) { return o.n; }); - * // => 20 - * - * // using the `_.property` iteratee shorthand - * _.sumBy(objects, 'n'); - * // => 20 - */ - (iteratee: ((value: T) => number) | string): SumBy1x1; - /** - * This method is like `_.sum` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the value to be summed. - * The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the sum. - * @example - * - * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; - * - * _.sumBy(objects, function(o) { return o.n; }); - * // => 20 - * - * // using the `_.property` iteratee shorthand - * _.sumBy(objects, 'n'); - * // => 20 - */ - (iteratee: ((value: T) => number) | string, collection: _.List | null | undefined): number; -} -interface SumBy1x1 { - /** - * This method is like `_.sum` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the value to be summed. - * The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the sum. - * @example - * - * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; - * - * _.sumBy(objects, function(o) { return o.n; }); - * // => 20 - * - * // using the `_.property` iteratee shorthand - * _.sumBy(objects, 'n'); - * // => 20 - */ - (): SumBy1x1; - /** - * This method is like `_.sum` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the value to be summed. - * The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the sum. - * @example - * - * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; - * - * _.sumBy(objects, function(o) { return o.n; }); - * // => 20 - * - * // using the `_.property` iteratee shorthand - * _.sumBy(objects, 'n'); - * // => 20 - */ - (collection: _.List | null | undefined): number; -} - -declare const sumBy: SumBy; +import { sumBy } from "../fp"; export = sumBy; diff --git a/types/lodash/fp/symmetricDifference.d.ts b/types/lodash/fp/symmetricDifference.d.ts index 8d09e4f1a3..cba1d1f70d 100644 --- a/types/lodash/fp/symmetricDifference.d.ts +++ b/types/lodash/fp/symmetricDifference.d.ts @@ -1,48 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Xor { - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (): Xor; - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (arrays2: _.List | null | undefined): Xor1x1; - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (arrays2: _.List | null | undefined, arrays: _.List | null | undefined): T[]; -} -interface Xor1x1 { - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (): Xor1x1; - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (arrays: _.List | null | undefined): T[]; -} - -declare const symmetricDifference: Xor; +import { symmetricDifference } from "../fp"; export = symmetricDifference; diff --git a/types/lodash/fp/symmetricDifferenceBy.d.ts b/types/lodash/fp/symmetricDifferenceBy.d.ts index 1bfeb6c6cd..8e9316cf42 100644 --- a/types/lodash/fp/symmetricDifferenceBy.d.ts +++ b/types/lodash/fp/symmetricDifferenceBy.d.ts @@ -1,186 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface XorBy { - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (): XorBy; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee): XorBy1x1; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, arrays: _.List | null | undefined): XorBy1x2; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface XorBy1x1 { - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (): XorBy1x1; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (arrays: _.List | null | undefined): XorBy1x2; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface XorBy1x2 { - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (): XorBy1x2; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (arrays2: _.List | null | undefined): T[]; -} - -declare const symmetricDifferenceBy: XorBy; +import { symmetricDifferenceBy } from "../fp"; export = symmetricDifferenceBy; diff --git a/types/lodash/fp/symmetricDifferenceWith.d.ts b/types/lodash/fp/symmetricDifferenceWith.d.ts index 0aa1d417fb..864ec01b50 100644 --- a/types/lodash/fp/symmetricDifferenceWith.d.ts +++ b/types/lodash/fp/symmetricDifferenceWith.d.ts @@ -1,177 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface XorWith { - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): XorWith; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator): XorWith1x1; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator, arrays: _.List | null | undefined): XorWith1x2; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator, arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface XorWith1x1 { - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): XorWith1x1; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays: _.List | null | undefined): XorWith1x2; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface XorWith1x2 { - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): XorWith1x2; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays2: _.List | null | undefined): T[]; -} - -declare const symmetricDifferenceWith: XorWith; +import { symmetricDifferenceWith } from "../fp"; export = symmetricDifferenceWith; diff --git a/types/lodash/fp/tail.d.ts b/types/lodash/fp/tail.d.ts index 1f4e5baea5..df9bcdcd57 100644 --- a/types/lodash/fp/tail.d.ts +++ b/types/lodash/fp/tail.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Tail = - /** - * Gets all but the first element of array. - * - * @param array The array to query. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined) => T[]; - -declare const tail: Tail; +import { tail } from "../fp"; export = tail; diff --git a/types/lodash/fp/take.d.ts b/types/lodash/fp/take.d.ts index 8c64452d27..ab46aca056 100644 --- a/types/lodash/fp/take.d.ts +++ b/types/lodash/fp/take.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Take { - /** - * Creates a slice of array with n elements taken from the beginning. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (): Take; - /** - * Creates a slice of array with n elements taken from the beginning. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (n: number): Take1x1; - /** - * Creates a slice of array with n elements taken from the beginning. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (n: number, array: _.List | null | undefined): T[]; -} -interface Take1x1 { - /** - * Creates a slice of array with n elements taken from the beginning. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (): Take1x1; - /** - * Creates a slice of array with n elements taken from the beginning. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const take: Take; +import { take } from "../fp"; export = take; diff --git a/types/lodash/fp/takeLast.d.ts b/types/lodash/fp/takeLast.d.ts index 6677d06e16..027dcda5ee 100644 --- a/types/lodash/fp/takeLast.d.ts +++ b/types/lodash/fp/takeLast.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface TakeRight { - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (): TakeRight; - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (n: number): TakeRight1x1; - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (n: number, array: _.List | null | undefined): T[]; -} -interface TakeRight1x1 { - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (): TakeRight1x1; - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const takeLast: TakeRight; +import { takeLast } from "../fp"; export = takeLast; diff --git a/types/lodash/fp/takeLastWhile.d.ts b/types/lodash/fp/takeLastWhile.d.ts index 4e2cd0a933..c6729c3529 100644 --- a/types/lodash/fp/takeLastWhile.d.ts +++ b/types/lodash/fp/takeLastWhile.d.ts @@ -1,108 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface TakeRightWhile { - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): TakeRightWhile; - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee): TakeRightWhile1x1; - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee, array: _.List | null | undefined): T[]; -} -interface TakeRightWhile1x1 { - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): TakeRightWhile1x1; - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const takeLastWhile: TakeRightWhile; +import { takeLastWhile } from "../fp"; export = takeLastWhile; diff --git a/types/lodash/fp/takeRight.d.ts b/types/lodash/fp/takeRight.d.ts index 385f447919..162c5166e4 100644 --- a/types/lodash/fp/takeRight.d.ts +++ b/types/lodash/fp/takeRight.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface TakeRight { - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (): TakeRight; - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (n: number): TakeRight1x1; - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (n: number, array: _.List | null | undefined): T[]; -} -interface TakeRight1x1 { - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (): TakeRight1x1; - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const takeRight: TakeRight; +import { takeRight } from "../fp"; export = takeRight; diff --git a/types/lodash/fp/takeRightWhile.d.ts b/types/lodash/fp/takeRightWhile.d.ts index b2a8934a14..b23f7a4608 100644 --- a/types/lodash/fp/takeRightWhile.d.ts +++ b/types/lodash/fp/takeRightWhile.d.ts @@ -1,108 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface TakeRightWhile { - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): TakeRightWhile; - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee): TakeRightWhile1x1; - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee, array: _.List | null | undefined): T[]; -} -interface TakeRightWhile1x1 { - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): TakeRightWhile1x1; - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const takeRightWhile: TakeRightWhile; +import { takeRightWhile } from "../fp"; export = takeRightWhile; diff --git a/types/lodash/fp/takeWhile.d.ts b/types/lodash/fp/takeWhile.d.ts index 3082de833b..b8cb517606 100644 --- a/types/lodash/fp/takeWhile.d.ts +++ b/types/lodash/fp/takeWhile.d.ts @@ -1,108 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface TakeWhile { - /** - * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): TakeWhile; - /** - * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee): TakeWhile1x1; - /** - * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee, array: _.List | null | undefined): T[]; -} -interface TakeWhile1x1 { - /** - * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): TakeWhile1x1; - /** - * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const takeWhile: TakeWhile; +import { takeWhile } from "../fp"; export = takeWhile; diff --git a/types/lodash/fp/tap.d.ts b/types/lodash/fp/tap.d.ts index 2091f9301a..8ffbbd7f23 100644 --- a/types/lodash/fp/tap.d.ts +++ b/types/lodash/fp/tap.d.ts @@ -1,66 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Tap { - /** - * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one - * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @parem thisArg The this binding of interceptor. - * @return Returns value. - **/ - (): Tap; - /** - * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one - * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @parem thisArg The this binding of interceptor. - * @return Returns value. - **/ - (interceptor: (value: T) => void): Tap1x1; - /** - * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one - * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @parem thisArg The this binding of interceptor. - * @return Returns value. - **/ - (interceptor: (value: T) => void, value: T): T; -} -interface Tap1x1 { - /** - * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one - * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @parem thisArg The this binding of interceptor. - * @return Returns value. - **/ - (): Tap1x1; - /** - * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one - * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @parem thisArg The this binding of interceptor. - * @return Returns value. - **/ - (value: T): T; -} - -declare const tap: Tap; +import { tap } from "../fp"; export = tap; diff --git a/types/lodash/fp/template.d.ts b/types/lodash/fp/template.d.ts index f913171374..3a37ed1af7 100644 --- a/types/lodash/fp/template.d.ts +++ b/types/lodash/fp/template.d.ts @@ -1,37 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Template = - /** - * Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, - * HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate" - * delimiters. Data properties may be accessed as free variables in the template. If a setting object is - * provided it takes precedence over _.templateSettings values. - * - * Note: In the development build _.template utilizes - * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier - * debugging. - * - * For more information on precompiling templates see - * [lodash's custom builds documentation](https://lodash.com/custom-builds). - * - * For more information on Chrome extension sandboxes see - * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). - * - * @param string The template string. - * @param options The options object. - * @param options.escape The HTML "escape" delimiter. - * @param options.evaluate The "evaluate" delimiter. - * @param options.imports An object to import into the template as free variables. - * @param options.interpolate The "interpolate" delimiter. - * @param options.sourceURL The sourceURL of the template's compiled source. - * @param options.variable The data object variable name. - * @return Returns the compiled template function. - */ - (string: string) => _.TemplateExecutor; - -declare const template: Template; +import { template } from "../fp"; export = template; diff --git a/types/lodash/fp/throttle.d.ts b/types/lodash/fp/throttle.d.ts index 7644c669e4..24d8b7f4ef 100644 --- a/types/lodash/fp/throttle.d.ts +++ b/types/lodash/fp/throttle.d.ts @@ -1,98 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Throttle { - /** - * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled - * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke - * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge - * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if - * the the throttled function is invoked more than once during the wait timeout. - * - * @param func The function to throttle. - * @param wait The number of milliseconds to throttle invocations to. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new throttled function. - */ - (): Throttle; - /** - * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled - * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke - * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge - * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if - * the the throttled function is invoked more than once during the wait timeout. - * - * @param func The function to throttle. - * @param wait The number of milliseconds to throttle invocations to. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new throttled function. - */ - (wait: number): Throttle1x1; - /** - * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled - * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke - * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge - * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if - * the the throttled function is invoked more than once during the wait timeout. - * - * @param func The function to throttle. - * @param wait The number of milliseconds to throttle invocations to. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new throttled function. - */ - any>(wait: number, func: T): T & _.Cancelable; -} -interface Throttle1x1 { - /** - * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled - * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke - * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge - * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if - * the the throttled function is invoked more than once during the wait timeout. - * - * @param func The function to throttle. - * @param wait The number of milliseconds to throttle invocations to. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new throttled function. - */ - (): Throttle1x1; - /** - * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled - * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke - * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge - * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if - * the the throttled function is invoked more than once during the wait timeout. - * - * @param func The function to throttle. - * @param wait The number of milliseconds to throttle invocations to. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new throttled function. - */ - any>(func: T): T & _.Cancelable; -} - -declare const throttle: Throttle; +import { throttle } from "../fp"; export = throttle; diff --git a/types/lodash/fp/thru.d.ts b/types/lodash/fp/thru.d.ts index d7f60ba8d0..b9725820ad 100644 --- a/types/lodash/fp/thru.d.ts +++ b/types/lodash/fp/thru.d.ts @@ -1,56 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Thru { - /** - * This method is like _.tap except that it returns the result of interceptor. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @param thisArg The this binding of interceptor. - * @return Returns the result of interceptor. - */ - (): Thru; - /** - * This method is like _.tap except that it returns the result of interceptor. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @param thisArg The this binding of interceptor. - * @return Returns the result of interceptor. - */ - (interceptor: (value: T) => TResult): Thru1x1; - /** - * This method is like _.tap except that it returns the result of interceptor. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @param thisArg The this binding of interceptor. - * @return Returns the result of interceptor. - */ - (interceptor: (value: T) => TResult, value: T): TResult; -} -interface Thru1x1 { - /** - * This method is like _.tap except that it returns the result of interceptor. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @param thisArg The this binding of interceptor. - * @return Returns the result of interceptor. - */ - (): Thru1x1; - /** - * This method is like _.tap except that it returns the result of interceptor. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @param thisArg The this binding of interceptor. - * @return Returns the result of interceptor. - */ - (value: T): TResult; -} - -declare const thru: Thru; +import { thru } from "../fp"; export = thru; diff --git a/types/lodash/fp/times.d.ts b/types/lodash/fp/times.d.ts index 777f7423fc..3d9f0c6077 100644 --- a/types/lodash/fp/times.d.ts +++ b/types/lodash/fp/times.d.ts @@ -1,56 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Times { - /** - * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee - * is invoked with one argument; (index). - * - * @param n The number of times to invoke iteratee. - * @param iteratee The function invoked per iteration. - * @return Returns the array of results. - */ - (): Times; - /** - * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee - * is invoked with one argument; (index). - * - * @param n The number of times to invoke iteratee. - * @param iteratee The function invoked per iteration. - * @return Returns the array of results. - */ - (iteratee: (num: number) => TResult): Times1x1; - /** - * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee - * is invoked with one argument; (index). - * - * @param n The number of times to invoke iteratee. - * @param iteratee The function invoked per iteration. - * @return Returns the array of results. - */ - (iteratee: (num: number) => TResult, n: number): TResult[]; -} -interface Times1x1 { - /** - * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee - * is invoked with one argument; (index). - * - * @param n The number of times to invoke iteratee. - * @param iteratee The function invoked per iteration. - * @return Returns the array of results. - */ - (): Times1x1; - /** - * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee - * is invoked with one argument; (index). - * - * @param n The number of times to invoke iteratee. - * @param iteratee The function invoked per iteration. - * @return Returns the array of results. - */ - (n: number): TResult[]; -} - -declare const times: Times; +import { times } from "../fp"; export = times; diff --git a/types/lodash/fp/toArray.d.ts b/types/lodash/fp/toArray.d.ts index 78d50b3fe3..4b18ce6d55 100644 --- a/types/lodash/fp/toArray.d.ts +++ b/types/lodash/fp/toArray.d.ts @@ -1,32 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ToArray { - /** - * Converts value to an array. - * - * @param value The value to convert. - * @return Returns the converted array. - */ - (value: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; - /** - * Converts value to an array. - * - * @param value The value to convert. - * @return Returns the converted array. - */ - (value: T): Array; - /** - * Converts value to an array. - * - * @param value The value to convert. - * @return Returns the converted array. - */ - (): any[]; -} - -declare const toArray: ToArray; +import { toArray } from "../fp"; export = toArray; diff --git a/types/lodash/fp/toFinite.d.ts b/types/lodash/fp/toFinite.d.ts index 7f28cb70da..1d41996182 100644 --- a/types/lodash/fp/toFinite.d.ts +++ b/types/lodash/fp/toFinite.d.ts @@ -1,30 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToFinite = - /** - * Converts `value` to a finite number. - * - * @since 4.12.0 - * @category Lang - * @param value The value to convert. - * @returns Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ - (value: any) => number; - -declare const toFinite: ToFinite; +import { toFinite } from "../fp"; export = toFinite; diff --git a/types/lodash/fp/toInteger.d.ts b/types/lodash/fp/toInteger.d.ts index 7eb32253d7..46ccaf945b 100644 --- a/types/lodash/fp/toInteger.d.ts +++ b/types/lodash/fp/toInteger.d.ts @@ -1,31 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToInteger = - /** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @category Lang - * @param value The value to convert. - * @returns Returns the converted integer. - * @example - * - * _.toInteger(3); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3'); - * // => 3 - */ - (value: any) => number; - -declare const toInteger: ToInteger; +import { toInteger } from "../fp"; export = toInteger; diff --git a/types/lodash/fp/toLength.d.ts b/types/lodash/fp/toLength.d.ts index 9df6af979b..bb62924318 100644 --- a/types/lodash/fp/toLength.d.ts +++ b/types/lodash/fp/toLength.d.ts @@ -1,32 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToLength = - /** - * Converts `value` to an integer suitable for use as the length of an - * array-like object. - * - * **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @category Lang - * @param value The value to convert. - * @return Returns the converted integer. - * @example - * - * _.toLength(3); - * // => 3 - * - * _.toLength(Number.MIN_VALUE); - * // => 0 - * - * _.toLength(Infinity); - * // => 4294967295 - * - * _.toLength('3'); - * // => 3 - */ - (value: any) => number; - -declare const toLength: ToLength; +import { toLength } from "../fp"; export = toLength; diff --git a/types/lodash/fp/toLower.d.ts b/types/lodash/fp/toLower.d.ts index 6423a579b2..64e6e364d0 100644 --- a/types/lodash/fp/toLower.d.ts +++ b/types/lodash/fp/toLower.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToLower = - /** - * Converts `string`, as a whole, to lower case. - * - * @param string The string to convert. - * @return Returns the lower cased string. - */ - (string: string) => string; - -declare const toLower: ToLower; +import { toLower } from "../fp"; export = toLower; diff --git a/types/lodash/fp/toNumber.d.ts b/types/lodash/fp/toNumber.d.ts index 346ded8778..262b91c52d 100644 --- a/types/lodash/fp/toNumber.d.ts +++ b/types/lodash/fp/toNumber.d.ts @@ -1,29 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToNumber = - /** - * Converts `value` to a number. - * - * @category Lang - * @param value The value to process. - * @returns Returns the number. - * @example - * - * _.toNumber(3); - * // => 3 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3'); - * // => 3 - */ - (value: any) => number; - -declare const toNumber: ToNumber; +import { toNumber } from "../fp"; export = toNumber; diff --git a/types/lodash/fp/toPairs.d.ts b/types/lodash/fp/toPairs.d.ts index 4097690ac8..89334fcb5d 100644 --- a/types/lodash/fp/toPairs.d.ts +++ b/types/lodash/fp/toPairs.d.ts @@ -1,25 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ToPairs { - /** - * Creates an array of own enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - (object: _.Dictionary | _.NumericDictionary): Array<[string, T]>; - /** - * Creates an array of own enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - (object: object): Array<[string, any]>; -} - -declare const toPairs: ToPairs; +import { toPairs } from "../fp"; export = toPairs; diff --git a/types/lodash/fp/toPairsIn.d.ts b/types/lodash/fp/toPairsIn.d.ts index 80859cc318..278ff0b1df 100644 --- a/types/lodash/fp/toPairsIn.d.ts +++ b/types/lodash/fp/toPairsIn.d.ts @@ -1,25 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ToPairsIn { - /** - * Creates an array of own and inherited enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - (object: _.Dictionary | _.NumericDictionary): Array<[string, T]>; - /** - * Creates an array of own and inherited enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - (object: object): Array<[string, any]>; -} - -declare const toPairsIn: ToPairsIn; +import { toPairsIn } from "../fp"; export = toPairsIn; diff --git a/types/lodash/fp/toPath.d.ts b/types/lodash/fp/toPath.d.ts index a501811e14..9f2287ceae 100644 --- a/types/lodash/fp/toPath.d.ts +++ b/types/lodash/fp/toPath.d.ts @@ -1,32 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToPath = - /** - * Converts `value` to a property path array. - * - * @category Util - * @param value The value to convert. - * @returns Returns the new property path array. - * @example - * - * _.toPath('a.b.c'); - * // => ['a', 'b', 'c'] - * - * _.toPath('a[0].b.c'); - * // => ['a', '0', 'b', 'c'] - * - * var path = ['a', 'b', 'c'], - * newPath = _.toPath(path); - * - * console.log(newPath); - * // => ['a', 'b', 'c'] - * - * console.log(path === newPath); - * // => false - */ - (value: any) => string[]; - -declare const toPath: ToPath; +import { toPath } from "../fp"; export = toPath; diff --git a/types/lodash/fp/toPlainObject.d.ts b/types/lodash/fp/toPlainObject.d.ts index 18b2eada62..22fa070387 100644 --- a/types/lodash/fp/toPlainObject.d.ts +++ b/types/lodash/fp/toPlainObject.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToPlainObject = - /** - * Converts value to a plain object flattening inherited enumerable properties of value to own properties - * of the plain object. - * - * @param value The value to convert. - * @return Returns the converted plain object. - */ - (value: any) => any; - -declare const toPlainObject: ToPlainObject; +import { toPlainObject } from "../fp"; export = toPlainObject; diff --git a/types/lodash/fp/toSafeInteger.d.ts b/types/lodash/fp/toSafeInteger.d.ts index 9ddc6a79a1..2f85078fcb 100644 --- a/types/lodash/fp/toSafeInteger.d.ts +++ b/types/lodash/fp/toSafeInteger.d.ts @@ -1,30 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToSafeInteger = - /** - * Converts `value` to a safe integer. A safe integer can be compared and - * represented correctly. - * - * @category Lang - * @param value The value to convert. - * @returns Returns the converted integer. - * @example - * - * _.toSafeInteger(3); - * // => 3 - * - * _.toSafeInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toSafeInteger(Infinity); - * // => 9007199254740991 - * - * _.toSafeInteger('3'); - * // => 3 - */ - (value: any) => number; - -declare const toSafeInteger: ToSafeInteger; +import { toSafeInteger } from "../fp"; export = toSafeInteger; diff --git a/types/lodash/fp/toString.d.ts b/types/lodash/fp/toString.d.ts index 0dcf51fecf..ee6703c068 100644 --- a/types/lodash/fp/toString.d.ts +++ b/types/lodash/fp/toString.d.ts @@ -1,27 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToString = - /** - * Converts `value` to a string if it's not one. An empty string is returned - * for `null` and `undefined` values. The sign of `-0` is preserved. - * - * @category Lang - * @param value The value to process. - * @returns Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - (value: any) => string; - -declare const toString: ToString; +import { toString } from "../fp"; export = toString; diff --git a/types/lodash/fp/toUpper.d.ts b/types/lodash/fp/toUpper.d.ts index af46b1dba8..6bf21c1fce 100644 --- a/types/lodash/fp/toUpper.d.ts +++ b/types/lodash/fp/toUpper.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToUpper = - /** - * Converts `string`, as a whole, to upper case. - * - * @param string The string to convert. - * @return Returns the upper cased string. - */ - (string: string) => string; - -declare const toUpper: ToUpper; +import { toUpper } from "../fp"; export = toUpper; diff --git a/types/lodash/fp/transform.d.ts b/types/lodash/fp/transform.d.ts index 420258c514..ab0653cb7c 100644 --- a/types/lodash/fp/transform.d.ts +++ b/types/lodash/fp/transform.d.ts @@ -1,240 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Transform { - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (): Transform; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (iteratee: _.MemoVoidIteratorCapped): Transform1x1; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (iteratee: _.MemoVoidIteratorCapped, accumulator: ReadonlyArray): Transform1x2; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (iteratee: _.MemoVoidIteratorCapped, accumulator: ReadonlyArray, object: ReadonlyArray | _.Dictionary): TResult[]; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (iteratee: _.MemoVoidIteratorCapped>): Transform2x1; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (iteratee: _.MemoVoidIteratorCapped>, accumulator: _.Dictionary): Transform2x2; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (iteratee: _.MemoVoidIteratorCapped>, accumulator: _.Dictionary, object: ReadonlyArray | _.Dictionary): _.Dictionary; -} -interface Transform1x1 { - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (): Transform1x1; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (accumulator: ReadonlyArray): Transform1x2; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (accumulator: ReadonlyArray, object: ReadonlyArray | _.Dictionary): TResult[]; -} -interface Transform1x2 { - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (): Transform1x2; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (object: ReadonlyArray | _.Dictionary): TResult[]; -} -interface Transform2x1 { - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (): Transform2x1; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (accumulator: _.Dictionary): Transform2x2; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (accumulator: _.Dictionary, object: ReadonlyArray | _.Dictionary): _.Dictionary; -} -interface Transform2x2 { - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (): Transform2x2; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (object: ReadonlyArray | _.Dictionary): _.Dictionary; -} - -declare const transform: Transform; +import { transform } from "../fp"; export = transform; diff --git a/types/lodash/fp/trim.d.ts b/types/lodash/fp/trim.d.ts index 7b1c8696b4..f0f9b905d0 100644 --- a/types/lodash/fp/trim.d.ts +++ b/types/lodash/fp/trim.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Trim = - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (string: string) => string; - -declare const trim: Trim; +import { trim } from "../fp"; export = trim; diff --git a/types/lodash/fp/trimChars.d.ts b/types/lodash/fp/trimChars.d.ts index 8c0a97e9f5..929a49300e 100644 --- a/types/lodash/fp/trimChars.d.ts +++ b/types/lodash/fp/trimChars.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Trim { - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (): Trim; - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (chars: string): Trim1x1; - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (chars: string, string: string): string; -} -interface Trim1x1 { - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (): Trim1x1; - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (string: string): string; -} - -declare const trimChars: Trim; +import { trimChars } from "../fp"; export = trimChars; diff --git a/types/lodash/fp/trimCharsEnd.d.ts b/types/lodash/fp/trimCharsEnd.d.ts index f8b74c9c5a..2f5609ae2d 100644 --- a/types/lodash/fp/trimCharsEnd.d.ts +++ b/types/lodash/fp/trimCharsEnd.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface TrimEnd { - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (): TrimEnd; - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (chars: string): TrimEnd1x1; - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (chars: string, string: string): string; -} -interface TrimEnd1x1 { - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (): TrimEnd1x1; - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (string: string): string; -} - -declare const trimCharsEnd: TrimEnd; +import { trimCharsEnd } from "../fp"; export = trimCharsEnd; diff --git a/types/lodash/fp/trimCharsStart.d.ts b/types/lodash/fp/trimCharsStart.d.ts index 5b4da3996d..fb998f7e50 100644 --- a/types/lodash/fp/trimCharsStart.d.ts +++ b/types/lodash/fp/trimCharsStart.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface TrimStart { - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (): TrimStart; - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (chars: string): TrimStart1x1; - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (chars: string, string: string): string; -} -interface TrimStart1x1 { - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (): TrimStart1x1; - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (string: string): string; -} - -declare const trimCharsStart: TrimStart; +import { trimCharsStart } from "../fp"; export = trimCharsStart; diff --git a/types/lodash/fp/trimEnd.d.ts b/types/lodash/fp/trimEnd.d.ts index 02754779a2..b666494483 100644 --- a/types/lodash/fp/trimEnd.d.ts +++ b/types/lodash/fp/trimEnd.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type TrimEnd = - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (string: string) => string; - -declare const trimEnd: TrimEnd; +import { trimEnd } from "../fp"; export = trimEnd; diff --git a/types/lodash/fp/trimStart.d.ts b/types/lodash/fp/trimStart.d.ts index 567dc22e5e..988227ca74 100644 --- a/types/lodash/fp/trimStart.d.ts +++ b/types/lodash/fp/trimStart.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type TrimStart = - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (string: string) => string; - -declare const trimStart: TrimStart; +import { trimStart } from "../fp"; export = trimStart; diff --git a/types/lodash/fp/truncate.d.ts b/types/lodash/fp/truncate.d.ts index 6645f41697..d38b7b18b6 100644 --- a/types/lodash/fp/truncate.d.ts +++ b/types/lodash/fp/truncate.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Truncate { - /** - * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated - * string are replaced with the omission string which defaults to "…". - * - * @param string The string to truncate. - * @param options The options object or maximum string length. - * @return Returns the truncated string. - */ - (): Truncate; - /** - * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated - * string are replaced with the omission string which defaults to "…". - * - * @param string The string to truncate. - * @param options The options object or maximum string length. - * @return Returns the truncated string. - */ - (options: _.TruncateOptions): Truncate1x1; - /** - * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated - * string are replaced with the omission string which defaults to "…". - * - * @param string The string to truncate. - * @param options The options object or maximum string length. - * @return Returns the truncated string. - */ - (options: _.TruncateOptions, string: string): string; -} -interface Truncate1x1 { - /** - * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated - * string are replaced with the omission string which defaults to "…". - * - * @param string The string to truncate. - * @param options The options object or maximum string length. - * @return Returns the truncated string. - */ - (): Truncate1x1; - /** - * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated - * string are replaced with the omission string which defaults to "…". - * - * @param string The string to truncate. - * @param options The options object or maximum string length. - * @return Returns the truncated string. - */ - (string: string): string; -} - -declare const truncate: Truncate; +import { truncate } from "../fp"; export = truncate; diff --git a/types/lodash/fp/unapply.d.ts b/types/lodash/fp/unapply.d.ts index 8bde142263..c59b6b2a19 100644 --- a/types/lodash/fp/unapply.d.ts +++ b/types/lodash/fp/unapply.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Rest = - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - (func: (...args: any[]) => any) => (...args: any[]) => any; - -declare const unapply: Rest; +import { unapply } from "../fp"; export = unapply; diff --git a/types/lodash/fp/unary.d.ts b/types/lodash/fp/unary.d.ts index 19e2946e96..02e319576a 100644 --- a/types/lodash/fp/unary.d.ts +++ b/types/lodash/fp/unary.d.ts @@ -1,21 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Unary = - /** - * Creates a function that accepts up to one argument, ignoring any - * additional arguments. - * - * @category Function - * @param func The function to cap arguments for. - * @returns Returns the new function. - * @example - * - * _.map(['6', '8', '10'], _.unary(parseInt)); - * // => [6, 8, 10] - */ - (func: (arg1: T, ...args: any[]) => TResult) => (arg1: T) => TResult; - -declare const unary: Unary; +import { unary } from "../fp"; export = unary; diff --git a/types/lodash/fp/unescape.d.ts b/types/lodash/fp/unescape.d.ts index 20b602a298..efcccf2a51 100644 --- a/types/lodash/fp/unescape.d.ts +++ b/types/lodash/fp/unescape.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Unescape = - /** - * The inverse of _.escape; this method converts the HTML entities &, <, >, ", ', and ` - * in string to their corresponding characters. - * - * Note: No other HTML entities are unescaped. To unescape additional HTML entities use a third-party library - * like he. - * - * @param string The string to unescape. - * @return Returns the unescaped string. - */ - (string: string) => string; - -declare const unescape: Unescape; +import { unescape } from "../fp"; export = unescape; diff --git a/types/lodash/fp/union.d.ts b/types/lodash/fp/union.d.ts index 99c9e3d4ff..8e098ee7f6 100644 --- a/types/lodash/fp/union.d.ts +++ b/types/lodash/fp/union.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Union { - /** - * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of combined values. - */ - (): Union; - /** - * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of combined values. - */ - (arrays2: _.List | null | undefined): Union1x1; - /** - * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of combined values. - */ - (arrays2: _.List | null | undefined, arrays: _.List | null | undefined): T[]; -} -interface Union1x1 { - /** - * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of combined values. - */ - (): Union1x1; - /** - * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of combined values. - */ - (arrays: _.List | null | undefined): T[]; -} - -declare const union: Union; +import { union } from "../fp"; export = union; diff --git a/types/lodash/fp/unionBy.d.ts b/types/lodash/fp/unionBy.d.ts index 42db2e6352..f3882c6b4a 100644 --- a/types/lodash/fp/unionBy.d.ts +++ b/types/lodash/fp/unionBy.d.ts @@ -1,105 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface UnionBy { - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (): UnionBy; - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (iteratee: _.ValueIteratee): UnionBy1x1; - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (iteratee: _.ValueIteratee, arrays1: _.List | null | undefined): UnionBy1x2; - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (iteratee: _.ValueIteratee, arrays1: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface UnionBy1x1 { - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (): UnionBy1x1; - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (arrays1: _.List | null | undefined): UnionBy1x2; - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (arrays1: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface UnionBy1x2 { - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (): UnionBy1x2; - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (arrays2: _.List | null | undefined): T[]; -} - -declare const unionBy: UnionBy; +import { unionBy } from "../fp"; export = unionBy; diff --git a/types/lodash/fp/unionWith.d.ts b/types/lodash/fp/unionWith.d.ts index 89a5066ec0..46e19fd176 100644 --- a/types/lodash/fp/unionWith.d.ts +++ b/types/lodash/fp/unionWith.d.ts @@ -1,177 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface UnionWith { - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): UnionWith; - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator): UnionWith1x1; - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator, arrays: _.List | null | undefined): UnionWith1x2; - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator, arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface UnionWith1x1 { - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): UnionWith1x1; - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays: _.List | null | undefined): UnionWith1x2; - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface UnionWith1x2 { - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): UnionWith1x2; - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays2: _.List | null | undefined): T[]; -} - -declare const unionWith: UnionWith; +import { unionWith } from "../fp"; export = unionWith; diff --git a/types/lodash/fp/uniq.d.ts b/types/lodash/fp/uniq.d.ts index a627214680..877d0d94d9 100644 --- a/types/lodash/fp/uniq.d.ts +++ b/types/lodash/fp/uniq.d.ts @@ -1,25 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Uniq = - /** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each element - * is kept. - * - * @category Array - * @param array The array to inspect. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - */ - (array: _.List | null | undefined) => T[]; - -declare const uniq: Uniq; +import { uniq } from "../fp"; export = uniq; diff --git a/types/lodash/fp/uniqBy.d.ts b/types/lodash/fp/uniqBy.d.ts index d89b8908c5..0e6522d704 100644 --- a/types/lodash/fp/uniqBy.d.ts +++ b/types/lodash/fp/uniqBy.d.ts @@ -1,186 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface UniqBy { - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (): UniqBy; - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (iteratee: (value: string) => _.NotVoid): UniqBy1x1; - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (iteratee: (value: string) => _.NotVoid, array: string | null | undefined): string[]; - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (iteratee: _.ValueIteratee): UniqBy2x1; - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (iteratee: _.ValueIteratee, array: _.List | null | undefined): T[]; -} -interface UniqBy1x1 { - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (): UniqBy1x1; - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (array: string | null | undefined): string[]; -} -interface UniqBy2x1 { - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (): UniqBy2x1; - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (array: _.List | null | undefined): T[]; -} - -declare const uniqBy: UniqBy; +import { uniqBy } from "../fp"; export = uniqBy; diff --git a/types/lodash/fp/uniqWith.d.ts b/types/lodash/fp/uniqWith.d.ts index f0e6de90ff..165f45f1e3 100644 --- a/types/lodash/fp/uniqWith.d.ts +++ b/types/lodash/fp/uniqWith.d.ts @@ -1,98 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface UniqWith { - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param array The array to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - (): UniqWith; - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param array The array to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - (comparator: _.Comparator): UniqWith1x1; - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param array The array to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - (comparator: _.Comparator, array: _.List | null | undefined): T[]; -} -interface UniqWith1x1 { - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param array The array to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - (): UniqWith1x1; - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param array The array to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - (array: _.List | null | undefined): T[]; -} - -declare const uniqWith: UniqWith; +import { uniqWith } from "../fp"; export = uniqWith; diff --git a/types/lodash/fp/uniqueId.d.ts b/types/lodash/fp/uniqueId.d.ts index d9ba028d53..57736d9ccd 100644 --- a/types/lodash/fp/uniqueId.d.ts +++ b/types/lodash/fp/uniqueId.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type UniqueId = - /** - * Generates a unique ID. If prefix is provided the ID is appended to it. - * - * @param prefix The value to prefix the ID with. - * @return Returns the unique ID. - */ - (prefix: string) => string; - -declare const uniqueId: UniqueId; +import { uniqueId } from "../fp"; export = uniqueId; diff --git a/types/lodash/fp/unnest.d.ts b/types/lodash/fp/unnest.d.ts index fc05e923c5..852e9a1367 100644 --- a/types/lodash/fp/unnest.d.ts +++ b/types/lodash/fp/unnest.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Flatten = - /** - * Flattens `array` a single level deep. - * - * @param array The array to flatten. - * @return Returns the new flattened array. - */ - (array: _.List<_.Many> | null | undefined) => T[]; - -declare const unnest: Flatten; +import { unnest } from "../fp"; export = unnest; diff --git a/types/lodash/fp/unset.d.ts b/types/lodash/fp/unset.d.ts index 12199c061a..3e99247714 100644 --- a/types/lodash/fp/unset.d.ts +++ b/types/lodash/fp/unset.d.ts @@ -1,63 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Unset { - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (): Unset; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (path: _.PropertyPath): Unset1x1; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (path: _.PropertyPath, object: any): boolean; -} -interface Unset1x1 { - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (): Unset1x1; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (object: any): boolean; -} - -declare const unset: Unset; +import { unset } from "../fp"; export = unset; diff --git a/types/lodash/fp/unzip.d.ts b/types/lodash/fp/unzip.d.ts index e6ce334d48..ba9d4cd709 100644 --- a/types/lodash/fp/unzip.d.ts +++ b/types/lodash/fp/unzip.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Unzip = - /** - * This method is like _.zip except that it accepts an array of grouped elements and creates an array - * regrouping the elements to their pre-zip configuration. - * - * @param array The array of grouped elements to process. - * @return Returns the new array of regrouped elements. - */ - (array: T[][] | _.List<_.List> | null | undefined) => T[][]; - -declare const unzip: Unzip; +import { unzip } from "../fp"; export = unzip; diff --git a/types/lodash/fp/unzipWith.d.ts b/types/lodash/fp/unzipWith.d.ts index 36fd2e6bf0..599eadb355 100644 --- a/types/lodash/fp/unzipWith.d.ts +++ b/types/lodash/fp/unzipWith.d.ts @@ -1,68 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface UnzipWith { - /** - * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * - * @param array The array of grouped elements to process. - * @param iteratee The function to combine regrouped values. - * @param thisArg The this binding of iteratee. - * @return Returns the new array of regrouped elements. - */ - (): UnzipWith; - /** - * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * - * @param array The array of grouped elements to process. - * @param iteratee The function to combine regrouped values. - * @param thisArg The this binding of iteratee. - * @return Returns the new array of regrouped elements. - */ - (iteratee: (...values: T[]) => TResult): UnzipWith1x1; - /** - * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * - * @param array The array of grouped elements to process. - * @param iteratee The function to combine regrouped values. - * @param thisArg The this binding of iteratee. - * @return Returns the new array of regrouped elements. - */ - (iteratee: (...values: T[]) => TResult, array: _.List<_.List> | null | undefined): TResult[]; -} -interface UnzipWith1x1 { - /** - * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * - * @param array The array of grouped elements to process. - * @param iteratee The function to combine regrouped values. - * @param thisArg The this binding of iteratee. - * @return Returns the new array of regrouped elements. - */ - (): UnzipWith1x1; - /** - * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * - * @param array The array of grouped elements to process. - * @param iteratee The function to combine regrouped values. - * @param thisArg The this binding of iteratee. - * @return Returns the new array of regrouped elements. - */ - (array: _.List<_.List> | null | undefined): TResult[]; -} - -declare const unzipWith: UnzipWith; +import { unzipWith } from "../fp"; export = unzipWith; diff --git a/types/lodash/fp/update.d.ts b/types/lodash/fp/update.d.ts index 011a8ea61e..76dfe482f8 100644 --- a/types/lodash/fp/update.d.ts +++ b/types/lodash/fp/update.d.ts @@ -1,105 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Update { - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (): Update; - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (path: _.PropertyPath): Update1x1; - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (path: _.PropertyPath, updater: (value: any) => any): Update1x2; - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (path: _.PropertyPath, updater: (value: any) => any, object: object): any; -} -interface Update1x1 { - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (): Update1x1; - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (updater: (value: any) => any): Update1x2; - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (updater: (value: any) => any, object: object): any; -} -interface Update1x2 { - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (): Update1x2; - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (object: object): any; -} - -declare const update: Update; +import { update } from "../fp"; export = update; diff --git a/types/lodash/fp/updateWith.d.ts b/types/lodash/fp/updateWith.d.ts index e26ed161d2..6d6331d1b5 100644 --- a/types/lodash/fp/updateWith.d.ts +++ b/types/lodash/fp/updateWith.d.ts @@ -1,431 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface UpdateWith { - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (): UpdateWith; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (customizer: _.SetWithCustomizer): UpdateWith1x1; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (customizer: _.SetWithCustomizer, path: _.PropertyPath): UpdateWith1x2; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (customizer: _.SetWithCustomizer, path: _.PropertyPath, updater: (oldValue: any) => any): UpdateWith1x3; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (customizer: _.SetWithCustomizer, path: _.PropertyPath, updater: (oldValue: any) => any, object: T): T; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (customizer: _.SetWithCustomizer, path: _.PropertyPath, updater: (oldValue: any) => any, object: T): TResult; -} -interface UpdateWith1x1 { - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (): UpdateWith1x1; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (path: _.PropertyPath): UpdateWith1x2; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (path: _.PropertyPath, updater: (oldValue: any) => any): UpdateWith1x3; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (path: _.PropertyPath, updater: (oldValue: any) => any, object: T): T; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (path: _.PropertyPath, updater: (oldValue: any) => any, object: T): TResult; -} -interface UpdateWith1x2 { - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (): UpdateWith1x2; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (updater: (oldValue: any) => any): UpdateWith1x3; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (updater: (oldValue: any) => any, object: T): T; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (updater: (oldValue: any) => any, object: T): TResult; -} -interface UpdateWith1x3 { - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (): UpdateWith1x3; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (object: T): T; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (object: T): TResult; -} - -declare const updateWith: UpdateWith; +import { updateWith } from "../fp"; export = updateWith; diff --git a/types/lodash/fp/upperCase.d.ts b/types/lodash/fp/upperCase.d.ts index 5e6cab91bf..10aadb28ec 100644 --- a/types/lodash/fp/upperCase.d.ts +++ b/types/lodash/fp/upperCase.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type UpperCase = - /** - * Converts `string`, as space separated words, to upper case. - * - * @param string The string to convert. - * @return Returns the upper cased string. - */ - (string: string) => string; - -declare const upperCase: UpperCase; +import { upperCase } from "../fp"; export = upperCase; diff --git a/types/lodash/fp/upperFirst.d.ts b/types/lodash/fp/upperFirst.d.ts index 54a442030e..e2c9adfd57 100644 --- a/types/lodash/fp/upperFirst.d.ts +++ b/types/lodash/fp/upperFirst.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type UpperFirst = - /** - * Converts the first character of `string` to upper case. - * - * @param string The string to convert. - * @return Returns the converted string. - */ - (string: string) => string; - -declare const upperFirst: UpperFirst; +import { upperFirst } from "../fp"; export = upperFirst; diff --git a/types/lodash/fp/useWith.d.ts b/types/lodash/fp/useWith.d.ts index 1196dfbade..991905a402 100644 --- a/types/lodash/fp/useWith.d.ts +++ b/types/lodash/fp/useWith.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface OverArgs { - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (): OverArgs; - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (func: (...args: any[]) => any): OverArgs1x1; - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (func: (...args: any[]) => any, transforms: _.Many<(...args: any[]) => any>): (...args: any[]) => any; -} -interface OverArgs1x1 { - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (): OverArgs1x1; - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (transforms: _.Many<(...args: any[]) => any>): (...args: any[]) => any; -} - -declare const useWith: OverArgs; +import { useWith } from "../fp"; export = useWith; diff --git a/types/lodash/fp/values.d.ts b/types/lodash/fp/values.d.ts index ec0ef37c08..75ec6fb4e5 100644 --- a/types/lodash/fp/values.d.ts +++ b/types/lodash/fp/values.d.ts @@ -1,32 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Values { - /** - * Creates an array of the own enumerable property values of object. - * - * @param object The object to query. - * @return Returns an array of property values. - */ - (object: _.Dictionary | _.NumericDictionary | _.List | null | undefined): T[]; - /** - * Creates an array of the own enumerable property values of object. - * - * @param object The object to query. - * @return Returns an array of property values. - */ - (object: T | null | undefined): Array; - /** - * Creates an array of the own enumerable property values of object. - * - * @param object The object to query. - * @return Returns an array of property values. - */ - (object: any): any[]; -} - -declare const values: Values; +import { values } from "../fp"; export = values; diff --git a/types/lodash/fp/valuesIn.d.ts b/types/lodash/fp/valuesIn.d.ts index 35e9073535..6f4f3b43bb 100644 --- a/types/lodash/fp/valuesIn.d.ts +++ b/types/lodash/fp/valuesIn.d.ts @@ -1,25 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ValuesIn { - /** - * Creates an array of the own and inherited enumerable property values of object. - * - * @param object The object to query. - * @return Returns the array of property values. - */ - (object: _.Dictionary|_.NumericDictionary|_.List | null | undefined): T[]; - /** - * Creates an array of the own and inherited enumerable property values of object. - * - * @param object The object to query. - * @return Returns the array of property values. - */ - (object: T | null | undefined): Array; -} - -declare const valuesIn: ValuesIn; +import { valuesIn } from "../fp"; export = valuesIn; diff --git a/types/lodash/fp/where.d.ts b/types/lodash/fp/where.d.ts index 4270edf2e4..41e21ec8ac 100644 --- a/types/lodash/fp/where.d.ts +++ b/types/lodash/fp/where.d.ts @@ -1,48 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ConformsTo { - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (): ConformsTo; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (source: _.ConformsPredicateObject): ConformsTo1x1; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (source: _.ConformsPredicateObject, object: T): boolean; -} -interface ConformsTo1x1 { - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (): ConformsTo1x1; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (object: T): boolean; -} - -declare const where: ConformsTo; +import { where } from "../fp"; export = where; diff --git a/types/lodash/fp/whereEq.d.ts b/types/lodash/fp/whereEq.d.ts index 1a660655f8..893316d625 100644 --- a/types/lodash/fp/whereEq.d.ts +++ b/types/lodash/fp/whereEq.d.ts @@ -1,116 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface IsMatch { - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (): IsMatch; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (source: object): IsMatch1x1; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (source: object, object: object): boolean; -} -interface IsMatch1x1 { - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (): IsMatch1x1; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (object: object): boolean; -} - -declare const whereEq: IsMatch; +import { whereEq } from "../fp"; export = whereEq; diff --git a/types/lodash/fp/without.d.ts b/types/lodash/fp/without.d.ts index 9c30e47289..600890a400 100644 --- a/types/lodash/fp/without.d.ts +++ b/types/lodash/fp/without.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Without { - /** - * Creates an array excluding all provided values using SameValueZero for equality comparisons. - * - * @param array The array to filter. - * @param values The values to exclude. - * @return Returns the new array of filtered values. - */ - (): Without; - /** - * Creates an array excluding all provided values using SameValueZero for equality comparisons. - * - * @param array The array to filter. - * @param values The values to exclude. - * @return Returns the new array of filtered values. - */ - (values: ReadonlyArray): Without1x1; - /** - * Creates an array excluding all provided values using SameValueZero for equality comparisons. - * - * @param array The array to filter. - * @param values The values to exclude. - * @return Returns the new array of filtered values. - */ - (values: ReadonlyArray, array: _.List | null | undefined): T[]; -} -interface Without1x1 { - /** - * Creates an array excluding all provided values using SameValueZero for equality comparisons. - * - * @param array The array to filter. - * @param values The values to exclude. - * @return Returns the new array of filtered values. - */ - (): Without1x1; - /** - * Creates an array excluding all provided values using SameValueZero for equality comparisons. - * - * @param array The array to filter. - * @param values The values to exclude. - * @return Returns the new array of filtered values. - */ - (array: _.List | null | undefined): T[]; -} - -declare const without: Without; +import { without } from "../fp"; export = without; diff --git a/types/lodash/fp/words.d.ts b/types/lodash/fp/words.d.ts index c827eafb15..2b06b26368 100644 --- a/types/lodash/fp/words.d.ts +++ b/types/lodash/fp/words.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Words = - /** - * Splits `string` into an array of its words. - * - * @param string The string to inspect. - * @param pattern The pattern to match words. - * @return Returns the words of `string`. - */ - (string: string) => string[]; - -declare const words: Words; +import { words } from "../fp"; export = words; diff --git a/types/lodash/fp/wrap.d.ts b/types/lodash/fp/wrap.d.ts index a906abe0f2..d9c2a283e2 100644 --- a/types/lodash/fp/wrap.d.ts +++ b/types/lodash/fp/wrap.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Wrap { - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (): Wrap; - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (wrapper: (value: T, ...args: TArgs[]) => TResult): Wrap1x1; - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (wrapper: (value: T, ...args: TArgs[]) => TResult, value: T): (...args: TArgs[]) => TResult; - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (wrapper: (value: T, ...args: any[]) => TResult): Wrap2x1; - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (wrapper: (value: T, ...args: any[]) => TResult, value: T): (...args: any[]) => TResult; -} -interface Wrap1x1 { - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (): Wrap1x1; - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (value: T): (...args: TArgs[]) => TResult; -} -interface Wrap2x1 { - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (): Wrap2x1; - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (value: T): (...args: any[]) => TResult; -} - -declare const wrap: Wrap; +import { wrap } from "../fp"; export = wrap; diff --git a/types/lodash/fp/xor.d.ts b/types/lodash/fp/xor.d.ts index d3e250cb5a..ac69bde236 100644 --- a/types/lodash/fp/xor.d.ts +++ b/types/lodash/fp/xor.d.ts @@ -1,48 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Xor { - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (): Xor; - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (arrays2: _.List | null | undefined): Xor1x1; - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (arrays2: _.List | null | undefined, arrays: _.List | null | undefined): T[]; -} -interface Xor1x1 { - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (): Xor1x1; - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (arrays: _.List | null | undefined): T[]; -} - -declare const xor: Xor; +import { xor } from "../fp"; export = xor; diff --git a/types/lodash/fp/xorBy.d.ts b/types/lodash/fp/xorBy.d.ts index 8d5b2fd05a..1232972323 100644 --- a/types/lodash/fp/xorBy.d.ts +++ b/types/lodash/fp/xorBy.d.ts @@ -1,186 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface XorBy { - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (): XorBy; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee): XorBy1x1; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, arrays: _.List | null | undefined): XorBy1x2; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface XorBy1x1 { - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (): XorBy1x1; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (arrays: _.List | null | undefined): XorBy1x2; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface XorBy1x2 { - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (): XorBy1x2; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (arrays2: _.List | null | undefined): T[]; -} - -declare const xorBy: XorBy; +import { xorBy } from "../fp"; export = xorBy; diff --git a/types/lodash/fp/xorWith.d.ts b/types/lodash/fp/xorWith.d.ts index 6bdcabdbd2..ec93e40b30 100644 --- a/types/lodash/fp/xorWith.d.ts +++ b/types/lodash/fp/xorWith.d.ts @@ -1,177 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface XorWith { - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): XorWith; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator): XorWith1x1; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator, arrays: _.List | null | undefined): XorWith1x2; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator, arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface XorWith1x1 { - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): XorWith1x1; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays: _.List | null | undefined): XorWith1x2; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface XorWith1x2 { - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): XorWith1x2; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays2: _.List | null | undefined): T[]; -} - -declare const xorWith: XorWith; +import { xorWith } from "../fp"; export = xorWith; diff --git a/types/lodash/fp/zip.d.ts b/types/lodash/fp/zip.d.ts index dd4e6a1e3c..2a83e733b6 100644 --- a/types/lodash/fp/zip.d.ts +++ b/types/lodash/fp/zip.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Zip { - /** - * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, - * the second of which contains the second elements of the given arrays, and so on. - * - * @param arrays The arrays to process. - * @return Returns the new array of grouped elements. - */ - (): Zip; - /** - * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, - * the second of which contains the second elements of the given arrays, and so on. - * - * @param arrays The arrays to process. - * @return Returns the new array of grouped elements. - */ - (arrays1: _.List): Zip1x1; - /** - * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, - * the second of which contains the second elements of the given arrays, and so on. - * - * @param arrays The arrays to process. - * @return Returns the new array of grouped elements. - */ - (arrays1: _.List, arrays2: _.List): Array<[T1 | undefined, T2 | undefined]>; -} -interface Zip1x1 { - /** - * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, - * the second of which contains the second elements of the given arrays, and so on. - * - * @param arrays The arrays to process. - * @return Returns the new array of grouped elements. - */ - (): Zip1x1; - /** - * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, - * the second of which contains the second elements of the given arrays, and so on. - * - * @param arrays The arrays to process. - * @return Returns the new array of grouped elements. - */ - (arrays2: _.List): Array<[T1 | undefined, T2 | undefined]>; -} - -declare const zip: Zip; +import { zip } from "../fp"; export = zip; diff --git a/types/lodash/fp/zipAll.d.ts b/types/lodash/fp/zipAll.d.ts index 62cf6eb647..af0b3ed3f5 100644 --- a/types/lodash/fp/zipAll.d.ts +++ b/types/lodash/fp/zipAll.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Zip = - /** - * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, - * the second of which contains the second elements of the given arrays, and so on. - * - * @param arrays The arrays to process. - * @return Returns the new array of grouped elements. - */ - (arrays: ReadonlyArray<_.List | null | undefined>) => Array>; - -declare const zipAll: Zip; +import { zipAll } from "../fp"; export = zipAll; diff --git a/types/lodash/fp/zipObj.d.ts b/types/lodash/fp/zipObj.d.ts index 7b1c5bb91a..4f4c19a87d 100644 --- a/types/lodash/fp/zipObj.d.ts +++ b/types/lodash/fp/zipObj.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ZipObject { - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (): ZipObject; - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (props: _.List<_.PropertyName>): ZipObject1x1; - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (props: _.List<_.PropertyName>, values: _.List): _.Dictionary; -} -interface ZipObject1x1 { - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (): ZipObject1x1; - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (values: _.List): _.Dictionary; -} - -declare const zipObj: ZipObject; +import { zipObj } from "../fp"; export = zipObj; diff --git a/types/lodash/fp/zipObject.d.ts b/types/lodash/fp/zipObject.d.ts index 61f5d04e79..f302d7b155 100644 --- a/types/lodash/fp/zipObject.d.ts +++ b/types/lodash/fp/zipObject.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ZipObject { - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (): ZipObject; - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (props: _.List<_.PropertyName>): ZipObject1x1; - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (props: _.List<_.PropertyName>, values: _.List): _.Dictionary; -} -interface ZipObject1x1 { - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (): ZipObject1x1; - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (values: _.List): _.Dictionary; -} - -declare const zipObject: ZipObject; +import { zipObject } from "../fp"; export = zipObject; diff --git a/types/lodash/fp/zipObjectDeep.d.ts b/types/lodash/fp/zipObjectDeep.d.ts index 0fd3f218ab..601063489d 100644 --- a/types/lodash/fp/zipObjectDeep.d.ts +++ b/types/lodash/fp/zipObjectDeep.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ZipObjectDeep { - /** - * This method is like _.zipObject except that it supports property paths. - * - * @param paths The property names. - * @param values The property values. - * @return Returns the new object. - */ - (): ZipObjectDeep; - /** - * This method is like _.zipObject except that it supports property paths. - * - * @param paths The property names. - * @param values The property values. - * @return Returns the new object. - */ - (paths: _.List<_.PropertyPath>): ZipObjectDeep1x1; - /** - * This method is like _.zipObject except that it supports property paths. - * - * @param paths The property names. - * @param values The property values. - * @return Returns the new object. - */ - (paths: _.List<_.PropertyPath>, values: _.List): object; -} -interface ZipObjectDeep1x1 { - /** - * This method is like _.zipObject except that it supports property paths. - * - * @param paths The property names. - * @param values The property values. - * @return Returns the new object. - */ - (): ZipObjectDeep1x1; - /** - * This method is like _.zipObject except that it supports property paths. - * - * @param paths The property names. - * @param values The property values. - * @return Returns the new object. - */ - (values: _.List): object; -} - -declare const zipObjectDeep: ZipObjectDeep; +import { zipObjectDeep } from "../fp"; export = zipObjectDeep; diff --git a/types/lodash/fp/zipWith.d.ts b/types/lodash/fp/zipWith.d.ts index 36c02c053c..9faaf3c589 100644 --- a/types/lodash/fp/zipWith.d.ts +++ b/types/lodash/fp/zipWith.d.ts @@ -1,105 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ZipWith { - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (): ZipWith; - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (iteratee: (value1: T1, value2: T2) => TResult): ZipWith1x1; - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (iteratee: (value1: T1, value2: T2) => TResult, arrays1: _.List): ZipWith1x2; - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (iteratee: (value1: T1, value2: T2) => TResult, arrays1: _.List, arrays2: _.List): TResult[]; -} -interface ZipWith1x1 { - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (): ZipWith1x1; - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (arrays1: _.List): ZipWith1x2; - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (arrays1: _.List, arrays2: _.List): TResult[]; -} -interface ZipWith1x2 { - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (): ZipWith1x2; - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (arrays2: _.List): TResult[]; -} - -declare const zipWith: ZipWith; +import { zipWith } from "../fp"; export = zipWith; diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 28d2967c86..ee86770a2a 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -26,6 +26,10 @@ _.chain([1, 2, 3, 4]).splice(1); // $ExpectType LoDashExplicitWrapper _.chain([1, 2, 3, 4]).splice(1, 2, 5, 6); // $ExpectType LoDashExplicitWrapper _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper +/********* + * Array * + *********/ + // _.chunk { const list: _.List | null | undefined = anything; @@ -41,7 +45,7 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper _.curry(testCurry)("1"); // $ExpectType CurriedFunction2 _.curry(testCurry); // $ExpectType CurriedFunction3 + _.curry(testCurry)(_, 2, true)("1"); // $ExpectType [string, number, boolean] + _.curry(testCurry)(_.curry.placeholder, 2, true)("1"); // $ExpectType [string, number, boolean] + _.curry(testCurry)("1", _, true)(2); // $ExpectType [string, number, boolean] + _.curry(testCurry)(_, 2)("1", true); // $ExpectType [string, number, boolean] + _.curry(testCurry)(_.curry.placeholder, 2)("1", true); // $ExpectType [string, number, boolean] _(testCurry).curry(); // $ExpectType LoDashImplicitWrapper> _.chain(testCurry).curry(); // $ExpectType LoDashExplicitWrapper> @@ -3538,6 +3547,9 @@ fp.now(); // $ExpectType number fp.curry(testCurry)("1")(2); // $ExpectType CurriedFunction1 fp.curry(testCurry)("1"); // $ExpectType CurriedFunction2 fp.curry(testCurry); // $ExpectType CurriedFunction3 + fp.curry(testCurry)(fp.__, 2, true)("1"); // $ExpectType [string, number, boolean] + fp.curry(testCurry)(fp.curry.placeholder, 2, true)("1"); // $ExpectType [string, number, boolean] + fp.curryN(3)(testCurry)(fp.curryN.placeholder, 2, true)("1"); // $ExpectType [string, number, boolean] // _.curryRight _.curryRight(testCurry)("1", 2, true); // $ExpectType [string, number, boolean] @@ -3548,6 +3560,10 @@ fp.now(); // $ExpectType number _.curryRight(testCurry)(true)(2); // $ExpectType RightCurriedFunction1 _.curryRight(testCurry)(true); // $ExpectType RightCurriedFunction2 _.curryRight(testCurry); // $ExpectType RightCurriedFunction3 + _.curryRight(testCurry)("1", _, true)(2); // $ExpectType [string, number, boolean] + _.curryRight(testCurry)("1", _.curryRight.placeholder, true)(2); // $ExpectType [string, number, boolean] + _.curryRight(testCurry)(true)("1", _)(2); // $ExpectType [string, number, boolean] + _.curryRight(testCurry)(true)("1", _.curryRight.placeholder)(2); // $ExpectType [string, number, boolean] _(testCurry).curryRight(); // $ExpectType LoDashImplicitWrapper> _.chain(testCurry).curryRight(); // $ExpectType LoDashExplicitWrapper> @@ -3559,6 +3575,9 @@ fp.now(); // $ExpectType number fp.curryRight(testCurry)(true)(2); // $ExpectType RightCurriedFunction1 fp.curryRight(testCurry)(true); // $ExpectType RightCurriedFunction2 fp.curryRight(testCurry); // $ExpectType RightCurriedFunction3 + fp.curryRight(testCurry)("1", fp.__, true)(2); // $ExpectType [string, number, boolean] + fp.curryRight(testCurry)("1", fp.curryRight.placeholder, true)(2); // $ExpectType [string, number, boolean] + fp.curryRightN(3)(testCurry)("1", fp.curryRightN.placeholder, true)(2); // $ExpectType [string, number, boolean] } // _.debounce @@ -6960,7 +6979,7 @@ fp.now(); // $ExpectType number _.noConflict(); // $ExpectType LoDashStatic _(42).noConflict(); // $ExpectType LoDashStatic _.chain(42).noConflict(); // $ExpectType LoDashExplicitWrapper - fp.noConflict(); // $ExpectType LoDashStatic + fp.noConflict(); // $ExpectType LoDashFp } // _.noop @@ -7218,6 +7237,7 @@ _.templateSettings; // $ExpectType TemplateSettings _.partial(func2); // $ExpectType Function2 _.partial(func2, 42); // $ExpectType Function1 _.partial(func2, _, "foo"); // $ExpectType Function1 + _.partial(func2, _.partial.placeholder, "foo"); // $ExpectType Function1 _.partial(func2, 42, "foo"); // $ExpectType Function0 // with arity 3 function _.partial(func3, 42, _, true); @@ -7230,6 +7250,7 @@ _.templateSettings; // $ExpectType TemplateSettings // with arity 2 function _.partialRight(func2); // $ExpectType Function2 _.partialRight(func2, 42, _); // $ExpectType Function1 + _.partialRight(func2, 42, _.partialRight.placeholder); // $ExpectType Function1 _.partialRight(func2, "foo"); // $ExpectType Function1 _.partialRight(func2, 42, "foo"); // $ExpectType Function0 // with arity 3 function @@ -7238,6 +7259,8 @@ _.templateSettings; // $ExpectType TemplateSettings fp.partial([], func0); // $ExpectType (...args: any[]) => any fp.partial([])(func0); // $ExpectType (...args: any[]) => any fp.partial([42])(func1); // $ExpectType (...args: any[]) => any + fp.partial([fp.partial.placeholder, "foo"])(func2); fp.partialRight([])(func0); // $ExpectType (...args: any[]) => any fp.partialRight([42])(func1); // $ExpectType (...args: any[]) => any + fp.partialRight([fp.partialRight.placeholder, "foo"])(func2); } diff --git a/types/lodash/scripts/generate-fp.ts b/types/lodash/scripts/generate-fp.ts index bbe648c6cd..3b8320b59c 100644 --- a/types/lodash/scripts/generate-fp.ts +++ b/types/lodash/scripts/generate-fp.ts @@ -1,4 +1,4 @@ -// Script for converting the lodash types into unctional programming (FP) format. +// Script for converting the lodash types into functional programming (FP) format. // The convertion is done based on this guide: https://github.com/lodash/lodash/wiki/FP-Guide // Assumptions: @@ -17,12 +17,18 @@ import path from "path"; interface Definition { name: string; overloads: Overload[]; + constants: string[]; jsdoc: string; } +interface InterfaceGroup { + functionName: string; + interfaces: Interface[]; +} interface Interface { name: string; typeParams: TypeParam[]; overloads: Overload[]; + constants: string[]; } interface Overload { typeParams: TypeParam[]; @@ -46,9 +52,9 @@ async function main() { // Read each function definition and fp-ify it const subfolders = ["common"]; - const promises: Array> = []; + const promises: Array> = []; for (const subfolder of subfolders) { - promises.push(new Promise((resolve, reject) => { + promises.push(new Promise((resolve, reject) => { fs.readdir(path.join("..", subfolder), (err, files) => { if (err) { console.error(`failed to list directory contents for '${subfolder}': `, err); @@ -66,40 +72,55 @@ async function main() { })); } - let functionNames: string[]; + let interfaceGroups: InterfaceGroup[]; try { - functionNames = _.flatten(await Promise.all(promises)); + interfaceGroups = _.flatten(await Promise.all(promises)); } catch (err) { console.error("Failed to parse all functions: ", err); return; } - functionNames = _.sortedUniq(_.sortBy(functionNames, _.toLower)); + interfaceGroups = _.sortBy(interfaceGroups, g => _.toLower(g.functionName)); + for (const interfaceGroup of interfaceGroups) { + // Rename interfaces for different versions of the same function with different arity (to avoid name conflicts). + // Don't rename aliases - instead they will be removed from the output when interfaces are written. + const interfaceName = interfaceGroup.interfaces[0].name; + const conflicts = interfaceGroups.filter(g => g.interfaces[0].name === interfaceName); + if (conflicts.length > 1 && _.some(conflicts, c => !_.isEqual(c.interfaces, conflicts[0].interfaces))) { + for (const conflict of conflicts) { + const oldName = conflict.interfaces[0].name; + const newName = getInterfaceBaseName(conflict.functionName); + for (const interfaceDef of conflict.interfaces) { + interfaceDef.name = interfaceDef.name.replace(oldName, newName); + for (const overload of interfaceDef.overloads) + overload.returnType = overload.returnType.replace(oldName, newName); + } + } + } + } + const interfaces = _.uniqBy(_.flatMap(interfaceGroups, g => g.interfaces), i => i.name); + const commonTypeSearch = new RegExp(`\\b(${commonTypes.join("|")})\\b`, "g"); + const interfaceStrings = _(interfaces) + .map(i => tab(interfaceToString(i), 1)) + .join(lineBreak) + .replace(commonTypeSearch, match => `lodash.${match}`); const fpFile = [ "// AUTO-GENERATED: do not modify this file directly.", "// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do:", "// npm run fp", "", - ...functionNames.map(f => `import ${f} = require("./fp/${f}");`), + 'import lodash = require("./index");', "", "export = _;", "", "declare const _: _.LoDashFp;", "declare namespace _ {", - " interface LoDashFp {", - ...functionNames.map(f => ` ${f}: typeof ${f};`), - " }", - "}", + interfaceStrings, "", - "// Backward compatibility with --target es5", - "declare global {", - " // tslint:disable-next-line:no-empty-interface", - " interface Set { }", - " // tslint:disable-next-line:no-empty-interface", - " interface Map { }", - " // tslint:disable-next-line:no-empty-interface", - " interface WeakSet { }", - " // tslint:disable-next-line:no-empty-interface", - " interface WeakMap { }", + " interface LoDashFp {", + ...interfaceGroups.map(g => ` ${g.functionName}: ${g.interfaces[0].name};`), + " __: lodash.__;", + " placehodler: lodash.__;", + " }", "}", "", ].join(lineBreak); @@ -110,7 +131,8 @@ async function main() { // Make sure the generated files are listed in tsconfig.json, so they are included in the lint checks const tsconfig = tsconfigFile.split(lineBreak).filter(row => !row.includes("fp/") || row.includes("fp/convert.d.ts")); - const newRows = functionNames.map(f => ` "fp/${f}.d.ts",`); + const newRows = interfaceGroups.map(g => ` "fp/${g.functionName}.d.ts",`) + .concat(["__", "placeholder"].map(p => ` "fp/${p}.d.ts",`)); newRows[newRows.length - 1] = newRows[newRows.length - 1].replace(",", ""); const insertIndex = _.findLastIndex(tsconfig, row => row.trim() === "]"); // Assume "files" is the last array @@ -140,17 +162,17 @@ function readFile(filePath: string): Promise { }); } -async function processDefinitions(filePaths: string[], commonTypes: string[]): Promise { +async function processDefinitions(filePaths: string[], commonTypes: string[]): Promise { const builder: { [name: string]: (...args: number[][]) => () => Interface[] } = {}; const unconvertedBuilder: { [name: string]: (...args: number[][]) => () => Interface[] } = {}; for (const filePath of filePaths) { const definitions = await parseFile(filePath, commonTypes); for (const definition of definitions) { - if (definition.overloads.every(o => o.params.length <= 1 && o.returnType === "typeof _")) { + if (definition.overloads.every(o => o.params.length <= 1 && (o.returnType === "typeof _" || o.returnType === "LoDashStatic"))) { // Our convert technique doesn't work well on "typeof _" functions (or at least runInContext) // Plus, if there are 0-1 parameters, there's nothing to curry anyways. unconvertedBuilder[definition.name] = (...args: number[][]) => { - return () => curryOverloads(definition.overloads, definition.name, args[0] || [], -1, false); + return () => curryDefinition(definition, args[0] || [], -1, false); }; } else { builder[definition.name] = (...args: Array) => { @@ -177,7 +199,7 @@ async function processDefinitions(filePaths: string[], commonTypes: string[]): P args = _.sortBy(args as number[][], (a: number[]) => a[0]); } - return () => curryOverloads(definition.overloads, definition.name, _.flatten(args), spreadIndex, isFixed); + return () => curryDefinition(definition, _.flatten(args), spreadIndex, isFixed); }; } } @@ -188,31 +210,14 @@ async function processDefinitions(filePaths: string[], commonTypes: string[]): P _.defaults(builderFp, unconvertedBuilder); const functionNames = Object.keys(builderFp).filter(key => key !== "convert" && typeof builderFp[key] === "function"); - for (const functionName of functionNames) { + const interfaceGroups: InterfaceGroup[] = functionNames.map((functionName): InterfaceGroup => ({ + functionName, // Assuming the maximum arity is 4. Pass one more arg than the max arity so we can detect if arguments weren't fixed. - const outputFn: (...args: any[]) => Interface[] = builderFp[functionName]([0], [1], [2], [3], [4]); - const commonTypeSearch = new RegExp(`\\b(${commonTypes.join("|")})\\b`, "g"); - commonTypeSearch.lastIndex; - let importCommon = false; - let output = outputFn([0], [1], [2], [3], [4]) - .map(interfaceToString) - .join(lineBreak) - .replace(commonTypeSearch, match => { - importCommon = true; - return `_.${match}`; - }); - if (!importCommon && output.includes("typeof _")) - importCommon = true; - const interfaceNameMatch = output.match(/(?:interface|type) ([A-Za-z0-9]+)/); - const interfaceName = (interfaceNameMatch ? interfaceNameMatch[1] : undefined) || _.upperFirst(functionName); - output = [ - "// AUTO-GENERATED: do not modify this file directly.", - "// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do:", - "// npm run fp", - importCommon ? `${lineBreak}import _ = require("../index");${lineBreak}` : '', - output, - "", - `declare const ${functionName}: ${interfaceName};`, + interfaces: builderFp[functionName]([0], [1], [2], [3], [4])([0], [1], [2], [3], [4]), + })); + for (const functionName of functionNames) { + const output = [ + `import { ${functionName} } from "../fp";`, `export = ${functionName};`, "", ].join(lineBreak); @@ -222,12 +227,12 @@ async function processDefinitions(filePaths: string[], commonTypes: string[]): P console.error(`failed to write file: ${targetFile}`, err); }); } - return functionNames; + return interfaceGroups; } async function parseFile(filePath: string, commonTypes: string[]): Promise { const definitionString = await readFile(filePath); - const newCommonTypeRegExp = / (?:type|interface) ([A-Za-z0-9]+)/g; + const newCommonTypeRegExp = / (?:type|interface) ([A-Za-z0-9_]+)/g; let newCommonType = newCommonTypeRegExp.exec(definitionString); while (newCommonType) { if (!commonTypes.includes(newCommonType[1])) @@ -246,14 +251,16 @@ async function parseFile(filePath: string, commonTypes: string[]): Promise !_.isEmpty(d.constants)); return definitons; } function parseDefinitions(definitionString: string, startIndex: number, endIndex: number, filePath: string, commonTypes: string[], name?: string): Definition[] { + const parentName = name; const overloadRegExp = name ? / [<(]/g : / (\w+)[<(:]/g; overloadRegExp.lastIndex = startIndex; let overloadMatch = overloadRegExp.exec(definitionString); @@ -271,7 +278,7 @@ function parseDefinitions(definitionString: string, startIndex: number, endIndex if (!currentDefinition || name !== currentDefinition.name) { if (currentDefinition && !_.isEmpty(currentDefinition.overloads)) definitons.push(currentDefinition); - currentDefinition = { name, overloads: [], jsdoc: "" }; + currentDefinition = { name, overloads: [], constants: [], jsdoc: "" }; const jsdocStartIndex = definitionString.lastIndexOf("/**", overloadStartIndex); const jsdocEndIndex = definitionString.indexOf("*/", jsdocStartIndex); if (jsdocStartIndex !== -1 && jsdocStartIndex > startIndex && jsdocEndIndex !== -1 && jsdocEndIndex < overloadStartIndex) { @@ -382,31 +389,43 @@ function parseDefinitions(definitionString: string, startIndex: number, endIndex } const [definition] = parseDefinitions(definitionString, interfaceStartIndex, interfaceEndIndex, filePath, commonTypes, name); if (definition) { - for (const overload of definition.overloads) - overload.jsdoc = currentDefinition.jsdoc; + if (currentDefinition.jsdoc) + for (const overload of definition.overloads) + overload.jsdoc = currentDefinition.jsdoc; currentDefinition.overloads.push(...definition.overloads); + currentDefinition.constants.push(...definition.constants); } } } + if (parentName && currentDefinition) { + const constantRexExp = / (\w+): *([^()\r\n]+);[\r\n]/g; + constantRexExp.lastIndex = startIndex; + for (let constantMatch = constantRexExp.exec(definitionString); constantMatch && constantMatch.index < endIndex; constantMatch = constantRexExp.exec(definitionString)) { + currentDefinition.constants.push(`${constantMatch[1]}: ${constantMatch[2]}`); + } + } + if (currentDefinition && !_.isEmpty(currentDefinition.overloads)) definitons.push(currentDefinition); return definitons; } -function curryOverloads(overloads: Overload[], functionName: string, paramOrder: number[], spreadIndex: number, isFixed: boolean): Interface[] { - overloads = _.cloneDeep(overloads); - +function curryDefinition(definition: Definition, paramOrder: number[], spreadIndex: number, isFixed: boolean): Interface[] { + // Remove any duplicate/redundant overloads + let overloads = _.uniqWith(_.cloneDeep(definition.overloads), + (a, b) => _.isEqual(a.params, b.params) && _.isEqual(getUsedTypeParams(a.params, a.typeParams), getUsedTypeParams(b.params, b.typeParams))); + const functionName = definition.name; // Remove unused type parameters for (const overload of overloads) { for (let i = 0; i < overload.typeParams.length; ++i) { - const search = new RegExp(`\\b${overload.typeParams[i].name}\\b`); + const typeParam = overload.typeParams[i]; + const search = new RegExp(`\\b${typeParam.name}\\b`); if (overload.params.every(p => !search.test(p)) && !search.test(overload.returnType)) { + // overload.returnType = overload.returnType.replace(search, typeParam.extends || "any"); overload.typeParams.splice(i, 1); --i; } } - if (overloads.some(o => o !== overload && _.isEqual(o, overload))) - _.pull(overloads, overload); } if (!isFixed) { @@ -414,9 +433,10 @@ function curryOverloads(overloads: Overload[], functionName: string, paramOrder: for (const overload of overloads) overload.params = overload.params.map(p => p.replace(/\?:/g, ":")); // No optional parameters return [{ - name: _.upperFirst(functionName), + name: getInterfaceBaseName(functionName), typeParams: [], overloads, + constants: definition.constants, }]; } paramOrder = paramOrder.filter(p => typeof p === "number"); @@ -540,6 +560,7 @@ function curryOverloads(overloads: Overload[], functionName: string, paramOrder: } for (const interfaceDef of interfaces) interfaceDef.overloads = mergeSimilarOverloads(interfaceDef.overloads); + interfaces[0].constants = definition.constants; return interfaces; } @@ -552,6 +573,10 @@ function getParamType(param: string) { return index !== -1 ? param.substring(index + 1).trim() : "any"; } +function isPlaceholder(param: string) { + return param.endsWith("__"); +} + function preProcessOverload(overload: Overload, functionName: string, arity: number): void { overload.params = overload.params .slice(0, arity) @@ -601,41 +626,26 @@ function capCallback(parameter: string, functionName: string): string { } function curryOverload(overload: Overload, functionName: string, overloadId: number): Interface[] { - let baseName = _.upperFirst(functionName); - if (baseName === "Pick") // A type called "Pick" already exists, so rename to avoid conflicts - baseName = "Lodash" + baseName; + const baseName = getInterfaceBaseName(functionName); if (overload.params.length <= 1) { // Functions with 0 or 1 arguments are not curried. Just use a basic function type. return [{ name: baseName, overloads: [overload], typeParams: [], + constants: [], }]; } + // Create a separate interface for each possible combination of parameters that could be passed. + // i = binary representation of which parameters were passed to result in this interface (reversed), e.g. + // 1 = 0001 = 1st parameter was passed; 2nd-4th remain + // 6 = 1010 = 2nd and 4th parameters were passed; 1st and 3rd remain const interfaces: Interface[] = []; - let passTypeParams: TypeParam[] = []; - for (let i = 0; i < overload.params.length; ++i) { - const interfaceDef = { - name: getInterfaceName(baseName, overloadId, i, []), - typeParams: _.cloneDeep(passTypeParams), - overloads: curryParams( - overload.params.slice(i), - _.without(overload.typeParams, ...passTypeParams), - overload.returnType, - baseName, - passTypeParams, - overloadId, - i, - overload.jsdoc, - ), - }; + const interfaceCount = (1 << overload.params.length) - 1; + for (let i = 0; i < interfaceCount; ++i) { + const interfaceDef = curryParams(baseName, overloadId, overload, i); interfaces.push(interfaceDef); - const currentParams = overload.params.slice(0, i + 1); - const usedTypeParams = overload.typeParams.filter(tp => currentParams.some(p => new RegExp(`\\b${tp.name}\\b`).test(p))); - usedTypeParams.unshift(...overload.typeParams.filter(tp => !usedTypeParams.includes(tp) && usedTypeParams.some(tp2 => !!tp2.extends && new RegExp(`\\b${tp.name}\\b`).test(tp2.extends)))); - const unusedParams = overload.params.slice(i + 1).concat(overload.returnType); - passTypeParams = usedTypeParams.filter(tp => unusedParams.some(p => new RegExp(`\\b${tp.name}\\b`).test(p))); } // The T[keyof T] constraint doesn't work so well if it's the only constraint. Convert to a plain old T constraint so it can be merged with // other ValueIteratee overloads @@ -687,38 +697,87 @@ function curryOverload(overload: Overload, functionName: string, overloadId: num } function curryParams( - params: string[], - typeParams: TypeParam[], - returnType: string, baseName: string, - interfaceTypeParams: TypeParam[], - overloadId: number, - index: number, - jsdoc: string, -): Overload[] { - // Assume params.length >= 1 - const overloads: Overload[] = [{ + sourceOverloadId: number, + sourceOverload: Overload, + interfaceIndex: number, +): Interface { + const params = getInterfaceParams(sourceOverload, interfaceIndex); + const interfaceTypeParams = getInterfaceTypeParams(sourceOverload, interfaceIndex); + + const prevParams = _.without(sourceOverload.params, ...params); + const prevTypeParams = getUsedTypeParams(prevParams, sourceOverload.typeParams); + const typeParams = _.without(sourceOverload.typeParams, ...prevTypeParams); + // 1st overload takes no parameters and just returns the same interface (effectively a no-op) + // HACK: omit the parameterless overload because it's not very useful, and it causes the build to run out of memory + // This assumes params.length > 0, which is true because curryParams is only called when params.length >= 2. + /*const overloads: Overload[] = [{ typeParams: [], params: [], - returnType: getInterfaceName(baseName, overloadId, index, interfaceTypeParams), - jsdoc, - }]; - for (let i = 1; i <= params.length; ++i) { - const currentParams = params.slice(0, i); - const usedTypeParams = i < params.length ? typeParams.filter(tp => currentParams.some(p => new RegExp(`\\b${tp.name}\\b`).test(p))) : typeParams; - usedTypeParams.unshift(...typeParams.filter(tp => !usedTypeParams.includes(tp) && usedTypeParams.some(tp2 => !!tp2.extends && new RegExp(`\\b${tp.name}\\b`).test(tp2.extends)))); - const unusedParams = params.slice(i).concat(returnType); - const passTypeParams = usedTypeParams.concat(interfaceTypeParams).filter(tp => unusedParams.some(p => new RegExp(`\\b${tp.name}\\b`).test(p))); - const currentReturnType = i < params.length ? getInterfaceName(baseName, overloadId, index + i, passTypeParams) : returnType; + returnType: getInterfaceName(baseName, sourceOverloadId, interfaceIndex, interfaceTypeParams), + jsdoc: sourceOverload.jsdoc, + }];*/ + const overloads: Overload[] = []; + const lastOverload = (1 << params.length) - 1; + for (let i = 1; i <= lastOverload; ++i) { + // xxxx i = number of parameters used by this overload + // const totalCombinations = nCk(params.length, i); + // i = binary representation of which parameters are used for this overload (reversed), e.g. + // 1 = 0001 -> 1000 = 1st parameter + // 6 = 1010 -> 0101 = 2nd and 4th parameters + const currentParams = params.map((p, j) => (i & (1 << j)) ? p : `${getParamName(p)}: __`); + while (currentParams.length > 0 && _.last(currentParams)!.endsWith("__")) + currentParams.pop(); // There's no point in passing a placeholder as the last parameter, so don't allow it. + + const usedTypeParams = i < lastOverload ? getUsedTypeParams(currentParams, typeParams) : typeParams; + const combinedIndex = combineIndexes(interfaceIndex, i); + const passTypeParams = getInterfaceTypeParams(sourceOverload, combinedIndex); + const currentReturnType = i < lastOverload ? getInterfaceName(baseName, sourceOverloadId, combinedIndex, passTypeParams) : sourceOverload.returnType; overloads.push({ typeParams: _.cloneDeep(usedTypeParams), params: currentParams, returnType: currentReturnType, - jsdoc, + jsdoc: interfaceIndex === 0 ? sourceOverload.jsdoc : "", }); } - return overloads; + const interfaceDef: Interface = { + name: getInterfaceName(baseName, sourceOverloadId, interfaceIndex, []), + typeParams: _.cloneDeep(interfaceTypeParams), + overloads, + constants: [], + }; + // Remove the `extends` constraint from interface type parameters, because sometimes they extend things that aren't passed to the interface. + for (const typeParam of interfaceDef.typeParams) { + if (!_.startsWith(typeParam.extends, "keyof ")) // We need to keep `extends keyof` constraints, because they're needed for TObject[TKey] to work. + delete typeParam.extends; + } + return interfaceDef; +} + +function getInterfaceBaseName(functionName: string) { + return "Lodash" + _.upperFirst(functionName); +} + +function getInterfaceParams(overload: Overload, interfaceIndex: number) { + return overload.params.filter((p, j) => !(interfaceIndex & (1 << j))); +} + +function getUsedTypeParams(params: string[], typeParams: TypeParam[]) { + const usedTypeParams = typeParams.filter(tp => params.some(p => new RegExp(`\\b${tp.name}\\b`).test(p))); + usedTypeParams.unshift(...typeParams.filter(tp => + !usedTypeParams.includes(tp) && usedTypeParams.some(tp2 => !!tp2.extends && new RegExp(`\\b${tp.name}\\b`).test(tp2.extends)))); + return usedTypeParams; +} + +function getInterfaceTypeParams(overload: Overload, interfaceIndex: number) { + const currentParams = getInterfaceParams(overload, interfaceIndex); + const passedParams = _.without(overload.params, ...currentParams); + const passedTypeParams = getUsedTypeParams(passedParams, overload.typeParams); + const interfaceTypeParams = passedTypeParams.filter(tp => currentParams.concat(overload.returnType).some(p => new RegExp(`\\b${tp.name}\\b`).test(p))); + interfaceTypeParams.unshift(...overload.typeParams.filter(tp => + !interfaceTypeParams.includes(tp) && interfaceTypeParams.some(tp2 => !!tp2.extends && new RegExp(`^keyof ${tp.name}\\b`).test(tp2.extends)))); + return interfaceTypeParams; } function mergeInterfaces(interfaces: Interface[]): void { @@ -732,10 +791,12 @@ function mergeSimilarOverloads(overloads: Overload[]): Overload[] { const newOverloads = _.cloneDeep(overloads); for (const overload of newOverloads) { // We can merge if all param types are the same except one, and the return types are the same. + // Also, we can't merge a placeholder param with a non-placeholder. const others = newOverloads.filter(o2 => o2 !== overload && _.isEqual(overload.typeParams, o2.typeParams) && overload.params.length === o2.params.length && overload.params.length >= 1 + && overload.params.every((p, i) => isPlaceholder(p) === isPlaceholder(o2.params[i])) && overload.params.filter((p, i) => getParamType(p) !== getParamType(o2.params[i])).length <= 1 && overload.returnType === o2.returnType); if (_.isEmpty(others)) @@ -748,8 +809,8 @@ function mergeSimilarOverloads(overloads: Overload[]): Overload[] { .value(); if (differingParamIndexes.length > 1) continue; // Only one param is different, but it's a different param for some overloads, so we can't merge + const similarOverloads = [overload].concat(others); for (let i = 0; i < overload.params.length; ++i) { - const similarOverloads = [overload].concat(others); const paramNames = _.uniq(similarOverloads.map(o => getParamName(o.params[i]))); const newParamName = (paramNames.length > 1) ? `${paramNames[0]}Or${paramNames.slice(1).map(_.upperFirst).join("Or")}` : paramNames[0]; @@ -767,6 +828,19 @@ function mergeSimilarOverloads(overloads: Overload[]): Overload[] { return newOverloads; } +function combineIndexes(i1: number, i2: number): number { + let result = i1; + let resultMask = 1; + for (let i2mask = 1; i2mask <= i2; i2mask <<= 1) { + while (result & resultMask) + resultMask <<= 1; + if (i2 & i2mask) + result += resultMask; + resultMask <<= 1; + } + return result; +} + function getInterfaceName(baseName: string, overloadId: number, index: number, typeParams: TypeParam[]): string { let interfaceName = baseName; if (index > 0) @@ -775,25 +849,31 @@ function getInterfaceName(baseName: string, overloadId: number, index: number, t } function interfaceToString(interfaceDef: Interface): string { - if (interfaceDef.overloads.length === 0) { + if (_.isEmpty(interfaceDef.overloads)) { // No point in creating an empty interface return ""; - } else if (interfaceDef.overloads.length === 1) { + } else if (interfaceDef.overloads.length === 1 && _.isEmpty(interfaceDef.constants)) { // Don't create an interface for a single type. Instead use a basic type def. - let jsdoc = interfaceDef.overloads[0].jsdoc; - if (jsdoc) - jsdoc += lineBreak; - interfaceDef.overloads[0].jsdoc = ""; - return `type ${interfaceDef.name}${typeParamsToString(interfaceDef.typeParams)} =${lineBreak}${tab(jsdoc + overloadToString(interfaceDef.overloads[0], true), 1)}`; + const overload = interfaceDef.overloads[0]; + // HACK: omit jsdoc comments because they cause the build to run out of memory + // const jsdoc = overload.jsdoc; + const jsdoc = ""; + overload.jsdoc = ""; + let overloadString = overloadToString(overload, true); + overloadString = jsdoc ? lineBreak + tab(jsdoc + lineBreak + overloadString, 1) : " " + overloadString; + return `type ${interfaceDef.name}${typeParamsToString(interfaceDef.typeParams)} =${overloadString}`; } else { - const overloadStrings = interfaceDef.overloads.map(o => lineBreak + tab(overloadToString(o), 1)).join(""); + const overloadStrings = interfaceDef.overloads.map(o => lineBreak + tab(overloadToString(o), 1)).join("") + + interfaceDef.constants.map(c => `${lineBreak}${tab(c, 1)};`).join(""); return `interface ${interfaceDef.name}${typeParamsToString(interfaceDef.typeParams)} {${overloadStrings}${lineBreak}}`; } } function overloadToString(overload: Overload, arrowSyntax = false): string { const joinedParams = overload.params.join(", "); - let jsdoc = overload.jsdoc; + // HACK: omit jsdoc comments because they cause the build to run out of memory + // let jsdoc = overload.jsdoc; + let jsdoc = ""; if (jsdoc) jsdoc += lineBreak; if (overload.tslintDisable) @@ -825,7 +905,7 @@ function getLineNumber(fileContents: string, index: number) { function tab(s: string, count: number) { const prepend: string = " ".repeat(count * 4); - return prepend + s.replace(/(?:\r\n|\n|\r)(.)/g, `${lineBreak}${prepend}$1`); + return (s[0] === "\n" || s[0] === "\r" ? "" : prepend) + s.replace(/(?:\r\n|\n|\r)(.)/g, `${lineBreak}${prepend}$1`); } function indexOfAny(source: string, values: string[], position?: number): number { diff --git a/types/lodash/tsconfig.json b/types/lodash/tsconfig.json index 926c4217d7..60a2e8323c 100644 --- a/types/lodash/tsconfig.json +++ b/types/lodash/tsconfig.json @@ -19,7 +19,6 @@ }, "files": [ "index.d.ts", - "common/common.d.ts", "lodash-tests.ts", "add.d.ts", "after.d.ts", @@ -715,6 +714,8 @@ "fp/zipObj.d.ts", "fp/zipObject.d.ts", "fp/zipObjectDeep.d.ts", - "fp/zipWith.d.ts" + "fp/zipWith.d.ts", + "fp/__.d.ts", + "fp/placeholder.d.ts" ] } \ No newline at end of file diff --git a/types/luxon/index.d.ts b/types/luxon/index.d.ts index ed78e5d542..c3b9d2a029 100644 --- a/types/luxon/index.d.ts +++ b/types/luxon/index.d.ts @@ -135,8 +135,10 @@ declare module 'luxon' { second?: number, millisecond?: number ): DateTime; - static max(...dateTimes: DateTime[]): DateTime | undefined; - static min(...dateTimes: DateTime[]): DateTime | undefined; + static max(): undefined; + static max(...dateTimes: DateTime[]): DateTime; + static min(): undefined; + static min(...dateTimes: DateTime[]): DateTime; static utc( year?: number, month?: number, diff --git a/types/mailgun-js/index.d.ts b/types/mailgun-js/index.d.ts new file mode 100644 index 0000000000..0ab5efcf45 --- /dev/null +++ b/types/mailgun-js/index.d.ts @@ -0,0 +1,167 @@ +// Type definitions for mailgun-js 0.16 +// Project: https://github.com/bojand/mailgun-js +// Definitions by: Sampson Oliver +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +declare const out: Mailgun.MailgunExport; +export = out; + +declare namespace Mailgun { + interface ConstructorParams { + apiKey: string; + publicApiKey?: string; + domain: string; + mute?: boolean; + timeout?: number; + host?: string; + endpoint?: string; + protocol?: string; + port?: number; + retry?: + | number + | { + times: number; + interval: number; + }; + proxy?: string; + } + + interface Error { + statusCode: number; + message: string; + } + + interface AttachmentParams { + data: string | Buffer | NodeJS.ReadWriteStream; + filename?: string; + knownLength?: number; + contentType?: string; + } + + class Attachment { + constructor(params: AttachmentParams); + data: string | Buffer | NodeJS.ReadWriteStream; + filename?: string; + knownLength?: number; + contentType?: string; + getType(): string; + } + + interface MailgunExport { + new (options: ConstructorParams): Mailgun; + (options: ConstructorParams): Mailgun; + } + + namespace messages { + interface SendData { + from?: string; + to: string | string[]; + cc?: string; + bcc?: string; + subject?: string; + text?: string; + html?: string; + attachment?: string | Buffer | NodeJS.ReadWriteStream | Attachment; + } + + interface BatchData extends SendData { + "recipient-variables"?: BatchSendRecipientVars; + } + + interface BatchSendRecipientVars { + [email: string]: { + first: string; + id: number; + }; + } + + interface SendResponse { + message: string; + id: string; + } + } + + namespace lists { + interface MemberCreateData { + subscribed: boolean; + address: string; + name: string; + vars?: object; + } + + interface MemberUpdateData { + subscribed: boolean; + name: string; + vars?: object; + } + + interface Members { + create( + data: MemberCreateData, + callback?: (err: Error, data: any) => void + ): Promise; + + add( + data: MemberCreateData[], + callback?: (err: Error, data: any) => void + ): Promise; + + list(callback?: (err: Error, data: any) => void): Promise; + } + + interface Member { + update( + data: MemberUpdateData, + callback?: (err: Error, data: any) => void + ): Promise; + } + } + + namespace validation { + interface ParseResponse { + parsed: string[]; + unparseable: string[]; + } + + interface ValidateResponse { + is_valid: boolean; + } + } + + interface Mailgun { + messages(): Messages; + lists(list: string): Lists; + Attachment: typeof Attachment; + validateWebhook( + bodyTimestamp: number, + bodyToken: string, + bodySignature: string + ): boolean; + + parse( + addressList: string[], + callback?: (error: Error, body: validation.ValidateResponse) => void + ): Promise; + + validate( + address: string, + callback?: (error: Error, body: validation.ValidateResponse) => void + ): Promise; + } + + interface Lists { + info(callback?: (error: Error, data: any) => void): Promise; + members(): lists.Members; + members(member: string): lists.Member; + } + + interface Messages { + send( + data: messages.SendData | messages.BatchData, + callback?: (error: Error, body: messages.SendResponse) => void + ): Promise; + } +} diff --git a/types/mailgun-js/mailgun-js-tests.ts b/types/mailgun-js/mailgun-js-tests.ts new file mode 100644 index 0000000000..dfbe8ab4a1 --- /dev/null +++ b/types/mailgun-js/mailgun-js-tests.ts @@ -0,0 +1,32 @@ +import * as mailgunFactory from "mailgun-js"; +import mailgunFactory2 = require('mailgun-js'); + +const mailgun = new mailgunFactory({ + apiKey: "auth.api_key", + domain: "auth.domain" +}); + +const mailgun2 = new mailgunFactory2({ + apiKey: "auth.api_key", + domain: "auth.domain" +}); + +mailgun.messages().send( + { + to: "fixture.message.to" + }, + err => { + console.log; + } +); + +mailgun.messages().send( + { + to: "someone@email.com", + attachment: new mailgun.Attachment({ + data: "filepath", + filename: "my_custom_name.png" + }) + }, + (err, body) => {} +); diff --git a/types/mailgun-js/tsconfig.json b/types/mailgun-js/tsconfig.json new file mode 100644 index 0000000000..b6a747659c --- /dev/null +++ b/types/mailgun-js/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": false, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "mailgun-js-tests.ts"] +} diff --git a/types/mailgun-js/tslint.json b/types/mailgun-js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mailgun-js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index a51172daec..b6a63ef9dd 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -399,7 +399,7 @@ declare namespace mapboxgl { * Navigation */ export class NavigationControl extends Control { - constructor(); + constructor(options?: {showCompass?: boolean, showZoom?: boolean}); } export class PositionOptions { @@ -610,7 +610,7 @@ declare namespace mapboxgl { interface RasterSource extends Source { type: 'raster'; - url: string; + url?: string; tiles?: string[]; minzoom?: number; maxzoom?: number; diff --git a/types/mapbox-gl/mapbox-gl-tests.ts b/types/mapbox-gl/mapbox-gl-tests.ts index 422cb3913d..ce10a26564 100644 --- a/types/mapbox-gl/mapbox-gl-tests.ts +++ b/types/mapbox-gl/mapbox-gl-tests.ts @@ -205,6 +205,22 @@ var videoSourceObj = new mapboxgl.VideoSource({ map.addSource('some id', videoSourceObj); // add map.removeSource('some id'); // remove +/** + * Add Raster Source /// made URL optional to allow only tiles. + */ +map.addSource('radar', { + type: 'raster', + tiles: ['https://nowcoast.noaa.gov/arcgis/services/nowcoast/radar_meteo_imagery_nexrad_time/MapServer/WmsServer?bbox={bbox-epsg-3857}&service=WMS&request=GetMap&version=1.3.0&layers=1&styles=&format=image/png&transparent=true&height=256&width=256&crs=EPSG:3857'], + tileSize: 256 +}) + +map.addLayer({ + id: 'radar', + type: 'raster', + source: 'radar', + paint: {} +}) + /** * Popup */ diff --git a/types/mathjs/index.d.ts b/types/mathjs/index.d.ts index ad3dec6d75..a02729b635 100644 --- a/types/mathjs/index.d.ts +++ b/types/mathjs/index.d.ts @@ -1,18 +1,22 @@ -// Type definitions for mathjs +// Type definitions for mathjs 3.20 // Project: http://mathjs.org/ -// Definitions by: Ilya Shestakov +// Definitions by: Ilya Shestakov , +// Andy Patterson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 -declare var math: mathjs.IMathJsStatic; +import { Decimal } from 'decimal.js'; -declare namespace mathjs { +declare const math: math.MathJsStatic; // tslint:disable-line strict-export-declare-modifiers +export as namespace math; // tslint:disable-line strict-export-declare-modifiers +export = math; // tslint:disable-line strict-export-declare-modifiers +declare namespace math { // tslint:disable-line strict-export-declare-modifiers type MathArray = number[]|number[][]; type MathType = number|BigNumber|Fraction|Complex|Unit|MathArray|Matrix; type MathExpression = string|string[]|MathArray|Matrix; - export interface IMathJsStatic { - + interface MathJsStatic { e: number; pi: number; i: number; @@ -31,9 +35,9 @@ declare namespace mathjs { uninitialized: any; version: string; - config(options: any): void; + expression: MathNode; - expression: MathNode; + config: (options: any) => void; /** * Solves the linear equation system by forwards substitution. Matrix must be a lower triangular matrix. @@ -44,7 +48,7 @@ declare namespace mathjs { lsolve(L: Matrix|MathArray, b: Matrix|MathArray): Matrix|MathArray; /** - * Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in two matrices (L, U) + * Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in two matrices (L, U) * and a row permutation vector p where A[p,:] = L * U * @param A A two dimensional matrix or array for which to get the LUP decomposition. * @returns The lower triangular matrix, the upper triangular matrix and the permutation matrix. @@ -57,22 +61,22 @@ declare namespace mathjs { * @param b Column Vector * @returns Column vector with the solution to the linear system A * x = b */ - lusolve(A: Matrix|MathArray|Number, b: Matrix|MathArray): Matrix|MathArray; + lusolve(A: Matrix|MathArray|number, b: Matrix|MathArray): Matrix|MathArray; /** - * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix A is decomposed in + * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix A is decomposed in * two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U * @param A A two dimensional sparse matrix for which to get the LU decomposition. - * @param order The Symbolic Ordering and Analysis order: 0 - Natural ordering, no permutation vector q is - * returned 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A' 2 - Symbolic - * ordering and analisis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'. - * This is appropriatefor LU factorization of unsymmetric matrices. 3 - Symbolic ordering and analisis is performed - * on M = A' * A. This is best used for LU factorization is matrix M has no dense rows. A dense row is a row with + * @param order The Symbolic Ordering and Analysis order: 0 - Natural ordering, no permutation vector q is + * returned 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A' 2 - Symbolic + * ordering and analysis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'. + * This is appropriate for LU factorization of non-symmetric matrices. 3 - Symbolic ordering and analysis is performed + * on M = A' * A. This is best used for LU factorization is matrix M has no dense rows. A dense row is a row with * more than 10*sqr(columns) entries. * @param threshold Partial pivoting threshold (1 for partial pivoting) * @returns The lower triangular matrix, the upper triangular matrix and the permutation vectors. */ - slu(A: Matrix, order: Number, threshold: Number): any; + slu(A: Matrix, order: number, threshold: number): any; /** * Solves the linear equation system by backward substitution. Matrix must be an upper triangular matrix. U * x = b @@ -80,7 +84,7 @@ declare namespace mathjs { * @param b A column vector with the b values * @returns A column vector with the linear system solution (x) */ - usolve(U: Matrix|MathArray, b:Matrix|MathArray): Matrix|MathArray; + usolve(U: Matrix|MathArray, b: Matrix|MathArray): Matrix|MathArray; /** * Calculate the absolute value of a number. For matrices, the function is evaluated element wise. @@ -130,7 +134,7 @@ declare namespace mathjs { ceil(x: Matrix): Matrix; ceil(x: Unit): Unit; - /** + /** * Compute the cube of a value, x * x * x. For matrices, the function is evaluated element wise. * @param x Number for which to calculate the cube * @returns Cube of x @@ -151,7 +155,7 @@ declare namespace mathjs { */ divide(x: Unit, y: Unit): Unit; divide(x: number, y: number): number; - divide(x:MathType, y:MathType): MathType; + divide(x: MathType, y: MathType): MathType; /** * Divide two matrices element wise. The function accepts both matrices and scalar values. @@ -169,7 +173,7 @@ declare namespace mathjs { */ dotMultiply(x: MathType, y: MathType): MathType; - /** + /** * Calculates the power of x to y element wise. * @param x The base * @param y The exponent @@ -183,21 +187,21 @@ declare namespace mathjs { * #returns Exponent of x */ exp(x: number): number; - exp(x: BigNumber ): BigNumber ; - exp(x: Complex ): Complex ; - exp(x: MathArray ): MathArray ; + exp(x: BigNumber): BigNumber ; + exp(x: Complex): Complex ; + exp(x: MathArray): MathArray ; exp(x: Matrix): Matrix; - /** + /** * Round a value towards zero. For matrices, the function is evaluated element wise. * @param x Number to be rounded * @returns Rounded value */ fix(x: number): number; - fix(x: BigNumber ): BigNumber ; - fix(x: Fraction ): Fraction ; - fix(x: Complex ): Complex ; - fix(x: MathArray ): MathArray ; + fix(x: BigNumber): BigNumber ; + fix(x: Fraction): Fraction ; + fix(x: Complex): Complex ; + fix(x: MathArray): MathArray ; fix(x: Matrix): Matrix; /** @@ -206,10 +210,10 @@ declare namespace mathjs { * @returns Rounded value */ floor(x: number): number; - floor(x: BigNumber ): BigNumber ; - floor(x: Fraction ): Fraction ; - floor(x: Complex ): Complex ; - floor(x: MathArray ): MathArray ; + floor(x: BigNumber): BigNumber ; + floor(x: Fraction): Fraction ; + floor(x: Complex): Complex ; + floor(x: MathArray): MathArray ; floor(x: Matrix): Matrix; /** @@ -242,7 +246,7 @@ declare namespace mathjs { * For matrices, the function is evaluated element wise. */ lcm(a: number, b: number): number; - lcm(a: BigNumber , b: BigNumber ): BigNumber ; + lcm(a: BigNumber , b: BigNumber): BigNumber ; lcm(a: MathArray, b: MathArray): MathArray; lcm(a: Matrix, b: Matrix): Matrix; @@ -267,7 +271,7 @@ declare namespace mathjs { * Calculates the modulus, the remainder of an integer division. For matrices, the function is evaluated element wise. * The modulus is defined as: * x - y * floor(x / y) - * See http://en.wikipedia.org/wiki/Modulo_operation. + * @see http://en.wikipedia.org/wiki/Modulo_operation. * @param x Dividend * @param y Divisor */ @@ -276,7 +280,6 @@ declare namespace mathjs { /** * Multiply two values, x * y. The result is squeezed. For matrices, the matrix product is calculated. */ - multiply(x: MathArray|Matrix, y: MathArray|Matrix): Matrix; multiply(x: MathArray|Matrix, y: MathType): Matrix; multiply(x: Unit, y: Unit): Unit; multiply(x: number, y: number): number; @@ -304,7 +307,7 @@ declare namespace mathjs { * @param x The base * @param y The exponent */ - pow(x: number|BigNumber|Complex|MathArray|Matrix, y: number|BigNumber|Complex): number|BigNumber|Complex|MathArray|Matrix; + pow(x: MathType, y: number|BigNumber|Complex): MathType; /** * Round a value towards the nearest integer. For matrices, the function is evaluated element wise. @@ -321,9 +324,9 @@ declare namespace mathjs { * For matrices, the function is evaluated element wise. */ sign(x: number): number; - sign(x: BigNumber ): BigNumber; - sign(x: Fraction ): Fraction ; - sign(x: Complex ): Complex ; + sign(x: BigNumber): BigNumber; + sign(x: Fraction): Fraction ; + sign(x: Complex): Complex ; sign(x: MathArray): MathArray; sign(x: Matrix): Matrix; sign(x: Unit): Unit; @@ -332,8 +335,8 @@ declare namespace mathjs { * Calculate the square root of a value. For matrices, the function is evaluated element wise. */ sqrt(x: number): number; - sqrt(x: BigNumber ): BigNumber; - sqrt(x: Complex ): Complex ; + sqrt(x: BigNumber): BigNumber; + sqrt(x: Complex): Complex ; sqrt(x: MathArray): MathArray; sqrt(x: Matrix): Matrix; sqrt(x: Unit): Unit; @@ -342,9 +345,9 @@ declare namespace mathjs { * Compute the square of a value, x * x. For matrices, the function is evaluated element wise. */ square(x: number): number; - square(x: BigNumber ): BigNumber; - square(x: Fraction ): Fraction ; - square(x: Complex ): Complex ; + square(x: BigNumber): BigNumber; + square(x: Fraction): Fraction ; + square(x: Complex): Complex ; square(x: MathArray): MathArray; square(x: Matrix): Matrix; square(x: Unit): Unit; @@ -359,9 +362,9 @@ declare namespace mathjs { * For matrices, the function is evaluated element wise. Boolean values and strings will be converted to a number. For complex numbers, both real and complex value are inverted. */ unaryMinus(x: number): number; - unaryMinus(x: BigNumber ): BigNumber; - unaryMinus(x: Fraction ): Fraction ; - unaryMinus(x: Complex ): Complex ; + unaryMinus(x: BigNumber): BigNumber; + unaryMinus(x: Fraction): Fraction ; + unaryMinus(x: Complex): Complex ; unaryMinus(x: MathArray): MathArray; unaryMinus(x: Matrix): Matrix; unaryMinus(x: Unit): Unit; @@ -371,10 +374,10 @@ declare namespace mathjs { * For matrices, the function is evaluated element wise. */ unaryPlus(x: number): number; - unaryPlus(x: BigNumber ): BigNumber; - unaryPlus(x: Fraction ): Fraction ; + unaryPlus(x: BigNumber): BigNumber; + unaryPlus(x: Fraction): Fraction ; unaryPlus(x: string): string; - unaryPlus(x: Complex ): Complex ; + unaryPlus(x: Complex): Complex ; unaryPlus(x: MathArray): MathArray; unaryPlus(x: Matrix): Matrix; unaryPlus(x: Unit): Unit; @@ -393,7 +396,7 @@ declare namespace mathjs { * Bitwise NOT value, ~x. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. */ bitNot(x: number): number; - bitNot(x: BigNumber ): BigNumber ; + bitNot(x: BigNumber): BigNumber ; bitNot(x: MathArray): MathArray; bitNot(x: Matrix): Matrix; @@ -401,7 +404,7 @@ declare namespace mathjs { * Bitwise OR two values, x | y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the lowest print base. */ bitOr(x: number): number; - bitOr(x: BigNumber ): BigNumber ; + bitOr(x: BigNumber): BigNumber ; bitOr(x: MathArray): MathArray; bitOr(x: Matrix): Matrix; @@ -432,17 +435,19 @@ declare namespace mathjs { rightLogShift(x: number|MathArray|Matrix, y: number): number|MathArray|Matrix; /** - * The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. bellNumbers only takes integer arguments. The following condition must be enforced: n >= 0 + * The Bell Numbers count the number of partitions of a set. + * A partition is a pairwise disjoint subset of S whose union is S. bellNumbers only takes integer arguments. + * The following condition must be enforced: n >= 0 * @param n Total number of objects in the set */ - bellNumbers(n: Number): Number; + bellNumbers(n: number): number; bellNumbers(n: BigNumber): BigNumber; /** * The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0 - * @pararm n nth Catalan number + * @param n nth Catalan number */ - catalan(n: Number): Number; + catalan(n: number): number; catalan(n: BigNumber): BigNumber; /** @@ -451,22 +456,22 @@ declare namespace mathjs { * @param k Number of objects in the subset * @returns Returns the composition counts of n into k parts. */ - composition(n: Number|BigNumber, k: Number|BigNumber): Number|BigNumber + composition(n: number|BigNumber, k: number|BigNumber): number|BigNumber; /** - * The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. stirlingS2 only takes integer arguments. The following condition must be enforced: k <= n. + * The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. + * stirlingS2 only takes integer arguments. The following condition must be enforced: k <= n. * If n = k or k = 1, then s(n,k) = 1 * @param n Total number of objects in the set * @param k Number of objects in the subset */ - stirlingS2(n: Number|BigNumber, k: Number|BigNumber): Number|BigNumber; + stirlingS2(n: number|BigNumber, k: number|BigNumber): number|BigNumber; /** * Compute the argument of a complex value. For a complex number a + bi, the argument is computed as atan2(b, a). For matrices, the function is evaluated element wise. * @param x A complex number or array with complex numbers */ - arg(x: number): number; - arg(x: Complex): number; + arg(x: number|Complex): number; arg(x: MathArray): MathArray; arg(x: Matrix): Matrix; @@ -476,8 +481,8 @@ declare namespace mathjs { */ conj(x: number|BigNumber|Complex|MathArray|Matrix): number|BigNumber|Complex|MathArray|Matrix; - /** - * Get the imaginary part of a complex number. For a complex number a + bi, the function returns b. + /** + * Get the imaginary part of a complex number. For a complex number a + bi, the function returns b. * For matrices, the function is evaluated element wise. */ im(x: number|BigNumber|Complex|MathArray|Matrix): number|BigNumber|MathArray|Matrix; @@ -494,29 +499,28 @@ declare namespace mathjs { bignumber(x?: number|string|MathArray|Matrix|boolean): BigNumber; /** - * Create a boolean or convert a string or number to a boolean. In case of a number, true is returned for non-zero numbers, and false in case of zero. Strings can be 'true' or 'false', or can contain a number. When value is a matrix, all elements will be converted to boolean. + * Create a boolean or convert a string or number to a boolean. + * In case of a number, true is returned for non-zero numbers, and false in case of zero. + * Strings can be 'true' or 'false', or can contain a number. When value is a matrix, all elements will be converted to boolean. */ - boolean(x: string|number|boolean|MathArray|Matrix ): boolean|MathArray|Matrix; + boolean(x: string|number|boolean|MathArray|Matrix): boolean|MathArray|Matrix; /** * Wrap any value in a chain, allowing to perform chained operations on the value. - * All methods available in the math.js library can be called upon the chain, and then will be evaluated with the value itself as first argument. The chain can be closed by executing chain.done(), which returns the final value. + * All methods available in the math.js library can be called upon the chain, and then will be evaluated with the value itself as first argument. + * The chain can be closed by executing chain.done(), which returns the final value. * The chain has a number of special functions: * done() Finalize the chain and return the chain's value. * valueOf() The same as done() * toString() Executes math.format() onto the chain's value, returning a string representation of the value. */ - chain(value?: any): IMathJsChain; + chain(value?: any): MathJsChain; /** * Create a complex value or convert a value to a complex value. */ - complex(): Complex; + complex(arg?: Complex|string|MathArray| PolarCoordinates): Complex; complex(re: number, im: number): Complex; - complex(complex: Complex): Complex; - complex(arg: string): Complex; - complex(array: MathArray): Complex; - complex(obj: IPolarCoordinates): Complex; /** * Create a fraction convert a value to a fraction. @@ -529,8 +533,8 @@ declare namespace mathjs { index(...ranges: any[]): Index; /** - * Create a Matrix. The function creates a new math.type.Matrix object from an Array. A Matrix has utility functions - * to manipulate the data in the matrix, like getting the size and getting or setting values in the matrix. Supported + * Create a Matrix. The function creates a new math.type.Matrix object from an Array. A Matrix has utility functions + * to manipulate the data in the matrix, like getting the size and getting or setting values in the matrix. Supported * storage formats are 'dense' and 'sparse'. */ matrix(format?: 'sparse'|'dense'): Matrix; @@ -543,11 +547,11 @@ declare namespace mathjs { number(unit: Unit, valuelessUnit: Unit|string): number|MathArray|Matrix; /** - * Create a Sparse Matrix. The function creates a new math.type.Matrix object from an Array. A Matrix has utility + * Create a Sparse Matrix. The function creates a new math.type.Matrix object from an Array. A Matrix has utility * functions to manipulate the data in the matrix, like getting the size and getting or setting values in the matrix. * @param data A two dimensional array */ - sparse(data?: MathArray|Matrix, dataType?:string): Matrix; + sparse(data?: MathArray|Matrix, dataType?: string): Matrix; /** * Create a string or convert any object into a string. Elements of Arrays and Matrices are processed element wise. @@ -556,18 +560,17 @@ declare namespace mathjs { string(value: any): string|MathArray|Matrix; /** - * Create a unit. Depending on the passed arguments, the function will create and return a new math.type.Unit object. + * Create a unit. Depending on the passed arguments, the function will create and return a new math.type.Unit object. * When a matrix is provided, all elements will be converted to units. */ unit(unit: string): Unit; unit(value: number, unit: string): Unit; /** - * Create a user-defined unit and register it with the Unit type. + * Create a user-defined unit and register it with the Unit type. */ - createUnit(name: string): Unit; - createUnit(name: string, definition: string|UnitDefinition, options?: CreateUnitOptions): Unit; - createUnit(units: {[name: string]: string|UnitDefinition}, options?: CreateUnitOptions): Unit; + createUnit(name: string, definition?: string|UnitDefinition, options?: CreateUnitOptions): Unit; + createUnit(units: Record, options?: CreateUnitOptions): Unit; /** * Parse and compile an expression. Returns a an object with a function eval([scope]) to evaluate the compiled expression. @@ -578,8 +581,7 @@ declare namespace mathjs { /** * Evaluate an expression. */ - eval(expr: MathExpression, scope?: any): any; - eval(exprs: MathExpression[], scope?: any): any; + eval(expr: MathExpression|MathExpression[], scope?: any): any; /** * Retrieve help on a function or data type. Help files are retrieved from the documentation in math.expression.docs. @@ -598,21 +600,21 @@ declare namespace mathjs { parser(): Parser; /** - * Calculates: The eucledian distance between two points in 2 and 3 dimensional spaces. Distance between point - * and a line in 2 and 3 dimensional spaces. Pairwise distance between a set of 2D or 3D points NOTE: When - * substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c For parametric + * Calculates: The eucledian distance between two points in 2 and 3 dimensional spaces. Distance between point + * and a line in 2 and 3 dimensional spaces. Pairwise distance between a set of 2D or 3D points NOTE: When + * substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c For parametric * equation of a 3D line, x0, y0, z0, a, b, c are from: (x−x0, y−y0, z−z0) = t(a, b, c) */ - distance(x: MathArray|Matrix|any, y: MathArray|Matrix|any): Number | BigNumber; + distance(x: MathType, y: MathType): number | BigNumber; /** - * Calculates the point of intersection of two lines in two or three dimensions and of a line and a plane in - * three dimensions. The inputs are in the form of arrays or 1 dimensional matrices. The line intersection functions + * Calculates the point of intersection of two lines in two or three dimensions and of a line and a plane in + * three dimensions. The inputs are in the form of arrays or 1 dimensional matrices. The line intersection functions * return null if the lines do not meet. * Note: Fill the plane coefficients as x + y + z = c and not as x + y + z + c = 0. * @param w Co-ordinates of first end-point of first line * @param x Co-ordinates of second end-point of first line - * @param y Co-ordinates of first end-point of second line OR Co-efficients of the plane's equation + * @param y Co-ordinates of first end-point of second line OR Coefficients of the plane's equation * @param z Co-ordinates of second end-point of second line OR null if the calculation is for line and plane * @returns Returns the point of intersection of lines/lines-planes */ @@ -642,10 +644,10 @@ declare namespace mathjs { * Concatenate two or more matrices. * dim: number is a zero-based dimension over which to concatenate the matrices. By default the last dimension of the matrices. */ - concat(...args: (MathArray|Matrix|number)[]): MathArray|Matrix; + concat(...args: Array): MathArray|Matrix; /** - * Calculate the cross product for two vectors in three dimensional space. The cross product of A = [a1, a2, a3] + * Calculate the cross product for two vectors in three dimensional space. The cross product of A = [a1, a2, a3] * and B =[b1, b2, b3] is defined as: * cross(A, B) = [ a2 * b3 - a3 * b2, a3 * b1 - a1 * b3, a1 * b2 - a2 * b1 ] */ @@ -658,9 +660,9 @@ declare namespace mathjs { /** * Create a diagonal matrix or retrieve the diagonal of a matrix. - * When x is a vector, a matrix with vector x on the diagonal will be returned. When x is a two dimensional matrix, + * When x is a vector, a matrix with vector x on the diagonal will be returned. When x is a two dimensional matrix, * the matrixes kth diagonal will be returned - * as vector. When k is positive, the values are placed on the super diagonal. When k is negative, the values are + * as vector. When k is positive, the values are placed on the super diagonal. When k is negative, the values are * placed on the sub diagonal. * @param X A two dimensional matrix or a vector * @param k The diagonal where the vector will be filled in or retrieved. Default value: 0. @@ -670,7 +672,8 @@ declare namespace mathjs { diag(X: MathArray|Matrix, k: number|BigNumber, format?: string): Matrix; /** - * Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] + * Calculate the dot product of two vectors. + * The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] * is defined as: * dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn */ @@ -679,14 +682,13 @@ declare namespace mathjs { /** * Create a 2-dimensional identity matrix with size m x n or n x n. The matrix has ones on the diagonal and zeros elsewhere. */ - eye(n: number, format?: string): Matrix; + eye(n: number|number[], format?: string): Matrix; eye(m: number, n: number, format?: string): Matrix; - eye(size: number[], format?: string): Matrix; /** * Flatten a multi dimensional matrix into a single dimensional matrix. */ - flatten(x: MathArray|Matrix): MathArray|Matrix; + flatten(x: MathArray|Matrix): MathArray|Matrix; /** * Calculate the inverse of a square matrix. @@ -696,9 +698,8 @@ declare namespace mathjs { /** * Create a matrix filled with ones. The created matrix can have one or multiple dimensions. */ - ones(n: number, format?: string): MathArray|Matrix; + ones(n: number|number[], format?: string): MathArray|Matrix; ones(m: number, n: number, format?: string): MathArray|Matrix; - ones(size: number[], format?: string): MathArray|Matrix; /** * Create an array from a range. By default, the range end is excluded. This can be customized by providing an extra parameter includeEnd. @@ -709,8 +710,8 @@ declare namespace mathjs { * @returns Parameters describing the ranges start, end, and optional step. */ range(str: string, includeEnd?: boolean): Matrix; - range(start: number|BigNumber, end:number|BigNumber, includeEnd?:boolean): Matrix; - range(start: number|BigNumber, end: number|BigNumber, step: number|BigNumber, includeEnd?:boolean): Matrix; + range(start: number|BigNumber, end: number|BigNumber, includeEnd?: boolean): Matrix; + range(start: number|BigNumber, end: number|BigNumber, step: number|BigNumber, includeEnd?: boolean): Matrix; /** * Resize a matrix @@ -752,12 +753,11 @@ declare namespace mathjs { /** * Create a matrix filled with zeros. The created matrix can have one or multiple dimensions. */ - zeros(n: number, format?: string): MathArray|Matrix; + zeros(n: number|number[], format?: string): MathArray|Matrix; zeros(m: number, n: number, format?: string): MathArray|Matrix; - zeros(size: number[], format?: string): MathArray|Matrix; /** - * Compute the number of ways of picking k unordered outcomes from n possibilities. + * Compute the number of ways of picking k unordered outcomes from n possibilities. * Combinations only takes integer arguments. The following condition must be enforced: k <= n. */ combinations(n: number|BigNumber, k: number|BigNumber): number|BigNumber; @@ -775,7 +775,7 @@ declare namespace mathjs { factorial(n: number|BigNumber|MathArray|Matrix): number|BigNumber|MathArray|Matrix; /** - * Compute the gamma function of a value using Lanczos approximation for small values, and an extended + * Compute the gamma function of a value using Lanczos approximation for small values, and an extended * Stirling approximation for large values. * For matrices, the function is evaluated element wise. */ @@ -798,7 +798,7 @@ declare namespace mathjs { * @param n The number of objects in total * @param k The number of objects in the subset */ - permutations(n: number|BigNumber, k?:number|BigNumber): number|BigNumber; + permutations(n: number|BigNumber, k?: number|BigNumber): number|BigNumber; /** * Random pick a value from a one dimensional array. Array element is picked using a random function with uniform distribution. @@ -808,23 +808,18 @@ declare namespace mathjs { /** * Return a random number larger or equal to min and smaller than max using a uniform distribution. */ - random(): number; - random(max: number): number; - random(min: number, max: number): number; - random(size: MathArray|Matrix, max?: number): MathArray|Matrix; - random(size: MathArray|Matrix, min:number, max: number): MathArray|Matrix; + random(min?: number, max?: number): number; + random(size: MathArray|Matrix, min?: number, max?: number): MathArray|Matrix; /** * Return a random integer number larger or equal to min and smaller than max using a uniform distribution. */ - randomInt(max: number): number; - randomInt(min: number, max: number): number; - randomInt(size: MathArray|Matrix, max?: number): MathArray|Matrix; - randomInt(size: MathArray|Matrix, min:number, max: number): MathArray|Matrix; + randomInt(min: number, max?: number): number; + randomInt(size: MathArray|Matrix, min?: number, max?: number): MathArray|Matrix; /** * Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y. - * x and y are considered equal when the relative difference between x and y is smaller than the configured epsilon. + * x and y are considered equal when the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. * For matrices, the function is evaluated element wise. */ @@ -837,91 +832,78 @@ declare namespace mathjs { /** * Test whether two values are equal. - * - * The function tests whether the relative difference between x and y is smaller than the configured epsilon. + * + * The function tests whether the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. In case of complex numbers, x.re must equal y.re, and x.im must equal y.im. - * * Values null and undefined are compared strictly, thus null is only equal to null and nothing else, and undefined is only equal to undefined and nothing else. */ equal(x: MathType, y: MathType): boolean|MathArray|Matrix; /** * Test whether value x is larger than y. - * - * The function returns true when x is larger than y and the relative difference between x and y is larger than the configured epsilon. + * The function returns true when x is larger than y and the relative difference between x and y is larger than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. */ larger(x: MathType, y: MathType): boolean|MathArray|Matrix; /** * Test whether value x is larger or equal to y. - * - * The function returns true when x is larger than y or the relative difference between x and y is smaller than the configured epsilon. + * The function returns true when x is larger than y or the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. */ largerEq(x: MathType, y: MathType): boolean|MathArray|Matrix; /** * Test whether value x is smaller than y. - * - * The function returns true when x is smaller than y and the relative difference between x and y is smaller than the configured epsilon. + * The function returns true when x is smaller than y and the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. */ smaller(x: MathType, y: MathType): boolean|MathArray|Matrix; /** * Test whether value x is smaller or equal to y. - * - * The function returns true when x is smaller than y or the relative difference between x and y is smaller than the configured epsilon. + * The function returns true when x is smaller than y or the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. For matrices, the function is evaluated element wise. */ smallerEq(x: MathType, y: MathType): boolean|MathArray|Matrix; /** * Test whether two values are unequal. - * - * The function tests whether the relative difference between x and y is larger than the configured epsilon. The function cannot + * The function tests whether the relative difference between x and y is larger than the configured epsilon. The function cannot * be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. In case of complex numbers, x.re must unequal y.re, or x.im must unequal y.im. - * - * Values null and undefined are compared strictly, thus null is unequal with everything except null, and undefined is unequal with - * everying except. undefined. + * Values null and undefined are compared strictly, thus null is unequal with everything except null, and undefined is unequal with + * everything except undefined. */ unequal(x: MathType, y: MathType): boolean|MathArray|Matrix; /** - * Compute the maximum value of a matrix or a list with values. In case of a multi dimensional array, the maximum of the flattened + * Compute the maximum value of a matrix or a list with values. In case of a multi dimensional array, the maximum of the flattened * array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ max(...args: MathType[]): any; max(A: MathArray|Matrix, dim?: number): any; /** - * Compute the mean value of matrix or a list with values. In case of a multi dimensional array, the mean of the flattened array will be + * Compute the mean value of matrix or a list with values. In case of a multi dimensional array, the mean of the flattened array will be * calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ mean(...args: MathType[]): any; mean(A: MathArray|Matrix, dim?: number): any; /** - * Compute the median of a matrix or a list with values. The values are sorted and the middle value is returned. In case of an + * Compute the median of a matrix or a list with values. The values are sorted and the middle value is returned. In case of an * even number of values, the average of the two middle values is returned. Supported types of values are: Number, BigNumber, Unit - * * In case of a (multi dimensional) array or matrix, the median of all elements will be calculated. */ median(...args: MathType[]): any; /** - * Compute the maximum value of a matrix or a list of values. In case of a multi dimensional array, the maximum of the flattened + * Compute the maximum value of a matrix or a list of values. In case of a multi dimensional array, the maximum of the flattened * array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ min(...args: MathType[]): any; @@ -938,21 +920,18 @@ declare namespace mathjs { prod(...args: MathType[]): any; /** - * Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. + * Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. * Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber - * * In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated. */ - quantileSeq(A: MathArray|Matrix, prob: Number|BigNumber|MathArray, sorted?: boolean): Number|BigNumber|Unit|MathArray; + quantileSeq(A: MathArray|Matrix, prob: number|BigNumber|MathArray, sorted?: boolean): number|BigNumber|Unit|MathArray; /** - * Compute the standard deviation of a matrix or a list with values. The standard deviations is defined as the square root of the - * variance: std(A) = sqrt(var(A)). In case of a (multi dimensional) array or matrix, the standard deviation over all elements will + * Compute the standard deviation of a matrix or a list with values. The standard deviations is defined as the square root of the + * variance: std(A) = sqrt(var(A)). In case of a (multi dimensional) array or matrix, the standard deviation over all elements will * be calculated. - * - * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following + * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following * values: - * * 'unbiased' (default) The sum of squared errors is divided by (n - 1) * 'uncorrected' The sum of squared errors is divided by n * 'biased' The sum of squared errors is divided by (n + 1) @@ -962,23 +941,21 @@ declare namespace mathjs { /** * Compute the sum of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the sum of all elements will be calculated. */ - sum(...args: (Number|BigNumber|Fraction)[]): any; + sum(...args: Array): any; sum(array: MathArray|Matrix): any; /** - * Compute the variance of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the variance over all + * Compute the variance of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the variance over all * elements will be calculated. - * - * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the + * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the * following values: - * * 'unbiased' (default) The sum of squared errors is divided by (n - 1) * 'uncorrected' The sum of squared errors is divided by n * 'biased' The sum of squared errors is divided by (n + 1) - * Note that older browser may not like the variable name var. In that case, the function can be called as math['var'](...) + * Note that older browser may not like the variable name var. In that case, the function can be called as math['var'](...) * instead of math.var(...). */ - var(...args: (Number|BigNumber|Fraction)[]): any; + var(...args: Array): any; var(array: MathArray|Matrix, normalization?: string): any; /** @@ -1076,9 +1053,8 @@ declare namespace mathjs { atan(x: Matrix): Matrix; /** - * Calculate the inverse tangent function with two arguments, y/x. By providing two arguments, the right quadrant of the + * Calculate the inverse tangent function with two arguments, y/x. By providing two arguments, the right quadrant of the * computed angle can be determined. - * * For matrices, the function is evaluated element wise. */ atan2(y: number, x: number): number; @@ -1093,127 +1069,105 @@ declare namespace mathjs { atanh(x: MathArray): MathArray; atanh(x: Matrix): Matrix; - /** - * Calculate the cosine of a value. For matrices, the function is evaluated element wise. - */ - asin(x: number): number; - asin(x: BigNumber): BigNumber; - asin(x: Complex): Complex; - asin(x: Unit): number; - asin(x: MathArray): MathArray; - asin(x: Matrix): Matrix; - /** * Calculate the hyperbolic cosine of a value, defined as cosh(x) = 1/2 * (exp(x) + exp(-x)). For matrices, the function is evaluated element wise. */ - cosh(x: number): number; + cosh(x: number|Unit): number; cosh(x: BigNumber): BigNumber; cosh(x: Complex): Complex; - cosh(x: Unit): number; cosh(x: MathArray): MathArray; cosh(x: Matrix): Matrix; /** * Calculate the cotangent of a value. cot(x) is defined as 1 / tan(x). For matrices, the function is evaluated element wise. */ - cot(x: number): number; + cot(x: number|Unit): number; cot(x: Complex): Complex; - cot(x: Unit): number; cot(x: MathArray): MathArray; cot(x: Matrix): Matrix; /** * Calculate the hyperbolic cotangent of a value, defined as coth(x) = 1 / tanh(x). For matrices, the function is evaluated element wise. */ - coth(x: number): number; + coth(x: number|Unit): number; coth(x: Complex): Complex; - coth(x: Unit): number; coth(x: MathArray): MathArray; coth(x: Matrix): Matrix; /** * Calculate the cosecant of a value, defined as csc(x) = 1/sin(x). For matrices, the function is evaluated element wise. */ - csc(x: number): number; + csc(x: number|Unit): number; csc(x: Complex): Complex; - csc(x: Unit): number; csc(x: MathArray): MathArray; csc(x: Matrix): Matrix; /** * Calculate the hyperbolic cosecant of a value, defined as csch(x) = 1 / sinh(x). For matrices, the function is evaluated element wise. */ - csch(x: number): number; + csch(x: number|Unit): number; csch(x: Complex): Complex; - csch(x: Unit): number; csch(x: MathArray): MathArray; csch(x: Matrix): Matrix; /** * Calculate the secant of a value, defined as sec(x) = 1/cos(x). For matrices, the function is evaluated element wise. */ - sec(x: number): number; + sec(x: number|Unit): number; sec(x: Complex): Complex; - sec(x: Unit): number; sec(x: MathArray): MathArray; sec(x: Matrix): Matrix; /** * Calculate the hyperbolic secant of a value, defined as sech(x) = 1 / cosh(x). For matrices, the function is evaluated element wise. */ - sech(x: number): number; + sech(x: number|Unit): number; sech(x: Complex): Complex; - sech(x: Unit): number; sech(x: MathArray): MathArray; sech(x: Matrix): Matrix; /** * Calculate the sine of a value. For matrices, the function is evaluated element wise. */ - sin(x: number): number; + sin(x: number|Unit): number; sin(x: BigNumber): BigNumber; sin(x: Complex): Complex; - sin(x: Unit): number; sin(x: MathArray): MathArray; sin(x: Matrix): Matrix; /** * Calculate the cosine of a value. For matrices, the function is evaluated element wise. */ - cos(x: number): number; + cos(x: number|Unit): number; cos(x: BigNumber): BigNumber; cos(x: Complex): Complex; - cos(x: Unit): number; cos(x: MathArray): MathArray; cos(x: Matrix): Matrix; /** * Calculate the hyperbolic sine of a value, defined as sinh(x) = 1/2 * (exp(x) - exp(-x)). For matrices, the function is evaluated element wise. */ - sinh(x: number): number; + sinh(x: number|Unit): number; sinh(x: BigNumber): BigNumber; sinh(x: Complex): Complex; - sinh(x: Unit): number; sinh(x: MathArray): MathArray; sinh(x: Matrix): Matrix; /** * Calculate the tangent of a value. tan(x) is equal to sin(x) / cos(x). For matrices, the function is evaluated element wise. */ - tan(x: number): number; + tan(x: number|Unit): number; tan(x: BigNumber): BigNumber; tan(x: Complex): Complex; - tan(x: Unit): number; tan(x: MathArray): MathArray; tan(x: Matrix): Matrix; /** * Calculate the hyperbolic tangent of a value, defined as tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1). For matrices, the function is evaluated element wise. */ - tanh(x: number): number; + tanh(x: number|Unit): number; tanh(x: BigNumber): BigNumber; tanh(x: Complex): Complex; - tanh(x: Unit): number; tanh(x: MathArray): MathArray; tanh(x: Matrix): Matrix; @@ -1222,7 +1176,7 @@ declare namespace mathjs { * @param x The unit to be converted. * @param unit New unit. Can be a string like "cm" or a unit without value. */ - to(x: Unit|MathArray|Matrix, unit: Unit|string): Unit|MathArray|Matrix + to(x: Unit|MathArray|Matrix, unit: Unit|string): Unit|MathArray|Matrix; /** * Clone an object. @@ -1232,25 +1186,25 @@ declare namespace mathjs { /** * Filter the items in an array or one dimensional matrix. * @param x A one dimensional matrix or array to filter - * @param test + * @param test */ - filter(x: MathArray|Matrix, test: RegExp|((item: any)=>boolean)): MathArray|Matrix; + filter(x: MathArray|Matrix, test: RegExp|((item: any) => boolean)): MathArray|Matrix; /** * Iterate over all elements of a matrix/array, and executes the given callback function. * @param x The matrix to iterate on. * @param callback The callback function is invoked with three parameters: the value of the element, the index of the element, and the Matrix/array being traversed. */ - forEach(x: MathArray|Matrix, callback: (item: any)=>any): void; + forEach: (x: MathArray|Matrix, callback: (item: any) => any) => void; /** * Format a value of any type into a string. * @param value The value to be formatted */ - format(value: any, options?: IFormatOptions|number|((item: any)=>string)): string; + format(value: any, options?: FormatOptions|number|((item: any) => string)): string; /** - * Test whether a value is an integer number. The function supports number, BigNumber, and Fraction. + * Test whether a value is an integer number. The function supports number, BigNumber, and Fraction. * The function is evaluated element-wise in case of Array or Matrix input. */ isInteger(x: any): boolean; @@ -1283,7 +1237,7 @@ declare namespace mathjs { * @param x The matrix to iterate on. * @param callback The callback method is invoked with three parameters: the value of the element, the index of the element, and the matrix being traversed. */ - map(x: MathArray|Matrix, callback: (item: any)=>any): MathArray|Matrix; + map(x: MathArray|Matrix, callback: (item: any) => any): MathArray|Matrix; /** * Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect. @@ -1292,7 +1246,7 @@ declare namespace mathjs { * @param compare An optional comparator function. The function is called as compare(a, b), and must return 1 when a > b, -1 when a < b, and 0 when a == b. Default value: 'asc'. * @returns Returns the kth lowest value. */ - partitionSelect(x: MathArray|Matrix, k: number, compare?: string|((a: any, b: any)=>number)): any; + partitionSelect(x: MathArray|Matrix, k: number, compare?: string|((a: any, b: any) => number)): any; /** * Interpolate values into a string template. @@ -1300,14 +1254,14 @@ declare namespace mathjs { * @param values An object containing variables which will be filled in in the template. * @param precision Number of digits to format numbers. If not provided, the value will not be rounded. */ - print(template:string, values: any, precision?: number): void; + print: (template: string, values: any, precision?: number) => void; /** * Sort the items in a matrix. * @param x A one dimensional matrix or array to sort * @param compare An optional comparator function. The function is called as compare(a, b), and must return 1 when a > b, -1 when a < b, and 0 when a == b. Default value: 'asc'. */ - sort(x: MathArray|Matrix, compare?: string|((a: any, b: any)=>number)): MathArray|Matrix; + sort(x: MathArray|Matrix, compare?: string|((a: any, b: any) => number)): MathArray|Matrix; /** * Determine the type of a variable. @@ -1315,7 +1269,7 @@ declare namespace mathjs { typeof(x: any): string; } - export interface Matrix { + interface Matrix { type: string; storage(): string; datatype(): string; @@ -1327,389 +1281,380 @@ declare namespace mathjs { clone(): Matrix; size(): number[]; map(callback: (a: any, b: number, c: Matrix) => any, skipZeros?: boolean): Matrix; - forEach(callback: (a: any, b: number, c: Matrix) => void, skipZeros?: boolean): void; + forEach: (callback: (a: any, b: number, c: Matrix) => void, skipZeros?: boolean) => void; toJSON(): any; diagonal(k?: number|BigNumber): any[]; swapRows(i: number, j: number): Matrix; } - export interface BigNumber { + interface BigNumber extends Decimal {} // tslint:disable-line no-empty-interface + interface Fraction { + s: number; + n: number; + d: number; } - export interface Fraction { - - } - - export interface Complex { + interface Complex { re: number; im: number; - toPolar(): IPolarCoordinates; + toPolar(): PolarCoordinates; clone(): Complex; } - export interface IPolarCoordinates { - r: number; + interface PolarCoordinates { + r: number; phi: number; - } + } - export interface Unit { + interface Unit { to(unit: string): Unit; toNumber(unit: string): number; } - export interface CreateUnitOptions { + interface CreateUnitOptions { override?: boolean; } - export interface UnitDefinition { + interface UnitDefinition { definition?: string|Unit; prefixes?: string; offset?: number; aliases?: string[]; } - export interface Index { + interface Index {} // tslint:disable-line no-empty-interface - } - - export interface EvalFunction { + interface EvalFunction { eval(scope?: any): any; } - export interface MathNode { - isNode: boolean; - isSymbolNode?: boolean; - isConstantNode?: boolean; - isOperatorNode?: boolean; - op?: string; - fn?: string; - args?: MathNode[]; - type: string; - name?: string; - value?: any; + interface MathNode { + isNode: boolean; + isSymbolNode?: boolean; + isConstantNode?: boolean; + isOperatorNode?: boolean; + op?: string; + fn?: string; + args?: MathNode[]; + type: string; + name?: string; + value?: any; - compile(): EvalFunction; - eval(): any; - eval(expr: string): any; - /** - * - * Filter nodes in an expression tree. The callback function is called as callback(node: Node, path: string, parent: Node) : boolean for every node in the tree, - * and must return a boolean. The function filter returns an array with nodes for which the test returned true. - * Parameter path is a string containing a relative JSON Path. - * - * Example: - * - * ``` - * var node = math.parse('x^2 + x/4 + 3*y'); - * var filtered = node.filter(function (node) { - * return node.isSymbolNode && node.name == 'x'; - * }); - * // returns an array with two entries: two SymbolNodes 'x' - * ``` - * - * @param The callback function is called as callback(node: Node, path: string, parent: Node) : boolean for every node in the tree, and must return a boolean. The function filter returns an array with nodes for which the test returned true. Parameter path is a string containing a relative JSON Path. - * @param {Function} callback(node [description] - * @return {[Mathnode]} Returns an array with nodes for which test returned true - */ - filter(callback: (node: MathNode, path: string, parent: MathNode)=>any ): MathNode[]; + compile(): EvalFunction; + eval(expr?: string): any; + /** + * + * Filter nodes in an expression tree. The callback function is called as callback(node: Node, path: string, parent: Node) : boolean for every node in the tree, + * and must return a boolean. The function filter returns an array with nodes for which the test returned true. + * Parameter path is a string containing a relative JSON Path. + * + * Example: + * + * ``` + * var node = math.parse('x^2 + x/4 + 3*y'); + * var filtered = node.filter(function (node) { + * return node.isSymbolNode && node.name == 'x'; + * }); + * // returns an array with two entries: two SymbolNodes 'x' + * ``` + * + * The callback function is called as callback(node: Node, path: string, parent: Node) : boolean for every node in the tree, and must return a boolean. + * The function filter returns an array with nodes for which the test returned true. Parameter path is a string containing a relative JSON Path. + * @return Returns an array with nodes for which test returned true + */ + filter(callback: (node: MathNode, path: string, parent: MathNode) => any): MathNode[]; + /** + * [forEach description] + */ + forEach(callback: (node: MathNode, path: string, parent: MathNode) => any): MathNode[]; - /** - * [forEach description] - * @param {MathNode} callback(node [description] - * @return {[type]} [description] - */ - forEach(callback: (node: MathNode, path: string, parent: MathNode)=>any): MathNode[]; + /** + * `traverse(callback)` + * + * Recursively traverse all nodes in a node tree. + * Executes given callback for this node and each of its child nodes. + * Similar to Array.forEach, except recursive. + * The callback function is a mapping function accepting a node, and returning a replacement for the node or the original node. + * Function callback is called as callback(node: Node, path: string, parent: Node) for every node in the tree. + * Parameter path is a string containing a relative JSON Path. Example: + * + * ``` + * var node = math.parse('3 * x + 2'); + * node.traverse(function (node, path, parent) { + * switch (node.type) { + * case 'OperatorNode': console.log(node.type, node.op); break; + * case 'ConstantNode': console.log(node.type, node.value); break; + * case 'SymbolNode': console.log(node.type, node.name); break; + * default: console.log(node.type); + * } + * }); + * // outputs: + * // OperatorNode + + * // OperatorNode * + * // ConstantNode 3 + * // SymbolNode x + * // ConstantNode 2 + * ``` + */ + traverse(callback: (node: MathNode, path: string, parent: MathNode) => void): any; + /** + * Recursively transform an expression tree via a transform function. Similar to Array.map, + * but recursively executed on all nodes in the expression tree. The callback function is a + * mapping function accepting a node, and returning a replacement for the node or the original node. + * Function callback is called as callback(node: Node, path: string, parent: Node) for every node in + * the tree, and must return a Node. Parameter path is a string containing a relative JSON Path. + * + * For example, to replace all nodes of type SymbolNode having name ‘x’ with a ConstantNode with value 3: + * ```js + * var node = math.parse('x^2 + 5*x'); + * var transformed = node.transform(function (node, path, parent) { + * if (node.SymbolNode && node.name == 'x') { + * return new math.expression.node.ConstantNode(3); + * } + * else { + * return node; + * } + * }); + * transformed.toString(); // returns '(3 ^ 2) + (5 * 3)' + * ``` + */ + transform(callback: (node: MathNode, path: string, parent: MathNode) => MathNode): MathNode; - - /** - * `traverse(callback)` - * - * Recursively traverse all nodes in a node tree. Executes given callback for this node and each of its child nodes. Similar to Array.forEach, except recursive. The callback function is a mapping function accepting a node, and returning a replacement for the node or the original node. Function callback is called as callback(node: Node, path: string, parent: Node) for every node in the tree. Parameter path is a string containing a relative JSON Path. Example: - * - * ``` - * var node = math.parse('3 * x + 2'); - * node.traverse(function (node, path, parent) { - * switch (node.type) { - * case 'OperatorNode': console.log(node.type, node.op); break; - * case 'ConstantNode': console.log(node.type, node.value); break; - * case 'SymbolNode': console.log(node.type, node.name); break; - * default: console.log(node.type); - * } - * }); - * // outputs: - * // OperatorNode + - * // OperatorNode * - * // ConstantNode 3 - * // SymbolNode x - * // ConstantNode 2 - * ``` - * - * @param {MathNode} callback=(node [description] - * @return {[type]} [description] - */ - traverse(callback: (node: MathNode, path: string, parent: MathNode)=> void): any; -//addEventListener(ev: 'change', callback: (ev: EditorChangeEvent) => any); - /** - * Recursively transform an expression tree via a transform function. Similar to Array.map, - * but recursively executed on all nodes in the expression tree. The callback function is a - * mapping function accepting a node, and returning a replacement for the node or the original node. - * Function callback is called as callback(node: Node, path: string, parent: Node) for every node in - * the tree, and must return a Node. Parameter path is a string containing a relative JSON Path. - * - * For example, to replace all nodes of type SymbolNode having name ‘x’ with a ConstantNode with value 3: - * ```js - * var node = math.parse('x^2 + 5*x'); - * var transformed = node.transform(function (node, path, parent) { - * if (node.SymbolNode && node.name == 'x') { - * return new math.expression.node.ConstantNode(3); - * } - * else { - * return node; - * } - * }); - * transformed.toString(); // returns '(3 ^ 2) + (5 * 3)' - * ``` - */ - transform(callback: (node: MathNode, path: string, parent: MathNode)=>MathNode): MathNode; - /** - * Transform a node. Creates a new Node having it’s childs be the results of calling the provided - * callback function for each of the childs of the original node. The callback function is called - * as `callback(child: Node, path: string, parent: Node)` and must return a Node. - * Parameter path is a string containing a relative JSON Path. - * - * - * See also transform, which is a recursive version of map. - */ - map(callback: (node: MathNode, path: string, parent: MathNode)=>MathNode): MathNode; + /** + * Transform a node. Creates a new Node having it’s child's be the results of calling the provided + * callback function for each of the child's of the original node. The callback function is called + * as `callback(child: Node, path: string, parent: Node)` and must return a Node. + * Parameter path is a string containing a relative JSON Path. + * + * + * See also transform, which is a recursive version of map. + */ + map(callback: (node: MathNode, path: string, parent: MathNode) => MathNode): MathNode; } - - export interface Parser { + interface Parser { eval(expr: string): any; get(variable: string): any; - set(variable: string, value: any): void; - clear(): void; + set: (variable: string, value: any) => void; + clear: () => void; } - export interface Distribution { + interface Distribution { random(size: any, min?: any, max?: any): any; randomInt(min: any, max?: any): any; pickRandom(array: any): any; } - export interface IFormatOptions { + interface FormatOptions { /** * Number notation. Choose from: * 'fixed' Always use regular number notation. For example '123.40' and '14000000' * 'exponential' Always use exponential notation. For example '1.234e+2' and '1.4e+7' - * 'auto' (default) Regular number notation for numbers having an absolute value between lower and upper bounds, and + * 'auto' (default) Regular number notation for numbers having an absolute value between lower and upper bounds, and * uses exponential notation elsewhere. Lower bound is included, upper bound is excluded. For example '123.4' and '1.4e7'. */ notation?: string; /** - * A number between 0 and 16 to round the digits of the number. In case of notations 'exponential' and 'auto', - * precision defines the total number of significant digits returned and is undefined by default. In case of notation 'fixed', + * A number between 0 and 16 to round the digits of the number. In case of notations 'exponential' and 'auto', + * precision defines the total number of significant digits returned and is undefined by default. In case of notation 'fixed', * precision defines the number of significant digits after the decimal point, and is 0 by default. */ precision?: number; /** - * An object containing two parameters, {number} lower and {number} upper, used by notation 'auto' to determine + * An object containing two parameters, {number} lower and {number} upper, used by notation 'auto' to determine * when to return exponential notation. Default values are lower=1e-3 and upper=1e5. Only applicable for notation auto. */ exponential?: {lower: number; upper: number}; /** - * Available values: 'ratio' (default) or 'decimal'. For example format(fraction(1, 3)) will output '1/3' when 'ratio' + * Available values: 'ratio' (default) or 'decimal'. For example format(fraction(1, 3)) will output '1/3' when 'ratio' * is configured, and will output 0.(3) when 'decimal' is configured. */ fraction?: string; - /** - * A custom formatting function. Can be used to override the built-in notations. Function fn is called with - * value as parameter and must return a string. Is useful for example to format all values inside a matrix in a particular way. - * */ - fn?: (item: any)=>string; + /** + * A custom formatting function. Can be used to override the built-in notations. Function fn is called with + * value as parameter and must return a string. Is useful for example to format all values inside a matrix in a particular way. + */ + fn?: (item: any) => string; } - export interface Help { + interface Help { toString(): string; toJSON(): string; - } + } - export interface IMathJsChain { + interface MathJsChain { /** * Solves the linear equation system by forwards substitution. Matrix must be a lower triangular matrix. * @param b A column vector with the b values */ - lsolve(b: Matrix|MathArray): IMathJsChain; + lsolve(b: Matrix|MathArray): MathJsChain; /** - * Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in two matrices (L, U) + * Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in two matrices (L, U) * and a row permutation vector p where A[p,:] = L * U */ - lup(): IMathJsChain; + lup(): MathJsChain; /** * Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector. * @param b Column Vector */ - lusolve(b: Matrix|MathArray): IMathJsChain; + lusolve(b: Matrix|MathArray): MathJsChain; /** - * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix A is decomposed in + * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix A is decomposed in * two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U - * @param order The Symbolic Ordering and Analysis order: 0 - Natural ordering, no permutation vector q is - * returned 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A' 2 - Symbolic - * ordering and analisis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'. - * This is appropriatefor LU factorization of unsymmetric matrices. 3 - Symbolic ordering and analisis is performed - * on M = A' * A. This is best used for LU factorization is matrix M has no dense rows. A dense row is a row with + * @param order The Symbolic Ordering and Analysis order: 0 - Natural ordering, no permutation vector q is + * returned 1 - Matrix must be square, symbolic ordering and analysis is performed on M = A + A' 2 - Symbolic + * ordering and analysis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'. + * This is appropriate for LU factorization of non-symmetric matrices. 3 - Symbolic ordering and analysis is performed + * on M = A' * A. This is best used for LU factorization is matrix M has no dense rows. A dense row is a row with * more than 10*sqr(columns) entries. * @param threshold Partial pivoting threshold (1 for partial pivoting) * @returns The lower triangular matrix, the upper triangular matrix and the permutation vectors. */ - slu(order: Number, threshold: Number): IMathJsChain; + slu(order: number, threshold: number): MathJsChain; /** * Solves the linear equation system by backward substitution. Matrix must be an upper triangular matrix. U * x = b * @param b A column vector with the b values * @returns A column vector with the linear system solution (x) */ - usolve(b:Matrix|MathArray): IMathJsChain; + usolve(b: Matrix|MathArray): MathJsChain; /** * Calculate the absolute value of a number. For matrices, the function is evaluated element wise. */ - abs(): IMathJsChain; + abs(): MathJsChain; /** * Add two values, x + y. For matrices, the function is evaluated element wise. * @param y Second value to add */ - add(y: MathType): IMathJsChain; + add(y: MathType): MathJsChain; /** * Calculate the cubic root of a value. For matrices, the function is evaluated element wise. * @param allRoots Optional, false by default. Only applicable when x is a number or complex number. If true, all complex roots are returned, if false (default) the principal root is returned. */ - cbrt(allRoots?: boolean): IMathJsChain; + cbrt(allRoots?: boolean): MathJsChain; /** * Round a value towards plus infinity If x is complex, both real and imaginary part are rounded towards plus infinity. For matrices, the function is evaluated element wise. */ - ceil(): IMathJsChain; + ceil(): MathJsChain; - /** + /** * Compute the cube of a value, x * x * x. For matrices, the function is evaluated element wise. */ - cube(): IMathJsChain; + cube(): MathJsChain; /** * Divide two values, x / y. To divide matrices, x is multiplied with the inverse of y: x * inv(y). * @param y Denominator */ - divide(y:MathType): IMathJsChain; + divide(y: MathType): MathJsChain; /** * Divide two matrices element wise. The function accepts both matrices and scalar values. * @param y Denominator */ - dotDivide(y: MathType): IMathJsChain; + dotDivide(y: MathType): MathJsChain; /** * Multiply two matrices element wise. The function accepts both matrices and scalar values. * @param y Right hand value */ - dotMultiply(y: MathType): IMathJsChain; + dotMultiply(y: MathType): MathJsChain; - /** + /** * Calculates the power of x to y element wise. * @param y The exponent */ - dotPow(y: MathType): IMathJsChain; + dotPow(y: MathType): MathJsChain; /** * Calculate the exponent of a value. For matrices, the function is evaluated element wise. */ - exp(): IMathJsChain; + exp(): MathJsChain; - /** + /** * Round a value towards zero. For matrices, the function is evaluated element wise. */ - fix(): IMathJsChain; + fix(): MathJsChain; /** * Round a value towards minus infinity. For matrices, the function is evaluated element wise. */ - floor(): IMathJsChain; + floor(): MathJsChain; /** * Calculate the greatest common divisor for two or more values or arrays. For matrices, the function is evaluated element wise. */ - gcd(...args: number[]): IMathJsChain; - gcd(...args: BigNumber[]): IMathJsChain ; - gcd(...args: Fraction[]): IMathJsChain ; - gcd(...args: MathArray[]): IMathJsChain ; - gcd(...args: Matrix[]): IMathJsChain; + gcd(...args: number[]): MathJsChain; + gcd(...args: BigNumber[]): MathJsChain ; + gcd(...args: Fraction[]): MathJsChain ; + gcd(...args: MathArray[]): MathJsChain ; + gcd(...args: Matrix[]): MathJsChain; /** - * Calculate the hypotenusa of a list with values. The hypotenusa is defined as: + * Calculate the hypotenuse of a list with values. The hypotenuse is defined as: * hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...) - * For matrix input, the hypotenusa is calculated for all values in the matrix. + * For matrix input, the hypotenuse is calculated for all values in the matrix. */ - hypot(...args: number[]): IMathJsChain; - hypot(...args: BigNumber[]): IMathJsChain; + hypot(...args: number[]): MathJsChain; + hypot(...args: BigNumber[]): MathJsChain; /** * Calculate the kronecker product of two matrices or vectors * @param x First Matrix * @param y Second Matrix */ - kron(x: Matrix|MathArray, y: Matrix|MathArray): IMathJsChain; + kron(x: Matrix|MathArray, y: Matrix|MathArray): MathJsChain; /** * Calculate the least common multiple for two or more values or arrays. lcm is defined as: * lcm(a, b) = abs(a * b) / gcd(a, b) * For matrices, the function is evaluated element wise. */ - lcm(b: number): IMathJsChain; - lcm(b: BigNumber ): IMathJsChain ; - lcm(b: MathArray): IMathJsChain; - lcm(b: Matrix): IMathJsChain; + lcm(b: number|BigNumber|MathArray|Matrix): MathJsChain; /** * Calculate the logarithm of a value. For matrices, the function is evaluated element wise. * @param base Optional base for the logarithm. If not provided, the natural logarithm of x is calculated. Default value: e. */ - log(base?: number|BigNumber|Complex): IMathJsChain; + log(base?: number|BigNumber|Complex): MathJsChain; /** * Calculate the 10-base of a value. This is the same as calculating log(x, 10). For matrices, the function is evaluated element wise. */ - log10(): IMathJsChain; + log10(): MathJsChain; /** * Calculates the modulus, the remainder of an integer division. For matrices, the function is evaluated element wise. * The modulus is defined as: * x - y * floor(x / y) - * See http://en.wikipedia.org/wiki/Modulo_operation. + * @see http://en.wikipedia.org/wiki/Modulo_operation. * @param y Divisor */ - mod(y: number|BigNumber|Fraction|MathArray|Matrix): IMathJsChain; + mod(y: number|BigNumber|Fraction|MathArray|Matrix): MathJsChain; /** * Multiply two values, x * y. The result is squeezed. For matrices, the matrix product is calculated. */ - multiply(y: MathType): IMathJsChain; + multiply(y: MathType): MathJsChain; /** * Calculate the norm of a number, vector or matrix. The second parameter p is optional. If not provided, it defaults to 2. * @param p Vector space. Supported numbers include Infinity and -Infinity. Supported strings are: 'inf', '-inf', and 'fro' (The Frobenius norm) Default value: 2. */ - norm(p?: number|BigNumber|string): IMathJsChain; + norm(p?: number|BigNumber|string): MathJsChain; /** * Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation @@ -1717,19 +1662,19 @@ declare namespace mathjs { * For matrices, the function is evaluated element wise. * @param root The root. Default value: 2. */ - nthRoot(root?: number|BigNumber): IMathJsChain; + nthRoot(root?: number|BigNumber): MathJsChain; /** * Calculates the power of x to y, x ^ y. Matrix exponentiation is supported for square matrices x, and positive integer exponents y. * @param y The exponent */ - pow(y: number|BigNumber|Complex): IMathJsChain; + pow(y: number|BigNumber|Complex): MathJsChain; /** * Round a value towards the nearest integer. For matrices, the function is evaluated element wise. * @param n Number of decimals Default value: 0. */ - round(n?: number|BigNumber|MathArray): IMathJsChain; + round(n?: number|BigNumber|MathArray): MathJsChain; /** * Compute the sign of a value. The sign of a value x is: @@ -1738,92 +1683,94 @@ declare namespace mathjs { * 0 when x == 0 * For matrices, the function is evaluated element wise. */ - sign(): IMathJsChain; + sign(): MathJsChain; /** * Calculate the square root of a value. For matrices, the function is evaluated element wise. */ - sqrt(): IMathJsChain; + sqrt(): MathJsChain; /** * Compute the square of a value, x * x. For matrices, the function is evaluated element wise. */ - square(): IMathJsChain; + square(): MathJsChain; /** * Subtract two values, x - y. For matrices, the function is evaluated element wise. */ - subtract(y: MathType): IMathJsChain; + subtract(y: MathType): MathJsChain; /** * Inverse the sign of a value, apply a unary minus operation. * For matrices, the function is evaluated element wise. Boolean values and strings will be converted to a number. For complex numbers, both real and complex value are inverted. */ - unaryMinus(): IMathJsChain; + unaryMinus(): MathJsChain; /** * Unary plus operation. Boolean values and strings will be converted to a number, numeric values will be returned as is. * For matrices, the function is evaluated element wise. */ - unaryPlus(): IMathJsChain; + unaryPlus(): MathJsChain; /** * Calculate the extended greatest common divisor for two values. See http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm. */ - xgcd(b: number|BigNumber): IMathJsChain; + xgcd(b: number|BigNumber): MathJsChain; /** * Bitwise AND two values, x & y. For matrices, the function is evaluated element wise. */ - bitAnd(y: number|BigNumber|MathArray|Matrix): IMathJsChain; + bitAnd(y: number|BigNumber|MathArray|Matrix): MathJsChain; /** * Bitwise NOT value, ~x. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. */ - bitNot(): IMathJsChain; + bitNot(): MathJsChain; /** * Bitwise OR two values, x | y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the lowest print base. */ - bitOr(): IMathJsChain; + bitOr(): MathJsChain; /** * Bitwise XOR two values, x ^ y. For matrices, the function is evaluated element wise. */ - bitXor(y: number|BigNumber|MathArray|Matrix): IMathJsChain; + bitXor(y: number|BigNumber|MathArray|Matrix): MathJsChain; /** * Bitwise left logical shift of a value x by y number of bits, x << y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. * @param x Value to be shifted * @param y Amount of shifts */ - leftShift(y: number|BigNumber): IMathJsChain; + leftShift(y: number|BigNumber): MathJsChain; /** * Bitwise right arithmetic shift of a value x by y number of bits, x >> y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. * @param x Value to be shifted * @param y Amount of shifts */ - rightArithShift(y: number|BigNumber): IMathJsChain; + rightArithShift(y: number|BigNumber): MathJsChain; /** * Bitwise right logical shift of value x by y number of bits, x >>> y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. * @param x Value to be shifted * @param y Amount of shifts */ - rightLogShift(y: number): IMathJsChain; + rightLogShift(y: number): MathJsChain; /** - * The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. bellNumbers only takes integer arguments. The following condition must be enforced: n >= 0 + * The Bell Numbers count the number of partitions of a set. + * A partition is a pairwise disjoint subset of S whose union is S. + * bellNumbers only takes integer arguments. The following condition must be enforced: n >= 0 * @param n Total number of objects in the set */ - bellNumbers(): IMathJsChain; + bellNumbers(): MathJsChain; /** * The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0 - * @pararm n nth Catalan number + * @param n nth Catalan number */ - catalan(): IMathJsChain; + catalan(): MathJsChain; /** * The composition counts of n into k parts. Composition only takes integer arguments. The following condition must be enforced: k <= n. @@ -1831,51 +1778,52 @@ declare namespace mathjs { * @param k Number of objects in the subset * @returns Returns the composition counts of n into k parts. */ - composition(k: Number|BigNumber): IMathJsChain; + composition(k: number|BigNumber): MathJsChain; /** - * The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. stirlingS2 only takes integer arguments. The following condition must be enforced: k <= n. + * The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. + * stirlingS2 only takes integer arguments. The following condition must be enforced: k <= n. * If n = k or k = 1, then s(n,k) = 1 * @param n Total number of objects in the set * @param k Number of objects in the subset */ - stirlingS2(k: Number|BigNumber): IMathJsChain; + stirlingS2(k: number|BigNumber): MathJsChain; /** * Compute the argument of a complex value. For a complex number a + bi, the argument is computed as atan2(b, a). For matrices, the function is evaluated element wise. * @param x A complex number or array with complex numbers */ - arg(): IMathJsChain; + arg(): MathJsChain; /** * Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate of x is a - bi. For matrices, the function is evaluated element wise. * @param x A complex number or array with complex numbers */ - conj(): IMathJsChain; + conj(): MathJsChain; - /** - * Get the imaginary part of a complex number. For a complex number a + bi, the function returns b. + /** + * Get the imaginary part of a complex number. For a complex number a + bi, the function returns b. * For matrices, the function is evaluated element wise. */ - im(): IMathJsChain; + im(): MathJsChain; /** * Get the real part of a complex number. For a complex number a + bi, the function returns a. * For matrices, the function is evaluated element wise. */ - re(): IMathJsChain; + re(): MathJsChain; /** - * Calculates: The eucledian distance between two points in 2 and 3 dimensional spaces. Distance between point - * and a line in 2 and 3 dimensional spaces. Pairwise distance between a set of 2D or 3D points NOTE: When - * substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c For parametric + * Calculates: The eucledian distance between two points in 2 and 3 dimensional spaces. Distance between point + * and a line in 2 and 3 dimensional spaces. Pairwise distance between a set of 2D or 3D points NOTE: When + * substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c For parametric * equation of a 3D line, x0, y0, z0, a, b, c are from: (x−x0, y−y0, z−z0) = t(a, b, c) */ - distance(y: MathArray|Matrix|any): IMathJsChain; + distance(y: MathType): MathJsChain; /** - * Calculates the point of intersection of two lines in two or three dimensions and of a line and a plane in - * three dimensions. The inputs are in the form of arrays or 1 dimensional matrices. The line intersection functions + * Calculates the point of intersection of two lines in two or three dimensions and of a line and a plane in + * three dimensions. The inputs are in the form of arrays or 1 dimensional matrices. The line intersection functions * return null if the lines do not meet. * Note: Fill the plane coefficients as x + y + z = c and not as x + y + z + c = 0. * @param w Co-ordinates of first end-point of first line @@ -1884,39 +1832,39 @@ declare namespace mathjs { * @param z Co-ordinates of second end-point of second line OR null if the calculation is for line and plane * @returns Returns the point of intersection of lines/lines-planes */ - intersect(x: MathArray|Matrix, y: MathArray|Matrix, z: MathArray|Matrix): IMathJsChain; + intersect(x: MathArray|Matrix, y: MathArray|Matrix, z: MathArray|Matrix): MathJsChain; /** * Logical and. Test whether two values are both defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. */ - and(y: number|BigNumber|Complex|Unit|MathArray|Matrix): IMathJsChain; + and(y: number|BigNumber|Complex|Unit|MathArray|Matrix): MathJsChain; /** * Logical not. Flips boolean value of a given parameter. For matrices, the function is evaluated element wise. */ - not(): IMathJsChain; + not(): MathJsChain; /** * Logical or. Test if at least one value is defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. */ - or(y: number|BigNumber|Complex|Unit|MathArray|Matrix): IMathJsChain; + or(y: number|BigNumber|Complex|Unit|MathArray|Matrix): MathJsChain; /** * Logical xor. Test whether one and only one value is defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. */ - xor(y: number|BigNumber|Complex|Unit|MathArray|Matrix): IMathJsChain; + xor(y: number|BigNumber|Complex|Unit|MathArray|Matrix): MathJsChain; /** - * Calculate the cross product for two vectors in three dimensional space. The cross product of A = [a1, a2, a3] + * Calculate the cross product for two vectors in three dimensional space. The cross product of A = [a1, a2, a3] * and B =[b1, b2, b3] is defined as: * cross(A, B) = [ a2 * b3 - a3 * b2, a3 * b1 - a1 * b3, a1 * b2 - a2 * b1 ] */ - cross(y: MathArray|Matrix): IMathJsChain; + cross(y: MathArray|Matrix): MathJsChain; /** * Calculate the determinant of a matrix. */ - det(): IMathJsChain; + det(): MathJsChain; /** * Resize a matrix @@ -1924,17 +1872,17 @@ declare namespace mathjs { * @param size One dimensional array with numbers * @param defaultValue Zero by default, except in case of a string, in that case defaultValue = ' ' Default value: 0. */ - resize(size: MathArray|Matrix, defaultValue?: number|string): IMathJsChain; + resize(size: MathArray|Matrix, defaultValue?: number|string): MathJsChain; /** * Calculate the size of a matrix or scalar. */ - size(): IMathJsChain; + size(): MathJsChain; /** * Squeeze a matrix, remove inner and outer singleton dimensions from a matrix. */ - squeeze(): IMathJsChain; + squeeze(): MathJsChain; /** * Get or set a subset of a matrix or string. @@ -1943,352 +1891,328 @@ declare namespace mathjs { * @param replacement An array, matrix, or scalar. If provided, the subset is replaced with replacement. If not provided, the subset is returned * @param defaultValue Default value, filled in on new entries when the matrix is resized. If not provided, math.matrix elements will be left undefined. Default value: undefined. */ - subset(index: Index, replacement?: any, defaultValue?: any): IMathJsChain; + subset(index: Index, replacement?: any, defaultValue?: any): MathJsChain; /** * Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix. */ - trace(): IMathJsChain; + trace(): MathJsChain; /** * Transpose a matrix. All values of the matrix are reflected over its main diagonal. Only two dimensional matrices are supported. */ - transpose(): IMathJsChain; + transpose(): MathJsChain; /** * Random pick a value from a one dimensional array. Array element is picked using a random function with uniform distribution. */ - pickRandom(): IMathJsChain; + pickRandom(): MathJsChain; /** * Return a random number larger or equal to min and smaller than max using a uniform distribution. */ - random(): IMathJsChain; - random(max?: number): IMathJsChain; - random(min:number, max: number): IMathJsChain; + random(min?: number, max?: number): MathJsChain; /** * Return a random integer number larger or equal to min and smaller than max using a uniform distribution. */ - randomInt(max?: number): IMathJsChain; - randomInt(min:number, max: number): IMathJsChain; + randomInt(min?: number, max?: number): MathJsChain; /** * Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y. - * x and y are considered equal when the relative difference between x and y is smaller than the configured epsilon. + * x and y are considered equal when the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. * For matrices, the function is evaluated element wise. */ - compare(y: MathType): IMathJsChain; + compare(y: MathType): MathJsChain; /** * Test element wise whether two matrices are equal. The function accepts both matrices and scalar values. */ - deepEqual(y: MathType): IMathJsChain; + deepEqual(y: MathType): MathJsChain; /** * Test whether two values are equal. - * - * The function tests whether the relative difference between x and y is smaller than the configured epsilon. + * The function tests whether the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. In case of complex numbers, x.re must equal y.re, and x.im must equal y.im. - * * Values null and undefined are compared strictly, thus null is only equal to null and nothing else, and undefined is only equal to undefined and nothing else. */ - equal(y: MathType): IMathJsChain; + equal(y: MathType): MathJsChain; /** * Test whether value x is larger than y. - * - * The function returns true when x is larger than y and the relative difference between x and y is larger than the configured epsilon. + * The function returns true when x is larger than y and the relative difference between x and y is larger than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. */ - larger(y: MathType): IMathJsChain; + larger(y: MathType): MathJsChain; /** * Test whether value x is larger or equal to y. - * - * The function returns true when x is larger than y or the relative difference between x and y is smaller than the configured epsilon. + * The function returns true when x is larger than y or the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. */ - largerEq(y: MathType): IMathJsChain; + largerEq(y: MathType): MathJsChain; /** * Test whether value x is smaller than y. - * - * The function returns true when x is smaller than y and the relative difference between x and y is smaller than the configured epsilon. + * The function returns true when x is smaller than y and the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. */ - smaller(IMathJsChainy: MathType): IMathJsChain; + smaller(MathJsChainy: MathType): MathJsChain; /** * Test whether value x is smaller or equal to y. - * - * The function returns true when x is smaller than y or the relative difference between x and y is smaller than the configured epsilon. + * The function returns true when x is smaller than y or the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. For matrices, the function is evaluated element wise. */ - smallerEq(IMathJsChainy: MathType): IMathJsChain; + smallerEq(MathJsChainy: MathType): MathJsChain; /** * Test whether two values are unequal. - * - * The function tests whether the relative difference between x and y is larger than the configured epsilon. The function cannot + * The function tests whether the relative difference between x and y is larger than the configured epsilon. The function cannot * be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. In case of complex numbers, x.re must unequal y.re, or x.im must unequal y.im. - * - * Values null and undefined are compared strictly, thus null is unequal with everything except null, and undefined is unequal with - * everying except. undefined. + * Values null and undefined are compared strictly, thus null is unequal with everything except null, and undefined is unequal with + * everything except undefined. */ - unequal(IMathJsChainy: MathType): IMathJsChain; + unequal(MathJsChainy: MathType): MathJsChain; /** - * Compute the maximum value of a matrix or a list with values. In case of a multi dimensional array, the maximum of the flattened + * Compute the maximum value of a matrix or a list with values. In case of a multi dimensional array, the maximum of the flattened * array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ - max(dim?: number): IMathJsChain; + max(dim?: number): MathJsChain; /** - * Compute the mean value of matrix or a list with values. In case of a multi dimensional array, the mean of the flattened array will be + * Compute the mean value of matrix or a list with values. In case of a multi dimensional array, the mean of the flattened array will be * calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ - mean(dim?: number): IMathJsChain; + mean(dim?: number): MathJsChain; /** - * Compute the median of a matrix or a list with values. The values are sorted and the middle value is returned. In case of an + * Compute the median of a matrix or a list with values. The values are sorted and the middle value is returned. In case of an * even number of values, the average of the two middle values is returned. Supported types of values are: Number, BigNumber, Unit - * * In case of a (multi dimensional) array or matrix, the median of all elements will be calculated. */ - median(): IMathJsChain; + median(): MathJsChain; /** - * Compute the maximum value of a matrix or a list of values. In case of a multi dimensional array, the maximum of the flattened + * Compute the maximum value of a matrix or a list of values. In case of a multi dimensional array, the maximum of the flattened * array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ - min(dim?: number): IMathJsChain; + min(dim?: number): MathJsChain; /** * Computes the mode of a set of numbers or a list with values(numbers or characters). If there are more than one modes, it returns a list of those values. */ - mode(): IMathJsChain; + mode(): MathJsChain; /** * Compute the product of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the sum of all elements will be calculated. */ - prod(): IMathJsChain; + prod(): MathJsChain; /** - * Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. + * Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. * Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber - * * In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated. */ - quantileSeq(prob: Number|BigNumber|MathArray, sorted?: boolean): IMathJsChain; + quantileSeq(prob: number|BigNumber|MathArray, sorted?: boolean): MathJsChain; /** - * Compute the standard deviation of a matrix or a list with values. The standard deviations is defined as the square root of the - * variance: std(A) = sqrt(var(A)). In case of a (multi dimensional) array or matrix, the standard deviation over all elements will + * Compute the standard deviation of a matrix or a list with values. The standard deviations is defined as the square root of the + * variance: std(A) = sqrt(var(A)). In case of a (multi dimensional) array or matrix, the standard deviation over all elements will * be calculated. - * - * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following + * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following * values: - * * 'unbiased' (default) The sum of squared errors is divided by (n - 1) * 'uncorrected' The sum of squared errors is divided by n * 'biased' The sum of squared errors is divided by (n + 1) */ - std(normalization?: string): IMathJsChain; + std(normalization?: string): MathJsChain; /** * Compute the sum of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the sum of all elements will be calculated. */ - sum(): IMathJsChain; + sum(): MathJsChain; /** - * Compute the variance of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the variance over all + * Compute the variance of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the variance over all * elements will be calculated. - * - * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the + * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the * following values: - * * 'unbiased' (default) The sum of squared errors is divided by (n - 1) * 'uncorrected' The sum of squared errors is divided by n * 'biased' The sum of squared errors is divided by (n + 1) - * Note that older browser may not like the variable name var. In that case, the function can be called as math['var'](...) + * Note that older browser may not like the variable name var. In that case, the function can be called as math['var'](...) * instead of math.var(...). */ - var(normalization?: string): IMathJsChain; + var(normalization?: string): MathJsChain; /** * Calculate the inverse cosine of a value. For matrices, the function is evaluated element wise. */ - acos(): IMathJsChain; + acos(): MathJsChain; /** * Calculate the hyperbolic arccos of a value, defined as acosh(x) = ln(sqrt(x^2 - 1) + x). * For matrices, the function is evaluated element wise. */ - acosh(): IMathJsChain; + acosh(): MathJsChain; /** * Calculate the inverse cotangent of a value. For matrices, the function is evaluated element wise. */ - acot(): IMathJsChain; + acot(): MathJsChain; /** * Calculate the hyperbolic arccotangent of a value, defined as acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2. * For matrices, the function is evaluated element wise. */ - acoth(): IMathJsChain; + acoth(): MathJsChain; /** * Calculate the inverse cosecant of a value. For matrices, the function is evaluated element wise. */ - acsc(): IMathJsChain; + acsc(): MathJsChain; /** * Calculate the hyperbolic arccosecant of a value, defined as acsch(x) = ln(1/x + sqrt(1/x^2 + 1)). * For matrices, the function is evaluated element wise. */ - acsch(): IMathJsChain; + acsch(): MathJsChain; /** * Calculate the inverse secant of a value. For matrices, the function is evaluated element wise. */ - asec(): IMathJsChain; + asec(): MathJsChain; /** * Calculate the hyperbolic arcsecant of a value, defined as asech(x) = ln(sqrt(1/x^2 - 1) + 1/x). For matrices, the function is evaluated element wise. */ - asech(): IMathJsChain; + asech(): MathJsChain; - /** + /** * Calculate the inverse sine of a value. For matrices, the function is evaluated element wise. */ - asin(): IMathJsChain; + asin(): MathJsChain; /** * Calculate the hyperbolic arcsine of a value, defined as asinh(x) = ln(x + sqrt(x^2 + 1)). For matrices, the function is evaluated element wise. */ - asinh(): IMathJsChain; + asinh(): MathJsChain; /** * Calculate the inverse tangent of a value. For matrices, the function is evaluated element wise. */ - atan(): IMathJsChain; + atan(): MathJsChain; /** - * Calculate the inverse tangent function with two arguments, y/x. By providing two arguments, the right quadrant of the + * Calculate the inverse tangent function with two arguments, y/x. By providing two arguments, the right quadrant of the * computed angle can be determined. - * * For matrices, the function is evaluated element wise. */ - atan2(x: number): IMathJsChain; - atan2(x: MathArray|Matrix): IMathJsChain; + atan2(x: number|MathArray|Matrix): MathJsChain; /** * Calculate the hyperbolic arctangent of a value, defined as atanh(x) = ln((1 + x)/(1 - x)) / 2. * For matrices, the function is evaluated element wise. */ - atanh(): IMathJsChain; + atanh(): MathJsChain; /** * Calculate the cosine of a value. For matrices, the function is evaluated element wise. */ - asin(): IMathJsChain; + asin(): MathJsChain; // tslint:disable-line adjacent-overload-signatures /** * Calculate the hyperbolic cosine of a value, defined as cosh(x) = 1/2 * (exp(x) + exp(-x)). For matrices, the function is evaluated element wise. */ - cosh(): IMathJsChain; + cosh(): MathJsChain; /** * Calculate the cotangent of a value. cot(x) is defined as 1 / tan(x). For matrices, the function is evaluated element wise. */ - cot(): IMathJsChain; + cot(): MathJsChain; /** * Calculate the hyperbolic cotangent of a value, defined as coth(x) = 1 / tanh(x). For matrices, the function is evaluated element wise. */ - coth(): IMathJsChain; + coth(): MathJsChain; /** * Calculate the cosecant of a value, defined as csc(x) = 1/sin(x). For matrices, the function is evaluated element wise. */ - csc(): IMathJsChain; + csc(): MathJsChain; /** * Calculate the hyperbolic cosecant of a value, defined as csch(x) = 1 / sinh(x). For matrices, the function is evaluated element wise. */ - csch(): IMathJsChain; + csch(): MathJsChain; /** * Calculate the secant of a value, defined as sec(x) = 1/cos(x). For matrices, the function is evaluated element wise. */ - sec(): IMathJsChain; + sec(): MathJsChain; /** * Calculate the hyperbolic secant of a value, defined as sech(x) = 1 / cosh(x). For matrices, the function is evaluated element wise. */ - sech(): IMathJsChain; + sech(): MathJsChain; /** * Calculate the sine of a value. For matrices, the function is evaluated element wise. */ - sin(): IMathJsChain; + sin(): MathJsChain; /** * Calculate the hyperbolic sine of a value, defined as sinh(x) = 1/2 * (exp(x) - exp(-x)). For matrices, the function is evaluated element wise. */ - sinh(): IMathJsChain; + sinh(): MathJsChain; /** * Calculate the tangent of a value. tan(x) is equal to sin(x) / cos(x). For matrices, the function is evaluated element wise. */ - tan(): IMathJsChain; + tan(): MathJsChain; /** * Calculate the hyperbolic tangent of a value, defined as tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1). For matrices, the function is evaluated element wise. */ - tanh(): IMathJsChain; + tanh(): MathJsChain; /** * Change the unit of a value. For matrices, the function is evaluated element wise. * @param x The unit to be converted. * @param unit New unit. Can be a string like "cm" or a unit without value. */ - to(unit: Unit|string): IMathJsChain; + to(unit: Unit|string): MathJsChain; /** * Clone an object. */ - clone(): IMathJsChain; + clone(): MathJsChain; /** * Filter the items in an array or one dimensional matrix. * @param x A one dimensional matrix or array to filter - * @param test + * @param test */ - filter(test: RegExp|((item: any)=>boolean)): IMathJsChain; + filter(test: RegExp|((item: any) => boolean)): MathJsChain; /** * Format a value of any type into a string. */ - format(options?: IFormatOptions|number|((item: any)=>string)): IMathJsChain; + format(options?: FormatOptions|number|((item: any) => string)): MathJsChain; /** * Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array. * @param callback The callback method is invoked with three parameters: the value of the element, the index of the element, and the matrix being traversed. */ - map(callback: (item: any)=>any): IMathJsChain; + map(callback: (item: any) => any): MathJsChain; /** * Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect. @@ -2296,20 +2220,16 @@ declare namespace mathjs { * @param compare An optional comparator function. The function is called as compare(a, b), and must return 1 when a > b, -1 when a < b, and 0 when a == b. Default value: 'asc'. * @returns Returns the kth lowest value. */ - partitionSelect(k: number, compare?: string|((a: any, b: any)=>number)): IMathJsChain; + partitionSelect(k: number, compare?: string|((a: any, b: any) => number)): MathJsChain; /** * Sort the items in a matrix. * @param compare An optional comparator function. The function is called as compare(a, b), and must return 1 when a > b, -1 when a < b, and 0 when a == b. Default value: 'asc'. */ - sort(compare?: string|((a: any, b: any)=>number)): IMathJsChain; + sort(compare?: string|((a: any, b: any) => number)): MathJsChain; done(): any; valueOf(): any; toString(): string; } } - -declare module 'mathjs'{ - export = math; -} diff --git a/types/mathjs/mathjs-tests.ts b/types/mathjs/mathjs-tests.ts index 64e5e0673b..306ab44ccd 100644 --- a/types/mathjs/mathjs-tests.ts +++ b/types/mathjs/mathjs-tests.ts @@ -1,17 +1,14 @@ - - - /* Basic usage examples */ -(function(){ +{ // functions and constants math.round(math.e, 3); // 2.718 math.atan2(3, -3) / math.pi; // 0.75 math.log(10000, 10); // 4 math.sqrt(-4); // 2i math.pow([[-1, 2], [3, 1]], 2); // [[7, 0], [0, 7]] - var angle = 0.2; + const angle = 0.2; math.add(math.pow(math.sin(angle), 2), math.pow(math.cos(angle), 2)); // returns number ~1 // expressions @@ -22,7 +19,7 @@ Basic usage examples math.eval('det([-1, 2; 3, 1])'); // -7 // chained operations - var a = math.chain(3) + const a = math.chain(3) .add(4) .multiply(2) .done(); // 14 @@ -33,18 +30,17 @@ Basic usage examples math.multiply(math.unit('5 mm'), 3); // Unit * number, 15 mm math.subtract([2, 3, 4], 5); // Array - number, [-3, -2, -1] math.add(math.matrix([2, 3]), [4, 5]); // Matrix + Array, [6, 8] -}()); - +} /* Bignumbers examples */ -(function() { +{ // configure the default type of numbers as BigNumbers math.config({ - number: 'bignumber', // Default type of number: - // 'number' (default), 'bignumber', or 'fraction' - precision: 20 // Number of significant digits for BigNumbers + number: 'bignumber', // Default type of number: + // 'number' (default), 'bignumber', or 'fraction' + precision: 20 // Number of significant digits for BigNumbers }); console.log('round-off errors with numbers'); @@ -68,23 +64,21 @@ Bignumbers examples math.eval('0.1 + 0.2'); // BigNumber, 0.3 math.eval('0.3 / 0.2'); // BigNumber, 1.5 console.log(); -}()); - - +} /* Chaining examples */ -(function() { +{ // create a chained operation using the function `chain(value)` // end a chain using done(). Let's calculate (3 + 4) * 2 - var a = math.chain(3) + const a = math.chain(3) .add(4) .multiply(2) .done(); // 14 // Another example, calculate square(sin(pi / 4)) - var b = math.chain(math.pi) + const b = math.chain(math.pi) .divide(4) .sin() .square() @@ -94,46 +88,44 @@ Chaining examples // these are demonstrated in the following examples // toString will return a string representation of the chain's value - var chain = math.chain(2).divide(3); - var str = chain.toString(); // "0.6666666666666666" + const chain = math.chain(2).divide(3); + const str = chain.toString(); // "0.6666666666666666" // a chain has a function .valueOf(), which returns the value hold by the chain. // This allows using it in regular operations. The function valueOf() acts the // same as function done(). chain.valueOf(); // 0.66666666666667 - // the function subset can be used to get or replace sub matrices - var array = [[1, 2], [3, 4]]; - var v = math.chain(array) + const array = [[1, 2], [3, 4]]; + const v = math.chain(array) .subset(math.index(1, 0)) .done(); // 3 - var m = math.chain(array) + const m = math.chain(array) .subset(math.index(0, 0), 8) .multiply(3) .done(); // [[24, 6], [9, 12]] -}()); - +} /* Complex numbers examples */ -(function(){ - var a = math.complex(2, 3); // 2 + 3i +{ + const a = math.complex(2, 3); // 2 + 3i // read the real and complex parts of the complex number a.re; // 2 a.im; // 3 // clone a complex value - var clone = a.clone(); // 2 + 3i + const clone = a.clone(); // 2 + 3i // adjust the complex value a.re = 5; // 5 + 3i // create a complex number by providing a string with real and complex parts - var b = math.complex('3 - 7i'); // 3 - 7i + const b = math.complex('3 - 7i'); // 3 - 7i console.log(); // perform operations with complex numbers @@ -148,18 +140,17 @@ Complex numbers examples // create a complex number from polar coordinates console.log('create complex numbers with polar coordinates'); - var c = math.complex({r: math.sqrt(2), phi: math.pi / 4}); // 1 + i + const c = math.complex({r: math.sqrt(2), phi: math.pi / 4}); // 1 + i // get polar coordinates of a complex number - var d = math.complex(3, 4); + const d = math.complex(3, 4); d.toPolar(); // { r: 5, phi: 0.9272952180016122 } -}()); - +} /* Expressions examples */ -(function() { +{ // 1. using the function math.eval // // Function `eval` accepts a single expression or an array with @@ -179,16 +170,16 @@ Expressions examples // evaluate multiple expressions at once console.log('\nevaluate multiple expressions at once'); math.eval([ - 'f = 3', - 'g = 4', - 'f * g' - ]); // [3, 4, 12] + 'f = 3', + 'g = 4', + 'f * g' + ]); // [3, 4, 12] // provide a scope (just a regular JavaScript Object) console.log('\nevaluate expressions providing a scope with variables and functions'); - var scope: any = { - a: 3, - b: 4 + let scope: any = { + a: 3, + b: 4, }; // variables can be read from the scope @@ -199,18 +190,16 @@ Expressions examples scope.c; // 6.8 // scope can contain both variables and functions - scope["hello"] = function (name: string) { - return 'hello, ' + name + '!'; + scope["hello"] = function(name: string) { + return `hello, ${name}!`; }; math.eval('hello("hero")', scope); // "hello, hero!" // define a function as an expression - var f = math.eval('f(x) = x ^ a', scope); + let f = math.eval('f(x) = x ^ a', scope); f(2); // 8 scope.f(2); // 8 - - // 2. using function math.parse // // Function `math.parse` parses expressions into a node tree. The syntax is @@ -224,7 +213,7 @@ Expressions examples // parse an expression console.log('\nparse an expression into a node tree'); - var node1 = math.parse('sqrt(3^2 + 4^2)'); + const node1 = math.parse('sqrt(3^2 + 4^2)'); node1.toString(); // "sqrt((3 ^ 2) + (4 ^ 2))" // compile and evaluate the compiled code @@ -233,12 +222,12 @@ Expressions examples // provide a scope console.log('\nprovide a scope'); - var node2 = math.parse('x^a'); - var code2 = node2.compile(); + const node2 = math.parse('x^a'); + let code2 = node2.compile(); node2.toString(); // "x ^ a" - var scope: any = { - x: 3, - a: 2 + scope = { + x: 3, + a: 2, }; code2.eval(scope); // 9 @@ -246,7 +235,6 @@ Expressions examples scope.a = 3; code2.eval(scope); // 27 - // 3. using function math.compile // // Function `math.compile` compiles expressions into a node tree. The syntax is @@ -260,21 +248,18 @@ Expressions examples // parse an expression console.log('\ncompile an expression'); - var code3 = math.compile('sqrt(3^2 + 4^2)'); + const code3 = math.compile('sqrt(3^2 + 4^2)'); // evaluate the compiled code code3.eval(); // 5 // provide a scope for the variable assignment console.log('\nprovide a scope'); - var code2 = math.compile('a = a + 3'); - var scope: any = { - a: 7 - }; + code2 = math.compile('a = a + 3'); + scope = { a: 7 }; code2.eval(scope); scope.a; // 10 - // 4. using a parser // // In addition to the static functions `math.eval` and `math.parse`, math.js @@ -282,7 +267,7 @@ Expressions examples // keeps a scope with assigned variables in memory. The parser also contains // some convenience methods to get, set, and remove variables from memory. console.log('\n4. USING A PARSER'); - var parser = math.parser(); + const parser = math.parser(); // evaluate with parser console.log('\nevaluate expressions'); @@ -313,29 +298,28 @@ Expressions examples // get and set variables and functions console.log('\nget and set variables and function in the scope of the parser'); - var x = parser.get('x'); + const x = parser.get('x'); console.log('x =', x); // x = 7 - var f = parser.get('f'); + f = parser.get('f'); console.log('f =', math.format(f)); // f = f(x, y) - var g = f(3, 3); + const g = f(3, 3); console.log('g =', g); // g = 27 parser.set('h', 500); parser.eval('h / 2'); // 250 - parser.set('hello', function (name: string) { - return 'hello, ' + name + '!'; + parser.set('hello', function(name: string) { + return `hello, ${name}!`; }); parser.eval('hello("hero")'); // "hello, hero!" // clear defined functions and variables parser.clear(); -}()); - +} /* Fractions examples */ -(function(){ +{ // configure the default type of numbers as Fractions math.config({ number: 'fraction' // Default type of number: @@ -377,65 +361,64 @@ Fractions examples // output formatting console.log('output formatting of fractions'); - var a = math.fraction('2/3'); + const a = math.fraction('2/3'); console.log(math.format(a)); // Fraction, 2/3 console.log(math.format(a, {fraction: 'ratio'})); // Fraction, 2/3 console.log(math.format(a, {fraction: 'decimal'})); // Fraction, 0.(6) console.log(a.toString()); // Fraction, 0.(6) console.log(); -}()); +} /* Matrices examples */ -(function() { +{ // create matrices and arrays. a matrix is just a wrapper around an Array, // providing some handy utilities. console.log('create a matrix'); - var a = math.matrix([1, 4, 9, 16, 25]); // [1, 4, 9, 16, 25] - var b = math.matrix(math.ones([2, 3])); // [[1, 1, 1], [1, 1, 1]] + const a = math.matrix([1, 4, 9, 16, 25]); // [1, 4, 9, 16, 25] + const b = math.matrix(math.ones([2, 3])); // [[1, 1, 1], [1, 1, 1]] b.size(); // [2, 3] // the Array data of a Matrix can be retrieved using valueOf() - var array = a.valueOf(); // [1, 4, 9, 16, 25] + const array = a.valueOf(); // [1, 4, 9, 16, 25] // Matrices can be cloned - var clone = a.clone(); // [1, 4, 9, 16, 25] + const clone = a.clone(); // [1, 4, 9, 16, 25] console.log(); // perform operations with matrices console.log('perform operations'); math.sqrt(a); // [1, 2, 3, 4, 5] - var c = [1, 2, 3, 4, 5]; + const c = [1, 2, 3, 4, 5]; math.factorial(c); // [1, 2, 6, 24, 120] console.log(); // create and manipulate matrices. Arrays and Matrices can be used mixed. console.log('manipulate matrices'); - var d = [[1, 2], [3, 4]]; // [[1, 2], [3, 4]] - var e = math.matrix([[5, 6], [1, 1]]); // [[5, 6], [1, 1]] + const d = [[1, 2], [3, 4]]; // [[1, 2], [3, 4]] + const e = math.matrix([[5, 6], [1, 1]]); // [[5, 6], [1, 1]] // set a submatrix. // Matrix indexes are zero-based. e.subset(math.index(1, [0, 1]), [[7, 8]]); // [[5, 6], [7, 8]] - var f = math.multiply(d, e); // [[19, 22], [43, 50]] - var g = f.subset(math.index(1, 0)); // 43 + const f = math.multiply(d, e); // [[19, 22], [43, 50]] + const g = f.subset(math.index(1, 0)); // 43 console.log(); // get a sub matrix // Matrix indexes are zero-based. console.log('get a sub matrix'); - var h = math.diag(math.range(1,4)); // [[1, 0, 0], [0, 2, 0], [0, 0, 3]] - h.subset( math.index([1, 2], [1, 2])); // [[2, 0], [0, 3]] - var i = math.range(1,6); // [1, 2, 3, 4, 5] - i.subset(math.index(math.range(1,4))); // [2, 3, 4] + const h = math.diag(math.range(1, 4)); // [[1, 0, 0], [0, 2, 0], [0, 0, 3]] + h.subset(math.index([1, 2], [1, 2])); // [[2, 0], [0, 3]] + const i = math.range(1, 6); // [1, 2, 3, 4, 5] + i.subset(math.index(math.range(1, 4))); // [2, 3, 4] console.log(); - // resize a multi dimensional matrix console.log('resizing a matrix'); - var j = math.matrix(); - var defaultValue = 0; + const j = math.matrix(); + let defaultValue = 0; j.resize([2, 2, 2], defaultValue); // [[[0, 0], [0, 0]], [[0, 0], [0, 0]]] j.size(); // [2, 2, 2] j.resize([2, 2]); // [[0, 0], [0, 0]] @@ -445,12 +428,12 @@ Matrices examples // setting a value outside the matrices range will resize the matrix. // new elements will be initialized with zero. console.log('set a value outside a matrices range'); - var k = math.matrix(); + const k = math.matrix(); k.subset(math.index(2), 6); // [0, 0, 6] console.log(); console.log('set a value outside a matrices range, leaving new entries uninitialized'); - var m = math.matrix(); + const m = math.matrix(); defaultValue = math.uninitialized; m.subset(math.index(2), 6, defaultValue); // [undefined, undefined, 6] console.log(); @@ -462,38 +445,38 @@ Matrices examples math.range('2:-1:-3'); // [2, 1, 0, -1, -2] math.factorial(math.range('1:6')); // [1, 2, 6, 24, 120] console.log(); -}()); +} /* Sparse matrices examples */ -(function() { +{ // create a sparse matrix console.log('creating a 1000x1000 sparse matrix...'); - var a = math.eye(1000, 1000, 'sparse'); + const a = math.eye(1000, 1000, 'sparse'); // do operations with a sparse matrix console.log('doing some operations on the sparse matrix...'); - var b = math.multiply(a, a); - var c = math.multiply(b, math.complex(2, 2)); - var d = math.transpose(c); - var e = math.multiply(d, a); + const b = math.multiply(a, a); + const c = math.multiply(b, math.complex(2, 2)); + const d = math.transpose(c); + const e = math.multiply(d, a); // we will not print the output, but doing the same operations // with a dense matrix are very slow, try it for yourself. console.log('already done'); console.log('now try this with a dense matrix :)'); -}()); +} /* Units examples */ -(function() { +{ // units can be created by providing a value and unit name, or by providing // a string with a valued unit. console.log('create units'); - var a = math.unit(45, 'cm'); // 450 mm - var b = math.unit('0.1m'); // 100 mm + const a = math.unit(45, 'cm'); // 450 mm + const b = math.unit('0.1m'); // 100 mm console.log(); // creating units @@ -509,7 +492,7 @@ Units examples aliases: ['knots', 'kt', 'kts'], prefixes: 'long' }, {override: true}); - math.createUnit( { + math.createUnit({ foo: { prefixes: 'long' }, @@ -561,10 +544,10 @@ Units examples // example engineering calculations console.log('compute molar volume of ideal gas at 65 Fahrenheit, 14.7 psi in L/mol'); - var Rg = math.unit('8.314 N m / (mol K)'); - var T = math.unit('65 degF'); - var P = math.unit('14.7 psi'); - var v = math.divide(math.multiply(Rg, T), P); + const Rg = math.unit('8.314 N m / (mol K)'); + const T = math.unit('65 degF'); + const P = math.unit('14.7 psi'); + const v = math.divide(math.multiply(Rg, T), P); console.log('gas constant (Rg) = ', format(Rg)); console.log('P = ' + format(P)); console.log('T = ' + format(T)); @@ -572,100 +555,74 @@ Units examples console.log(); console.log('compute speed of fluid flowing out of hole in a container'); - var g = math.unit('9.81 m / s^2'); - var h = math.unit('1 m'); - var v2 = math.pow(math.multiply(2, math.multiply(g, h)), 0.5); // Can also use math.sqrt + const g = math.unit('9.81 m / s^2'); + const h = math.unit('1 m'); + const v2 = math.pow(math.multiply(2, math.multiply(g, h)), 0.5); // Can also use math.sqrt console.log('g = ' + format(g)); console.log('h = ' + format(h)); console.log('v = (2 g h) ^ 0.5 = ' + format(v2)); // 4.429... m / s console.log(); console.log('electrical power consumption:'); - var expr = '460 V * 20 A * 30 days to kWh'; - console.log(expr + ' = ' + math.eval(expr)); // 6624 kWh + let expr = '460 V * 20 A * 30 days to kWh'; + console.log(`${expr} = ${math.eval(expr)}`); // 6624 kWh console.log(); console.log('circuit design:'); - var expr = '24 V / (6 mA)'; - console.log(expr + ' = ' + math.eval(expr)); // 4 kohm + expr = '24 V / (6 mA)'; + console.log(`${expr} = ${math.eval(expr)}`); // 4 kohm console.log(); console.log('operations on arrays:'); - var B = math.eval('[1, 0, 0] T'); - var v3 = math.eval('[0, 1, 0] m/s'); - var q = math.eval('1 C'); - var F = math.multiply(q, math.cross(v3, B)); + const B = math.eval('[1, 0, 0] T'); + const v3 = math.eval('[0, 1, 0] m/s'); + const q = math.eval('1 C'); + const F = math.multiply(q, math.cross(v3, B)); console.log('B (magnetic field strength) = ' + format(B)); // [1 T, 0 T, 0 T] console.log('v (particle velocity) = ' + format(v3)); // [0 m / s, 1 m / s, 0 m / s] console.log('q (particle charge) = ' + format(q)); // 1 C console.log('F (force) = q (v cross B) = ' + format(F)); // [0 N, 0 N, -1 N] /** - * Helper function to format an output a value. - * @param {*} value - * @return {string} Returns the formatted value - */ - function format (value: any): string { - var precision = 14; + * Helper function to format an output a value. + * @return Returns the formatted value + */ + function format(value: any): string { + const precision = 14; return math.format(value, precision); } -}()); - +} /* Expression tree examples */ -(function(){ +{ + // Filter an expression tree + console.log('Filter all symbol nodes "x" in the expression "x^2 + x/4 + 3*y"'); + const node = math.parse('x^2 + x/4 + 3*y'); + const filtered = node.filter(function(node) { + return node.isSymbolNode && node.name === 'x'; + }); + // returns an array with two entries: two SymbolNodes 'x' - // Filter an expression tree -console.log('Filter all symbol nodes "x" in the expression "x^2 + x/4 + 3*y"'); -var node = math.parse('x^2 + x/4 + 3*y'); -var filtered = node.filter(function (node) { - return node.isSymbolNode && node.name == 'x'; -}); -// returns an array with two entries: two SymbolNodes 'x' + filtered.forEach(function(node) { + console.log(node.type, node.toString()); + }); + // outputs: + // SymbolNode x + // SymbolNode x -filtered.forEach(function (node) { - console.log(node.type, node.toString()) -}); -// outputs: -// SymbolNode x -// SymbolNode x - - -// Traverse an expression tree -console.log(); -console.log('Traverse the expression tree of expression "3 * x + 2"'); -var node1 = math.parse('3 * x + 2'); -node1.traverse(function (node, path, parent) { - switch (node.type) { - // case 'OperatorNode': console.log(node.type, node.op); break; - case 'OperatorNode': console.log(node.type); break;//for now removing .op - case 'ConstantNode': console.log(node.type, node.value); break; - case 'SymbolNode': console.log(node.type, node.name); break; - default: console.log(node.type); - } -}); -// outputs: -// OperatorNode + -// OperatorNode * -// ConstantNode 3 -// SymbolNode x -// ConstantNode 2 - - -// transform an expression tree -// console.log(); -// console.log('Replace all symbol nodes "x" in expression "x^2 + 5*x" with a constant 3'); -// var node2 = math.parse('x^2 + 5*x'); -// var transformed = node2.transform(function (node, path, parent) { -// if (node.isSymbolNode && node.name == 'x') { -// return new math.expression.node.ConstantNode(3); -// } -// else { -// return node; -// } -// }); -// console.log(transformed.toString()); -// outputs: '(3 ^ 2) + (5 * 3)' -}()); + // Traverse an expression tree + console.log(); + console.log('Traverse the expression tree of expression "3 * x + 2"'); + const node1 = math.parse('3 * x + 2'); + node1.traverse(function(node, path, parent) { + switch (node.type) { + // case 'OperatorNode': console.log(node.type, node.op); break; + case 'OperatorNode': console.log(node.type); break; // for now removing .op + case 'ConstantNode': console.log(node.type, node.value); break; + case 'SymbolNode': console.log(node.type, node.name); break; + default: console.log(node.type); + } + }); +} diff --git a/types/mathjs/package.json b/types/mathjs/package.json new file mode 100644 index 0000000000..23474e431e --- /dev/null +++ b/types/mathjs/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "decimal.js": "^10.0.0" + } +} diff --git a/types/mathjs/tslint.json b/types/mathjs/tslint.json index a41bf5d19a..c2e987daf6 100644 --- a/types/mathjs/tslint.json +++ b/types/mathjs/tslint.json @@ -1,79 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "only-arrow-functions": false } } diff --git a/types/mem-fs-editor/index.d.ts b/types/mem-fs-editor/index.d.ts new file mode 100644 index 0000000000..01234bbc0c --- /dev/null +++ b/types/mem-fs-editor/index.d.ts @@ -0,0 +1,48 @@ +// Type definitions for mem-fs-editor 4.0 +// Project: https://github.com/SBoudrias/mem-fs-editor#readme +// Definitions by: My Food Bag +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +import * as Buffer from 'buffer'; +import { Transform } from 'stream'; +import { Store } from 'mem-fs'; +import { Options as TemplateOptions } from 'ejs'; +import { IOptions as GlobOptions } from 'glob'; + +export function create(store: Store): memFsEditor.Editor; + +export namespace memFsEditor { + type Contents = string|Buffer; + + type ReplacerFunc = (key: string, value: any) => string|null|undefined; + + type Space = string|number; + + type ProcessFunc = (contents: Buffer) => Contents; + + interface CopyOptions { + process?: ProcessFunc; + globOptions?: GlobOptions; + } + + interface Editor { + read: (filepath: string, options?: { raw: boolean, defaults: string }) => string; + readJSON: (filepath: string, defaults?: string) => string; + write: (filepath: string, contents: Contents) => void; + writeJSON: (filepath: string, contents: object, replacer?: ReplacerFunc, space?: Space) => void; + append: (filepath: string, contents: Contents, options?: { trimEnd: boolean, separator: string }) => void; + extendJSON: (filepath: string, contents: object, replacer?: ReplacerFunc, space?: Space) => void; + delete: (filepath: string, options?: { globOptions: GlobOptions }) => void; + copy: (from: string, to: string, options?: CopyOptions) => void; + copyTpl: (from: string, to: string, context: object, templateOptions?: TemplateOptions, copyOptions?: CopyOptions) => void; + move: (from: string, to: string, options?: { globOptions: GlobOptions }) => void; + exists: (filepath: string) => boolean; + commit: (filters: ReadonlyArray, callback: () => void) => void; + } + + const prototype: { + }; +} diff --git a/types/mem-fs-editor/mem-fs-editor-tests.ts b/types/mem-fs-editor/mem-fs-editor-tests.ts new file mode 100644 index 0000000000..355c714bf9 --- /dev/null +++ b/types/mem-fs-editor/mem-fs-editor-tests.ts @@ -0,0 +1,18 @@ +import memFs = require('mem-fs'); +import editor = require('mem-fs-editor'); + +const store = memFs.create(); +const fs = editor.create(store); + +fs.write('template.js', 'var a = 1; console.log(\'<%= foo %>\', a);'); + +fs.copy('template.js', 'template.tpl', { + process: (contents) => contents, + globOptions: { + cwd: '.' + } +}); + +fs.copyTpl('template.tpl', 'output.js', { + foo: 'bar' +}); diff --git a/types/mem-fs-editor/tsconfig.json b/types/mem-fs-editor/tsconfig.json new file mode 100644 index 0000000000..52623549e4 --- /dev/null +++ b/types/mem-fs-editor/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", + "mem-fs-editor-tests.ts" + ] +} diff --git a/types/mem-fs-editor/tslint.json b/types/mem-fs-editor/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mem-fs-editor/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/mem-fs/index.d.ts b/types/mem-fs/index.d.ts new file mode 100644 index 0000000000..4b1d8c4d14 --- /dev/null +++ b/types/mem-fs/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for mem-fs 1.1 +// Project: https://github.com/sboudrias/mem-fs +// Definitions by: My Food Bag +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { EventEmitter } from 'events'; +import { Transform } from 'stream'; +import * as File from 'vinyl'; + +export interface Store extends EventEmitter { + add: (file: File, content: string) => void; + each: (callback: (file: File, index: number) => void) => void; + get: (filepath: string) => File; + stream: () => Transform; +} + +export function create(...args: any[]): Store; + +export namespace memFs { +} diff --git a/types/mem-fs/mem-fs-tests.ts b/types/mem-fs/mem-fs-tests.ts new file mode 100644 index 0000000000..9605c65ef7 --- /dev/null +++ b/types/mem-fs/mem-fs-tests.ts @@ -0,0 +1,8 @@ +import * as fs from 'mem-fs'; + +const store: fs.Store = fs.create(); +const file = store.get('hello'); + +store.add(file, 'hahahahah'); + +store.each(file => console.dir(store.get(file.path))); diff --git a/types/mem-fs/tsconfig.json b/types/mem-fs/tsconfig.json new file mode 100644 index 0000000000..23cb94acb6 --- /dev/null +++ b/types/mem-fs/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", + "mem-fs-tests.ts" + ] +} diff --git a/types/mem-fs/tslint.json b/types/mem-fs/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/mem-fs/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/meteor-roles/index.d.ts b/types/meteor-roles/index.d.ts index 80a4b02c90..ed91f96ab5 100644 --- a/types/meteor-roles/index.d.ts +++ b/types/meteor-roles/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for Meteor Roles 1.2.14 // Project: https://github.com/alanning/meteor-roles/ // Definitions by: Robbie Van Gorkom +// Matthew Zartman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -262,3 +263,256 @@ declare namespace Roles { declare namespace Meteor { var roles : Mongo.Collection; } + + +/* Declaring in the format prescribed by Meteor */ +declare module "meteor/alanning:roles" { + namespace Roles { + /** + * Constant used to reference the special 'global' group that + * can be used to apply blanket permissions across all groups. + * + * @example + * Roles.addUsersToRoles(user, 'admin', Roles.GLOBAL_GROUP) + * Roles.userIsInRole(user, 'admin') // => true + * + * Roles.setUserRoles(user, 'support-staff', Roles.GLOBAL_GROUP) + * Roles.userIsInRole(user, 'support-staff') // => true + * Roles.userIsInRole(user, 'admin') // => false + * + * @property GLOBAL_GROUP + * @type String + * @static + * @final + */ + var GLOBAL_GROUP : string; + + /** + * Subscription handle for the currently logged in user's permissions. + * + * NOTE: The corresponding publish function, `_roles`, depends on + * `this.userId` so it will automatically re-run when the currently + * logged-in user changes. + * + * @example + * + * `Roles.subscription.ready()` // => `true` if user roles have been loaded + * + * @property subscription + * @type Object + * @for Roles + */ + var subscription : Subscription; + + /** + * Add users to roles. Will create roles as needed. + * + * NOTE: Mixing grouped and non-grouped roles for the same user + * is not supported and will throw an error. + * + * Makes 2 calls to database: + * 1. retrieve list of all existing roles + * 2. update users' roles + * + * @example + * Roles.addUsersToRoles(userId, 'admin') + * Roles.addUsersToRoles(userId, ['view-secrets'], 'example.com') + * Roles.addUsersToRoles([user1, user2], ['user','editor']) + * Roles.addUsersToRoles([user1, user2], ['glorious-admin', 'perform-action'], 'example.org') + * Roles.addUsersToRoles(userId, 'admin', Roles.GLOBAL_GROUP) + * + * @method addUsersToRoles + * @param {Array|String} users User id(s) or object(s) with an _id field + * @param {Array|String} roles Name(s) of roles/permissions to add users to + * @param {String} [group] Optional group name. If supplied, roles will be + * specific to that group. + * Group names can not start with '$' or numbers. + * Periods in names '.' are automatically converted + * to underscores. + * The special group Roles.GLOBAL_GROUP provides + * a convenient way to assign blanket roles/permissions + * across all groups. The roles/permissions in the + * Roles.GLOBAL_GROUP group will be automatically + * included in checks for any group. + */ + function addUsersToRoles( + user : string|string[]|Object|Object[], + roles : string|string[], + group? : string + ) : void; + + /** + * Create a new role. Whitespace will be trimmed. + * + * @method createRole + * @param {String} role Name of role + * @return {String} id of new role + */ + function createRole(role : string) : string; + + /** + * Delete an existing role. Will throw "Role in use" error if any users + * are currently assigned to the target role. + * + * @method deleteRole + * @param {String} role Name of role + */ + function deleteRole (role : string) : void; + + /** + * Retrieve set of all existing roles + * + * @method getAllRoles + * @return {Cursor} cursor of existing roles + */ + function getAllRoles() : Mongo.Cursor; + + /** + * Retrieve users groups, if any + * + * @method getGroupsForUser + * @param {String|Object} user User Id or actual user object + * @param {String} [role] Optional name of roles to restrict groups to. + * + * @return {Array} Array of user's groups, unsorted. Roles.GLOBAL_GROUP will be omitted + */ + function getGroupsForUser( + user : string|Object, + role? : string + ) : string[]; + + /** + * Retrieve users roles + * + * @method getRolesForUser + * @param {String|Object} user User Id or actual user object + * @param {String} [group] Optional name of group to restrict roles to. + * User's Roles.GLOBAL_GROUP will also be included. + * @return {Array} Array of user's roles, unsorted. + */ + function getRolesForUser( + user : string|Object, + group? : string + ) : string[]; + + /** + * Retrieve all users who are in target role. + * + * NOTE: This is an expensive query; it performs a full collection scan + * on the users collection since there is no index set on the 'roles' field. + * This is by design as most queries will specify an _id so the _id index is + * used automatically. + * + * @method getUsersInRole + * @param {Array|String} role Name of role/permission. If array, users + * returned will have at least one of the roles + * specified but need not have _all_ roles. + * @param {String} [group] Optional name of group to restrict roles to. + * User's Roles.GLOBAL_GROUP will also be checked. + * @param {Object} [options] Optional options which are passed directly + * through to `Meteor.users.find(query, options)` + * @return {Cursor} cursor of users in role + */ + function getUsersInRole( + role : string|string[], + group? : string, + options? : { + sort?: Mongo.SortSpecifier; + skip?: number; + limit?: number; + fields?: Mongo.FieldSpecifier; + reactive?: boolean; + transform?: Function; + }) : Mongo.Cursor; + + /** + * Remove users from roles + * + * @example + * Roles.removeUsersFromRoles(users.bob, 'admin') + * Roles.removeUsersFromRoles([users.bob, users.joe], ['editor']) + * Roles.removeUsersFromRoles([users.bob, users.joe], ['editor', 'user']) + * Roles.removeUsersFromRoles(users.eve, ['user'], 'group1') + * + * @method removeUsersFromRoles + * @param {Array|String} users User id(s) or object(s) with an _id field + * @param {Array|String} roles Name(s) of roles to add users to + * @param {String} [group] Optional. Group name. If supplied, only that + * group will have roles removed. + */ + function removeUsersFromRoles( + user : string|string[]|Object|Object[], + roles? : string[], + group? : string + ) : void; + + /** + * Set a users roles/permissions. + * + * @example + * Roles.setUserRoles(userId, 'admin') + * Roles.setUserRoles(userId, ['view-secrets'], 'example.com') + * Roles.setUserRoles([user1, user2], ['user','editor']) + * Roles.setUserRoles([user1, user2], ['glorious-admin', 'perform-action'], 'example.org') + * Roles.setUserRoles(userId, 'admin', Roles.GLOBAL_GROUP) + * + * @method setUserRoles + * @param {Array|String} users User id(s) or object(s) with an _id field + * @param {Array|String} roles Name(s) of roles/permissions to add users to + * @param {String} [group] Optional group name. If supplied, roles will be + * specific to that group. + * Group names can not start with '$'. + * Periods in names '.' are automatically converted + * to underscores. + * The special group Roles.GLOBAL_GROUP provides + * a convenient way to assign blanket roles/permissions + * across all groups. The roles/permissions in the + * Roles.GLOBAL_GROUP group will be automatically + * included in checks for any group. + */ + function setUserRoles ( + user : string|string[]|Object|Object[], + roles : string|string[], + group? : string + ) : void; + + /** + * Check if user has specified permissions/roles + * + * @example + * // non-group usage + * Roles.userIsInRole(user, 'admin') + * Roles.userIsInRole(user, ['admin','editor']) + * Roles.userIsInRole(userId, 'admin') + * Roles.userIsInRole(userId, ['admin','editor']) + * + * // per-group usage + * Roles.userIsInRole(user, ['admin','editor'], 'group1') + * Roles.userIsInRole(userId, ['admin','editor'], 'group1') + * Roles.userIsInRole(userId, ['admin','editor'], Roles.GLOBAL_GROUP) + * + * // this format can also be used as short-hand for Roles.GLOBAL_GROUP + * Roles.userIsInRole(user, 'admin') + * + * @method userIsInRole + * @param {String|Object} user User Id or actual user object + * @param {String|Array} roles Name of role/permission or Array of + * roles/permissions to check against. If array, + * will return true if user is in _any_ role. + * @param {String} [group] Optional. Name of group. If supplied, limits check + * to just that group. + * The user's Roles.GLOBAL_GROUP will always be checked + * whether group is specified or not. + * @return {Boolean} true if user is in _any_ of the target roles + */ + function userIsInRole( + user : string|string[]|Object|Object[], + roles : string|string[], + group? : string + ) : boolean; + + interface Role { + name : string; + } + } +} diff --git a/types/meteor/server-render.d.ts b/types/meteor/server-render.d.ts index 1695142ee4..0f78cac1c0 100644 --- a/types/meteor/server-render.d.ts +++ b/types/meteor/server-render.d.ts @@ -12,5 +12,7 @@ declare module "meteor/server-render" { appendToElementById?(id: string, html: string): void; renderIntoElementById?(id: string, html: string): void; } - function onPageLoad(sink: Sink): Promise | any; + + type Callback = (sink: Sink) => Promise | any; + export function onPageLoad(callback: T): T; } diff --git a/types/mini-css-extract-plugin/index.d.ts b/types/mini-css-extract-plugin/index.d.ts new file mode 100644 index 0000000000..f9b57632ef --- /dev/null +++ b/types/mini-css-extract-plugin/index.d.ts @@ -0,0 +1,32 @@ +// Type definitions for mini-css-extract-plugin 0.2 +// Project: https://github.com/webpack-contrib/mini-css-extract-plugin +// Definitions by: JounQin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Loader, Plugin } from 'webpack'; + +/** + * Lightweight CSS extraction webpack plugin + * This plugin extract CSS into separate files. It creates a CSS file per JS file which contains CSS. It supports On-Demand-Loading of CSS and SourceMaps. + * Configuration Detail: https://github.com/webpack-contrib/mini-css-extract-plugin#configuration + */ +declare class MiniCssExtractPlugin extends Plugin { + /** webpack loader used always at the end of loaders list */ + static loader: Loader; + + constructor(options?: MiniCssExtractPlugin.PluginOptions); +} + +declare namespace MiniCssExtractPlugin { + interface PluginOptions { + /** + * Options similar to the same options in webpackOptions.output, both options are optional + * May contain `[name]`, `[id]`, `hash` and `[chunkhash]` + */ + filename?: string; + chunkFilename?: string; + } +} + +export = MiniCssExtractPlugin; diff --git a/types/mini-css-extract-plugin/mini-css-extract-plugin-tests.ts b/types/mini-css-extract-plugin/mini-css-extract-plugin-tests.ts new file mode 100644 index 0000000000..9d418ed211 --- /dev/null +++ b/types/mini-css-extract-plugin/mini-css-extract-plugin-tests.ts @@ -0,0 +1,58 @@ +import webpack = require('webpack'); +import MiniCssExtractPlugin = require('mini-css-extract-plugin'); + +let configuration: webpack.Configuration; + +configuration = { + // The standard entry point and output config + entry: { + posts: './posts', + post: './post', + about: './about', + }, + output: { + filename: '[name].js', + chunkFilename: '[id].js', + }, + module: { + rules: [ + // Extract css files + { + test: /\.css$/, + use: [MiniCssExtractPlugin.loader, 'css-loader'], + }, + // Optionally extract less files + // or any other compile-to-css language + { + test: /\.less$/, + use: [ + MiniCssExtractPlugin.loader, + 'css-loader', + 'style-loader', + ], + }, + // You could also use other loaders the same way. I. e. the autoprefixer-loader + ], + }, + // Use the plugin to specify the resulting filename (and add needed behavior to the compiler) + plugins: [ + new MiniCssExtractPlugin({ + filename: '[name].css', + }), + ], +}; + +configuration = { + // ... + plugins: [new MiniCssExtractPlugin()], +}; + +configuration = { + // ... + plugins: [ + new MiniCssExtractPlugin({ + filename: 'styles.css', + chunkFilename: 'style.css', + }), + ], +}; diff --git a/types/mini-css-extract-plugin/tsconfig.json b/types/mini-css-extract-plugin/tsconfig.json new file mode 100644 index 0000000000..e79daeceef --- /dev/null +++ b/types/mini-css-extract-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", + "mini-css-extract-plugin-tests.ts" + ] +} diff --git a/types/mini-css-extract-plugin/tslint.json b/types/mini-css-extract-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mini-css-extract-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/minio/index.d.ts b/types/minio/index.d.ts index 7e920428ff..bdbcb8032a 100644 --- a/types/minio/index.d.ts +++ b/types/minio/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for minio 4.0 +// Type definitions for minio 5.1 // Project: https://github.com/minio/minio-js#readme // Definitions by: Barin Britva +// Lubomir Kaplan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -11,7 +12,6 @@ import EventEmitter = NodeJS.EventEmitter; // Exports only from typings export type Region = 'us-east-1'|'us-west-1'|'us-west-2'|'eu-west-1'|'eu-central-1'|'ap-southeast-1'|'ap-northeast-1'|'ap-southeast-2'|'sa-east-1'|'cn-north-1'|string; -export type PolicyValue = 'none'|'readonly'|'writeonly'|'readwrite'; export type NoResultCallback = (error: Error|null) => void; export type ResultCallback = (error: Error|null, result: T) => void; @@ -46,7 +46,7 @@ export interface BucketItemStat { size: number; contentType: string; etag: string; - lastModified: string; + lastModified: Date; } export interface IncompleteUploadedBucketItem { @@ -83,10 +83,10 @@ export class Client { makeBucket(bucketName: string, region: Region): Promise; listBuckets(callback: ResultCallback): void; - listBuckets(): Promise; + listBuckets(): Promise; - bucketExists(bucketName: string, callback: NoResultCallback): void; - bucketExists(bucketName: string): Promise; + bucketExists(bucketName: string, callback: ResultCallback): void; + bucketExists(bucketName: string): Promise; removeBucket(bucketName: string, callback: NoResultCallback): void; removeBucket(bucketName: string): Promise; @@ -158,11 +158,11 @@ export class Client { // todo #low Specify events listenBucketNotification(bucketName: string, prefix: string, suffix: string, events: string[]): EventEmitter; - getBucketPolicy(bucketName: string, objectPrefix: string, callback: ResultCallback): void; - getBucketPolicy(bucketName: string, objectPrefix: string): Promise; + getBucketPolicy(bucketName: string, callback: ResultCallback): void; + getBucketPolicy(bucketName: string): Promise; - setBucketPolicy(bucketName: string, objectPrefix: string, bucketPolice: PolicyValue, callback: NoResultCallback): void; - setBucketPolicy(bucketName: string, objectPrefix: string, bucketPolice: PolicyValue): Promise; + setBucketPolicy(bucketName: string, bucketPolicy: string, callback: NoResultCallback): void; + setBucketPolicy(bucketName: string, bucketPolicy: string): Promise; // Other newPostPolicy(): PostPolicy; diff --git a/types/minio/minio-tests.ts b/types/minio/minio-tests.ts index 78a7fab267..05f8283d32 100644 --- a/types/minio/minio-tests.ts +++ b/types/minio/minio-tests.ts @@ -16,7 +16,7 @@ minio.makeBucket('testBucket', 'region-not-from-list'); minio.listBuckets((error: Error|null, bucketList: Minio.BucketItemFromList[]) => { console.log(error, bucketList); }); minio.listBuckets(); -minio.bucketExists('testBucket', (error: Error|null) => { console.log(error); }); +minio.bucketExists('testBucket', (error: Error|null, exists: boolean) => { console.log(error, exists); }); minio.bucketExists('testBucket'); minio.removeBucket('testBucket', (error: Error|null) => { console.log(error); }); @@ -106,8 +106,14 @@ minio.removeAllBucketNotification('testBucket'); minio.listenBucketNotification('testBucket', 'pref_', '_suf', [ Minio.ObjectCreatedAll ]); -minio.getBucketPolicy('testBucket', 'pref_', (error: Error|null, policy: Minio.PolicyValue) => { console.log(error, policy); }); -minio.getBucketPolicy('testBucket', ''); +minio.getBucketPolicy('testBucket', (error: Error|null, policy: string) => { console.log(error, policy); }); +minio.getBucketPolicy('testBucket'); -minio.setBucketPolicy('testBucket', '', Minio.Policy.READWRITE, (error: Error|null) => { console.log(error); }); -minio.setBucketPolicy('testBucket', 'pref_', Minio.Policy.WRITEONLY); +const testPolicy = `{"Version":"2012-10-17","Statement":[{"Action":["s3:GetBucketLocation"],"Effect":"Allow", +"Principal":{"AWS":["*"]},"Resource":["arn:aws:s3:::bucketName"],"Sid":""},{"Action":["s3:ListBucket"], +"Condition":{"StringEquals":{"s3:prefix":["foo","prefix/"]}},"Effect":"Allow","Principal":{"AWS":["*"]}, +"Resource":["arn:aws:s3:::bucketName"],"Sid":""},{"Action":["s3:GetObject"],"Effect":"Allow", +"Principal":{"AWS":["*"]},"Resource":["arn:aws:s3:::bucketName/foo*","arn:aws:s3:::bucketName/prefix/*"],"Sid":""}]} +`; +minio.setBucketPolicy('testBucket', testPolicy, (error: Error|null) => { console.log(error); }); +minio.setBucketPolicy('testBucket', testPolicy); diff --git a/types/modernizr/index.d.ts b/types/modernizr/index.d.ts index ff88e9f523..a9cfb92f54 100644 --- a/types/modernizr/index.d.ts +++ b/types/modernizr/index.d.ts @@ -448,6 +448,6 @@ interface ModernizrAPI { interface ModernizrStatic extends ModernizrAPI, FeatureDetects { } declare var Modernizr: ModernizrStatic; -declare module "Modernizr" { +declare module "modernizr" { export = Modernizr; } diff --git a/types/modernizr/tslint.json b/types/modernizr/tslint.json index 2279635eb4..9edbcd99ab 100644 --- a/types/modernizr/tslint.json +++ b/types/modernizr/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { "no-single-declare-module": false, - "no-empty-interface": false + "no-empty-interface": false, + "no-declare-current-package": false } } diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 0ebe9203bb..00356214c6 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -8,6 +8,7 @@ // Mariano Cortesi // Enrico Picci // Alexander Christie +// Julien Chaumond // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -96,6 +97,10 @@ export interface MongoClientOptions extends validateOptions?: Object; // The name of the application that created this MongoClient instance. appname?: string; + auth?: { + user: string; + password: string; + } } export interface SSLOptions { @@ -104,7 +109,7 @@ export interface SSLOptions { // Use ssl connection (needs to have a mongod server with ssl support) ssl?: boolean; // Default: true; Validate mongod server certificate against ca (mongod server >=2.4 with ssl support required) - sslValidate?: Object; + sslValidate?: boolean; // Default: true; Server identity checking during SSL checkServerIdentity?: boolean | Function; // Array of valid certificates either as Buffers or Strings @@ -465,8 +470,8 @@ export interface Collection { // Get current index hint for collection. hint: any; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#aggregate */ - aggregate(pipeline: Object[], callback: MongoCallback): AggregationCursor; - aggregate(pipeline: Object[], options?: CollectionAggregationOptions, callback?: MongoCallback): AggregationCursor; + aggregate(pipeline: Object[], callback: MongoCallback>): AggregationCursor; + aggregate(pipeline: Object[], options?: CollectionAggregationOptions, callback?: MongoCallback>): AggregationCursor; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#bulkWrite */ bulkWrite(operations: Object[], callback: MongoCallback): void; bulkWrite(operations: Object[], options?: CollectionBluckWriteOptions): Promise; @@ -508,9 +513,9 @@ export interface Collection { dropIndexes(callback?: MongoCallback): void; dropIndexes(options: {session?: ClientSession, maxTimeMS?: number}, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#find */ - find(query?: FilterQuery): Cursor; + find(query?: FilterQuery): Cursor; /** @deprecated */ - find(query: FilterQuery, options?: FindOneOptions): Cursor; + find(query: FilterQuery, options?: FindOneOptions): Cursor; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#findOne */ findOne(filter: FilterQuery, callback: MongoCallback): void; findOne(filter: FilterQuery, options?: FindOneOptions): Promise; diff --git a/types/mongodb/mongodb-tests.ts b/types/mongodb/mongodb-tests.ts index af307ce6d8..270379989a 100644 --- a/types/mongodb/mongodb-tests.ts +++ b/types/mongodb/mongodb-tests.ts @@ -20,7 +20,7 @@ let options: mongodb.MongoClientOptions = { reconnectInterval: 123456, ssl: true, - sslValidate: {}, + sslValidate: false, checkServerIdentity: function () { }, sslCA: ['str'], sslCert: new Buffer(999), @@ -113,5 +113,7 @@ MongoClient.connect('mongodb://127.0.0.1:27017/test', options, function (err: mo $and: [{ $gt: 0, $lt: 100 }] } }); + + const res: mongodb.Cursor = testCollection.find({ _id: 123 }); } }) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 50496fc9da..d8ffa046e9 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mongoose 5.0.1 +// Type definitions for Mongoose 5.0.12 // Project: http://mongoosejs.com/ // Definitions by: horiuchi // sindrenm @@ -618,8 +618,74 @@ declare module "mongoose" { /** * Defines a pre hook for the document. */ - pre(method: string, parallel: boolean, fn: HookAsyncCallback, errorCb?: HookErrorCallback): this; - pre(method: string, fn: HookSyncCallback, errorCb?: HookErrorCallback): this; + pre( + method: "init" | "validate" | "save" | "remove", + fn: HookSyncCallback, + errorCb?: HookErrorCallback + ): this; + pre = Query>( + method: + | "count" + | "find" + | "findOne" + | "findOneAndRemove" + | "findOneAndUpdate" + | "update", + fn: HookSyncCallback, + errorCb?: HookErrorCallback + ): this; + pre = Aggregate>( + method: "aggregate", + fn: HookSyncCallback, + errorCb?: HookErrorCallback + ): this; + pre = Model>( + method: "insertMany", + fn: HookSyncCallback, + errorCb?: HookErrorCallback + ): this; + pre | Query | Aggregate>( + method: string, + fn: HookSyncCallback, + errorCb?: HookErrorCallback + ): this; + + pre( + method: "init" | "validate" | "save" | "remove", + parallel: boolean, + fn: HookAsyncCallback, + errorCb?: HookErrorCallback + ): this; + pre = Query>( + method: + | "count" + | "find" + | "findOne" + | "findOneAndRemove" + | "findOneAndUpdate" + | "update", + parallel: boolean, + fn: HookAsyncCallback, + errorCb?: HookErrorCallback + ): this; + pre = Aggregate>( + method: "aggregate", + parallel: boolean, + fn: HookAsyncCallback, + errorCb?: HookErrorCallback + ): this; + pre = Model>( + method: "insertMany", + parallel: boolean, + fn: HookAsyncCallback, + errorCb?: HookErrorCallback + ): this; + pre | Query | Aggregate>( + method: string, + parallel: boolean, + fn: HookAsyncCallback, + errorCb?: HookErrorCallback + ): this; /** * Adds a method call to the queue. @@ -679,12 +745,12 @@ declare module "mongoose" { } // Hook functions: https://github.com/vkarpov15/hooks-fixed - interface HookSyncCallback { - (next: HookNextFunction): any; + interface HookSyncCallback { + (this: T, next: HookNextFunction): Promise | void; } - interface HookAsyncCallback { - (next: HookNextFunction, done: HookDoneFunction): any; + interface HookAsyncCallback { + (this: T, next: HookNextFunction, done: HookDoneFunction): Promise | void; } interface HookErrorCallback { @@ -2608,10 +2674,18 @@ declare module "mongoose" { * because it only sends one operation to the server, rather than one for each * document. * This function does not trigger save middleware. + * @param docs Documents to insert. + * @param options Optional settings. + * @param options.ordered if true, will fail fast on the first error encountered. + * If false, will insert all the documents it can and report errors later. + * @param options.rawResult if false, the returned promise resolves to the documents that passed mongoose document validation. + * If `false`, will return the [raw result from the MongoDB driver](http://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#~insertWriteOpCallback) + * with a `mongoose` property that contains `validationErrors` if this is an unordered `insertMany`. */ insertMany(docs: any[], callback?: (error: any, docs: T[]) => void): Promise; + insertMany(docs: any[], options?: { ordered?: boolean, rawResult?: boolean }, callback?: (error: any, docs: T[]) => void): Promise; insertMany(doc: any, callback?: (error: any, doc: T) => void): Promise; - insertMany(...docsWithCallback: any[]): Promise; + insertMany(doc: any, options?: { ordered?: boolean, rawResult?: boolean }, callback?: (error: any, doc: T) => void): Promise; /** * Executes a mapReduce command. diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index fc43549f8e..244658ac9b 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -260,6 +260,118 @@ schema.plugin(function (schema, opts) { } }).plugin(cb, {opts: true}); +/* `.pre` hook tests */ + +interface PreHookTestDocumentInterface extends mongoose.Document {} +interface PreHookTestQueryInterface extends mongoose.Query {} +interface PreHookTestAggregateInterface extends mongoose.Aggregate {} +interface PreHookTestModelInterface extends mongoose.Model {} + +// it is used to ensure that all testing cases return a value of mongoose.Schema type +const preHookTestSchemaArr: mongoose.Schema[] = []; + +// testing order: +// serial with default value and returning void +// serial with a type argument and returning a promise +// parallel with default value and returning void +// parallel with a type argument and returning a promise + +// Document +preHookTestSchemaArr.push( + schema.pre("init", function (next) { + const isDefaultType: mongoose.Document = this; + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre("init", function (next) { + const isSpecificType: PreHookTestDocumentInterface = this; + return Promise.resolve(""); + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre("init", true, function (next, done) { + const isDefaultType: mongoose.Document = this; + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre("init", true, function (next, done) { + const isSpecificType: PreHookTestDocumentInterface = this; + return Promise.resolve(""); + }, err => {}) +); + +// Query +preHookTestSchemaArr.push( + schema.pre("count", function (next) { + const isDefaultType: mongoose.Query = this; + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre>("count", function (next) { + const isSpecificType: PreHookTestQueryInterface = this; + return Promise.resolve(""); + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre("count", true, function (next, done) { + const isDefaultType: mongoose.Query = this; + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre>("count", true, function (next, done) { + const isSpecificType: PreHookTestQueryInterface = this; + return Promise.resolve(""); + }, err => {}) +); + +// Aggregate +preHookTestSchemaArr.push( + schema.pre("aggregate", function(next) { + const isDefaultType: mongoose.Aggregate = this; + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre>("aggregate", function(next) { + const isSpecificType: PreHookTestAggregateInterface = this; + return Promise.resolve("") + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre("aggregate", true, function(next, done) { + const isDefaultType: mongoose.Aggregate = this; + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre>("aggregate", true, function(next, done) { + const isSpecificType: PreHookTestAggregateInterface = this; + return Promise.resolve("") + }, err => {}) +); + +// Model +preHookTestSchemaArr.push( + schema.pre("insertMany", function(next) { + const isDefaultType: mongoose.Model = this; + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre>("insertMany", function(next) { + const isSpecificType: PreHookTestModelInterface = this; + return Promise.resolve("") + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre("insertMany", true, function(next, done) { + const isDefaultType: mongoose.Model = this; + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre>("insertMany", true, function(next, done) { + const isSpecificType: PreHookTestModelInterface = this; + return Promise.resolve("") + }, err => {}) +); + schema .post('save', function (error, doc, next) { error.stack; diff --git a/types/named-regexp-groups/index.d.ts b/types/named-regexp-groups/index.d.ts new file mode 100644 index 0000000000..19426c352e --- /dev/null +++ b/types/named-regexp-groups/index.d.ts @@ -0,0 +1,38 @@ +// Type definitions for named-regexp-groups 1.0 +// Project: https://github.com/commenthol/named-regexp-groups/ +// Definitions by: Vilim Stubičan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +interface NamedRegExpExecArray extends RegExpExecArray { + groups: { [propName: string]: string }; +} + +declare class NamedRegExp { + constructor(pattern?: string | RegExp, flags?: string); + + /** + * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. + * @param string The String object or string literal on which to perform the search. + */ + exec(string: string): NamedRegExpExecArray | null; + + /** + * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. + * @param string String on which to perform the search. + */ + test(string: string): boolean; + + // Non-standard extensions + toString(): string; + + [Symbol.replace](str: string, replacement: string | ((match: string, ...capturedGroups: string[]) => string)): string; + + [Symbol.match](str: string): NamedRegExpExecArray; + + [Symbol.split](str: string): string[]; + + [Symbol.search](str: string): number; +} + +export = NamedRegExp; diff --git a/types/named-regexp-groups/named-regexp-groups-tests.ts b/types/named-regexp-groups/named-regexp-groups-tests.ts new file mode 100644 index 0000000000..cff4cc057e --- /dev/null +++ b/types/named-regexp-groups/named-regexp-groups-tests.ts @@ -0,0 +1,19 @@ +import NamedRegExp = require("named-regexp-groups"); + +// $ExpectType NamedRegExp +new NamedRegExp('aaa', 'gi'); + +// $ExpectType NamedRegExp +new NamedRegExp(/aaa/gi); + +// $ExpectType NamedRegExp +new NamedRegExp(); + +// $ExpectError +new NamedRegExp(1); + +// $ExpectError +new NamedRegExp({}); + +// $ExpectError +new NamedRegExp([]); diff --git a/types/named-regexp-groups/tsconfig.json b/types/named-regexp-groups/tsconfig.json new file mode 100644 index 0000000000..9ce09a5d74 --- /dev/null +++ b/types/named-regexp-groups/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", + "named-regexp-groups-tests.ts" + ] +} diff --git a/types/named-regexp-groups/tslint.json b/types/named-regexp-groups/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/named-regexp-groups/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/navermaps/index.d.ts b/types/navermaps/index.d.ts new file mode 100644 index 0000000000..aa36578e63 --- /dev/null +++ b/types/navermaps/index.d.ts @@ -0,0 +1,1411 @@ +// Type definitions for Naver Maps JavaScript API 3.0 +// Project: https://navermaps.github.io/maps.js +// Definitions by: Ckboyjiy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare namespace naver.maps { + /** + * Types + */ + type PointArrayLiteral = [number, number]; + type PointLiteral = PointArrayLiteral | PointObjectLiteral; + type SizeArrayLiteral = [number, number]; + type SizeLiteral = SizeArrayLiteral | SizeObjectLiteral; + type LatLngLiteral = PointLiteral | LatLngObjectLiteral; + type PointBoundsArrayLiteral = [number, number, number, number]; + type PointBoundsLiteral = PointBoundsArrayLiteral | PointBoundsObjectLiteral; + type LatLngBoundsLiteral = PointBoundsLiteral | LatLngBoundsObjectLiteral; + type BoundsLiteral = PointBoundsLiteral | LatLngBoundsLiteral; + type CoordLiteral = PointLiteral | LatLngLiteral; + type Coord = Point | LatLng; + type Bounds = PointBounds | LatLngBounds; + type DOMEvent = Event; + type StylingFunction = (feature: Feature) => StyleOptions; + type ArrayOfCoords = Point[] | LatLng[]; + type ArrayOfBounds = PointBounds[] | LatLngBounds[]; + type ArrayOfBoundsLiteral = PointBoundsLiteral[] | LatLngBoundsLiteral[]; + type forEachOverlayCallback = (overlay: Marker | Polyline | Polygon, index: number) => void; + type GeoJSON = any; + type GPX = any; + type KML = any; + type KVOArrayOfCoords = any; + type ArrayOfCoordsLiteral = PointLiteral[] | LatLngLiteral[]; + type strokeStyleType = 'solid' | 'shortdash' | 'shortdot' | 'shortdashdot' | 'shortdashdotdot' | 'dot' | 'dash' | + 'longdash' | 'dashdot' | 'longdashdot' | 'longdashdotdot'; + type strokeLineCapType = 'butt' | 'round' | 'square'; + type strokeLineJoinType = 'miter' | 'round ' | 'bevel'; + + /** + * Interfaces + */ + interface MapEventListener { + eventName: string; + listener: () => any; + listenerId: string; + target: any; + } + interface PointObjectLiteral { + x: number; + y: number; + } + interface SizeObjectLiteral { + width: number; + height: number; + } + interface LatLngObjectLiteral { + lat: number; + lng: number; + } + interface PointBoundsObjectLiteral { + minX: number; + minY: number; + maxX: number; + maxY: number; + } + interface LatLngBoundsObjectLiteral { + north: number; + east: number; + south: number; + west: number; + } + interface MapSystemProjection extends KVO { + factor(zoom: number): number; + fromCoordToOffset(coord: Coord): Point; + fromCoordToPoint(coord: Coord): Point; + fromOffsetToCoord(offset: Point): Coord; + fromOffsetToPoint(offset: Point): Point; + fromPointToCoord(point: Point): Coord; + fromPointToOffset(point: Point): Point; + getDestinationCoord(fromCoord: Coord, angle: number, meter: number): Coord; + getDistance(coord1: Coord, coord2: Coord): number; + getProjectionName(): number; + scaleDown(operand: number | Point | Size, zoom: number): number | Point | Size; + scaleUp(operand: number | Point | Size, zoom: number): number | Point | Size; + } + interface MapOptions { + background?: string; + baseTileOpacity?: number; + bounds?: any; + center?: any; + disableDoubleClickZoom?: boolean; + disableDoubleTapZoom?: boolean; + disableKineticPan?: boolean; + disableTwoFingerTapZoom?: boolean; + draggable?: boolean; + keyboardShortcuts?: boolean; + logoControl?: boolean; + logoControlOptions?: any; + mapDataControl?: boolean; + mapDataControlOptions?: any; + mapTypeControl?: boolean; + mapTypeControlOptions?: any; + mapTypeId?: string; + mapTypes?: any; + maxBounds?: any; + maxZoom?: number; + minZoom?: number; + padding?: any; + pinchZoom?: boolean; + resizeOrigin?: any; + scaleControl?: boolean; + scaleControlOptions?: any; + scrollWheel?: boolean; + size?: any; + overlayZoomEffect?: null | string; + tileSpare?: number; + tileTransition?: boolean; + zoom?: number; + zoomControl?: boolean; + zoomControlOptions?: any; + zoomOrigin?: any; + } + interface MarkerOptions { + animation?: any; + map?: Map; + position?: any; + icon?: any; + shape?: any; + title?: string; + cursor?: string; + clickable?: boolean; + draggable?: boolean; + visible?: boolean; + zIndex?: number; + } + interface MapPanes { + overlayLayer: HTMLElement; + overlayImage: HTMLElement; + floatPane: HTMLElement; + } + interface InfoWindowOptions { + position?: Coord | CoordLiteral; + content: string | HTMLElement; + zIndex?: number; + maxWidth?: number; + pixelOffset?: Point | PointLiteral; + backgroundColor?: string; + borderColor?: string; + borderWidth?: number; + disableAutoPan?: boolean; + disableAnchor?: boolean; + anchorSkew?: boolean; + anchorSize?: Size | SizeLiteral; + anchorColor?: string; + } + interface ImageTileOptions { + urls: string[]; + imgonload?: () => any; + imgonerror?: () => any; + opacity?: number; + transition?: boolean; + offset?: Point; + zIndex?: number; + size?: Size; + pane?: HTMLElement; + } + interface ImageMapTypeOptions { + name: string; + maxZoom: number; + minZoom: number; + projection: Projection; + tileSize?: Size | SizeLiteral; + repeatX?: boolean; + vendor?: string; + provider?: MapDataProvider[]; + uid?: string; + darktheme?: boolean; + getTileUrl?: () => any; + tileSet?: string | string[]; + } + interface GroundOverlayOptions { + clickable?: boolean; + map?: Map | null; + opacity?: number; + } + interface EllipseOptions { + map?: Map; + bounds: Bounds | BoundsLiteral; + strokeWeight?: number; + strokeOpacity?: number; + strokeColor?: string; + strokeStyle?: strokeStyleType; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; + fillColor?: string; + fillOpacity?: number; + clickable?: boolean; + visible?: boolean; + zIndex?: number; + } + interface FeatureEvent { + feature: Feature; + } + interface PointerEvent { + coord: Coord; + point: Point; + offset: Point; + pointerEvent: DOMEvent; + feature: Feature; + } + interface PropertyEvent { + feature: Feature; + name: string; + oldValue: any; + newValue: any; + } + interface StyleOptions { + strokeColor?: string; + strokeOpacity?: number; + strokeWeight?: number; + fillColor?: string; + fillOpacity?: number; + clickable?: boolean; + icon?: string | ImageIcon | SymbolIcon | HtmlIcon; + shape?: MarkerShape; + title?: string; + visible?: boolean; + zIndex?: number; + } + interface ControlOptions { + position: Position; + } + interface CircleOptions { + map?: Map; + center: Coord | CoordLiteral; + radius?: number; + strokeWeight?: number; + strokeOpacity?: number; + strokeColor?: string; + strokeStyle?: strokeStyleType; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; + fillColor?: string; + fillOpacity?: number; + clickable?: boolean; + visible?: boolean; + zIndex?: number; + } + interface TileOptions { + opacity?: number; + transition?: boolean; + offset?: Point; + zIndex?: number; + size?: Size; + pane?: HTMLElement; + } + interface TileIndex { + xIndex: number; + yIndex: number; + } + interface CanvasTileOptions { + imageData?: ImageData; + opacity?: number; + transition?: boolean; + offset?: Point; + zIndex?: number; + size?: Size; + pane?: HTMLElement; + } + interface CanvasMapTypeOptions { + name: string; + maxZoom: number; + minZoom: number; + projection: Projection; + tileSize?: Size | SizeLiteral; + repeatX?: boolean; + vendor?: string; + provider?: MapDataProvider[]; + uid?: string; + darktheme?: boolean; + getTileData?: () => any; + } + interface MapDataProvider { + title: string; + link?: string; + bounds?: Bounds | BoundsLiteral | ArrayOfBounds | ArrayOfBoundsLiteral; + } + interface MapType { + maxZoom: number; + minZoom: number; + name: string; + projection: Projection; + tileSize: Size; + getTile(x: number, y: number, z: number): HTMLElement | Tile; + } + interface Projection { + fromCoordToPoint(coord: Coord): Point; + fromPointToCoord(point: Point): Coord; + } + interface CadastralLayerOptions { + overlayMap: boolean | undefined; + zIndex: number | undefined; + } + interface AroundControlOptions { + position: Position; + } + interface NaverImageMapTypeOptions { + maxZoom?: number; + minZoom?: number; + projection?: Projection; + tileSize?: Size; + hd?: string; + } + interface LogoControlOptions { + position: Position; + } + interface MapDataControlOptions { + position: Position; + } + interface MapTypeControlOptions { + mapTypeIds: MapTypeId[] | null; + position: Position; + style: MapTypeControlStyle; + } + interface ScaleControlOptions { + position: Position; + } + interface ZoomControlOptions { + position: Position; + style: ZoomControlStyle; + legendDisabled: boolean; + } + interface LayerOptions { + hd: boolean; + overlayMap: boolean | undefined; + zIndex: number | undefined; + } + interface CadastralLayerOptions { + overlayMap: boolean | undefined; + zIndex: number | undefined; + } + interface StreetLayerOptions { + overlayMap: boolean | undefined; + zIndex: number | undefined; + } + interface TrafficLayerOptions { + interval: number; + overlayMap: boolean | undefined; + zIndex: number | undefined; + } + interface HtmlIcon { + content: string | HTMLElement; + size?: Size | SizeLiteral; + anchor?: Point | PointLiteral | Position; + } + interface ImageIcon { + url: string; + size?: Size | SizeLiteral; + scaledSize?: Size | SizeLiteral; + origin?: Point | PointLiteral; + anchor?: Point | PointLiteral | Position; + } + interface MarkerShape { + coords: any[]; + type: string; + } + interface SymbolIcon { + path: SymbolPath | Point[] | PointLiteral[]; + style?: SymbolStyle; + radius?: number; + fillColor?: string; + fillOpacity?: number; + strokeColor?: string; + strokeWeight?: number; + strokeOpacity?: number; + anchor?: Point | PointLiteral | Position; + } + interface PolygonOptions { + map?: Map; + paths: ArrayOfCoords[] | KVOArrayOfCoords[] | ArrayOfCoordsLiteral[]; + strokeWeight?: number; + strokeOpacity?: number; + strokeColor?: string; + strokeStyle?: strokeStyleType; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; + fillColor?: string; + fillOpacity?: number; + clickable?: boolean; + visible?: boolean; + zIndex?: number; + } + interface PolylineOptions { + map?: Map; + path: ArrayOfCoords | KVOArrayOfCoords | ArrayOfCoordsLiteral; + strokeWeight?: number; + strokeOpacity?: number; + strokeColor?: string; + strokeStyle?: strokeStyleType; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; + clickable?: boolean; + visible?: boolean; + zIndex?: number; + startIcon?: PointingIcon; + startIconSize?: number; + endIcon?: PointingIcon; + endIconSize?: number; + } + interface RectangleOptions { + map?: Map; + bounds: Bounds | BoundsLiteral; + strokeWeight?: number; + strokeOpacity?: number; + strokeColor?: string; + strokeStyle?: strokeStyleType; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; + fillColor?: string; + fillOpacity?: number; + clickable?: boolean; + visible?: boolean; + zIndex?: number; + } + interface PanoramaOptions { + size: Size | SizeLiteral; + panoId: string; + position: LatLng | LatLngLiteral; + pov: PanoramaPov; + visible: boolean; + minScale: number; + maxScale: number; + minZoom: number; + maxZoom: number; + logoControl: boolean; + logoControlOptions: LogoControlOptions; + zoomControl: boolean; + zoomControlOptions: ZoomControlOptions; + aroundControl: boolean; + aroundControlOptions: AroundControlOptions; + } + interface PanoramaPov { + pan: number; + tilt: number; + fov: number; + } + interface PanoramaLocation { + panoId: string; + title: string; + address: string; + coord: LatLng; + photodate: string; + } + interface DOMEventListener { + eventName: string; + listener: () => any; + target: HTMLElement; + } + interface Margin { + top?: number; + right?: number; + bottom?: number; + left?: number; + } + + interface TransitionOptions { + duration?: number; + easing?: string; + } + + /** + * Enums + */ + enum MapTypeControlStyle { + BUTTON, + DROPDOWN + } + enum ZoomControlStyle { + LARGE, + SMALL + } + + /** + * Members + */ + enum Animation { + BOUNCE = 1, + DROP + } + let jsContentLoaded: boolean; + type MapTypeId = string; + namespace MapTypeId { // TODO. 확실하지 않음 + let NORMAL: string; + let TERRAIN: string; + let SATELLITE: string; + let HYBRID: string; + } + function onJSContentLoaded(...args: any[]): any; + enum PointingIcon { + OPEN_ARROW = 1, + BLOCK_ARROW, + CIRCLE, + DIAMOND + } + enum Position { + CENTER = 0, + TOP_LEFT, + TOP_CENTER, + TOP_RIGHT, + LEFT_CENTER, + LEFT_TOP, + LEFT_BOTTOM, + RIGHT_TOP, + RIGHT_CENTER, + RIGHT_BOTTOM, + BOTTOM_LEFT, + BOTTOM_CENTER, + BOTTOM_RIGHT + } + enum SymbolPath { + BACKWARD_CLOSED_ARROW = 1, + BACKWARD_OPEN_ARROW, + CIRCLE, + FORWARD_CLOSED_ARROW, + FORWARD_OPEN_ARROW + } + type SymbolStyle = string; + namespace SymbolStyle { + let CIRCLE: string; + let PATH: string; + let CLOSED_PATH: string; + } + + /** + * Classes + */ + // KVO + class KVO { + constructor(); + addListener(eventName: any, listener: () => any): MapEventListener; + addListenerOnce(eventName: any, listener: () => any): MapEventListener; + bindTo(key: string, target: KVO, targetKey?: string): void; + clearListeners(eventName: string): void; + get(key: string): any; + hasListener(eventName: string): boolean; + removeListener(listeners: MapEventListener | MapEventListener[]): void; + set(key: string, value: any, silently?: boolean): void; + setValues(properties: any): void; + trigger(eventName: string, eventObject?: any): void; + unbind(key: string): void; + unbindAll(): void; + } + class KVOArray extends KVO { + constructor(array: any[]); + clear(): void; + forEach(callback: (element: any, index: number) => void): void; + getArray(): any[]; + getAt(index: number): any; + getIndexOfElement(element: any): number; + getLength(): number; + insertAt(index: number, element: any): void; + pop(): any; + push(element: any): number; + removeAt(index: number): any; + removeElement(element: any): void; + setAt(index: number, element: any): void; + splice(startIndex: number, deleteCount: number, element?: any): any[]; + } + // Base + class Point { + constructor(x: number, y: number); + add(point: Coord | PointLiteral): Point; + add(x: number, y: number): Point; + ceil(): Point; + clone(): Point; + div(point: Coord | PointLiteral): void; + div(x: number, y: number): Point; + equals(point: Point): boolean; + floor(): Point; + mul(point: Coord | PointLiteral): Point; + mul(x: number, y: number): Point; + round(): Point; + sub(point: Coord | PointLiteral): Point; + sub(x: number, y: number): Point; + toString(): string; + } + class Size { + width: number; + height: number; + constructor(width: number, height: number); + add(size: Size | SizeLiteral): Size; + add(width: number, height: number): Size; + ceil(): Size; + clone(): Size; + div(width: number, height: number): Size; + div(size: Size | SizeLiteral): Size; + equals(size: Size | SizeLiteral): boolean; + floor(): Size; + mul(size: Size | SizeLiteral): Size; + mul(width: number, height: number): Size; + round(): Size; + sub(size: Size | SizeLiteral): Size; + sub(width: number, height: number): Size; + toString(): string; + } + class PointBounds { + constructor(minPoint: Point, maxPoint: Point); + static bounds(point: Coord | PointLiteral, + pointN: Coord | PointLiteral): PointBounds; + clone(): PointBounds; + equals(bounds: Bounds | PointBoundsLiteral): boolean; + extend(point: Coord | PointLiteral): PointBounds; + getCenter(): Point; + getMax(): Point; + getMin(): Point; + hasBounds(bounds: Bounds | PointBoundsLiteral): boolean; + hasPoint(point: Coord | PointLiteral): boolean; + intersects(bounds: Bounds | PointBoundsLiteral): boolean; + maxX(): number; + maxY(): number; + minX(): number; + minY(): number; + toString(): string; + union(bounds: Bounds | PointBoundsLiteral): PointBounds; + } + class LatLng extends Point { + constructor(lat: number, lng: number); + clone(): LatLng; + destinationPoint(angle: number, meter: number): LatLng; + equals(point: Coord | LatLngLiteral): boolean; + lat(): number; + lng(): number; + toPoint(): Point; + toString(): string; + } + class LatLngBounds extends PointBounds { + constructor(sw: LatLng, ne: LatLng); + static bounds(latlng: Coord | LatLngLiteral, + latlngN: Coord | LatLngLiteral): LatLngBounds; + clone(): LatLngBounds; + east(): number; + equals(bounds: Bounds | LatLngBoundsLiteral): boolean; + extend(latlng: Coord | LatLngLiteral): LatLngBounds; + getCenter(): LatLng; + getNE(): LatLng; + getSW(): LatLng; + hasLatLng(latlng: Coord | LatLngLiteral): boolean; + intersects(bounds: Bounds | LatLngBoundsLiteral): boolean; + north(): number; + south(): number; + toPointBounds(): PointBounds; + union(bounds: Bounds | LatLngBoundsLiteral): LatLngBounds; + west(): number; + } + // Map + class Map extends KVO { + controls: any; + data: any; + layers: any; + mapTypes: any; + mapSystemProjection: any; + constructor(mapDiv: string, mapOptions?: MapOptions); + addPane(name: string, elementOrIndex: HTMLElement | number): void; + destory(): void; + fitBounds(bounds: any, margin?: any): void; + getBounds(): Bounds; + getCenter(): Coord; + getCenterPoint(): Coord; + getElement(): HTMLElement; + getMapTypeId(): string; + getOptions(key?: string): any; + getPanes(): MapPanes; + getPrimitiveProjection(): Projection; + getProjection(): MapSystemProjection; + getSize(): Size; + getZoom(): number; + morph(coord: Coord | CoordLiteral, zoom?: number, transitionOptions?: TransitionOptions): void; + panBy(offset: Point | PointLiteral): void; + panTo(coord: Coord | CoordLiteral, transitionOptions: TransitionOptions): void; + panToBounds(bounds: Bounds | BoundsLiteral, transitionOptions: TransitionOptions, margin?: Margin): void; + refresh(noEffect?: boolean): void; + removePane(name: string): void; + setCenter(center: Coord | CoordLiteral): void; + setCenterPoint(point: Point | PointLiteral): void; + setMapTypeId(mapTypeId: string): void; + setOptions(newOptionsOrKey: any, value?: any): void; + setSize(size: Size | SizeLiteral): void; + setZoom(zoom: number, effect?: boolean): void; + updateBy(coord: Coord | CoordLiteral, zoom: number): void; + zoomBy(deltaZoom: number, zoomOrigin?: Coord | CoordLiteral, effect?: boolean): void; + } + // Map.Tile + class Tile extends KVO { + constructor(element: HTMLElement, tileOptions?: TileOptions); + appendTo(parentNode: HTMLElement): void; + cancelFadeIn(): void; + destroy(): void; + fadeIn(callback: () => any, startOpacity?: number): void; + getElement(): HTMLElement; + getOffset(): Point; + getOpacity(): number; + getSize(): Size; + getTileIndex(): TileIndex; + getZIndex(): number; + hide(): void; + load(tileOptions?: TileOptions): void; + remove(): void; + reset(mapType: MapType, zoom: number, tileOptions?: TileOptions): void; + setBlank(): void; + setOffset(offset: Point): void; + setOffset(x: number, y: number): void; + setOpacity(opacity: number): void; + setSize(size: Size): void; + setTileIndex(tileIndex: TileIndex): void; + setZIndex(zIndex: number): void; + show(): void; + } + class CanvasTile extends Tile { + constructor(canvasTileOptions: CanvasTileOptions); + } + class ImageTile extends Tile { + constructor(imageTileOptions: ImageTileOptions); + getImageElements(): HTMLElement[]; + getUrls(): string[]; + setUrls(urls: string[]): void; + } + // Map.MapType + class CanvasMapType implements MapType { + maxZoom: number; + minZoom: number; + name: string; + projection: Projection; + tileSize: Size; + constructor(canvasMapTypeOptions: CanvasMapTypeOptions); + getMapTypeOptions(): CanvasMapTypeOptions; + getMaxZoom(): number; + getMinZoom(): number; + getName(): string; + getTile(x: number, y: number, z: number): CanvasTile; + getTileData(x: number, y: number, z: number): ImageData; + setMapTypeOptions(canvasMapTypeOptions: CanvasMapTypeOptions): void; + } + class ImageMapType implements MapType { + maxZoom: number; + minZoom: number; + name: string; + projection: Projection; + tileSize: Size; + constructor(imageMapTypeOptions: ImageMapTypeOptions); + getMapTypeOptions(): ImageMapTypeOptions; + getMaxZoom(): number; + getMinZoom(): number; + getName(): string; + getTile(x: number, y: number, z: number): ImageTile; + getTileUrls(x: number, y: number, z: number): string[]; + setMapTypeOptions(imageMapTypeOptions: ImageMapTypeOptions): void; + } + class MapTypeRegistry extends KVO { + constructor(mapTypeInfo?: any, defaultMapTypeId?: string); + getPreviousTypeId(): string; + getSelectedType(): MapType; + getSelectedTypeId(): string; + getTypeIds(): string[]; + set(mapTypeId: string, mapType: MapType): void; + setSelectedTypeId(mapTypeId: string): void; + } + + // Map.MapType.Preset + function NaverMapTypeOption(options: NaverImageMapTypeOptions): void; + namespace NaverMapTypeOption { + function getBicycleLayer(opts: NaverImageMapTypeOptions): ImageMapType; + function getBlankMap(opts: NaverImageMapTypeOptions): ImageMapType; + function getCadastralLayer(opts?: NaverImageMapTypeOptions): ImageMapType; + function getHybridMap(opts?: NaverImageMapTypeOptions): ImageMapType; + function getMapTypes(opts?: NaverImageMapTypeOptions): MapTypeRegistry; + function getNormalLabelLayer(opts?: NaverImageMapTypeOptions): ImageMapType; + function getNormalMap(opts?: NaverImageMapTypeOptions): ImageMapType; + function getSatelliteLabelLayer(opts?: NaverImageMapTypeOptions): ImageMapType; + function getSatelliteMap(opts?: NaverImageMapTypeOptions): ImageMapType; + function getStreetLayer(opts?: NaverImageMapTypeOptions): ImageMapType; + function getTerrainMap(opts?: NaverImageMapTypeOptions): ImageMapType; + function getTrafficLayer(opts?: NaverImageMapTypeOptions): ImageMapType; + function getVectorMap(opts?: NaverImageMapTypeOptions): ImageMapType; + function getWorldMap(opts?: NaverImageMapTypeOptions): ImageMapType; + } + + // Control + class CustomControl extends KVO { + constructor(html: string, ControlOptions: ControlOptions); + getElement(): HTMLElement; + getMap(): Map | null; + getOptions(key?: string): any; + html(html?: string): string | undefined; + setMap(map?: Map | null): void; + setOptions(newOptions: ControlOptions): void; + setPosition(position: Position): void; + } + // Naver Controls + class LogoControl extends CustomControl { + constructor(LogoControlOptions: LogoControlOptions); + } + class MapDataControl extends CustomControl { + constructor(MapDataControlOptions: MapDataControlOptions); + } + class MapTypeControl extends CustomControl { + constructor(MapTypeControlOptions: MapTypeControlOptions); + } + class ScaleControl extends CustomControl { + constructor(ScaleControlOptions: ScaleControlOptions); + } + class ZoomControl extends CustomControl { + constructor(ZoomControlOptions: ZoomControlOptions); + } + // Layer + class Layer extends KVO { + constructor(name: string, MapTypeRegistry: MapTypeRegistry, options: LayerOptions); + getLayerType(): MapType; + getLayerTypeId(): string; + getMap(): Map | null; + getOpacity(): number; + getPaneElement(): HTMLElement; + refresh(noEffect?: boolean): void; + setLayerTypeId(typeId: string): void; + setMap(map: Map | null): void; + setOpacity(opacity: number): void; + } + // Naver Layers + class LabelLayer extends Layer { + constructor(name: string, registry: ImageMapType, option: any); + } + class CadastralLayer extends LabelLayer { + name: string; + constructor(option?: CadastralLayerOptions); + } + class StreetLayer extends LabelLayer { + name: string; + constructor(option?: StreetLayerOptions); + } + class TrafficLayer extends LabelLayer { + name: string; + constructor(option?: TrafficLayerOptions); + endAutoRefresh(): void; + startAutoRefresh(): void; + } + // Data Layer + class Data extends KVO { + constructor(); + addFeature(feature: Feature, autoStyle: boolean): void; + addGeoJson(geojson: GeoJSON, autoStyle: boolean): void; + addGpx(xmlDoc: GPX, autoStyle: boolean): void; + addKml(xmlDoc: KML, autoStyle: boolean): void; + forEach(callback: (feature: Feature, index: number) => void): void; + getAllFeature(): Feature[]; + getFeatureById(id: string | number): Feature; + getMap(): Map | null; + getStyle(): StyleOptions | StylingFunction; + overrideStyle(feature: Feature, style: StyleOptions): void; + removeFeature(feature: Feature): void; + removeGeoJson(geojson: GeoJSON): void; + revertStyle(feature: Feature): void; + setMap(map: Map | null): void; + setStyle(style: StyleOptions | StylingFunction): void; + toGeoJson(): GeoJSON; + } + class Feature extends KVO { + constructor(rawFeature: any); + forEachOverlay(callback: forEachOverlayCallback): void; + getBounds(): Bounds; + getGeometries(): Geometry[]; + getId(): string; + getOverlays(): Marker[] | Polyline[] | Polygon[]; + getProperty(name: string): any; + getRaw(): GeoJSON; + setProperty(name: string, value: any): void; + setStyle(styleOptions: StyleOptions): void; // Data.StyleOptions + } + class Geometry extends KVO { + constructor(rawGeometry: any); + getCoords(): ArrayOfCoords; + getType(): string; + } + // Overlay + class OverlayView extends KVO { + draw(): void; + getContainerTopLeft(): Point; + getMap(): Map | null; + getPanes(): MapPanes; + getProjection(): MapSystemProjection; + onAdd(): any; + onRemove(): any; + setMap(map: Map | null): void; + } + // Naver Overlays + class Circle extends OverlayView { + constructor(options?: CircleOptions); + getAreaSize(): number; + getBounds(): Bounds; + getCenter(): Coord; + getClickable(): boolean; + getDrawingRect(): Bounds; + getOptions(key?: string): CircleOptions; + getRadius(): number; + getStyles(key: string): CircleOptions; + getVisible(): boolean; + getZIndex(): number; + setCenter(center: Coord | CoordLiteral): void; + setClickable(clickable: boolean): void; + setOptions(key: string, value: any): void; + setOptions(options: CircleOptions): void; + setRadius(radius: number): void; + setStyles(key: string, value: string): void; + setStyles(options: CircleOptions): void; + setVisible(visible: boolean): void; + setZIndex(zIndex: number): void; + } + class Ellipse extends OverlayView { + constructor(options?: EllipseOptions); + getAreaSize(): number; + getBounds(): Bounds; + getClickable(): boolean; + getDrawingRect(): Bounds; + getOptions(key?: string): EllipseOptions; + getStyles(key?: string): EllipseOptions; + getVisible(): boolean; + getZIndex(): number; + setBounds(bounds: Bounds | BoundsLiteral): void; + setOptions(options: EllipseOptions): void; + setOptions(key: string, value: any): void; + setStyles(options: EllipseOptions): void; + setStyles(key: string, value: any): void; + setVisible(visible: boolean): void; + setZIndex(zIndex: number): void; + } + class GroundOverlay extends OverlayView { + constructor(url: string, bounds: Bounds | BoundsLiteral, options?: GroundOverlayOptions); + getBounds(): Bounds; + getOpacity(): number; + getUrl(): string; + setOpacity(opacity: number): void; + } + class InfoWindow extends OverlayView { + constructor(options: InfoWindowOptions); + close(): void; + getContent(): HTMLElement; + getOptions(key?: string): InfoWindowOptions; + getPosition(): Coord; + getZIndex(): number; + open(map: Map, anchor: Coord | CoordLiteral | Marker): void; + setContent(content: string | HTMLElement): void; + setOptions(options: InfoWindowOptions): void; + setPosition(position: Coord | CoordLiteral): void; + setZIndex(zIndex: number): void; + } + class Marker extends OverlayView { + constructor(options: MarkerOptions); + draw(): void; + getAnimation(): Animation; + getClickable(): boolean; + getCursor(): string; + getDraggable(): boolean; + getDrawingRect(): Bounds; + getIcon(): ImageIcon | SymbolIcon | HtmlIcon; + getOptions(key?: string): MarkerOptions; + getPosition(): Coord; + getShape(): MarkerShape; + getTitle(): string; + getVisible(): boolean; + getZIndex(): number; + onAdd(): void; + onRemove(): void; + setAnimation(animation: Animation): void; + setClickable(clickable: boolean): void; + setCursor(cursor: string): void; + setDraggable(draggable: boolean): void; + setIcon(icon: string | ImageIcon | SymbolIcon | HtmlIcon): void; + setOptions(options: MarkerOptions): void; + setPosition(position: Coord | CoordLiteral): void; + setShape(shape: MarkerShape): void; + setTitle(title: string): void; + setVisible(visible: boolean): void; + setZIndex(zIndex: number): void; + } + class Polygon extends OverlayView { + constructor(options?: PolygonOptions); + getAreaSize(): number; + getBounds(): Bounds; + getClickable(): boolean; + getDrawingRect(): Bounds; + getOptions(key?: string): PolygonOptions; + getPath(): ArrayOfCoords | KVOArrayOfCoords; + getPaths(): ArrayOfCoords[] | KVOArrayOfCoords[]; + getStyles(key?: string): PolygonOptions; + getVisible(): boolean; + getZIndex(): number; + setClickable(clickable: boolean): void; + setOptions(key: string, value: any): void; + setOptions(options: PolygonOptions): void; + setPath(path: ArrayOfCoords | KVOArrayOfCoords | ArrayOfCoordsLiteral): void; + setPaths(paths: ArrayOfCoords[] | ArrayOfCoordsLiteral): void; // TODO. KVOArray. + setStyles(key: string, value: any): void; + setStyles(options: PolygonOptions): void; + setVisible(visible: boolean): void; + setZIndex(zIndex: number): void; + } + class Polyline extends OverlayView { + constructor(options?: PolylineOptions); + getBounds(): Bounds; + getClickable(): boolean; + getDistance(): number; + getDrawingRect(): Bounds; + getOptions(key?: string): PolylineOptions; + getPath(): ArrayOfCoords | KVOArrayOfCoords; + getStyles(key?: string): PolylineOptions; + getVisible(): boolean; + getZIndex(): number; + setClickable(clickable: boolean): void; + setOptions(key: string, value: any): void; + setOptions(options: PolylineOptions): void; + setPath(path: ArrayOfCoords | KVOArrayOfCoords | ArrayOfCoordsLiteral): void; + setStyles(key: string, value: any): void; + setStyles(options: PolylineOptions): void; + setVisible(visible: boolean): void; + setZIndex(zIndex: number): void; + } + class Rectangle extends OverlayView { + constructor(options?: RectangleOptions); + getAreaSize(): number; + getBounds(): Bounds; + getClickable(): boolean; + getDrawingRect(): Bounds; + getOptions(key?: string): RectangleOptions; + getStyles(key?: string): RectangleOptions; + getVisible(): boolean; + getZIndex(): number; + setBounds(bounds: Bounds | BoundsLiteral): void; + setClickable(clickable: boolean): void; + setOptions(options: RectangleOptions): void; + setOptions(key: string, value: any): void; + setStyles(key: string, value: any): void; + setStyles(options: RectangleOptions): void; + setVisible(visible: boolean): void; + setZIndex(zIndex: number): void; + } + + // Sub module: panorama + class PanoramaProjection extends KVO { + fromCoordToPov(coord: LatLng): PanoramaPov; + } + class Panorama extends KVO { + constructor(panoramaDiv: string | HTMLElement, panoramaOptions: PanoramaOptions); + getLocation(): PanoramaLocation; + getMaxScale(): number; + getMaxZoom(): number; + getMinScale(): number; + getMinZoom(): number; + getPanoId(): string; + getPosition(): LatLng; + getPov(): PanoramaPov; + getProjection(): PanoramaProjection; + getScale(): number; + getSize(): Size; + getVisible(): boolean; + getZoom(): number; + setOptions(key: string, value: any): void; + setOptions(newOptions: PanoramaOptions): void; + setPanoId(panoId: string): void; + setPanoIdWithPov(panoId: string, pov: PanoramaPov): void; + setPosition(position: LatLng | LatLngLiteral): void; + setPov(pov: PanoramaPov): void; + setScale(scale: number): void; + setSize(size: Size | SizeLiteral): void; + setVisible(visible: boolean): void; + setZoom(zoom: number): void; + zoomIn(): void; + zoomOut(): void; + } + class FlightSpot extends KVO { + constructor(); + getMap(): Map | null; + setMap(map: Map | null): void; + } + class AroundControl extends CustomControl { + constructor(aroundControlOptions: AroundControlOptions); + } + + // Sub module: drawing + function drawing(): void; + namespace drawing { + interface DrawingOptions { + map?: Map; + drawingControl?: DrawingMode[]; + drawingControlOptions?: drawingControlOptions; + drawingMode?: DrawingMode; + controlPointOptions?: controlPointOptions; + rectangleOptions?: RectangleOptions; + ellipseOptions?: EllipseOptions; + polylineOptions?: PolylineOptions; + arrowlineOptions?: PolylineOptions; + polygonOptions?: PolygonOptions; + markerOptions?: MarkerOptions; + } + type drawingControlOptions = DrawingControlOptions; + interface DrawingControlOptions { + position?: Position; + style?: DrawingStyle; + } + type controlPointOptions = ControlPointOptions; + interface ControlPointOptions { + anchorPointOptions: CircleOptions; + midPointOptions: CircleOptions; + } + interface DrawingOverlay { + id: string; + name: string; + setEditable: (editable: boolean, controlPointOptions?: controlPointOptions) => void; + } + enum DrawingStyle { + HORIZONTAL = 0, + VERTICAL, + HORIZONTAL_2, + VERTICAL_2 + } + enum DrawingMode { + HAND = 0, + RECTANGLE, + ELLIPSE, + POLYLINE, + ARROWLINE, + POLYGON, + MARKER + } + enum DrawingEvent { + ADD, + REMOVE, + SELECT, + Added, + Removed, + Selected + } + class DrawingManager extends KVO { + constructor(options?: DrawingOptions); + addDrawing(overlay: DrawingOverlay, drawingMode: DrawingMode, id?: string): void; + addListener(eventName: DrawingEvent, + listener: (overlay: DrawingOverlay) => void): MapEventListener; + destroy(): void; + getDrawing(id: string): DrawingOverlay; + getDrawings(): any; + getMap(): Map | null; + setMap(map: Map | null): void; + toGeoJson(): any; + } + } + + // Sub module: visualization + function visualization(): void; + namespace visualization { + interface DotMapOptions { + map: Map; + data: LatLng[] | PointArrayLiteral[] | WeightedLocation[]; + opacity?: number; + radius?: number; + strokeWeight?: number; + strokeColor?: string; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; + fillColor?: string; + } + interface HeatMapOptions { + map: Map; + data: LatLng[] | PointArrayLiteral[] | WeightedLocation[]; + opacity?: number; + radius?: number; + colorMap?: SpectrumStyle; + } + enum SpectrumStyle { + JET, + HSV, + HOT, + COOL, + GREYS, + YIGnBu, + YIOrRd, + RdBu, + RAINBOW, + PORTLAND, + OXYGEN + } + class DotMap extends KVO { + constructor(dotMapOptions?: DotMapOptions); + addDrawing(overlay: drawing.DrawingOverlay, drawingMode: drawing.DrawingMode, id?: string): void; + addListener(eventName: drawing.DrawingEvent, + listener: (overlay: drawing.DrawingOverlay) => void): MapEventListener; + destroy(): void; + getDrawing(id: string): drawing.DrawingOverlay; + getDrawings(): any; + getMap(): Map | null; + setMap(map: Map | null): void; + toGeoJson(): any; + } + class HeatMap { + constructor(heatMapOptions?: HeatMapOptions); + getColorMap(): SpectrumStyle; + getData(): LatLng[] | PointArrayLiteral[]; + getMap(): Map | null; + getOptions(key?: string): HeatMapOptions; + redraw(): void; + setColorMap(colormap: SpectrumStyle, inReverse: boolean): void; + setData(data: LatLng[] | PointArrayLiteral[]): void; + setMap(map: Map | null): void; + setOptions(key: string, value: any): void; + setOptions(options: HeatMapOptions): void; + } + class WeightedLocation { + constructor(lat: number, lng: number, weight?: number); + clone(): WeightedLocation; + getLocation(): LatLng; + getWeight(): number; + lat(): number; + lng(): number; + toString(): string; + } + } + + // Sub module: geocoder + function Service(): void; + namespace Service { + interface ServiceOptions { + encoding?: any; + coordType?: any; + } + interface GeocodeServiceOptions extends ServiceOptions { + address?: string; + } + interface ReverseServiceOptions extends ServiceOptions { + location?: Coord | CoordLiteral; + } + interface AddressItem { + address: string; + addrdetail: { + country: string; + sido: string; + sigugun: string; + dongmyun: string; + rest: string; + }; + } + interface GeocodeResponse { + result: { + userquery: any; + total: number; + items: AddressItem[]; + }; + } + interface ReverseGeocodeResponse { + result: { + userquery: string; + total: number; + items: AddressItem[]; + }; + } + enum CoordType { + LATLNG, + TM128 + } + enum Encoding { + UTF_8, + EUC_KR + } + enum Status { + OK, + ERROR + } + + function fromAddrToCoord(): void; + function fromCoordToAddr(): void; + function geocode(options: GeocodeServiceOptions, + callback?: (status: Status, response: GeocodeResponse) => void): void; + function reverseGeocode(options: ReverseServiceOptions, + callback?: (status: Status, response: ReverseGeocodeResponse) => void): void; + } + + function TransCoord(): void; + namespace TransCoord { + function fromEPSG3857ToLatLng(coord: Point): LatLng; + function fromEPSG3857ToNaver(coord: Point): Point; + function fromEPSG3857ToTM128(coord: Point): Point; + function fromEPSG3857ToUTMK(coord: Point): Point; + function fromLatLngToEPSG3857(latlng: Coord): Point; + function fromLatLngToNaver(latlng: Coord): Point; + function fromLatLngToTM128(latlng: Coord): Point; + function fromLatLngToUTMK(latlng: Coord): Point; + function fromNaverToEPSG3857(n: Point): Point; + function fromNaverToLatLng(n: Point): LatLng; + function fromNaverToTM128(n: Point): Point; + function fromNaverToUTMK(n: Point): Point; + function fromTM128ToEPSG3857(tm128: Point): Point; + function fromTM128ToLatLng(tm128: Point): LatLng; + function fromTM128ToNaver(tm128: Point): Point; + function fromTM128ToUTMK(tm128: Point): Point; + function fromUTMKToEPSG3857(utmk: Point): Point; + function fromUTMKToLatLng(utmk: Point): LatLng; + function fromUTMKToNaver(utmk: Point): Point; + function fromUTMKToTM128(utmk: Point): Point; + } + + function Event(): void; + namespace Event { + function addDOMListener(element: HTMLElement, eventName: string, listener: () => any): void; + function addListener(target: any, eventName: string, listener: () => any): MapEventListener; + function clearInstanceListeners(target: any): void; + function clearListeners(target: any, fromEventName: string): void; + function forward(source: any, fromEventName: string, target: any, toEventName: string): MapEventListener; + function hasListener(target: any, eventName: string): boolean; + function once(target: any, eventName: string, listener: () => any): MapEventListener; + function removeDOMListener(element: HTMLElement, eventName: string, listener: () => any): void; + function removeDOMListener(listeners: DOMEventListener | DOMEventListener[]): void; + function removeListener(listeners: MapEventListener | MapEventListener[]): void; + function resumeDispatch(target: any, eventName: string): void; + function stopDispatch(target: any, eventName: string): void; + function trigger(target: any, eventName: string, eventObject?: any): void; + } + + // Projection + function EPSG3857(): void; + namespace EPSG3857 { // implements Projection + function fromCoordToPoint(coord: Coord): Point; + function fromLatLngToPoint(latlng: LatLng): Point; + function fromPointToCoord(point: Point): LatLng; + function fromPointToLatLng(point: Point): LatLng; + function getDestinationCoord(fromLatLng: LatLng, angle: number, meter: number): LatLng; + function getDistance(latlng1: LatLng, latlng2: LatLng): number; + } + + function UTMK(): void; + namespace UTMK { + let name: string; + let pointPerMeter: number; + function fromCoordToPoint(latlng: LatLng): Point; + function fromCoordToUTMK(latlng: LatLng): Point; + function fromLatLngToPoint(latlng: LatLng): Point; + function fromLatLngToUTMK(latlng: LatLng): Point; + function fromPointToCoord(point: Point): LatLng; + function fromPointToLatLng(point: Point): LatLng; + function fromPointToUTMK(point: Point): Point; + function fromUTMKToCoord(utmk: Point): LatLng; + function fromUTMKToLatLng(utmk: Point): LatLng; + function fromUTMKToPoint(utmk: Point): Point; + function getDestinationCoord(fromLatLng: LatLng, angle: number, meter: number): LatLng; + function getDistance(latlng1: LatLng, latlng2: LatLng): number; + } + + function UTMK_NAVER(): void; + namespace UTMK_NAVER { // extends UTMK + let name: string; + let pointPerMeter: number; + function fromCoordToNaver(latlng: LatLng): Point; + function fromLatLngToNaver(latlng: LatLng): Point; + function fromNaverToCoord(naverPoint: Point): LatLng; + function fromNaverToLatLng(naverPoint: Point): LatLng; + function fromNaverToPoint(naverPoint: Point): Point; + function fromNaverToUTMK(naverPoint: Point): Point; + function fromPointToNaver(point: Point): Point; + function fromUTMKToNaver(utmk: Point): Point; + } + + function EPSG3857Coord(): void; + namespace EPSG3857Coord { + function fromCoordToLatLng(coord: Point): LatLng; + function fromCoordToPoint(coord: Point): Point; + function fromEPSG3857ToLatLng(coord: Point): LatLng; + function fromEPSG3857ToPoint(coord: Point): Point; + function fromLatLngToCoord(coord: Coord): Point; + function fromLatLngToEPSG3857(coord: Coord): Point; + function fromPointToCoord(point: Point): Point; + function fromPointToEPSG3857(point: Point): Point; + } + + function TM128(): void; + namespace TM128 { // extends TM128Coord + function fromCoordToPoint(latlng: Coord): Point; + function fromPointToCoord(point: Point): LatLng; + } + + function TM128Coord(): void; + namespace TM128Coord { // extends UTMK + function fromCoordToLatLng(tm128: Point): LatLng; + function fromCoordToPoint(tm128: Point): Point; + function fromLatLngToCoord(latlng: Coord): Point; + function fromLatLngToTM128(latlng: Coord): Point; + function fromPointToCoord(point: Point): Point; + function fromPointToTM128(point: Point): Point; + function fromTM128ToLatLng(tm128: Point): LatLng; + function fromTM128ToPoint(tm128: Point): Point; + function fromTM128ToUTMK(tm128: Point): Point; + function fromUTMKToTM128(utmk: Point): Point; + } + + function UTMK_NAVERCoord(): void; + namespace UTMK_NAVERCoord { // extends UTMK_NAVER + function fromCoordToLatLng(n: Point): LatLng; + function fromCoordToPoint(n: Point): Point; + function fromLatLngToCoord(latlng: Coord): Point; + function fromPointToCoord(point: Point): Point; + } + + function UTMKCoord(): void; + namespace UTMKCoord { // extends UTMK + function fromCoordToLatLng(utmk: Point): LatLng; + function fromCoordToPoint(utmk: Point): Point; + function fromLatLngToCoord(latlng: Coord): Point; + function fromPointToCoord(point: Point): Point; + } +} diff --git a/types/navermaps/navermaps-tests.ts b/types/navermaps/navermaps-tests.ts new file mode 100644 index 0000000000..81bbe620f5 --- /dev/null +++ b/types/navermaps/navermaps-tests.ts @@ -0,0 +1,151 @@ +let map = new naver.maps.Map('map'); +map.setMapTypeId(naver.maps.MapTypeId.HYBRID); + +const jeju = new naver.maps.LatLng(33.3590628, 126.534361); + +map.setCenter(jeju); // 중심 좌표 이동 +map.setZoom(13); // 줌 레벨 변경 + +const seoul = new naver.maps.LatLngBounds( + new naver.maps.LatLng(37.42829747263545, 126.76620435615891), + new naver.maps.LatLng(37.7010174173061, 127.18379493229875)); + +map.fitBounds(seoul); // 좌표 경계 이동 + +map.panBy(new naver.maps.Point(10, 10)); // 우측 하단으로 10 픽셀 이동 + +map = new naver.maps.Map('map', { + mapTypeId: naver.maps.MapTypeId.HYBRID +}); + +const registry = new naver.maps.MapTypeRegistry(); + +map = new naver.maps.Map('map', { + mapTypes: registry, + mapTypeId: naver.maps.MapTypeId.SATELLITE +}); + +map.mapTypes.set(naver.maps.MapTypeId.SATELLITE, naver.maps.NaverMapTypeOption.getSatelliteMap()); +map.mapTypes.set(naver.maps.MapTypeId.HYBRID, naver.maps.NaverMapTypeOption.getHybridMap()); + +map.setMapTypeId(naver.maps.MapTypeId.NORMAL); // error thrown + +const GTA5MapTypeOption1 = { + minZoom: 0, + maxZoom: 22, + projection: naver.maps.EPSG3857, + name: '세계 지도', + tileSize: new naver.maps.Size(256, 256), + repeatX: true, + vendor: 'MyCorp.', + provider: [{ + title: "내 지도 ver 1.0" + }, { + title: "OpenStreetMap", + link: "http://www.openstreetmap.org/copyright" + }, { + title: "/인천광역시", + bounds: new naver.maps.LatLngBounds( + new naver.maps.LatLng(36.915887, 125.690716), + new naver.maps.LatLng(37.687529, 126.853252)) + }], + tileSet: [ + "http://mymap1.com/tiles/world/{z}/{x}/{y}.png", + "http://mymap2.com/tiles/world/{z}/{x}/{y}.png", + "http://mymap3.com/tiles/world/{z}/{x}/{y}.png", + "http://mymap4.com/tiles/world/{z}/{x}/{y}.png" + ] +}; + +map = new naver.maps.Map('map', { + center: new naver.maps.LatLng(74.92514151088395, -127.880859375), + zoom: 2, + mapTypes: new naver.maps.MapTypeRegistry({ + Atlas: new naver.maps.ImageMapType(GTA5MapTypeOption1) + }) +}); + +map.setMapTypeId("Atlas"); + +const map2 = new naver.maps.Map('map', { + center: new naver.maps.LatLng(37.3595704, 127.105399), + zoom: 10 +}); + +const marker = new naver.maps.Marker({ + position: new naver.maps.LatLng(37.3595704, 127.105399), + map: map2 +}); + +const HOME_PATH = ''; + +const cityhall = new naver.maps.LatLng(37.5666805, 126.9784147); +const map3 = new naver.maps.Map('map', { + center: cityhall.destinationPoint(0, 500), + zoom: 10 +}); +const marker2 = new naver.maps.Marker({ + map: map3, + position: cityhall +}); + +const contentString = [ + `
+

서울특별시청

+

서울특별시 중구 태평로1가 31 | 서울특별시 중구 세종대로 110 서울특별시청
+ 서울시청
+ 02-120 | 공공,사회기관 > 특별,광역시청
+ www.seoul.go.kr/ +

+
` + ].join(''); + +const infowindow = new naver.maps.InfoWindow({ + content: contentString +}); + +naver.maps.Event.addListener(marker2, "click", () => { + if (infowindow.getMap()) { + infowindow.close(); + } else { + infowindow.open(map3, marker2); + } +}); + +infowindow.open(map3, marker2); + +const GREEN_FACTORY = new naver.maps.LatLng(37.3595953, 127.1053971); + +const map4 = new naver.maps.Map('map', { + center: GREEN_FACTORY, + zoom: 3 +}); + +const rectangle = new naver.maps.Rectangle({ + map: map4, + bounds: new naver.maps.LatLngBounds( + new naver.maps.LatLng(37.1793196, 125.8795594), + new naver.maps.LatLng(37.5398662, 126.3312422) + ) +}); + +const circle = new naver.maps.Circle({ + map: map4, + center: GREEN_FACTORY, + radius: 20000, + fillColor: 'crimson', + fillOpacity: 0.8 +}); + +const ellipse = new naver.maps.Ellipse({ + map: map4, + bounds: new naver.maps.LatLngBounds( + new naver.maps.LatLng(37.1793196, 127.6795594), + new naver.maps.LatLng(37.5398662, 128.4312422) + ), + strokeColor: 'yellowgreen', + strokeOpacity: 1, + strokeWeight: 3, + fillColor: 'yellowgreen', + fillOpacity: 0.3 +}); diff --git a/types/navermaps/tsconfig.json b/types/navermaps/tsconfig.json new file mode 100644 index 0000000000..5e1beca4fb --- /dev/null +++ b/types/navermaps/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", + "navermaps-tests.ts" + ] +} diff --git a/types/navermaps/tslint.json b/types/navermaps/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/navermaps/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/navigo/index.d.ts b/types/navigo/index.d.ts index ebc0ecb8c5..30fb656d45 100644 --- a/types/navigo/index.d.ts +++ b/types/navigo/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/krasimir/navigo // Definitions by: Adrian Ehrsam // Dancespiele +// Daniel Almaguer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -53,7 +54,7 @@ declare class Navigo { link(path: string): string; - lastRouteResolved(): {url: string, query: string}; + lastRouteResolved(): {url: string, query: string, hooks: NavigoHooks, params?: Params, name?: string}; disableIfAPINotAvailable(): void; diff --git a/types/newrelic/index.d.ts b/types/newrelic/index.d.ts index 83b6e409dc..f6c54f5a4b 100644 --- a/types/newrelic/index.d.ts +++ b/types/newrelic/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for newrelic 2.7 +// Type definitions for newrelic 3.3 // Project: http://github.com/newrelic/node-newrelic // Definitions by: Matt R. Wilson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -147,6 +147,23 @@ declare namespace newrelic { */ getBrowserTimingHeader(): string; + /** + * Instrument a particular method to improve visibility into a transaction, + * or optionally turn it into a metric. + * + * The name defines a name for the segment. This name will be visible in transaction traces and + * as a new metric in the New Relic UI. + * The record flag defines whether the segment should be recorded as a metric. + * The handler is the function you want to track as a segment. + * The optional callback is a function passed to the handler to fire after its work is done. + * + * The agent begins timing the segment when startSegment is called. + * The segment is ended when either the handler finishes executing, or callback is fired, if it is provided. + * If a promise is returned from the handler, the segment's ending will be tied to that promise resolving or rejecting. + */ + startSegment>(name: string, record: boolean, handler: T): T; + startSegment any>(name: string, record: boolean, handler: (cb?: C) => T, callback?: C): T; + /** * Instrument a particular callback to improve visibility into a transaction. * @@ -157,6 +174,9 @@ declare namespace newrelic { * * The agent begins timing the segment when createTracer is called, and ends the segment when the callback * defined by the callback argument finishes executing. + * + * @deprecated + * This method has been deprecated in favor of newrelic.startSegment() */ createTracer any>(name: string, handle: T): T; diff --git a/types/newrelic/newrelic-tests.ts b/types/newrelic/newrelic-tests.ts index 73cd53cc78..3f99152c66 100644 --- a/types/newrelic/newrelic-tests.ts +++ b/types/newrelic/newrelic-tests.ts @@ -29,6 +29,12 @@ newrelic.addIgnoringRule(/^[0-9]+$/); // $ExpectType void newrelic.getBrowserTimingHeader(); // $ExpectType string +newrelic.startSegment('foo', false, () => "bar"); // $ExpectType string +newrelic.startSegment('foo', false, () => "bar", () => "baz"); // $ExpectType string +newrelic.startSegment('foo', false, Promise.all([5, 7])).then(([a, b]: [number, number]) => { + console.log(a, b); +}); + const wrappedFn = newrelic.createTracer("foo", (x: number) => { return x * x; }); diff --git a/types/next/config.d.ts b/types/next/config.d.ts new file mode 100644 index 0000000000..1b2e330bb0 --- /dev/null +++ b/types/next/config.d.ts @@ -0,0 +1 @@ +export default function(): {serverRuntimeConfig: any, publicRuntimeConfig: any}; diff --git a/types/next/tsconfig.json b/types/next/tsconfig.json index 05e0b4e7ad..48d3f0c8be 100644 --- a/types/next/tsconfig.json +++ b/types/next/tsconfig.json @@ -26,6 +26,7 @@ "head.d.ts", "link.d.ts", "router.d.ts", + "config.d.ts", "test/next-tests.ts", "test/next-error-tests.tsx", "test/next-head-tests.tsx", @@ -34,4 +35,4 @@ "test/next-dynamic-tests.tsx", "test/next-router-tests.tsx" ] -} \ No newline at end of file +} diff --git a/types/ngsijs/index.d.ts b/types/ngsijs/index.d.ts new file mode 100644 index 0000000000..b39cbb5469 --- /dev/null +++ b/types/ngsijs/index.d.ts @@ -0,0 +1,58 @@ +// Type definitions for ngsijs 1.0 +// Project: https://github.com/conwetlab/ngsijs +// Definitions by: Guillermofr +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export class Connection { + constructor(url: any); + v2: Connection.V2; + v1: Connection.V1; +} + +export namespace Connection { + class V1 { + constructor(connection: any); + addAttributes(toAdd: any, callbacks: any): void; + cancelAvailabilitySubscription(subId: any, callbacks: any): void; + cancelRegistration(regId: any, callbacks: any): void; + cancelSubscription(subId: any, options: any): void; + createAvailabilitySubscription(entities: any, attributeNames: any, duration: any, restriction: any, options: any, ...args: any[]): void; + createRegistration(entities: any, attributes: any, duration: any, providingApplication: any, callbacks: any): void; + createSubscription(entities: any, attributeNames: any, duration: any, throttling: any, cond: any, options: any, ...args: any[]): void; + deleteAttributes(toDelete: any, callbacks: any): void; + discoverAvailability(entities: any, attributeNames: any, callbacks: any): void; + getAvailableTypes(options: any): void; + getTypeInfo(type: any, options: any): void; + query(entities: any, attributesName: any, options: any): void; + updateAttributes(update: any, callbacks: any): void; + updateAvailabilitySubscription(subId: any, entities: any, attributeNames: any, duration: any, restriction: any, callbacks: any): void; + updateRegistration(regId: any, entities: any, attributes: any, duration: any, providingApplication: any, callbacks: any): any; + updateSubscription(subId: any, duration: any, throttling: any, cond: any, options: any): void; + } + + class V2 { + constructor(connection: any); + appendEntityAttributes(changes: any, options: any): any; + batchQuery(query: any, options: any): any; + batchUpdate(changes: any, options: any): any; + createEntity(entity: any, options: any): any; + createSubscription(subscription: any, options: any): any; + deleteEntity(options: any): any; + deleteEntityAttribute(options: any): any; + deleteSubscription(options: any): any; + getEntity(options: any): any; + getEntityAttribute(options: any): any; + getEntityAttributeValue(options: any): any; + getEntityAttributes(options: any): any; + getSubscription(options: any): any; + getType(options: any): any; + listEntities(options: any): any; + listSubscriptions(options: any): any; + listTypes(options: any): any; + replaceEntityAttribute(changes: any, options: any): any; + replaceEntityAttributeValue(options: any): any; + replaceEntityAttributes(entity: any, options: any): any; + updateEntityAttributes(changes: any, options: any): any; + updateSubscription(changes: any, options: any): any; + } +} diff --git a/types/ngsijs/tsconfig.json b/types/ngsijs/tsconfig.json new file mode 100644 index 0000000000..ecc22c8314 --- /dev/null +++ b/types/ngsijs/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} diff --git a/types/ngsijs/tslint.json b/types/ngsijs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ngsijs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/nightmare/index.d.ts b/types/nightmare/index.d.ts index 061f22bd10..60c73d850f 100644 --- a/types/nightmare/index.d.ts +++ b/types/nightmare/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Nightmare 2.10.0 +// Type definitions for Nightmare 2.10.1 // Project: https://github.com/segmentio/nightmare // Definitions by: horiuchi // Sam Yang @@ -12,7 +12,6 @@ declare class Nightmare { constructor(options?: Nightmare.IConstructorOptions); // Interact - userAgent(agent: string): Nightmare; end(): Nightmare; then(fn: (value: T) => R): Promise; halt(error: string, cb: () => void): Nightmare; @@ -57,8 +56,8 @@ declare class Nightmare { run(cb?: (err: any, nightmare: Nightmare) => void): Nightmare; // Extract - exists(selector: string, cb: (result: boolean) => void): Nightmare; - visible(selector: string, cb: (result: boolean) => void): Nightmare; + exists(selector: string, cb?: (result: boolean) => void): Nightmare; + visible(selector: string, cb?: (result: boolean) => void): Nightmare; on(event: string, cb: () => void): Nightmare; on(event: 'initialized', cb: () => void): Nightmare; on(event: 'loadStarted', cb: () => void): Nightmare; @@ -114,6 +113,7 @@ declare class Nightmare { html(path: string, saveType: 'MHTML'): Nightmare; pdf(path: string): Nightmare; pdf(path: string, options: Object): Nightmare; + pdf(cb: (err: Error, data: Buffer) => void): Nightmare; title(): string; title(cb: (title: string) => void): Nightmare; url(cb: (url: string) => void): Nightmare; diff --git a/types/nightmare/nightmare-tests.ts b/types/nightmare/nightmare-tests.ts index 7eb376b996..d49d8b5932 100644 --- a/types/nightmare/nightmare-tests.ts +++ b/types/nightmare/nightmare-tests.ts @@ -52,6 +52,16 @@ new Nightmare() }) .run(done); +new Nightmare() + .goto('http://www.wikipedia.org/') + .exists('a.link-box') + .then((exists: boolean) => { }) + +new Nightmare() + .goto('http://www.wikipedia.org/') + .visible('a.link-box') + .then((isVisible: boolean) => { }) + new Nightmare() .goto('http://www.wikipedia.org/') .title(function (title) { @@ -189,6 +199,13 @@ new Nightmare() .pdf('test/test.pdf') .run(done); +new Nightmare() + .goto("http://yahoo.com") + .pdf((err,data)=>{ + console.log(Buffer.isBuffer(data)) + }) + .run(done) + new Nightmare() .goto('http://www.google.com/') .wait('input') @@ -387,7 +404,3 @@ new Nightmare({ executionTimeout: 1000 }) }, 2000) }) }) - - - - diff --git a/types/nightwatch/index.d.ts b/types/nightwatch/index.d.ts index 6d3cc8f4a0..8559f73b10 100644 --- a/types/nightwatch/index.d.ts +++ b/types/nightwatch/index.d.ts @@ -1822,7 +1822,7 @@ export interface NightwatchAPI { * @param frameId: Identifier for the frame to change focus to. * @param callback: Optional callback function to be called when the command finishes. */ - frame(frameId?: string, callback?: () => void): this; + frame(frameId: string | undefined | null, callback?: () => void): this; /** * Change focus to the parent context. If the current context is the top level browsing context, the context remains unchanged. diff --git a/types/nivo-slider/index.d.ts b/types/nivo-slider/index.d.ts new file mode 100644 index 0000000000..f30f6d445b --- /dev/null +++ b/types/nivo-slider/index.d.ts @@ -0,0 +1,39 @@ +// Type definitions for Nivo Slider 3.2 +// Project: https://github.com/Codeinwp/Nivo-Slider-jQuery +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +export type EffectType = 'sliceDown' | 'sliceDownLeft' | 'sliceUp' | 'sliceUpLeft' | 'sliceUpDown' | 'sliceUpDownLeft' | + 'fold' | 'fade' | 'random' | 'slideInRight' | 'slideInLeft' | 'boxRandom' | 'boxRain' | 'boxRainReverse' | + 'boxRainGrow' | 'boxRainGrowReverse'; + +export interface Options { + effect?: EffectType; + slices?: number; + boxCols?: number; + boxRows?: number; + animSpeed?: number; + pauseTime?: number; + startSlide?: number; + directionNav?: boolean; + controlNav?: boolean; + controlNavThumbs?: boolean; + pauseOnHover?: boolean; + manualAdvance?: boolean; + prevText?: string; + nextText?: string; + randomStart?: boolean; + beforeChange?: () => void; + afterChange?: () => void; + slideshowEnd?: () => void; + lastSlide?: () => void; + afterLoad?: () => void; +} +declare global { + interface JQuery { + nivoSlider(options?: Options): JQuery; + } +} diff --git a/types/nivo-slider/nivo-slider-tests.ts b/types/nivo-slider/nivo-slider-tests.ts new file mode 100644 index 0000000000..a82ec64106 --- /dev/null +++ b/types/nivo-slider/nivo-slider-tests.ts @@ -0,0 +1,23 @@ +import { Options } from "nivo-slider"; + +// basic usage +$('#slider').nivoSlider(); + +// with options +const options: Options = { + effect: 'random', + slices: 15, + boxCols: 8, + boxRows: 4, + animSpeed: 500, + pauseTime: 3000, + startSlide: 0, + directionNav: true, + controlNav: true, + controlNavThumbs: false, + pauseOnHover: true, + manualAdvance: false, + prevText: 'Prev', + nextText: 'Next' +}; +$('#slider').nivoSlider(options); diff --git a/types/nivo-slider/tsconfig.json b/types/nivo-slider/tsconfig.json new file mode 100644 index 0000000000..4275013350 --- /dev/null +++ b/types/nivo-slider/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, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "nivo-slider-tests.ts" + ] +} \ No newline at end of file diff --git a/types/nivo-slider/tslint.json b/types/nivo-slider/tslint.json new file mode 100644 index 0000000000..d04fe2e1fa --- /dev/null +++ b/types/nivo-slider/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} \ No newline at end of file diff --git a/types/noble/index.d.ts b/types/noble/index.d.ts index 474338d383..ee4fbf1654 100644 --- a/types/noble/index.d.ts +++ b/types/noble/index.d.ts @@ -6,6 +6,7 @@ // Luke Libraro // Dan Chao // Michal Lower +// Rob Moran // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -63,7 +64,10 @@ export declare class Peripheral extends events.EventEmitter { export interface Advertisement { localName: string; - serviceData: Buffer; + serviceData: { + uuid: string, + data: Buffer + }; txPowerLevel: number; manufacturerData: Buffer; serviceUuids: string[]; diff --git a/types/noble/noble-tests.ts b/types/noble/noble-tests.ts index 65e13f4d43..5e00105433 100644 --- a/types/noble/noble-tests.ts +++ b/types/noble/noble-tests.ts @@ -39,7 +39,10 @@ var peripheral: noble.Peripheral = new noble.Peripheral(); peripheral.uuid = "12ad4e81"; peripheral.advertisement = { localName: "device", - serviceData: new Buffer(1), + serviceData: { + uuid: "180a", + data: new Buffer(1) + }, txPowerLevel: 1, manufacturerData: new Buffer(1), serviceUuids: ["0x180a", "0x180d"] diff --git a/types/nock/index.d.ts b/types/nock/index.d.ts index 91037b8e54..90eae08189 100644 --- a/types/nock/index.d.ts +++ b/types/nock/index.d.ts @@ -158,6 +158,13 @@ declare namespace nock { (fixtureName: string, nockedFn: (nockDone: () => void) => void): void; (fixtureName: string, options: NockBackOptions, nockedFn: (nockDone: () => void) => void): void; + (fixtureName: string, options?: NockBackOptions): Promise<{ nockDone: () => void, context: NockBackContext }>; + } + + export interface NockBackContext { + scopes: Scope[]; + assertScopesFinished(): void; + isLoaded: boolean; } export interface NockBackOptions { diff --git a/types/nock/nock-tests.ts b/types/nock/nock-tests.ts index 44397db941..7ed4ecc25d 100644 --- a/types/nock/nock-tests.ts +++ b/types/nock/nock-tests.ts @@ -72,10 +72,10 @@ scope = inst.reply(num, str); scope = inst.reply(num, str, headers); scope = inst.reply(num, obj, headers); scope = inst.reply(num, (uri: string, body: string) => { - return str; + return str; }); scope = inst.reply(num, (uri: string, body: string) => { - return str; + return str; }, headers); scope = inst.replyWithFile(num, str); @@ -97,11 +97,11 @@ inst = inst.delayConnection(num); scope = scope.filteringPath(regex, str); scope = scope.filteringPath((path: string) => { - return str; + return str; }); scope = scope.filteringRequestBody(regex, str); scope = scope.filteringRequestBody((path: string) => { - return str; + return str; }); scope = scope.log(() => { }); @@ -126,8 +126,8 @@ scope.restore(); nock.recorder.rec(); nock.recorder.rec(true); nock.recorder.rec({ - dont_print: true, - output_objects: true + dont_print: true, + output_objects: true }); nock.recorder.clear(); strings = nock.recorder.play() as string[]; @@ -713,6 +713,12 @@ nockBack('zomboFixture.json', { before, after }, (nockDone: () => void) => { }); }); +// in promise mode +nockBack('promisedFixture.json') + .then(({nockDone, context}) => { + context.assertScopesFinished(); - - + // do your tests returning a promise and chain it with + Promise.resolve('foo') + .then(nockDone); + }); diff --git a/types/node-fetch/index.d.ts b/types/node-fetch/index.d.ts index d39b6db22e..aaaf30a5e3 100644 --- a/types/node-fetch/index.d.ts +++ b/types/node-fetch/index.d.ts @@ -77,6 +77,7 @@ export class Body { json(): Promise; text(): Promise; buffer(): Promise; + arrayBuffer(): Promise; } export class Response extends Body { diff --git a/types/node-fetch/node-fetch-tests.ts b/types/node-fetch/node-fetch-tests.ts index dbf140225f..564a31fe79 100644 --- a/types/node-fetch/node-fetch-tests.ts +++ b/types/node-fetch/node-fetch-tests.ts @@ -30,6 +30,10 @@ function test_fetchUrl() { handlePromise(fetch("http://www.andlabs.net/html5/uCOR.php")); } +function test_fetchUrlArrayBuffer() { + handlePromise(fetch("http://www.andlabs.net/html5/uCOR.php"), true); +} + function test_fetchUrlWithRequestObject() { var requestOptions: RequestInit = { method: "POST", @@ -53,13 +57,17 @@ function test_globalFetchVar() { }); } -function handlePromise(promise: Promise) { - promise.then((response) => { +function handlePromise(promise: Promise, isArrayBuffer: boolean = false) { + promise.then((response):Promise => { if (response.type === 'basic') { // for test only } - return response.text(); - }).then((text) => { + if (isArrayBuffer) { + return response.arrayBuffer(); + } else { + return response.text(); + } + }).then((text:string | ArrayBuffer) => { console.log(text); }); } diff --git a/types/node-hid/index.d.ts b/types/node-hid/index.d.ts index 92ffd4a60a..00a2f5eaee 100644 --- a/types/node-hid/index.d.ts +++ b/types/node-hid/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for node-hid 0.5 +// Type definitions for node-hid 0.7 // Project: https://github.com/node-hid/node-hid#readme // Definitions by: Mohamed Hegazy // Robert Kiss +// Rob Moran // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export interface Device { @@ -22,13 +23,14 @@ export class HID { constructor(vid: number, pid: number); close(): void; pause(): void; - read(callback: (value: any, err: any) => void): any; + read(callback: (err: any, data: number[]) => void): void; readSync(): number[]; readTimeout(time_out: number): number[]; - sendFeatureReport(data: number[]): void; + sendFeatureReport(data: number[]): number; getFeatureReport(report_id: number, report_length: number): number[]; resume(): void; on(event: string, handler: (value: any) => void): void; - write(values: number[]): void; + write(values: number[]): number; + setDriverType(type: string): void; } export function devices(): Device[]; diff --git a/types/node-polyglot/index.d.ts b/types/node-polyglot/index.d.ts index 7587f77640..3133def496 100644 --- a/types/node-polyglot/index.d.ts +++ b/types/node-polyglot/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for node-polyglot v0.4.1 +// Type definitions for node-polyglot v0.4.2 // Project: https://github.com/airbnb/polyglot.js // Definitions by: Tim Jackson-Kiely // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -38,6 +38,8 @@ declare class Polyglot { locale(): string; locale(locale: string): void; + + has(phrase: string): boolean; } export = Polyglot; diff --git a/types/node-polyglot/node-polyglot-tests.ts b/types/node-polyglot/node-polyglot-tests.ts index bfb18339c0..14efa8ad30 100644 --- a/types/node-polyglot/node-polyglot-tests.ts +++ b/types/node-polyglot/node-polyglot-tests.ts @@ -47,6 +47,9 @@ function translate(): void { _: "I like to write in %{language}.", language: "Javascript" }); + + polyglot.has("hello"); + polyglot.has("world"); polyglot.replace({ "hello": "hey", diff --git a/types/node-pushnotifications/index.d.ts b/types/node-pushnotifications/index.d.ts new file mode 100644 index 0000000000..5b9ed891f9 --- /dev/null +++ b/types/node-pushnotifications/index.d.ts @@ -0,0 +1,180 @@ +// Type definitions for node-pushnotifications 1.0 +// Project: https://github.com/appfeel/node-pushnotifications +// Definitions by: Menushka Weeratunga +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.1 +/// + +export = PushNotifications; + +declare class PushNotifications { + constructor(settings: PushNotifications.Settings); + + setOptions(opts: PushNotifications.Settings): void; + sendWith(method: PushNotifications.PushMethod, regIds: string[], data: PushNotifications.Data, cb: PushNotifications.Callback): void; + send(registrationIds: string[], data: PushNotifications.Data, cb: PushNotifications.Callback): void; + send(registrationIds: string[], data: PushNotifications.Data): Promise; +} + +declare namespace PushNotifications { + interface Settings { + /** Google Cloud Messaging */ + gcm?: { + /** GCM or FCM token */ + id?: string; + }; + /** Apple Push Notifications */ + apn?: { + /** APN Token */ + token?: { + /** + * The filename of the provider token key (as supplied by Apple) to load from disk, or a + * Buffer/String containing the key data. + */ + key?: Buffer | string; + /** The ID of the key issued by Apple */ + keyId?: string; + /** ID of the team associated with the provider token key */ + teamId?: string; + }; + /** + * The filename of the connection certificate to load from disk, or a Buffer/String containing the + * certificate data. + */ + cert?: string; + /** The filename of the connection key to load from disk, or a Buffer or String containing the key data. */ + key?: string; + /** + * An array of trusted certificates. Each element should contain either a filename to load, or a + * Buffer/String (in PEM format) to be used directly. If this is omitted several well known "root" CAs + * will be used. - You may need to use this as some environments don't include the CA used by + * Apple (entrust_2048). + */ + ca?: Array; + /** + * File path for private key, certificate and CA certs in PFX or PKCS12 format, or a Buffer containing + * the PFX data. If supplied will always be used instead of certificate and key above. + */ + pfx?: Buffer | string; + /** The passphrase for the connection key, if required */ + passphrase?: string; + production?: boolean; + voip?: boolean; + address?: string; + port?: number; + rejectUnauthorized?: boolean; + connectionRetryLimit?: number; + cacheLength?: number; + connectionTimeout?: number; + autoAdjustCache?: boolean; + maxConnections?: number; + minConnections?: number; + connectTimeout?: number; + buffersNotifications?: boolean; + fastMode?: boolean; + disableNagle?: boolean; + disableEPIPEFix?: boolean; + }; + /** Amazon Device Messaging */ + adm?: { + client_id?: string; + client_secret?: string; + }; + /** Windows Push Notifications */ + wns?: { + client_id?: string; + client_secret?: string; + accessToken?: string; + headers?: string; + notificationMethod?: string; + }; + /** Microsoft Push Notification Service */ + mpns?: { + options?: { + client_id?: string; + client_secret?: string; + }; + }; + } + interface Data { + /** REQUIRED */ + title: string; + /** REQUIRED */ + body: string; + custom?: { + sender?: string; + }; + /** + * gcm, apn. Supported values are 'high' or 'normal' (gcm). Will be translated to 10 and 5 for apn. Defaults + * to 'high' + */ + priority?: string; + /** gcm for android, used as collapseId in apn */ + collapseKey?: string; + /** gcm for android */ + contentAvailable?: boolean | string; + /** gcm for android */ + delayWhileIdle?: boolean; + /** gcm for android */ + restrictedPackageName?: string; + /** gcm for android */ + dryRun?: boolean; + /** gcm for android */ + icon?: string; + /** gcm for android */ + tag?: string; + /** gcm for android */ + color?: string; + /** gcm for android. In ios, category will be used if not supplied */ + clickAction?: string; + /** gcm, apn */ + locKey?: string; + /** gcm, apn */ + bodyLocArgs?: string; + /** gcm, apn */ + titleLocKey?: string; + /** gcm, apn */ + titleLocArgs?: string; + /** gcm, apn */ + retries?: number; + /** apn */ + encoding?: string; + /** gcm for ios, apn */ + badge?: number; + /** gcm, apn */ + sound?: string; + /** apn, will take precedence over title and body. It is also accepted a text message in alert */ + alert?: {} | string; + /** apn and gcm for ios */ + launchImage?: string; + /** apn and gcm for ios */ + action?: string; + /** apn and gcm for ios */ + topic?: string; + /** apn and gcm for ios */ + category?: string; + /** apn and gcm for ios */ + mdm?: string; + /** apn and gcm for ios */ + urlArgs?: string; + /** apn and gcm for ios */ + truncateAtWordEnd?: boolean; + /** apn */ + mutableContent?: number; + /** seconds */ + expiry?: number; + /** if both expiry and timeToLive are given, expiry will take precedency */ + timeToLive?: number; + /** wns */ + headers?: string[]; + /** wns */ + launch?: string; + /** wns */ + duration?: string; + /** ADM */ + consolidationKey?: string; + } + type PushMethod = (regIds: string[], data: Data, settings: Settings) => void; + type Callback = (err: any, result: any) => void; +} diff --git a/types/node-pushnotifications/node-pushnotifications-tests.ts b/types/node-pushnotifications/node-pushnotifications-tests.ts new file mode 100644 index 0000000000..6a4d9d3335 --- /dev/null +++ b/types/node-pushnotifications/node-pushnotifications-tests.ts @@ -0,0 +1,51 @@ +import PushNotifications = require('node-pushnotifications'); + +const settings = { + gcm: { + id: "null" + }, + apn: { + token: { + key: './certs/key.p8', + keyId: 'ABCD', + teamId: 'EFGH', + } + }, + adm: { + client_id: "null", + client_secret: "null" + }, + wns: { + client_id: "null", + client_secret: "null", + notificationMethod: 'sendTileSquareBlock', + } +}; +const push = new PushNotifications(settings); + +const registrationIds = []; +registrationIds.push('INSERT_YOUR_DEVICE_ID'); +registrationIds.push('INSERT_OTHER_DEVICE_ID'); + +const data = { + title: 'New push notification', + body: 'Powered by AppFeel' +}; + +// You can use it in node callback style +push.send(registrationIds, data, (err, result) => { + if (err) { + console.log(err); + } else { + console.log(result); + } +}); + +// Or you could use it as a promise: +push.send(registrationIds, data) + .then((results) => { + console.log(results); + }) + .catch((err) => { + console.log(err); + }); diff --git a/types/node-pushnotifications/tsconfig.json b/types/node-pushnotifications/tsconfig.json new file mode 100644 index 0000000000..54ace6c986 --- /dev/null +++ b/types/node-pushnotifications/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", + "node-pushnotifications-tests.ts" + ] +} diff --git a/types/node-pushnotifications/tslint.json b/types/node-pushnotifications/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/node-pushnotifications/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/node-rsa/index.d.ts b/types/node-rsa/index.d.ts index 63d569378d..e0730eef74 100644 --- a/types/node-rsa/index.d.ts +++ b/types/node-rsa/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for node-rsa 0.4 // Project: https://github.com/rzcoder/node-rsa // Definitions by: Ali Taheri +// Christian Moniz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -17,6 +18,11 @@ declare class NodeRSA { */ constructor(key: NodeRSA.Key, format?: NodeRSA.Format, options?: NodeRSA.Options); + /** + * Set and validate options for key instance. + */ + setOptions(options: NodeRSA.Options): void; + /** * @param bits Key size in bits. 2048 by default. * @param exponent public exponent. 65537 by default. @@ -31,7 +37,10 @@ declare class NodeRSA { /** * Export key to PEM string, PEM/DER Buffer or components. */ - exportKey(format?: NodeRSA.Format): NodeRSA.Key; + exportKey(format?: NodeRSA.FormatPem): string; + exportKey(format: NodeRSA.FormatDer): Buffer; + exportKey(format: NodeRSA.FormatComponentsPrivate): NodeRSA.KeyComponentsPrivate; + exportKey(format: NodeRSA.FormatComponentsPublic): NodeRSA.KeyComponentsPublic; isPrivate(): boolean; @@ -85,20 +94,26 @@ declare class NodeRSA { } declare namespace NodeRSA { - type Key = string | Buffer | KeyComponents; + type Key = string | Buffer | KeyComponentsPrivate | KeyComponentsPublic; type Data = string | object | any[]; - type Format = + type FormatPem = | 'private' | 'public' - | 'pkcs1' | 'pkcs1-pem' | 'pkcs1-der' - | 'pkcs1-private' | 'pkcs1-private-pem' | 'pkcs1-private-der' - | 'pkcs1-public' | 'pkcs1-public-pem' | 'pkcs1-public-der' - | 'pkcs8' | 'pkcs8-pem' | 'pkcs8-der' - | 'pkcs8-private' | 'pkcs8-private-pem' | 'pkcs8-private-der' - | 'pkcs8-public' | 'pkcs8-public-pem' | 'pkcs8-public-der' + | 'pkcs1' | 'pkcs1-pem' + | 'pkcs1-private' | 'pkcs1-private-pem' + | 'pkcs1-public' | 'pkcs1-public-pem' + | 'pkcs8' | 'pkcs8-pem' + | 'pkcs8-private' | 'pkcs8-private-pem' + | 'pkcs8-public' | 'pkcs8-public-pem'; + type FormatDer = + | 'pkcs1-der' | 'pkcs1-private-der' | 'pkcs1-public-der' + | 'pkcs8-der' | 'pkcs8-private-der' | 'pkcs8-public-der'; + type FormatComponentsPrivate = | 'components' | 'components-pem' | 'components-der' - | 'components-private' | 'components-private-pem' | 'components-private-der' + | 'components-private' | 'components-private-pem' | 'components-private-der'; + type FormatComponentsPublic = | 'components-public' | 'components-public-pem' | 'components-public-der'; + type Format = FormatPem | FormatDer | FormatComponentsPrivate | FormatComponentsPublic; type EncryptionScheme = 'pkcs1_oaep' | 'pkcs1'; @@ -124,7 +139,7 @@ declare namespace NodeRSA { | 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'latin1' | 'base64' | 'hex' | 'binary' | 'buffer'; - interface KeyComponents { + interface KeyComponentsPrivate { n: Buffer; e: Buffer | number; d: Buffer; @@ -135,6 +150,11 @@ declare namespace NodeRSA { coeff: Buffer; } + interface KeyComponentsPublic { + n: Buffer; + e: Buffer | number; + } + interface KeyBits { /** * The length of the key in bits. diff --git a/types/node-rsa/node-rsa-tests.ts b/types/node-rsa/node-rsa-tests.ts index 0f8defacbd..88d8bdcb2e 100644 --- a/types/node-rsa/node-rsa-tests.ts +++ b/types/node-rsa/node-rsa-tests.ts @@ -2,6 +2,11 @@ import NodeRSA = require('node-rsa'); const key = new NodeRSA({ b: 512 }); +key.setOptions({ + encryptionScheme: 'pkcs1_oaep', + signingScheme: 'pkcs1' +}); + const text = 'Hello RSA!'; const encrypted = key.encrypt(text, 'base64'); const decrypted = key.decrypt(encrypted, 'utf8'); @@ -26,8 +31,10 @@ Es+KCn25OKXR/FJ5fu6A6A+MptABL3r8SEjlpLc= const keyData = '-----BEGIN PUBLIC KEY----- ... -----END PUBLIC KEY-----'; key.importKey(keyData, 'pkcs8'); -const publicDer = key.exportKey('pkcs8-public-der'); -const privateDer = key.exportKey('pkcs1-der'); +const defaultPem: string = key.exportKey(); +const publicPem: string = key.exportKey('pkcs8-public-pem'); +const publicDer: Buffer = key.exportKey('pkcs8-public-der'); +const privateDer: Buffer = key.exportKey('pkcs1-der'); key.importKey({ n: new Buffer('0086fa9ba066685845fc03833a9699c8baefb53cfbf19052a7f10f1eaa30488cec1ceb752bdff2df9fad6c64b3498956e7dbab4035b4823c99a44cc57088a23783', 'hex'), e: 65537, @@ -39,6 +46,17 @@ key.importKey({ coeff: new Buffer('00b399675e5e81506b729a777cc03026f0b2119853dfc5eb124610c0ab82999e45', 'hex') }, 'components'); const publicComponents = key.exportKey('components-public'); +let b: Buffer = publicComponents.n; +let bn: Buffer|number = publicComponents.e; +const privateComponents = key.exportKey('components-private'); +b = privateComponents.n; +bn = privateComponents.e; +b = privateComponents.d; +b = privateComponents.p; +b = privateComponents.q; +b = privateComponents.dmp1; +b = privateComponents.dmq1; +b = privateComponents.coeff; key.isPrivate(); key.isPublic(true); diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 0994982b41..d27e680aed 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -20,6 +20,9 @@ // Klaus Meinhardt // Huw // Nicolas Even +// Mohsen Azimi +// Hoàng Văn Khải +// Alexander T. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** inspector module types */ @@ -216,10 +219,6 @@ declare var Buffer: { */ new(buffer: Buffer): Buffer; prototype: Buffer; - /** - * Allocates a new Buffer using an {array} of octets. - */ - from(array: any[]): Buffer; /** * When passed a reference to the .buffer property of a TypedArray instance, * the newly created Buffer will share the same allocated memory as the TypedArray. @@ -230,9 +229,10 @@ declare var Buffer: { */ from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; /** - * Copies the passed {buffer} data onto a new Buffer instance. + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer */ - from(buffer: Buffer): Buffer; + from(data: any[] | string | Buffer | ArrayBuffer /*| TypedArray*/): Buffer; /** * Creates a new Buffer containing the given JavaScript string {str}. * If provided, the {encoding} parameter identifies the character encoding. @@ -953,6 +953,7 @@ declare module "http" { 'access-control-allow-headers'?: string; 'accept-patch'?: string; 'accept-ranges'?: string; + 'authorization'?: string; 'age'?: string; 'allow'?: string; 'alt-svc'?: string; @@ -1749,17 +1750,9 @@ declare module "https" { export type ServerOptions = tls.SecureContextOptions & tls.TlsOptions; - export type RequestOptions = http.RequestOptions & { + export type RequestOptions = http.RequestOptions & tls.SecureContextOptions & { rejectUnauthorized?: boolean; // Defaults to true servername?: string; // SNI TLS Extension - pfx?: string | Buffer | Array; - key?: string | Buffer | Array; - passphrase?: string; - cert?: string | Buffer | Array; - ca?: string | Buffer | Array; - ciphers?: string; - clientCertEngine?: string; - secureProtocol?: string; // SSL Method, e.g. SSLv23_method }; export interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { @@ -2001,10 +1994,11 @@ declare module "vm" { } export function createContext(sandbox?: Context): Context; export function isContext(sandbox: Context): boolean; - export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions): any; + export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any; + /** @deprecated */ export function runInDebugContext(code: string): any; - export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions): any; - export function runInThisContext(code: string, options?: RunningScriptOptions): any; + export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any; + export function runInThisContext(code: string, options?: RunningScriptOptions | string): any; } declare module "child_process" { @@ -2361,6 +2355,9 @@ declare module "url" { export function format(urlObject: UrlObject | string): string; export function resolve(from: string, to: string): string; + export function domainToASCII(domain: string): string; + export function domainToUnicode(domain: string): string; + export interface URLFormatOptions { auth?: boolean; fragment?: boolean; @@ -4680,11 +4677,11 @@ declare module "path" { /** * The platform-specific file separator. '\\' or '/'. */ - export var sep: string; + export var sep: '\\' | '/'; /** * The platform-specific file delimiter. ';' or ':'. */ - export var delimiter: string; + export var delimiter: ';' | ':'; /** * Returns an object from a path string - the opposite of format(). * @@ -4975,7 +4972,6 @@ declare module "tls" { } export interface TlsOptions extends SecureContextOptions { - clientCertEngine?: string; handshakeTimeout?: number; requestCert?: boolean; rejectUnauthorized?: boolean; @@ -5176,9 +5172,9 @@ declare module "crypto" { update(data: string, input_encoding: Utf8AsciiBinaryEncoding, output_encoding: HexBase64BinaryEncoding): string; final(): Buffer; final(output_encoding: string): string; - setAutoPadding(auto_padding?: boolean): void; + setAutoPadding(auto_padding?: boolean): this; getAuthTag(): Buffer; - setAAD(buffer: Buffer): void; + setAAD(buffer: Buffer): this; } export function createDecipher(algorithm: string, password: any): Decipher; export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher; @@ -5189,9 +5185,9 @@ declare module "crypto" { update(data: string, input_encoding: HexBase64BinaryEncoding, output_encoding: Utf8AsciiBinaryEncoding): string; final(): Buffer; final(output_encoding: string): string; - setAutoPadding(auto_padding?: boolean): void; - setAuthTag(tag: Buffer): void; - setAAD(buffer: Buffer): void; + setAutoPadding(auto_padding?: boolean): this; + setAuthTag(tag: Buffer): this; + setAAD(buffer: Buffer): this; } export function createSign(algorithm: string): Signer; export interface Signer extends NodeJS.WritableStream { @@ -5612,8 +5608,8 @@ declare module "assert" { }); } - export function fail(message: string): void; - export function fail(actual: any, expected: any, message?: string, operator?: string): void; + export function fail(message: string): never; + export function fail(actual: any, expected: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index 08dbb68b8a..776364a740 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -423,9 +423,19 @@ function bufferTests() { buf.swap64(); } - // Class Method: Buffer.from(array) + // Class Method: Buffer.from(data) { - const buf: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Array + const buf1: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Buffer + const buf2: Buffer = Buffer.from(buf1); + // String + const buf3: Buffer = Buffer.from('this is a tést'); + // ArrayBuffer + const arr: Uint16Array = new Uint16Array(2); + arr[0] = 5000; + arr[1] = 4000; + const buf4: Buffer = Buffer.from(arr.buffer); } // Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) @@ -435,22 +445,15 @@ function bufferTests() { arr[1] = 4000; let buf: Buffer; - buf = Buffer.from(arr.buffer); buf = Buffer.from(arr.buffer, 1); buf = Buffer.from(arr.buffer, 0, 1); } - // Class Method: Buffer.from(buffer) - { - const buf1: Buffer = Buffer.from('buffer'); - const buf2: Buffer = Buffer.from(buf1); - } - // Class Method: Buffer.from(str[, encoding]) { - const buf1: Buffer = Buffer.from('this is a tést'); const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex'); } + // Class Method: Buffer.alloc(size[, fill[, encoding]]) { const buf1: Buffer = Buffer.alloc(5); @@ -635,6 +638,11 @@ namespace url_tests { } } + { + const ascii: string = url.domainToASCII('español.com'); + const unicode: string = url.domainToUnicode('xn--espaol-zwa.com'); + } + { let myURL = new url.URL('https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); assert.equal(myURL.hash, '#bar'); @@ -2550,6 +2558,10 @@ namespace vm_tests { const Debug = vm.runInDebugContext('Debug'); Debug.scripts().forEach((script: any) => { console.log(script.name); }); } + + { + vm.runInThisContext('console.log("hello world"', './my-file.js'); + } } ///////////////////////////////////////////////////// diff --git a/types/node/v0/index.d.ts b/types/node/v0/index.d.ts index 800a909c49..ef1c485d2d 100644 --- a/types/node/v0/index.d.ts +++ b/types/node/v0/index.d.ts @@ -1870,7 +1870,7 @@ declare module "assert" { operator?: string; stackStartFunction?: Function}); } - export function fail(actual?: any, expected?: any, message?: string, operator?: string): void; + export function fail(actual?: any, expected?: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; diff --git a/types/node/v4/index.d.ts b/types/node/v4/index.d.ts index 16e54d002d..4793b4e9f7 100644 --- a/types/node/v4/index.d.ts +++ b/types/node/v4/index.d.ts @@ -164,10 +164,6 @@ declare var Buffer: { */ new (buffer: Buffer): Buffer; prototype: Buffer; - /** - * Allocates a new Buffer using an {array} of octets. - */ - from(array: any[]): Buffer; /** * When passed a reference to the .buffer property of a TypedArray instance, * the newly created Buffer will share the same allocated memory as the TypedArray. @@ -178,9 +174,10 @@ declare var Buffer: { */ from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?:number): Buffer; /** - * Copies the passed {buffer} data onto a new Buffer instance. + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer */ - from(buffer: Buffer): Buffer; + from(data: any[] | string | Buffer | ArrayBuffer /*| TypedArray*/): Buffer; /** * Creates a new Buffer containing the given JavaScript string {str}. * If provided, the {encoding} parameter identifies the character encoding. @@ -2448,7 +2445,7 @@ declare module "assert" { operator?: string; stackStartFunction?: Function}); } - export function fail(actual: any, expected: any, message?: string, operator?: string): void; + export function fail(actual: any, expected: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; diff --git a/types/node/v4/node-tests.ts b/types/node/v4/node-tests.ts index 2b3be03f8d..6409e83e18 100644 --- a/types/node/v4/node-tests.ts +++ b/types/node/v4/node-tests.ts @@ -240,9 +240,19 @@ function bufferTests() { var result1 = Buffer.concat([utf8Buffer, base64Buffer]); var result2 = Buffer.concat([utf8Buffer, base64Buffer], 9999999); - // Class Method: Buffer.from(array) + // Class Method: Buffer.from(data) { - const buf: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Array + const buf1: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Buffer + const buf2: Buffer = Buffer.from(buf1); + // String + const buf3: Buffer = Buffer.from('this is a tést'); + // ArrayBuffer + const arr: Uint16Array = new Uint16Array(2); + arr[0] = 5000; + arr[1] = 4000; + const buf4: Buffer = Buffer.from(arr.buffer); } // Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) @@ -252,22 +262,15 @@ function bufferTests() { arr[1] = 4000; let buf: Buffer; - buf = Buffer.from(arr.buffer); buf = Buffer.from(arr.buffer, 1); buf = Buffer.from(arr.buffer, 0, 1); } - // Class Method: Buffer.from(buffer) - { - const buf1: Buffer = Buffer.from('buffer'); - const buf2: Buffer = Buffer.from(buf1); - } - // Class Method: Buffer.from(str[, encoding]) { - const buf1: Buffer = Buffer.from('this is a tést'); const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex'); } + // Class Method: Buffer.alloc(size[, fill[, encoding]]) { const buf1: Buffer = Buffer.alloc(5); diff --git a/types/node/v6/index.d.ts b/types/node/v6/index.d.ts index 3ca66a2df5..8cde8ee611 100644 --- a/types/node/v6/index.d.ts +++ b/types/node/v6/index.d.ts @@ -6,6 +6,7 @@ // Thomas Bouldin // Sebastian Silbermann // Alorel +// Hoàng Văn Khải // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /************************************************ @@ -163,10 +164,6 @@ declare var Buffer: { */ new (buffer: Buffer): Buffer; prototype: Buffer; - /** - * Allocates a new Buffer using an {array} of octets. - */ - from(array: any[]): Buffer; /** * When passed a reference to the .buffer property of a TypedArray instance, * the newly created Buffer will share the same allocated memory as the TypedArray. @@ -177,9 +174,10 @@ declare var Buffer: { */ from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; /** - * Copies the passed {buffer} data onto a new Buffer instance. + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer */ - from(buffer: Buffer): Buffer; + from(data: any[] | string | Buffer | ArrayBuffer /*| TypedArray*/): Buffer; /** * Creates a new Buffer containing the given JavaScript string {str}. * If provided, the {encoding} parameter identifies the character encoding. @@ -3003,11 +3001,11 @@ declare module "path" { /** * The platform-specific file separator. '\\' or '/'. */ - export var sep: string; + export var sep: '\\' | '/'; /** * The platform-specific file delimiter. ';' or ':'. */ - export var delimiter: string; + export var delimiter: ';' | ':'; /** * Returns an object from a path string - the opposite of format(). * @@ -3876,7 +3874,7 @@ declare module "assert" { }); } - export function fail(actual: any, expected: any, message?: string, operator?: string): void; + export function fail(actual: any, expected: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; diff --git a/types/node/v6/node-tests.ts b/types/node/v6/node-tests.ts index 6cfb45692b..f9d5a9cd62 100644 --- a/types/node/v6/node-tests.ts +++ b/types/node/v6/node-tests.ts @@ -321,9 +321,19 @@ function bufferTests() { buf.swap64(); } - // Class Method: Buffer.from(array) + // Class Method: Buffer.from(data) { - const buf: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Array + const buf1: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Buffer + const buf2: Buffer = Buffer.from(buf1); + // String + const buf3: Buffer = Buffer.from('this is a tést'); + // ArrayBuffer + const arr: Uint16Array = new Uint16Array(2); + arr[0] = 5000; + arr[1] = 4000; + const buf4: Buffer = Buffer.from(arr.buffer); } // Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) @@ -333,22 +343,15 @@ function bufferTests() { arr[1] = 4000; let buf: Buffer; - buf = Buffer.from(arr.buffer); buf = Buffer.from(arr.buffer, 1); buf = Buffer.from(arr.buffer, 0, 1); } - // Class Method: Buffer.from(buffer) - { - const buf1: Buffer = Buffer.from('buffer'); - const buf2: Buffer = Buffer.from(buf1); - } - // Class Method: Buffer.from(str[, encoding]) { - const buf1: Buffer = Buffer.from('this is a tést'); const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex'); } + // Class Method: Buffer.alloc(size[, fill[, encoding]]) { const buf1: Buffer = Buffer.alloc(5); diff --git a/types/node/v7/index.d.ts b/types/node/v7/index.d.ts index 748f932d80..e8290f204c 100644 --- a/types/node/v7/index.d.ts +++ b/types/node/v7/index.d.ts @@ -6,6 +6,7 @@ // Christian Vaagland Tellnes // Wilco Bakker // Sebastian Silbermann +// Hoàng Văn Khải // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /************************************************ @@ -174,10 +175,6 @@ declare var Buffer: { */ new (buffer: Buffer): Buffer; prototype: Buffer; - /** - * Allocates a new Buffer using an {array} of octets. - */ - from(array: any[]): Buffer; /** * When passed a reference to the .buffer property of a TypedArray instance, * the newly created Buffer will share the same allocated memory as the TypedArray. @@ -188,9 +185,10 @@ declare var Buffer: { */ from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; /** - * Copies the passed {buffer} data onto a new Buffer instance. + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer */ - from(buffer: Buffer): Buffer; + from(data: any[] | string | Buffer | ArrayBuffer /*| TypedArray*/): Buffer; /** * Creates a new Buffer containing the given JavaScript string {str}. * If provided, the {encoding} parameter identifies the character encoding. @@ -2024,6 +2022,9 @@ declare module "url" { export function format(urlObject: UrlObject | string): string; export function resolve(from: string, to: string): string; + export function domainToASCII(domain: string): string; + export function domainToUnicode(domain: string): string; + export interface URLFormatOptions { auth?: boolean; fragment?: boolean; @@ -3089,11 +3090,11 @@ declare module "path" { /** * The platform-specific file separator. '\\' or '/'. */ - export var sep: string; + export var sep: '\\' | '/'; /** * The platform-specific file delimiter. ';' or ':'. */ - export var delimiter: string; + export var delimiter: ';' | ':'; /** * Returns an object from a path string - the opposite of format(). * @@ -3981,7 +3982,7 @@ declare module "assert" { }); } - export function fail(actual: any, expected: any, message?: string, operator?: string): void; + export function fail(actual: any, expected: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; diff --git a/types/node/v7/node-tests.ts b/types/node/v7/node-tests.ts index eb25e01f10..0ea05066b4 100644 --- a/types/node/v7/node-tests.ts +++ b/types/node/v7/node-tests.ts @@ -303,9 +303,19 @@ function bufferTests() { buf.swap64(); } - // Class Method: Buffer.from(array) + // Class Method: Buffer.from(data) { - const buf: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Array + const buf1: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Buffer + const buf2: Buffer = Buffer.from(buf1); + // String + const buf3: Buffer = Buffer.from('this is a tést'); + // ArrayBuffer + const arr: Uint16Array = new Uint16Array(2); + arr[0] = 5000; + arr[1] = 4000; + const buf4: Buffer = Buffer.from(arr.buffer); } // Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) @@ -315,10 +325,15 @@ function bufferTests() { arr[1] = 4000; let buf: Buffer; - buf = Buffer.from(arr.buffer); buf = Buffer.from(arr.buffer, 1); buf = Buffer.from(arr.buffer, 0, 1); } + + // Class Method: Buffer.from(str[, encoding]) + { + const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex'); + } + // Class Method: Buffer.alloc(size[, fill[, encoding]]) { const buf1: Buffer = Buffer.alloc(5); @@ -334,18 +349,6 @@ function bufferTests() { const buf: Buffer = Buffer.allocUnsafeSlow(10); } - // Class Method: Buffer.from(buffer) - { - const buf1: Buffer = Buffer.from('buffer'); - const buf2: Buffer = Buffer.from(buf1); - } - - // Class Method: Buffer.from(str[, encoding]) - { - const buf1: Buffer = Buffer.from('this is a tést'); - const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex'); - } - // Test that TS 1.6 works with the 'as Buffer' annotation // on isBuffer. var a: Buffer | number; @@ -475,6 +478,11 @@ namespace url_tests { assert.equal(helloUrl.query.hello, 'world'); } + { + const ascii: string = url.domainToASCII('español.com'); + const unicode: string = url.domainToUnicode('xn--espaol-zwa.com'); + } + { let myURL = new url.URL('https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); assert.equal(myURL.hash, '#bar'); diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index 1697093de7..642a957eca 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -19,6 +19,7 @@ // Alberto Schiabel // Huw // Nicolas Even +// Hoàng Văn Khải // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -30,6 +31,7 @@ interface Console { Console: NodeJS.ConsoleConstructor; assert(value: any, message?: string, ...optionalParams: any[]): void; dir(obj: any, options?: NodeJS.InspectOptions): void; + debug(message?: any, ...optionalParams: any[]): void; error(message?: any, ...optionalParams: any[]): void; info(message?: any, ...optionalParams: any[]): void; log(message?: any, ...optionalParams: any[]): void; @@ -215,10 +217,6 @@ declare var Buffer: { */ new(buffer: Buffer): Buffer; prototype: Buffer; - /** - * Allocates a new Buffer using an {array} of octets. - */ - from(array: any[]): Buffer; /** * When passed a reference to the .buffer property of a TypedArray instance, * the newly created Buffer will share the same allocated memory as the TypedArray. @@ -229,9 +227,10 @@ declare var Buffer: { */ from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; /** - * Copies the passed {buffer} data onto a new Buffer instance. + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer */ - from(buffer: Buffer): Buffer; + from(data: any[] | string | Buffer | ArrayBuffer /*| TypedArray*/): Buffer; /** * Creates a new Buffer containing the given JavaScript string {str}. * If provided, the {encoding} parameter identifies the character encoding. @@ -526,6 +525,7 @@ declare namespace NodeJS { } export interface WriteStream extends Socket { + readonly writableHighWaterMark: number; columns?: number; rows?: number; _write(chunk: any, encoding: string, callback: Function): void; @@ -537,6 +537,7 @@ declare namespace NodeJS { destroy(error?: Error): void; } export interface ReadStream extends Socket { + readonly readableHighWaterMark: number; isRaw?: boolean; setRawMode?(mode: boolean): void; _read(size: number): void; @@ -791,6 +792,7 @@ declare namespace NodeJS { class Module { static runMain(): void; static wrap(code: string): string; + static builtinModules: string[]; static Module: typeof Module; @@ -943,6 +945,7 @@ declare module "http" { 'access-control-allow-headers'?: string; 'accept-patch'?: string; 'accept-ranges'?: string; + 'authorization'?: string; 'age'?: string; 'allow'?: string; 'alt-svc'?: string; @@ -1467,27 +1470,28 @@ declare module "zlib" { export function createInflateRaw(options?: ZlibOptions): InflateRaw; export function createUnzip(options?: ZlibOptions): Unzip; - export function deflate(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function deflate(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function deflateSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function deflateRaw(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function deflateRaw(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function deflateRawSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function gzip(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function gzip(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function gzipSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function gunzip(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function gunzip(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function gunzipSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function inflate(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function inflate(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function inflateSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function inflateRaw(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function inflateRaw(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function inflateRawSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function unzip(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function unzip(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function unzipSync(buf: Buffer | string, options?: ZlibOptions): Buffer; + type InputType = string | Buffer | DataView /* | TypedArray */; + export function deflate(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function deflate(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateSync(buf: InputType, options?: ZlibOptions): Buffer; + export function deflateRaw(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateRaw(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; + export function gzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function gzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function gzipSync(buf: InputType, options?: ZlibOptions): Buffer; + export function gunzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function gunzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer; + export function inflate(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function inflate(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateSync(buf: InputType, options?: ZlibOptions): Buffer; + export function inflateRaw(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateRaw(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; + export function unzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function unzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function unzipSync(buf: InputType, options?: ZlibOptions): Buffer; export namespace constants { // Allowed flush values. @@ -1990,10 +1994,10 @@ declare module "vm" { } export function createContext(sandbox?: Context): Context; export function isContext(sandbox: Context): boolean; - export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions): any; + export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any; export function runInDebugContext(code: string): any; - export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions): any; - export function runInThisContext(code: string, options?: RunningScriptOptions): any; + export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any; + export function runInThisContext(code: string, options?: RunningScriptOptions | string): any; } declare module "child_process" { @@ -2350,6 +2354,9 @@ declare module "url" { export function format(urlObject: UrlObject | string): string; export function resolve(from: string, to: string): string; + export function domainToASCII(domain: string): string; + export function domainToUnicode(domain: string): string; + export interface URLFormatOptions { auth?: boolean; fragment?: boolean; @@ -4658,11 +4665,11 @@ declare module "path" { /** * The platform-specific file separator. '\\' or '/'. */ - export var sep: string; + export var sep: '\\' | '/'; /** * The platform-specific file delimiter. ';' or ':'. */ - export var delimiter: string; + export var delimiter: ';' | ':'; /** * Returns an object from a path string - the opposite of format(). * @@ -5152,9 +5159,9 @@ declare module "crypto" { update(data: string, input_encoding: Utf8AsciiBinaryEncoding, output_encoding: HexBase64BinaryEncoding): string; final(): Buffer; final(output_encoding: string): string; - setAutoPadding(auto_padding?: boolean): void; + setAutoPadding(auto_padding?: boolean): this; getAuthTag(): Buffer; - setAAD(buffer: Buffer): void; + setAAD(buffer: Buffer): this; } export function createDecipher(algorithm: string, password: any): Decipher; export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher; @@ -5165,9 +5172,9 @@ declare module "crypto" { update(data: string, input_encoding: HexBase64BinaryEncoding, output_encoding: Utf8AsciiBinaryEncoding): string; final(): Buffer; final(output_encoding: string): string; - setAutoPadding(auto_padding?: boolean): void; - setAuthTag(tag: Buffer): void; - setAAD(buffer: Buffer): void; + setAutoPadding(auto_padding?: boolean): this; + setAuthTag(tag: Buffer): this; + setAAD(buffer: Buffer): this; } export function createSign(algorithm: string): Signer; export interface Signer extends NodeJS.WritableStream { @@ -5280,6 +5287,7 @@ declare module "stream" { export class Readable extends Stream implements NodeJS.ReadableStream { readable: boolean; + readonly readableHighWaterMark: number; constructor(opts?: ReadableOptions); _read(size: number): void; read(size?: number): any; @@ -5365,6 +5373,7 @@ declare module "stream" { export class Writable extends Stream implements NodeJS.WritableStream { writable: boolean; + readonly writableHighWaterMark: number; constructor(opts?: WritableOptions); _write(chunk: any, encoding: string, callback: (err?: Error) => void): void; _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (err?: Error) => void): void; @@ -5456,6 +5465,7 @@ declare module "stream" { // Note: Duplex extends both Readable and Writable. export class Duplex extends Readable implements Writable { writable: boolean; + readonly writableHighWaterMark: number; constructor(opts?: DuplexOptions); _write(chunk: any, encoding: string, callback: (err?: Error) => void): void; _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (err?: Error) => void): void; @@ -5582,8 +5592,8 @@ declare module "assert" { }); } - export function fail(message: string): void; - export function fail(actual: any, expected: any, message?: string, operator?: string): void; + export function fail(message: string): never; + export function fail(actual: any, expected: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; diff --git a/types/node/v8/node-tests.ts b/types/node/v8/node-tests.ts index b63d494fbd..2546184d0a 100644 --- a/types/node/v8/node-tests.ts +++ b/types/node/v8/node-tests.ts @@ -397,9 +397,19 @@ function bufferTests() { buf.swap64(); } - // Class Method: Buffer.from(array) + // Class Method: Buffer.from(data) { - const buf: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Array + const buf1: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Buffer + const buf2: Buffer = Buffer.from(buf1); + // String + const buf3: Buffer = Buffer.from('this is a tést'); + // ArrayBuffer + const arr: Uint16Array = new Uint16Array(2); + arr[0] = 5000; + arr[1] = 4000; + const buf4: Buffer = Buffer.from(arr.buffer); } // Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) @@ -409,22 +419,15 @@ function bufferTests() { arr[1] = 4000; let buf: Buffer; - buf = Buffer.from(arr.buffer); buf = Buffer.from(arr.buffer, 1); buf = Buffer.from(arr.buffer, 0, 1); } - // Class Method: Buffer.from(buffer) - { - const buf1: Buffer = Buffer.from('buffer'); - const buf2: Buffer = Buffer.from(buf1); - } - // Class Method: Buffer.from(str[, encoding]) { - const buf1: Buffer = Buffer.from('this is a tést'); const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex'); } + // Class Method: Buffer.alloc(size[, fill[, encoding]]) { const buf1: Buffer = Buffer.alloc(5); @@ -609,6 +612,11 @@ namespace url_tests { } } + { + const ascii: string = url.domainToASCII('español.com'); + const unicode: string = url.domainToUnicode('xn--espaol-zwa.com'); + } + { let myURL = new url.URL('https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); assert.equal(myURL.hash, '#bar'); @@ -2025,14 +2033,17 @@ namespace string_decoder_tests { namespace child_process_tests { { childProcess.exec("echo test"); + childProcess.exec("echo test", {windowsHide: true}); childProcess.spawnSync("echo test"); + childProcess.spawnSync("echo test", {windowsVerbatimArguments: false}); } { childProcess.execFile("npm", () => {}); + childProcess.execFile("npm", { windowsHide: true }, () => {}); childProcess.execFile("npm", ["-v"], () => {}); - childProcess.execFile("npm", ["-v"], { encoding: 'utf-8' }, (stdout, stderr) => { assert(stdout instanceof String); }); - childProcess.execFile("npm", ["-v"], { encoding: 'buffer' }, (stdout, stderr) => { assert(stdout instanceof Buffer); }); + childProcess.execFile("npm", ["-v"], { windowsHide: true, encoding: 'utf-8' }, (stdout, stderr) => { assert(stdout instanceof String); }); + childProcess.execFile("npm", ["-v"], { windowsHide: true, encoding: 'buffer' }, (stdout, stderr) => { assert(stdout instanceof Buffer); }); childProcess.execFile("npm", { encoding: 'utf-8' }, (stdout, stderr) => { assert(stdout instanceof String); }); childProcess.execFile("npm", { encoding: 'buffer' }, (stdout, stderr) => { assert(stdout instanceof Buffer); }); } @@ -2521,6 +2532,10 @@ namespace vm_tests { const Debug = vm.runInDebugContext('Debug'); Debug.scripts().forEach((script: any) => { console.log(script.name); }); } + + { + vm.runInThisContext('console.log("hello world"', './my-file.js'); + } } ///////////////////////////////////////////////////// @@ -3944,6 +3959,7 @@ namespace module_tests { const m1: Module = new Module("moduleId"); const m2: Module = new Module.Module("moduleId"); + const b: string[] = Module.builtinModules; let paths: string[] = module.paths; paths = m1.paths; } diff --git a/types/nodecredstash/index.d.ts b/types/nodecredstash/index.d.ts new file mode 100644 index 0000000000..9b2fed47c8 --- /dev/null +++ b/types/nodecredstash/index.d.ts @@ -0,0 +1,45 @@ +// Type definitions for nodecredstash 2.0 +// Project: https://github.com/DavidTanner/nodecredstash +// Definitions by: Mike Cook +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +import * as AWS from 'aws-sdk'; + +interface CredstashConfig { + table?: string; + awsOpts?: AWS.KMS.ClientConfiguration; + dynamoOpts?: AWS.DynamoDB.ClientConfiguration; + kmsKey?: string; + kmsOpts?: AWS.KMS.ClientConfiguration; +} + +interface CredstashContext { + [key: string]: string; +} + +interface PutSecretOptions { + name: string; + secret: string; + context: CredstashContext; + digest?: string; + version?: number; +} + +interface Credstash { + getHighestVersion: (options: { name: string }) => Promise; + incrementVersion: (options: { name: string }) => Promise; + putSecret: (options: PutSecretOptions) => Promise; + decryptStash: (stash: { key: string; }, context?: CredstashContext) => Promise; + getAllVersions: (options: { name: string, context?: CredstashContext, limit?: number }) => Promise>; + getSecret: (options: { name: string, context?: CredstashContext, version?: number }) => Promise; + deleteSecrets: (options: { name: string }) => Promise; + deleteSecret: (options: { name: string, version: number }) => Promise; + listSecrets: () => Promise; + getAllSecrets: (options: { version?: number, context?: CredstashContext, startsWith?: string }) => Promise<{ [key: string]: string }>; + createDdbTable: () => Promise; +} + +declare function Credstash(config: CredstashConfig): Credstash; + +export = Credstash; diff --git a/types/nodecredstash/nodecredstash-tests.ts b/types/nodecredstash/nodecredstash-tests.ts new file mode 100644 index 0000000000..f3788adc55 --- /dev/null +++ b/types/nodecredstash/nodecredstash-tests.ts @@ -0,0 +1,59 @@ +import Credstash = require('nodecredstash'); + +const credstash = Credstash({ + awsOpts: { region: 'us-east-1' }, + dynamoOpts: { accessKeyId: 'foo' }, + kmsKey: 'bar', + kmsOpts: { accessKeyId: 'baz' }, + table: 'something' +}); + +credstash.decryptStash({ key: 'foo' }).then((result) => { + return { + id: result.KeyId, + text: result.Plaintext + }; +}); + +credstash.deleteSecret({ name: 'foo', version: 1 }).then((result) => { + if (result.Attributes) return result.Attributes['blah']; + if (result.ConsumedCapacity) return result.ConsumedCapacity.TableName; + if (result.ItemCollectionMetrics) return result.ItemCollectionMetrics.ItemCollectionKey; +}); + +credstash.deleteSecrets({ name: 'foo' }).then((results) => { + const result = results[0]; + if (result.Attributes) return result.Attributes['blah'].toUpperCase(); + if (result.ConsumedCapacity) return result.ConsumedCapacity.TableName; + if (result.ItemCollectionMetrics) return result.ItemCollectionMetrics.ItemCollectionKey; +}); + +credstash.getAllSecrets({ version: 1 }).then((result) => { + return result['foo'].toUpperCase(); +}); + +credstash.getAllVersions({ name: 'foo', context: { bar: 'baz' }, limit: 1 }).then((result) => { + return result[0].secret.toUpperCase() + result[0].version.toUpperCase(); +}); + +credstash.getHighestVersion({ name: 'foo' }).then((result) => { + return result['foo'].S; +}); + +credstash.getSecret({ name: 'foo', version: 1, context: { bar: 'baz' } }).then((result) => { + return result.toUpperCase(); +}); + +credstash.incrementVersion({ name: 'foo' }).then((result) => { + return result.toUpperCase(); +}); + +credstash.listSecrets().then((result) => { + return result.map((str) => str.toUpperCase()); +}); + +credstash.putSecret({ name: 'foo', secret: 'bar', context: { baz: 'qux' }, digest: 'quux', version: 1 }).then((result) => { + if (result.Attributes) return result.Attributes['foo']; + if (result.ConsumedCapacity) return result.ConsumedCapacity.TableName; + if (result.ItemCollectionMetrics) return result.ItemCollectionMetrics.ItemCollectionKey; +}); diff --git a/types/nodecredstash/package.json b/types/nodecredstash/package.json new file mode 100644 index 0000000000..0347abc684 --- /dev/null +++ b/types/nodecredstash/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "aws-sdk": "^2.211.0" + }, + "private": true +} diff --git a/types/nodecredstash/tsconfig.json b/types/nodecredstash/tsconfig.json new file mode 100644 index 0000000000..ec4305243c --- /dev/null +++ b/types/nodecredstash/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", + "nodecredstash-tests.ts" + ] +} diff --git a/types/nodecredstash/tslint.json b/types/nodecredstash/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/nodecredstash/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/nodegit/checkout-options.d.ts b/types/nodegit/checkout-options.d.ts index d711ae7ba9..6971f59f3a 100644 --- a/types/nodegit/checkout-options.d.ts +++ b/types/nodegit/checkout-options.d.ts @@ -14,7 +14,7 @@ export class CheckoutOptions { notifyPayload?: undefined; progressCb?: any; progressPayload?: undefined; - paths?: Strarray; + paths?: Strarray | string | string[]; baseline?: Tree; baselineIndex?: Index; targetDirectory?: string; diff --git a/types/nodegit/diff-options.d.ts b/types/nodegit/diff-options.d.ts index 408a0530e1..3925f5c70c 100644 --- a/types/nodegit/diff-options.d.ts +++ b/types/nodegit/diff-options.d.ts @@ -4,7 +4,7 @@ export interface DiffOptions { version?: number; flags?: number; ignoreSubmodules?: number; - pathspec?: Strarray; + pathspec?: Strarray | string | string[]; notifyCb?: Function; contextLines?: number; interhunkLines?: number; diff --git a/types/nodegit/fetch-options.d.ts b/types/nodegit/fetch-options.d.ts index 77b5a9586c..6907db6bca 100644 --- a/types/nodegit/fetch-options.d.ts +++ b/types/nodegit/fetch-options.d.ts @@ -7,7 +7,7 @@ export interface FetchOptions { prune?: number; updateFetchhead?: number; downloadTags?: number; - customHeaders?: Strarray; + customHeaders?: Strarray | string | string[]; proxyOpts?: any; [key: string]: any; } diff --git a/types/nodegit/index_.d.ts b/types/nodegit/index_.d.ts index 3bf55c229d..aeea3c9b5a 100644 --- a/types/nodegit/index_.d.ts +++ b/types/nodegit/index_.d.ts @@ -26,7 +26,7 @@ export class Index { static open(indexPath: string): Promise; add(sourceEntry: IndexEntry): number; - addAll(pathspec: Strarray, flags: number, callback?: Function): Promise; + addAll(pathspec: Strarray | string | string[], flags: number, callback?: Function): Promise; addByPath(path: string): Promise; caps(): number; checksum(): Oid; @@ -44,11 +44,11 @@ export class Index { read(force: number): number; readTree(tree: Tree): number; remove(path: string, stage: number): number; - removeAll(pathspec: Strarray, callback?: Function): Promise; + removeAll(pathspec: Strarray | string | string[], callback?: Function): Promise; removeByPath(path: string): Promise; removeDirectory(dir: string, stage: number): number; setCaps(caps: number): number; - updateAll(pathspec: Strarray, callback?: Function): Promise; + updateAll(pathspec: Strarray | string | string[], callback?: Function): Promise; write(): number; writeTree(): Promise; writeTreeTo(repo: Repository): Promise; diff --git a/types/nodegit/path-spec.d.ts b/types/nodegit/path-spec.d.ts index 99435d5e0d..31b58f0149 100644 --- a/types/nodegit/path-spec.d.ts +++ b/types/nodegit/path-spec.d.ts @@ -23,7 +23,7 @@ export class Pathspec { static matchListEntrycount(m: any): number; static matchListFailedEntry(m: any, pos: number): string; static matchListFailedEntrycount(m: any): number; - static create(pathspec: Strarray): Pathspec; + static create(pathspec: Strarray | string | string[]): Pathspec; free(): void; matchDiff(diff: Diff, flags: number): Promise; diff --git a/types/nodegit/push-options.d.ts b/types/nodegit/push-options.d.ts index b736325f91..5f7625db2e 100644 --- a/types/nodegit/push-options.d.ts +++ b/types/nodegit/push-options.d.ts @@ -6,7 +6,7 @@ export interface PushOptions { version?: number; pbParallelism?: number; callbacks?: RemoteCallbacks; - customHeaders?: Strarray; + customHeaders?: Strarray | string | string[]; proxyOpts?: ProxyOptions; [key: string]: any; } diff --git a/types/nodegit/remote.d.ts b/types/nodegit/remote.d.ts index 61fdc63d1c..8a77f4ea69 100644 --- a/types/nodegit/remote.d.ts +++ b/types/nodegit/remote.d.ts @@ -62,7 +62,7 @@ export class Remote { stop(): void; updateTips(callbacks: RemoteCallbacks, updateFetchhead: number, downloadTags: number, reflogMessage: string): number; - upload(refspecs: Strarray, opts?: PushOptions): number; + upload(refspecs: Strarray | string | string[], opts?: PushOptions): number; url(): string; /** * Lists advertised references from a remote. You must connect to the remote before using referenceList. diff --git a/types/nodegit/reset.d.ts b/types/nodegit/reset.d.ts index 800ad34434..9051fa693b 100644 --- a/types/nodegit/reset.d.ts +++ b/types/nodegit/reset.d.ts @@ -20,7 +20,7 @@ export class Reset { /** * Look up a refs's commit. */ - static default(repo: Repository, target: Object, pathspecs: Strarray): Promise; + static default(repo: Repository, target: Object, pathspecs: Strarray | string | string[]): Promise; /** * Sets the current head to the specified commit oid and optionally resets the index and working tree to match. * This behaves like reset but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages. diff --git a/types/nodegit/status-options.d.ts b/types/nodegit/status-options.d.ts index 363dcd1fbb..f0189706bd 100644 --- a/types/nodegit/status-options.d.ts +++ b/types/nodegit/status-options.d.ts @@ -4,6 +4,6 @@ export interface StatusOptions { version?: number; show?: number; flags?: number; - pathspec?: Strarray; + pathspec?: Strarray | string | string[]; [key: string]: any; } diff --git a/types/nodegit/tag.d.ts b/types/nodegit/tag.d.ts index 3f6b5aa836..08d25859d2 100644 --- a/types/nodegit/tag.d.ts +++ b/types/nodegit/tag.d.ts @@ -10,7 +10,7 @@ export class Tag { static createLightweight(repo: Repository, tagName: string, target: Object, force: number): Promise; static delete(repo: Repository, tagName: string): Promise; static list(repo: Repository): Promise; - static listMatch(tagNames: Strarray, pattern: string, repo: Repository): number; + static listMatch(tagNames: Strarray | string | string[], pattern: string, repo: Repository): number; /** * Retrieves the tag pointed to by the oid * diff --git a/types/nodegit/transport.d.ts b/types/nodegit/transport.d.ts index 4cdd39f400..f4f4721333 100644 --- a/types/nodegit/transport.d.ts +++ b/types/nodegit/transport.d.ts @@ -9,7 +9,7 @@ export namespace Transport { } export class Transport { - static sshWithPaths(owner: Remote, payload: Strarray): Promise; + static sshWithPaths(owner: Remote, payload: Strarray | string | string[]): Promise; static unregister(prefix: string): number; init(version: number): number; smartCertificateCheck(cert: Cert, valid: number, hostName: string): number; diff --git a/types/oauth/index.d.ts b/types/oauth/index.d.ts new file mode 100644 index 0000000000..21b74369e9 --- /dev/null +++ b/types/oauth/index.d.ts @@ -0,0 +1,315 @@ +// Type definitions for oauth 0.9 +// Project: https://github.com/ciaranj/node-oauth#readme +// Definitions by: nonAlgebraic +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Agent, ClientRequest, IncomingMessage, OutgoingHttpHeaders, RequestOptions } from 'http'; + +import { UrlWithStringQuery } from 'url'; + +export type oauth1tokenCallback = ( + err: {statusCode: number, data?: any}, + token: string, + token_secret: string, + parsedQueryString: any +) => any; + +export type oauth2tokenCallback = ( + err: {statusCode: number, data?: any}, + access_token: string, + refresh_token: string, + result: any +) => any; + +export type dataCallback = ( + err: {statusCode: number, data?: any}, + result: string | Buffer, + response: IncomingMessage +) => any; + +export class OAuth { + protected _isEcho: boolean; + protected _requestUrl: string; + protected _accessUrl: string; + protected _consumerKey: string; + protected _consumerSecret: string; + protected _protectedKey: string; + protected _version: string; + protected _authorize_callback: string; + protected _signatureMethod: string; + protected _nonceSize: number; + protected _headers: OutgoingHttpHeaders; + protected _clientOptions: { + requestTokenHttpMethod: string, + accessTokenHttpMethod: string, + followRedirects: boolean + }; + protected _oauthParameterSeperator: string; + protected _realm: string; + protected _verifyCredentials: string; + + NONCE_CHARS: string[]; + + constructor( + requestUrl: string, + accessUrl: string, + consumerKey: string, + consumerSecret: string, + version: string, + authorize_callback: string | null, + signatureMethod: string, + nonceSize?: number, + customHeaders?: OutgoingHttpHeaders + ); + + setClientOptions(options: { + requestTokenHttpMethod: string, + accessTokenHttpMethod: string, + followRedirects: boolean + }): void; + + getOAuthAccessToken( + oauth_token: string, + oauth_token_secret: string, + oauth_verifier: string, + callback: oauth1tokenCallback + ): void; + getOAuthAccessToken( + oauth_token: string, + oauth_token_secret: string, + callback: oauth1tokenCallback + ): void; + + getProtectedResource( + url: string, + method: string, + oauth_token: string, + oauth_token_secret: string, + callback: dataCallback + ): void; + + delete( + url: string, + oauth_token: string, + oauth_token_secret: string, + callback: dataCallback + ): ClientRequest; + + get( + url: string, + oauth_token: string, + oauth_token_secret: string, + callback: dataCallback + ): ClientRequest; + + put( + url: string, + oauth_token: string, + oauth_token_secret: string, + post_body?: any, + post_content_type?: string, + callback?: dataCallback + ): ClientRequest; + + post( + url: string, + oauth_token: string, + oauth_token_secret: string, + post_body?: any, + post_content_type?: string, + callback?: dataCallback + ): ClientRequest; + + getOAuthRequestToken( + extraparams: any, + callback: oauth1tokenCallback + ): void; + getOAuthRequestToken(callback: oauth1tokenCallback): void; + + signUrl( + url: string, + oauth_token: string, + oauth_token_secret: string, + method?: string + ): string; + + authHeader( + url: string, + oauth_token: string, + oauth_token_secret: string, + method?: string + ): string; + + protected _getTimestamp(): number | string; + + protected _encodeData(toEncode: string): string; + + protected _decodeData(toDecode: string): string; + + protected _getSignature( + method: string, + url: string, + parameters: string, + tokenSecret: string + ): string; + + protected _normalizeUrl(url: string): string; + + protected _isParameterNameAnOAuthParameter(parameter: string): boolean; + + protected _buildAuthorizationHeaders(orderedParameters: string[][]): string; + + protected _makeArrayOfArgumentsHash( + argumentHash: {[key: string]: string | string[]} + ): string[][]; + + protected _sortRequestParams(argument_pairs: string[][]): string[][]; + + protected _normaliseRequestParams(args: string[][]): string; + + protected _createSignatureBase( + method: string, + url: string, + parameters: string + ): string; + + protected _createSignature(signatureBase: string, tokenSecret: string): string; + + protected _getNonce(nonceSize: number): string; + + protected _createClient( + port?: number | string, + hostname?: string, + method?: string, + path?: string, + headers?: OutgoingHttpHeaders, + sslEnabled?: boolean + ): ClientRequest; + + protected _prepareParameters( + oauth_token: string, + oauth_token_secret: string, + method: string, + url: string, + extra_params?: any + ): string[][]; + protected _prepareParameters( + oauth_token_secret: string, + method: string, + url: string, + extra_params?: any + ): string[][]; + + protected _performSecureRequest( + oauth_token: string, + oauth_token_secret: string, + method: string, + url: string, + extra_params?: any, + post_body?: any, + post_content_type?: string, + callback?: dataCallback + ): ClientRequest; + + protected _putOrPost( + method: string, + url: string, + oauth_token: string, + oauth_token_secret: string, + post_body?: any, + post_content_type?: string, + callback?: dataCallback + ): ClientRequest; +} + +export class OAuthEcho extends OAuth { + constructor( + realm: string, + verify_credentials: string, + consumerKey: string, + consumerSecret: string, + version: string, + signatureMethod: string, + nonceSize?: number, + customHeaders?: OutgoingHttpHeaders + ); +} + +export class OAuth2 { + protected _clientId: string; + protected _clientSecret: string; + protected _baseSite: string; + protected _authorizeUrl: string; + protected _accessTokenUrl: string; + protected _accessTokenName: string; + protected _authMethod: string; + protected _customHeaders: OutgoingHttpHeaders; + protected _useAuthorizationHeaderForGET: boolean; + protected _agent: Agent | boolean; + + constructor( + clientId: string, + clientSecret: string, + baseSite: string, + authorizePath?: string, + accessTokenPath?: string, + customHeaders?: OutgoingHttpHeaders + ); + + setAgent(agent: Agent | boolean): void; + + setAccessTokenName(name: string): void; + + setAuthMethod(authMethod: string): void; + + useAuthorizationHeaderforGET(useIt: boolean): void; + + buildAuthHeader(token: string): string; + + getAuthorizeUrl(params?: any): string; + + getOAuthAccessToken( + code: string, + params: any, + callback: oauth2tokenCallback + ): void; + getOAuthAccessToken(code: string, callback: oauth2tokenCallback): void; + + getProtectedResource( + url: string, + access_token: string, + callback: dataCallback + ): void; + + get(url: string, + access_token: string, + callback: string + ): void; + + protected _getAccessTokenUrl(): string; + + protected _chooseHttpLibrary(parsedUrl: UrlWithStringQuery): string; + + protected _request( + method: string, + url: string, + headers: OutgoingHttpHeaders | null, + post_body: any, + access_token: string | null, + callback: dataCallback + ): void; + + protected _executeRequest( + http_library: string, + options: RequestOptions, + post_body: any, + callback: dataCallback + ): void; + protected _executeRequest( + http_library: string, + options: RequestOptions, + callback: dataCallback + ): void; +} diff --git a/types/oauth/oauth-tests.ts b/types/oauth/oauth-tests.ts new file mode 100644 index 0000000000..3218a46754 --- /dev/null +++ b/types/oauth/oauth-tests.ts @@ -0,0 +1,68 @@ +import { OAuth2 } from 'oauth'; + +import http = require('http'); +import qs = require('querystring'); + +const clientID = ''; +const clientSecret = ''; +const oauth2 = new OAuth2(clientID, + clientSecret, + 'https://github.com/', + 'login/oauth/authorize', + 'login/oauth/access_token'); + +http.createServer((req, res) => { + const p: string[] = []; + if (req.url) { + req.url.split('/'); + } + const pLen = p.length; + + /** + * Authorised url as per github docs: + * https://developer.github.com/v3/oauth/#redirect-users-to-request-github-access + * + * getAuthorizedUrl: https://github.com/ciaranj/node-oauth/blob/master/lib/oauth2.js#L148 + * Adding params to authorize url with fields as mentioned in github docs + * + */ + const authURL = oauth2.getAuthorizeUrl({ + redirect_uri: 'http://localhost:8080/code', + scope: ['repo', 'user'], + state: 'some random string to protect against cross-site request forgery attacks' + }); + + /** + * Creating an anchor with authURL as href and sending as response + */ + const body = ` Get Code `; + if (pLen === 2 && p[1] === '') { + res.writeHead(200, { + 'Content-Length': body.length, + 'Content-Type': 'text/html' }); + res.end(body); + } else if (pLen === 2 && p[1].indexOf('code') === 0) { + /** Github sends auth code so that access_token can be obtained */ + /** To obtain and parse code='...' from code?code='...' */ + const qsObj = qs.parse<{[key: string]: string}>(p[1].split('?')[1]); + + /** Obtaining access_token */ + oauth2.getOAuthAccessToken( + qsObj['code'], + {redirect_uri: 'http://localhost:8080/code/'}, + (e, access_token, refresh_token, results) => { + if (e) { + console.log(e); + res.end(e); + } else if (results.error) { + console.log(results); + res.end(JSON.stringify(results)); + } else { + console.log('Obtained access_token: ', access_token); + res.end(access_token); + } + }); + } else { + // Unhandled url + } +}).listen(8080); diff --git a/types/oauth/tsconfig.json b/types/oauth/tsconfig.json new file mode 100644 index 0000000000..1c60786e15 --- /dev/null +++ b/types/oauth/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", + "oauth-tests.ts" + ] +} diff --git a/types/oauth/tslint.json b/types/oauth/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/oauth/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 3b1173505d..e08e0f1ee0 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -8,6 +8,11 @@ office-js Copyright (c) Microsoft Corporation */ + +//////////////////////////////////////////////////////////////// +//////////////////// Begin Office namespace //////////////////// +//////////////////////////////////////////////////////////////// + declare namespace Office { export var context: Context; /** @@ -178,15 +183,15 @@ declare namespace Office { messageParent(messageObject: any): void; /** * Closes the UI container where the JavaScript is executing. - * + * * Supported hosts: Outlook - Minimum requirement set: Mailbox 1.5 - * + * * The behavior of this method is specified by the following: - * + * * Called from a UI-less command button: No effect. Any dialog opened by displayDialogAsync will remain open. - * + * * Called from a taskpane: The taskpane will close. Any dialog opened by displayDialogAsync will also close. If the taskpane supports pinning and was pinned by the user, it will be un-pinned. - * + * * Called from a module extension: No effect. */ closeContainer(): void; @@ -1548,6 +1553,12 @@ declare namespace Office { } +//////////////////////////////////////////////////////////////// +///////////////////// End Office namespace ///////////////////// +//////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////// @@ -2091,6 +2102,19 @@ declare namespace Office { * Returns string values that match the named regular expression defined in the manifest XML file */ getRegExMatchesByName(name: string): Array; + /** + * Gets the entities found in the selected item that are currently selected + * + * [Api set: Mailbox 1.6] + */ + getSelectedEntities(): Entities; + /** + * Returns string values in the currently selected message object that match the regular expressions defined in the manifest XML file and + * are selected in the current item + * + * [Api set: Mailbox 1.6] + */ + getSelectedRegExMatches(): any; } export interface LocalClientTime { month: number; @@ -2597,12 +2621,12 @@ declare namespace OfficeExtension { } export interface EmbeddedOptions { - sessionKey?: string, - container?: HTMLElement, - id?: string; - timeoutInMilliseconds?: number; - height?: string; - width?: string; + sessionKey?: string, + container?: HTMLElement, + id?: string; + timeoutInMilliseconds?: number; + height?: string; + width?: string; } class EmbeddedSession { @@ -2886,6 +2910,18 @@ declare namespace OfficeExtension { } +//////////////////////////////////////////////////////////////// +///////////////// End OfficeExtension runtime ////////////////// +//////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////// +////////////////////// Begin OfficeCore //////////////////////// +//////////////////////////////////////////////////////////////// + declare namespace OfficeCore { /** @@ -2960,7 +2996,7 @@ declare namespace OfficeCore { //////////////////////////////////////////////////////////////// -///////////////// End OfficeExtension runtime ////////////////// +/////////////////////// End OfficeCore ///////////////////////// //////////////////////////////////////////////////////////////// @@ -22317,6 +22353,10 @@ declare namespace OneNote { +//////////////////////////////////////////////////////////////// + + + //////////////////////////////////////////////////////////////// /////////////////////// Begin Visio APIs /////////////////////// //////////////////////////////////////////////////////////////// diff --git a/types/openfin/index.d.ts b/types/openfin/index.d.ts index 30afded19b..9428247938 100644 --- a/types/openfin/index.d.ts +++ b/types/openfin/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for OpenFin API 17.0 +// Type definitions for OpenFin API 29.0 // Project: https://openfin.co/ // Definitions by: Chris Barker +// Ricardo de Pena // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// based on v6.49.17.14 +// based on v8.56.29.51 // see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean /** @@ -18,1715 +19,1873 @@ * * Overview * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API - * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. + * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "documennt" objects. */ declare namespace fin { - const desktop: OpenFinDesktop; + const desktop: OpenFinDesktop; - interface OpenFinDesktop { - main(f: () => any): void; - Application: OpenFinApplicationStatic; - ExternalApp: OpenFinExternalApplicationStatic; - InterApplicationBus: OpenFinInterApplicationBus; - Notification: OpenFinNotificationStatic; - System: OpenFinSystem; - Window: OpenFinWindowStatic; - } + interface OpenFinDesktop { + main(f: () => any): void; + Application: OpenFinApplicationStatic; + ExternalApp: OpenFinExternalApplicationStatic; + InterApplicationBus: OpenFinInterApplicationBus; + Notification: OpenFinNotificationStatic; + System: OpenFinSystem; + Window: OpenFinWindowStatic; + Frame: OpenFinFrameStatic; + } - interface OpenFinApplicationStatic { - /** - * Creates a new Application. - * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. - */ - new ( - options: ApplicationOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; - /** - * Returns an Application object that represents an existing application. - */ - getCurrent(): OpenFinApplication; - /** - * Returns an Application object that represents an existing application. - */ - wrap(uuid: string): OpenFinApplication; - } + interface OpenFinApplicationStatic { + /** + * Creates a new Application. + * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. + */ + new ( + options: ApplicationOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; + /** + * Launches the given Application manifest. + */ + createFromManifest(manifestUrl: string, callback?: (app: OpenFinApplication) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Returns an Application object that represents an existing application. + */ + getCurrent(): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + wrap(uuid: string): OpenFinApplication; + } - /** - * Application - * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. - */ - interface OpenFinApplication { - /** - * Returns an instance of the main Window of the application - */ - getWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinApplicationEventType, - listener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Closes the application and any child windows created by the application. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. - */ - getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. - */ - getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. - */ - getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. - */ - getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves current configuration of application's shortcuts. - */ - getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves information about the application. - */ - getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the application is currently running. - */ - isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Passes in custom data that will be relayed to the RVM - */ - registerCustomData(data: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinApplicationEventType, - previouslyRegisteredListener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => any, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the application's icon from the tray. - */ - removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restarts the application. - */ - restart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Runs the application. When the application is created, run must be called. - */ - run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * Tells the rvm to relaunch the main application once upon a complete shutdown - */ - scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets new shortcut configuration for current application. - * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to - * be able to change shortcut states. - */ - setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Adds a customizable icon in the system tray and notifies the application when clicked. - */ - setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the application by terminating its process. - */ - terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application - * to continue and to generate another "not-responding" message after a certain period of time. - */ - wait(callback?: () => void, errorCallback?: (reason: string) => void): void; - } + /** + * Application + * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. + */ + interface OpenFinApplication { + /** + * Returns an instance of the main Window of the application + */ + getWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinApplicationEventType, + listener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Closes the application and any child windows created by the application. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. + */ + getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. + */ + getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. + */ + getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. + */ + getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves current configuration of application's shortcuts. + */ + getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the system tray. + */ + getTrayIconInfo(callback?: (trayInfo: TrayIconInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the application is currently running. + */ + isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Registers a username and an app name for licensing purposes. + */ + registerUser(userName: string, appName: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinApplicationEventType, + previouslyRegisteredListener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => any, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the application's icon from the tray. + */ + removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restarts the application. + */ + restart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Runs the application. When the application is created, run must be called. + */ + run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Tells the rvm to relaunch the main application once upon a complete shutdown + */ + scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets new shortcut configuration for current application. + * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to + * be able to change shortcut states. + */ + setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Adds a customizable icon in the system tray and notifies the application when clicked. + */ + setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the application by terminating its process. + */ + terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application + * to continue and to generate another "not-responding" message after a certain period of time. + */ + wait(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * The Application's uuid + */ + uuid: string; + } - interface ShortCutConfig { - /** - * application has a shortcut on the desktop - */ - desktop?: boolean; - /** - * application has no shortcut in the start menu - */ - startMenu?: boolean; - /** - * application will be launched on system startup - */ - systemStartup?: boolean; - } + interface ShortCutConfig { + /** + * application has a shortcut on the desktop + */ + desktop?: boolean; + /** + * application has no shortcut in the start menu + */ + startMenu?: boolean; + /** + * application will be launched on system startup + */ + systemStartup?: boolean; + } - interface SuccessObj { - httpResponseCode: number; - } + interface SuccessObj { + httpResponseCode: number; + } - interface NetworkErrorInfo extends ErrorInfo { - networkErrorCode: number; - } + interface NetworkErrorInfo extends ErrorInfo { + networkErrorCode: number; + } - interface ErrorInfo { - stack: string; - message: string; - } + interface ErrorInfo { + stack: string; + message: string; + } - interface ApplicationOptions { - /** - * The name of the application. - */ - name?: string; - /** - * The url to the application. - */ - url?: string; - /** - * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. - */ - uuid?: string; - /** - * Enable Flash at the application level. Default: false. - */ - plugins?: boolean; - /** - * The options of the main window of the application. - */ - mainWindowOptions?: WindowOptions; - } + interface ApplicationOptions { + /** + * The name of the application. + */ + name?: string; + /** + * The url to the application. + */ + url?: string; + /** + * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. + */ + uuid?: string; + /** + * Enable Flash at the application level. Default: false. + */ + plugins?: boolean; + /** + * The options of the main window of the application. + */ + mainWindowOptions?: WindowOptions; + } - interface WindowOptions { - /** - * Enable keyboard shortcuts for devtools and zoom. Default: false for both. - */ - accelerator?: { - devtools?: boolean, - zoom?: boolean, - reload?: boolean, - reloadIgnoreCache?: boolean, + interface WindowOptions { + /** + * Enable keyboard shortcuts for devtools and zoom. Default: false for both. + */ + accelerator?: { + devtools?: boolean, + zoom?: boolean, + reload?: boolean, + reloadIgnoreCache?: boolean, + }; + /** + * A flag to always position the window at the top of the window stack. Default: false. + * Updatable + */ + alwaysOnTop?: boolean; + /** + * A flag to automatically show the Window when it is created. Default: false. + */ + autoShow?: boolean; + /** + * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true + * Updatable + */ + contextMenu?: boolean; + /** + * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. + * Updatable + */ + cornerRounding?: { + width?: number; + height?: number; + }; + /** + * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. + */ + customData?: any; + /** + * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the position from before the window was closed is used. + * This option overrides defaultLeft and defaultTop. Default: false. + */ + defaultCentered?: boolean; + /** + * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. + */ + defaultHeight?: number; + /** + * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. + */ + defaultWidth?: number; + /** + * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. + */ + defaultTop?: number; + /** + * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. + */ + defaultLeft?: number; + /** + * A flag to show the frame. Default: true. + * Updatable + */ + frame?: boolean; + /** + * A flag to allow a window to be hidden when the close button is clicked.Default: false. + * Updatable + */ + hideOnClose?: boolean; + /** + * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. + * Updatable + */ + icon?: string; + /** + * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxHeight?: number; + /** + * A flag that lets the window be maximized.Default: true. + * Updatable + */ + maximizable?: boolean; + /** + * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxWidth?: number; + /** + * The minimum height of a window.Default: 0. + * Updatable + */ + minHeight?: number; + /** + * A flag that lets the window be minimized.Default: true. + */ + minimizable?: boolean; + /** + * The minimum width of a window.Default: 0. + */ + minWidth?: number; + /** + * The name for the window which must be unique within the context of the invoking Application. + */ + name?: string; + /** + * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. + * Updatable + */ + opacity?: number; + /** + * A flag to drop to allow the user to resize the window.Default: true. + * Updatable + */ + resizable?: boolean; + /** + * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. + * Updatable + */ + resizeRegion?: { + /** + * The size in pixels (Default: 2), + */ + size?: number; + /** + * The size in pixels of an additional + * square resizable region located at the + * bottom right corner of a + * frameless window. (Default: 4) + */ + bottomRightCorner?: number; + }; + /** + * A flag to show the Window's icon in the taskbar. Default: true. + */ + showTaskbarIcon?: boolean; + /** + * A flag to cache the location of the window or not. Default: true. + */ + saveWindowState?: boolean; + /** + * Specify a taskbar group for the window. Default: app's uuid. + */ + taskbarIconGroup?: string; + /** + * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". + */ + state?: string; + /** + * The URL of the window. Default: "about:blank". + */ + url?: string; + /** + * When set to false, the window will render before the "load" event is fired on the content's window. + * Caution, when false you will see an initial empty white window. Default: true. + */ + waitForPageLoad?: boolean; + } + + /** + * Clipboard + * Clipboard API allows reading and writting to the clipboard in multiple formats. + */ + interface OpenFinClipboard { + /** + * Reads available formats for the clipboard type + */ + availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Reads available formats for the clipboard type + */ + readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as Rtf + */ + readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as plain text + */ + readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard + */ + write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Html + */ + writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Rtf + */ + writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as plain text + */ + writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + interface OpenFinExternalApplicationStatic { + /** + * Returns an External Application object that represents an existing external application. + */ + wrap(uuid: string): OpenFinExternalApplication; + } + /** + * ExternalApplication + * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. + */ + interface OpenFinExternalApplication { + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: ExternalApplicationInfo) => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + /** + * InterApplicationBus + * A messaging bus that allows for pub/sub messaging between different applications. + */ + interface OpenFinInterApplicationBus { + /** + * Adds a listener that gets called when applications subscribe to the current application's messages. + */ + addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Adds a listener that gets called when applications unsubscribe to the current application's messages. + */ + addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered subscribe listener. + */ + removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered unsubscribe listener. + */ + removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. + */ + publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sends a message to a specific application on a specific topic. + */ + send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], + * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. + */ + subscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + subscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Unsubscribes to messages from the specified application on the specified topic. + */ + unsubscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + unsubscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + } + + interface OpenFinNotificationStatic { + /** + * ctor + */ + new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; + /** + * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. + */ + getCurrent(): OpenFinNotification; + } + + /** + * Notification + * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. + * A notification is typically used to alert the user of some important event which requires his or her attention. + * Notifications are a child or your application that are controlled by the runtime. + */ + interface OpenFinNotification { + /** + * Closes the notification. + */ + close(callback?: () => void): void; + /** + * Sends a message to the notification. + */ + sendMessage(message: any, callback?: () => void): void; + /** + * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. + */ + sendMessageToApplication(message: any, callback?: () => void): void; + } + + interface NotificationOptions { + /** + * A boolean that will force dismissal even if the mouse is hovering over the notification + */ + ignoreMouseOver?: boolean; + /** + * A message of any primitive or composite-primitive type to be passed to the notification upon creation. + */ + message?: any; + /** + * The timeout for displaying a notification.Can be in milliseconds or "never". + */ + duration?: number | "never"; + /** + * The url of the notification + */ + url?: string; + /** + * A function that is called when a notification is clicked. + */ + onClick?(callback: () => void): void; + /** + * Invoked when the notification is closed via .close() method on the created notification instance + * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). + * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss + */ + onClose?(callback: () => void): void; + /** + * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. + */ + onDismiss?(callback: () => void): void; + /** + * A function that is called when an error occurs.The reason for the error is passed as an argument. + */ + onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * The onMessage function will respond to messages sent from notification.sendMessageToApplication. + * The function is passed the message, which can be of any primitive or composite-primitive type. + */ + onMessage?(callback: (message: any) => void): void; + /** + * A function that is called when a notification is shown. + */ + onShow?(callback: (successObj: SuccessObj) => void): void; + } + + /** + * System + * An object representing the core of OpenFin Runtime. + * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. + */ + interface OpenFinSystem { + Clipboard: OpenFinClipboard; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Clears cached data containing window state/positions, + * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. + */ + clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Clears all cached data when OpenFin Runtime exits. + */ + deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Downloads the given application asset + */ + downloadAsset( + assetObj: AppAssetInfo, + progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, + callback?: (successObj: { path: string }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + + /** + * Download preload scripts from given URLs + */ + downloadPreloadScripts(scripts: DownloadPreloadOption[], callback?: (downloadInfo: DownloadPreloadInfo[]) => void, + errorCallback?: (reason: string) => void): void; + /** + * Downloads the given OpenFin Runtime. + */ + downloadRuntime(options: RuntimeDownloadOptions, onProgress?: (progress: RuntimeDownloadProgress) => void, onComplete?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Exits the Runtime. + */ + exit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Writes any unwritten cookies data to disk. + */ + flushCookieStore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all applications. + */ + getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all external applications. + */ + getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data (name, ids, bounds) for all application windows. + */ + getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the app asset. + */ + getAppAssetInfo(options: AppAssetOptions, callback?: (appAssetInfo: AppAssetInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Get additional info of cookies. + */ + getCookies(option: CookieOption, callback?: (info: CookieInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the command line argument string that started OpenFin Runtime. + */ + getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the configuration object that started the OpenFin Runtime. + */ + getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns a hex encoded hash of the mac address and the currently logged in user name + */ + getDeviceUserId(callback?: (id: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns an Entity info object relating to the entity specified by the uuid and name passed in. The possible types are 'window', 'iframe', 'external connection' or 'unknown'. + */ + getEntityInfo(uuid: string, name: string, callback?: (info: EntityInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the value of a given environment variable on the computer on which the runtime is installed. + */ + getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves currently focused window identity. + */ + getFocusedWindow(callback?: (focusedWindowIdentity: Identity) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves system information. + */ + getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the contents of the log with the specified filename. + */ + getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing information for each log file. + */ + getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the minimum (inclusive) logging level that is currently being written to the logs. + */ + getMinLogLevel(callback?: (logLevel: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. + */ + getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the mouse in virtual screen coordinates (left, top). + */ + getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of all of the runtime processes that are currently running. + * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. + */ + getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the Proxy settings. + */ + getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the running RVM in an object. + */ + getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. + */ + getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Runs an executable or batch file. + */ + launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Writes the passed message into both the log file and the console. + */ + log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Monitors a running process. + */ + monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + readRegistryValue(rootKey: string, subkey: string, value: string, callback?: (info: RegistryInfo) => void, + errorCallback?: (reason: string) => void): void; + /** + * This function call will register a unique id and produce a token. The token can be used to broker an external connection. + */ + registerExternalConnection( + uuid: string, + callback?: (detail: { + /** + * this will be unique each time + */ + token: string; + /** + * "remote-connection-uuid" + */ + uuid: string; + }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). + */ + releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Set the minimum log level above which logs will be written to the OpenFin log + */ + setMinLogLevel(logLevel: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the Chrome Developer Tools for the specified window. + */ + showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. + */ + terminateExternalProcess( + processUuid: string, + timeout: number, + killTree: boolean, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + terminateExternalProcess( + processUuid: string, + timeout: number, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Update the OpenFin Runtime Proxy settings. + */ + updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface CacheOptions { + cache?: boolean; + cookies?: boolean; + localStorage?: boolean; + appcache?: boolean; + userData?: boolean; + } + + interface AppAssetInfo { + src?: string; + alias?: string; + version?: string; + target?: string; + args?: string; + mandatory?: boolean; + } + + interface AppAssetOptions { + alias: string; + } + + interface ApplicationInfo { + /** + * true when the application is running. + */ + isRunning?: boolean; + /** + * uuid of the application. + */ + uuid?: string; + /** + * uuid of the application that launches this application. + */ + parentUuid?: string; + } + + interface Identity { + uuid: string; + name: string; + } + + interface EntityInfo { + name: string; + uuid: string; + parent: Identity; + entityType: string; + } + + interface DownloadPreloadOption { + url: string; + } + + interface DownloadPreloadInfo { + success: boolean; + url?: string; + error: string; + } + + interface CookieInfo { + name: string; + // expirationDate: Date; + domain: string; + path: string; + } + + interface CookieOption { + name: string; + } + + interface RegistryInfo { + data: any; + rootKey: string; + subkey: string; + type: string; + value: string; + } + + interface RuntimeDownloadOptions { + version: string; + } + + interface RuntimeDownloadProgress { + downloadedBytes: number; + totalBytes: number; + } + + interface WindowDetails { + uuid?: string; + mainWindow?: WindowInfo; + childWindows?: WindowInfo[]; + } + + interface WindowInfo { + /** + * name of the child window + */ + name?: string; + /** + * top-most coordinate of the child window + */ + top?: number; + /** + * right-most coordinate of the child window + */ + right?: number; + /** + * bottom-most coordinate of the child window + */ + bottom?: number; + /** + * left-most coordinate of the child window + */ + left?: number; + } + + interface HostSpecInfo { + /** + * "x86" for 32-bit or "x86_64" for 64-bit + */ + arch: string; + /** + * Same payload as Node's os.cpus() + */ + cpus: NodeCpuInfo[]; + gpu: { + /** + * Graphics card name + */ + name: string; + }; + /** + * Same payload as Node's os.totalmem() + */ + memory: number; + /** + * OS name and version/edition + */ + name: string; + } + + interface NodeCpuInfo { + model: string; + /** + * in MHz + */ + speed: number; + times: { + /** + * The number of milliseconds the CPU has spent in user mode. + */ + user: number; + /** + * The number of milliseconds the CPU has spent in nice mode. + */ + nice: number; + /** + * The number of milliseconds the CPU has spent in sys mode. + */ + sys: number; + /** + * The number of milliseconds the CPU has spent in idle mode. + */ + idle: number; + /** + * The number of milliseconds the CPU has spent in irq mode. + */ + irq: number; + }; + } + + interface LogInfo { + /** + * the filename of the log + */ + name?: string; + /** + * the size of the log in bytes + */ + size?: number; + /** + * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" + */ + date?: string; + } + + interface ProcessInfo { + /** + * the percentage of total CPU usage + */ + cpuUsage?: number; + /** + * the application name + */ + name?: string; + /** + * the current nonpaged pool usage in bytes + */ + nonPagedPoolUsage?: number; + /** + * the number of page faults + */ + pageFaultCount?: number; + /** + * the current paged pool usage in bytes + */ + pagedPoolUsage?: number; + /** + * the total amount of memory in bytes that the memory manager has committed + */ + pagefileUsage?: number; + /** + * the peak nonpaged pool usage in bytes + */ + peakNonPagedPoolUsage?: number; + /** + * the peak paged pool usage in bytes + */ + peakPagedPoolUsage?: number; + /** + * the peak value in bytes of pagefileUsage during the lifetime of this process + */ + peakPagefileUsage?: number; + /** + * the peak working set size in bytes + */ + peakWorkingSetSize?: number; + /** + * the native process identifier + */ + processId?: number; + /** + * the application UUID + */ + uuid?: string; + /** + * the current working set size (both shared and private data) in bytes + */ + workingSetSize?: number; + } + + interface ProxyInfo { + /** + * the configured Proxy Address + */ + proxyAddress?: string; + /** + * the configured Proxy port + */ + proxyPort?: number; + /** + * Proxy Type + */ + type?: string; + } + + interface RvmInfo { + version?: string; + "start-time"?: string; + } + + interface ExternalProcessLaunchInfo { + path?: string; + /** + * Additionally note that the executable found in the zip file specified in appAssets + * will default to the one mentioned by appAssets.target + * If the the path below refers to a specific path it will override this default + */ + alias?: string; + /** + * When using alias; if no arguments are passed then the arguments (if any) + * are taken from the 'app.json' file, from the 'args' parameter + * of the 'appAssets' Object with the relevant 'alias'. + * If 'arguments' is passed as a parameter it takes precedence + * over any 'args' set in the 'app.json'. + */ + arguments?: string; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + certificate?: CertificationInfo; + } + + interface CertificationInfo { + /** + * A hex string with or without spaces + */ + serial?: string; + /** + * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields + */ + subject?: string; + /** + * A hex string with or without spaces + */ + publickey?: string; + /** + * A hex string with or without spaces + */ + thumbprint?: string; + /** + * A boolean indicating that the certificate is trusted and not revoked + */ + trusted?: boolean; + } + + interface ExternalProcessInfo { + pid?: number; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + } + + interface OpenFinWindowStatic { + /** + * Class: Window + * + * new Window(options, callbackopt, errorCallbackopt) + * + * Creates a new OpenFin Window + * + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + * @param options - The options of the window + * @param [callback] - Called if the window creation was successful + * @param [callback.successObj] - httpResponseCode + */ + new ( + options: WindowOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; + /** + * Returns an instance of the current window. + * @returns Current window + */ + getCurrent(): OpenFinWindow; + /** + * Returns a Window object that wraps an existing window. + */ + wrap(appUuid: string, windowName: string): OpenFinWindow; + } + + /** + * Window + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + */ + interface OpenFinWindow { + /** + * Name of window + */ + name: string; + /** + * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, + * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the + * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. + * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). + * @returns Native window + */ + getNativeWindow(): Window; + /** + * Gets the parent application. + * @returns Parent application + */ + getParentApplication(): OpenFinApplication; + /** + * Gets the parent window. + */ + getParentWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Performs the specified window transitions + */ + animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Provides credentials to authentication requests + */ + authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes focus from the window. + */ + blur(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Brings the window to the front of the OpenFin window stack. + */ + bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the window. + * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Prevents a user from changing a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-disabled' is generated when an enabled frame becomes disabled. + */ + disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Re-enables user changes to a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-enabled' is generated when a disabled frame has becomes enabled. + */ + enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Flashes the window's frame and taskbar icon until the window is activated. + */ + flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gives focus to the window. + */ + focus(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current bounds (top, left, width, height) of the window. + */ + getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. + * Please note that calling window is included in the result array. + */ + getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current settings of the window. + */ + getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets a base64 encoded PNG snapshot of the window. + */ + getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current state ("minimized", "maximized", or "restored") of the window. + */ + getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the zoom level of the window. + */ + getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; + /** + * Hides the window. + */ + hide(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the window is currently showing. + */ + isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Joins the same window group as the specified window. + */ + joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Leaves the current window group so that the window can be move independently of those in the group. + */ + leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Maximizes the window. + */ + maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Merges the instance's window group with the same window group as the specified window + */ + mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Minimizes the window. + */ + minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window by a specified amount. + */ + moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window to a specified location. + */ + moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restores the window to its normal state (i.e., unminimized, unmaximized). + */ + restore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Will bring the window to the front of the entire stack and give it focus. + */ + setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the window's size and position + */ + setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the zoom level of the window. + */ + setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden. + * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. + */ + show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. + */ + showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Stops the taskbar icon from flashing. + */ + stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Updates the window using the passed options + */ + updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface OpenFinFrameStatic { + wrap(uuid: string, name: string): OpenFinFrame; + + getCurrent(): OpenFinFrame; + } + + interface OpenFinFrame { + name: string; + uuid: string; + + addEventListener(type: string, listener: () => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + + getParentWindow(callback?: (entityInfo: EntityInfo) => void, errorCallback?: (reason: string) => void): void; + + getInfo(callback?: (entityInfo: EntityInfo) => void, errorCallback?: (reason: string) => void): void; + + removeEventListener(type: string, listener: () => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ApplicationBaseEvent { + topic: string; + type: OpenFinApplicationEventType; + uuid: string; + } + + interface TrayIconClickedEvent extends ApplicationBaseEvent { + button: number; // 0 for left, 1 for middle, 2 for right + monitorInfo: MonitorInfo; + x: number; // the cursor x coordinate + y: number; // the cursor y coordinate + } + + interface WindowEvent extends ApplicationBaseEvent { + name: string; + } + + interface WindowAlertRequestedEvent extends WindowEvent { + message: string; + url: string; + } + + interface WindowAuthRequested extends WindowEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowNavigationRejectedEvent extends WindowEvent { + sourceName: string; + url: string; + } + + interface WindowEndLoadEvent extends WindowEvent { + documentName: string; + isMain: boolean; + } + + interface MonitorInfoChangedEvent extends MonitorInfo { + topic: "system"; + type: "monitor-info-changed"; + } + + interface MonitorInfo { + nonPrimaryMonitors: MonitorInfoDetail[]; + primaryMonitor: MonitorInfoDetail; + reason: string; + taskbar: { + edge: "left" | "right" | "top" | "bottom", + rect: MontiorCoordinates + }; + topic: "system"; + type: "monitor-info-changed"; + virtualScreen: MontiorCoordinates; + } + + interface TrayIconInfo { + x: number; + y: number; + bounds: { + x: number; + y: number; + width: number; + height: number; }; - /** - * A flag to always position the window at the top of the window stack. Default: false. - * Updatable - */ - alwaysOnTop?: boolean; - /** - * A flag to automatically show the Window when it is created. Default: false. - */ - autoShow?: boolean; - /** - * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true - * Updatable - */ - contextMenu?: boolean; - /** - * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. - * Updatable - */ - cornerRounding?: { - width?: number; - height?: number; - }; - /** - * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. - */ - customData?: any; - /** - * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the position from before the window was closed is used. - * This option overrides defaultLeft and defaultTop. Default: false. - */ - defaultCentered?: boolean; - /** - * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. - */ - defaultHeight?: number; - /** - * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. - */ - defaultWidth?: number; - /** - * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. - */ - defaultTop?: number; - /** - * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. - */ - defaultLeft?: number; - /** - * A flag to show the frame. Default: true. - * Updatable - */ - frame?: boolean; - /** - * A flag to allow a window to be hidden when the close button is clicked.Default: false. - * Updatable - */ - hideOnClose?: boolean; - /** - * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. - * Updatable - */ - icon?: string; - /** - * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxHeight?: number; - /** - * A flag that lets the window be maximized.Default: true. - * Updatable - */ - maximizable?: boolean; - /** - * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxWidth?: number; - /** - * The minimum height of a window.Default: 0. - * Updatable - */ - minHeight?: number; - /** - * A flag that lets the window be minimized.Default: true. - */ - minimizable?: boolean; - /** - * The minimum width of a window.Default: 0. - */ - minWidth?: number; - /** - * The name for the window which must be unique within the context of the invoking Application. - */ - name?: string; - /** - * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. - * Updatable - */ - opacity?: number; - /** - * A flag to drop to allow the user to resize the window.Default: true. - * Updatable - */ - resizable?: boolean; - /** - * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. - * Updatable - */ - resizeRegion?: { - /** - * The size in pixels (Default: 2), - */ - size?: number; - /** - * The size in pixels of an additional - * square resizable region located at the - * bottom right corner of a - * frameless window. (Default: 4) - */ - bottomRightCorner?: number; - }; - /** - * A flag to show the Window's icon in the taskbar. Default: true. - */ - showTaskbarIcon?: boolean; - /** - * A flag to cache the location of the window or not. Default: true. - */ - saveWindowState?: boolean; - /** - * Specify a taskbar group for the window. Default: app's uuid. - */ - taskbarIconGroup?: string; - /** - * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". - */ - state?: string; - /** - * The URL of the window. Default: "about:blank". - */ - url?: string; - /** - * When set to false, the window will render before the "load" event is fired on the content's window. - * Caution, when false you will see an initial empty white window. Default: true. - */ - waitForPageLoad?: boolean; - } - - /** - * Clipboard - * Clipboard API allows reading and writting to the clipboard in multiple formats. - */ - interface OpenFinClipboard { - /** - * Reads available formats for the clipboard type - */ - availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Reads available formats for the clipboard type - */ - readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as Rtf - */ - readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as plain text - */ - readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard - */ - write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Html - */ - writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Rtf - */ - writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as plain text - */ - writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - interface OpenFinExternalApplicationStatic { - /** - * Returns an External Application object that represents an existing external application. - */ - wrap(uuid: string): OpenFinExternalApplication; - } - /** - * ExternalApplication - * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. - */ - interface OpenFinExternalApplication { - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - /** - * InterApplicationBus - * A messaging bus that allows for pub/sub messaging between different applications. - */ - interface OpenFinInterApplicationBus { - /** - * Adds a listener that gets called when applications subscribe to the current application's messages. - */ - addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Adds a listener that gets called when applications unsubscribe to the current application's messages. - */ - addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered subscribe listener. - */ - removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered unsubscribe listener. - */ - removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. - */ - publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sends a message to a specific application on a specific topic. - */ - send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], - * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. - */ - subscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - subscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Unsubscribes to messages from the specified application on the specified topic. - */ - unsubscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - unsubscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - } - - interface OpenFinNotificationStatic { - /** - * ctor - */ - new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; - /** - * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. - */ - getCurrent(): OpenFinNotification; - } - - /** - * Notification - * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. - * A notification is typically used to alert the user of some important event which requires his or her attention. - * Notifications are a child or your application that are controlled by the runtime. - */ - interface OpenFinNotification { - /** - * Closes the notification. - */ - close(callback?: () => void): void; - /** - * Sends a message to the notification. - */ - sendMessage(message: any, callback?: () => void): void; - /** - * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. - */ - sendMessageToApplication(message: any, callback?: () => void): void; - } - - interface NotificationOptions { - /** - * A boolean that will force dismissal even if the mouse is hovering over the notification - */ - ignoreMouseOver?: boolean; - /** - * A message of any primitive or composite-primitive type to be passed to the notification upon creation. - */ - message?: any; - /** - * The timeout for displaying a notification.Can be in milliseconds or "never". - */ - duration?: number | "never"; - /** - * The url of the notification - */ - url?: string; - /** - * A function that is called when a notification is clicked. - */ - onClick?(callback: () => void): void; - /** - * Invoked when the notification is closed via .close() method on the created notification instance - * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). - * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss - */ - onClose?(callback: () => void): void; - /** - * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. - */ - onDismiss?(callback: () => void): void; - /** - * A function that is called when an error occurs.The reason for the error is passed as an argument. - */ - onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * The onMessage function will respond to messages sent from notification.sendMessageToApplication. - * The function is passed the message, which can be of any primitive or composite-primitive type. - */ - onMessage?(callback: (message: any) => void): void; - /** - * A function that is called when a notification is shown. - */ - onShow?(callback: (successObj: SuccessObj) => void): void; - } - - /** - * System - * An object representing the core of OpenFin Runtime. - * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. - */ - interface OpenFinSystem { - Clipboard: OpenFinClipboard; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Clears cached data containing window state/positions, - * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. - */ - clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Clears all cached data when OpenFin Runtime exits. - */ - deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Downloads the given application asset - */ - downloadAsset( - assetObj: AppAssetInfo, - progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, - callback?: (successObj: { path: string }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * Exits the Runtime. - */ - exit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all applications. - */ - getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all external applications. - */ - getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data (name, ids, bounds) for all application windows. - */ - getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the command line argument string that started OpenFin Runtime. - */ - getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the configuration object that started the OpenFin Runtime. - */ - getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the value of a given environment variable on the computer on which the runtime is installed. - */ - getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves system information. - */ - getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the contents of the log with the specified filename. - */ - getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing information for each log file. - */ - getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. - */ - getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the mouse in virtual screen coordinates (left, top). - */ - getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of all of the runtime processes that are currently running. - * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. - */ - getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the Proxy settings. - */ - getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns information about the running RVM in an object. - */ - getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. - */ - getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Runs an executable or batch file. - */ - launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Writes the passed message into both the log file and the console. - */ - log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Monitors a running process. - */ - monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Opens the passed URL in the default web browser. - */ - openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * This function call will register a unique id and produce a token. The token can be used to broker an external connection. - */ - registerExternalConnection( - uuid: string, - callback?: (detail: { - /** - * this will be unique each time - */ - token: string; - /** - * "remote-connection-uuid" - */ - uuid: string; - }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). - */ - releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the Chrome Developer Tools for the specified window. - */ - showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. - */ - terminateExternalProcess( - processUuid: string, - timeout: number, - killTree: boolean, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - terminateExternalProcess( - processUuid: string, - timeout: number, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Update the OpenFin Runtime Proxy settings. - */ - updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface CacheOptions { - cache?: boolean; - cookies?: boolean; - localStorage?: boolean; - appcache?: boolean; - userData?: boolean; - } - - interface AppAssetInfo { - src?: string; - alias?: string; - version?: string; - target?: string; - args?: string; - } - - interface ApplicationInfo { - /** - * true when the application is running. - */ - isRunning?: boolean; - /** - * uuid of the application. - */ - uuid?: string; - /** - * uuid of the application that launches this application. - */ - parentUuid?: string; - } - - interface WindowDetails { - uuid?: string; - mainWindow?: WindowInfo; - childWindows?: WindowInfo[]; - } - - interface WindowInfo { - /** - * name of the child window - */ - name?: string; - /** - * top-most coordinate of the child window - */ - top?: number; - /** - * right-most coordinate of the child window - */ - right?: number; - /** - * bottom-most coordinate of the child window - */ - bottom?: number; - /** - * left-most coordinate of the child window - */ - left?: number; - } - - interface HostSpecInfo { - /** - * "x86" for 32-bit or "x86_64" for 64-bit - */ - arch: string; - /** - * Same payload as Node's os.cpus() - */ - cpus: NodeCpuInfo[]; - gpu: { - /** - * Graphics card name - */ - name: string; - }; - /** - * Same payload as Node's os.totalmem() - */ - memory: number; - /** - * OS name and version/edition - */ - name: string; - } - - interface NodeCpuInfo { - model: string; - /** - * in MHz - */ - speed: number; - times: { - /** - * The number of milliseconds the CPU has spent in user mode. - */ - user: number; - /** - * The number of milliseconds the CPU has spent in nice mode. - */ - nice: number; - /** - * The number of milliseconds the CPU has spent in sys mode. - */ - sys: number; - /** - * The number of milliseconds the CPU has spent in idle mode. - */ - idle: number; - /** - * The number of milliseconds the CPU has spent in irq mode. - */ - irq: number; - }; - } - - interface LogInfo { - /** - * the filename of the log - */ - name?: string; - /** - * the size of the log in bytes - */ - size?: number; - /** - * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" - */ - date?: string; - } - - interface ProcessInfo { - /** - * the percentage of total CPU usage - */ - cpuUsage?: number; - /** - * the application name - */ - name?: string; - /** - * the current nonpaged pool usage in bytes - */ - nonPagedPoolUsage?: number; - /** - * the number of page faults - */ - pageFaultCount?: number; - /** - * the current paged pool usage in bytes - */ - pagedPoolUsage?: number; - /** - * the total amount of memory in bytes that the memory manager has committed - */ - pagefileUsage?: number; - /** - * the peak nonpaged pool usage in bytes - */ - peakNonPagedPoolUsage?: number; - /** - * the peak paged pool usage in bytes - */ - peakPagedPoolUsage?: number; - /** - * the peak value in bytes of pagefileUsage during the lifetime of this process - */ - peakPagefileUsage?: number; - /** - * the peak working set size in bytes - */ - peakWorkingSetSize?: number; - /** - * the native process identifier - */ - processId?: number; - /** - * the application UUID - */ - uuid?: string; - /** - * the current working set size (both shared and private data) in bytes - */ - workingSetSize?: number; - } - - interface ProxyInfo { - /** - * the configured Proxy Address - */ - proxyAddress?: string; - /** - * the configured Proxy port - */ - proxyPort?: number; - /** - * Proxy Type - */ - type?: string; - } - - interface RvmInfo { - version?: string; - "start-time"?: string; - } - - interface ExternalProcessLaunchInfo { - path?: string; - /** - * Additionally note that the executable found in the zip file specified in appAssets - * will default to the one mentioned by appAssets.target - * If the the path below refers to a specific path it will override this default - */ - alias?: string; - /** - * When using alias; if no arguments are passed then the arguments (if any) - * are taken from the 'app.json' file, from the 'args' parameter - * of the 'appAssets' Object with the relevant 'alias'. - * If 'arguments' is passed as a parameter it takes precedence - * over any 'args' set in the 'app.json'. - */ - arguments?: string; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - certificate?: CertificationInfo; - } - - interface CertificationInfo { - /** - * A hex string with or without spaces - */ - serial?: string; - /** - * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields - */ - subject?: string; - /** - * A hex string with or without spaces - */ - publickey?: string; - /** - * A hex string with or without spaces - */ - thumbprint?: string; - /** - * A boolean indicating that the certificate is trusted and not revoked - */ - trusted?: boolean; - } - - interface ExternalProcessInfo { - pid?: number; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - } - - interface OpenFinWindowStatic { - /** - * Class: Window - * - * new Window(options, callbackopt, errorCallbackopt) - * - * Creates a new OpenFin Window - * - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - * @param options - The options of the window - * @param [callback] - Called if the window creation was successful - * @param [callback.successObj] - httpResponseCode - */ - new ( - options: WindowOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; - /** - * Returns an instance of the current window. - * @returns Current window - */ - getCurrent(): OpenFinWindow; - /** - * Returns a Window object that wraps an existing window. - */ - wrap(appUuid: string, windowName: string): OpenFinWindow; - } - - /** - * Window - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - */ - interface OpenFinWindow { - /** - * Name of window - */ - name: string; - /** - * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, - * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the - * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. - * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). - * @returns Native window - */ - getNativeWindow(): Window; - /** - * Gets the parent application. - * @returns Parent application - */ - getParentApplication(): OpenFinApplication; - /** - * Gets the parent window. - */ - getParentWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Performs the specified window transitions - */ - animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Provides credentials to authentication requests - */ - authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes focus from the window. - */ - blur(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Brings the window to the front of the OpenFin window stack. - */ - bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the window. - * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Prevents a user from changing a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-disabled' is generated when an enabled frame becomes disabled. - */ - disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Re-enables user changes to a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-enabled' is generated when a disabled frame has becomes enabled. - */ - enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Flashes the window's frame and taskbar icon until the window is activated. - */ - flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gives focus to the window. - */ - focus(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current bounds (top, left, width, height) of the window. - */ - getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. - * Please note that calling window is included in the result array. - */ - getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current settings of the window. - */ - getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets a base64 encoded PNG snapshot of the window. - */ - getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current state ("minimized", "maximized", or "restored") of the window. - */ - getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the zoom level of the window. - */ - getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; - /** - * Hides the window. - */ - hide(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the window is currently showing. - */ - isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Joins the same window group as the specified window. - */ - joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Leaves the current window group so that the window can be move independently of those in the group. - */ - leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Maximizes the window. - */ - maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Merges the instance's window group with the same window group as the specified window - */ - mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Minimizes the window. - */ - minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window by a specified amount. - */ - moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window to a specified location. - */ - moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restores the window to its normal state (i.e., unminimized, unmaximized). - */ - restore(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Will bring the window to the front of the entire stack and give it focus. - */ - setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the window's size and position - */ - setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the zoom level of the window. - */ - setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden. - * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. - */ - show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. - */ - showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Stops the taskbar icon from flashing. - */ - stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Updates the window using the passed options - */ - updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface ApplicationBaseEvent { - topic: string; - type: OpenFinApplicationEventType; - uuid: string; - } - - interface TrayIconClickedEvent extends ApplicationBaseEvent { - button: number; // 0 for left, 1 for middle, 2 for right monitorInfo: MonitorInfo; - x: number; // the cursor x coordinate - y: number; // the cursor y coordinate } - interface WindowEvent extends ApplicationBaseEvent { - name: string; - } + interface MonitorInfoDetail { + availableRect: MontiorCoordinates; + deviceId: string; + displayDeviceActive: boolean; + monitorRect: MontiorCoordinates; + name: string; + } - interface WindowAlertRequestedEvent extends WindowEvent { - message: string; - url: string; - } + interface MontiorCoordinates { + bottom: number; + left: number; + right: number; + top: number; + } - interface WindowAuthRequested extends WindowEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } + interface VirtualScreenCoordinates { + left: number; + top: number; + } - interface WindowNavigationRejectedEvent extends WindowEvent { - sourceName: string; - url: string; - } + interface SystemBaseEvent { + topic: string; + type: OpenFinSystemEventType; + uuid: string; + } - interface WindowEndLoadEvent extends WindowEvent { - documentName: string; - isMain: boolean; - } + interface DesktopIconClickedEvent { + mouse: { + /** + * the left virtual screen coordinate of the mouse + */ + left: number, + /** + * the top virtual screen coordinate of the mouse + */ + top: number + }; + /** + * the number of milliseconds that have elapsed since the system was started, + */ + tickCount: number; + topic: "system"; + type: "desktop-icon-clicked"; + } - interface MonitorInfoChangedEvent extends MonitorInfo { - topic: "system"; - type: "monitor-info-changed"; - } + interface IdleStateChangedEvent { + /** + * How long in milliseconds since the user has been idle. + */ + elapsedTime: number; + /** + * true when the user is idle,false when the user has returned; + */ + isIdle: boolean; + topic: "system"; + type: "idle-state-changed"; + } - interface MonitorInfo { - nonPrimaryMonitors: MonitorInfoDetail[]; - primaryMonitor: MonitorInfoDetail; - reason: string; - taskbar: { - edge: "left" | "right" | "top" | "bottom", - rect: MontiorCoordinates - }; - topic: "system"; - type: "monitor-info-changed"; - virtualScreen: MontiorCoordinates; - } + interface WindowBaseEvent { + /** + * the name of the window + */ + name: string; + /** + * always window + */ + topic: "window"; + /** + * window event type + */ + type: OpenFinWindowEventType; + /** + * the UUID of the application the window belongs to + */ + uuid: string; + } - interface MonitorInfoDetail { - availableRect: MontiorCoordinates; - deviceId: string; - displayDeviceActive: boolean; - monitorRect: MontiorCoordinates; - name: string; - } + interface WindowAuthRequestedEvent extends WindowBaseEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } - interface MontiorCoordinates { - bottom: number; - left: number; - right: number; - top: number; - } + interface WindowBoundsEvent extends WindowBaseEvent { + /** + * describes what kind of change occurred. + * 0 means a change in position. + * 1 means a change in size. + * 2 means a change in position and size. + */ + changeType: number; + /** + * true when pending changes have been applied to the window. + */ + deferred: boolean; + /** + * the new height of the window. + */ + height: number; + /** + * the left-most coordinate of the window. + */ + left: number; + /** + * the top-most coordinate of the window. + */ + top: number; - interface VirtualScreenCoordinates { - left: number; - top: number; - } + type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; + /** + * the new width of the window. + */ + width: number; + } - interface SystemBaseEvent { - topic: string; - type: OpenFinSystemEventType; - uuid: string; - } + interface WindowExternalProcessStartedEvent extends WindowBaseEvent { + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-started"; + } - interface DesktopIconClickedEvent { - mouse: { - /** - * the left virtual screen coordinate of the mouse - */ - left: number, - /** - * the top virtual screen coordinate of the mouse - */ - top: number - }; - /** - * the number of milliseconds that have elapsed since the system was started, - */ - tickCount: number; - topic: "system"; - type: "desktop-icon-clicked"; - } + interface WindowExternalProcessExited extends WindowBaseEvent { + /** + * the process exit code + */ + exitCode: number; + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-exited"; + } - interface IdleStateChangedEvent { - /** - * How long in milliseconds since the user has been idle. - */ - elapsedTime: number; - /** - * true when the user is idle,false when the user has returned; - */ - isIdle: boolean; - topic: "system"; - type: "idle-state-changed"; - } + interface WindowGroupChangedEvent extends WindowBaseEvent { + /** + * Which group array the window that the event listener was registered on is included in: + * 'source' The window is included in sourceGroup. + * 'target' The window is included in targetGroup. + * 'nothing' The window is not included in sourceGroup nor targetGroup. + */ + memberOf: "source" | "target" | "nothing"; + /** + * The reason this event was triggered. + * 'leave' A window has left the group due to a leave or merge with group. + * 'join' A window has joined the group. + * 'merge' Two groups have been merged together. + * 'disband' There are no other windows in the group. + */ + reason: "leave" | "join" | "merge" | "disband"; + /** + * All the windows in the group the sourceWindow originated from. + */ + sourceGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. + */ + sourceWindowAppUuid: string; + /** + * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. + */ + sourceWindowName: string; + /** + * All the windows in the group the targetWindow orginated from + */ + targetGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowAppUuid: string; + /** + * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowName: string; + type: "group-changed"; + } - interface WindowBaseEvent { - /** - * the name of the window - */ - name: string; - /** - * always window - */ - topic: "window"; - /** - * window event type - */ - type: OpenFinWindowEventType; - /** - * the UUID of the application the window belongs to - */ - uuid: string; - } + interface WindowOfGroupInfo { + /** + * The UUID of the application this window entry belongs to. + */ + appUuid: string; + /** + * The name of this window entry. + */ + windowName: string; + } - interface WindowAuthRequestedEvent extends WindowBaseEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } + interface WindowHiddenEvent extends WindowBaseEvent { + /** + * What action prompted the close. + * The reasons are: "hide", "hide-on-close" + */ + reason: "hide" | "hide-on-close"; + type: "hidden"; + } - interface WindowBoundsEvent extends WindowBaseEvent { - /** - * describes what kind of change occurred. - * 0 means a change in position. - * 1 means a change in size. - * 2 means a change in position and size. - */ - changeType: number; - /** - * true when pending changes have been applied to the window. - */ - deferred: boolean; - /** - * the new height of the window. - */ - height: number; - /** - * the left-most coordinate of the window. - */ - left: number; - /** - * the top-most coordinate of the window. - */ - top: number; + interface Window_NavigationRejectedEvent { + name: string; + /** + * source of navigation window name + */ + sourceName: string; + topic: "navigation-rejected"; + /** + * Url that was not reached "http://blocked-content.url" + */ + url: string; + /** + * the UUID of the application the window belongs to. + */ + uuid: string; + } - type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; - /** - * the new width of the window. - */ - width: number; - } + interface AnimationTransition { + opacity?: { + /** + * This value is clamped from 0.0 to 1.0 + */ + opacity?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'opacity' as absolute or as a delta. Defaults to false. + */ + relative?: boolean; + }; + position?: { + /** + * Defaults to the window's current left position in virtual screen coordinates. + */ + left?: number; + /** + * Defaults to the window's current top position in virtual screen coordinates. + */ + top?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + size?: { + /** + * Optional if height is present. Defaults to the window's current width. + */ + width?: number; + /** + * Optional if width is present. Defaults to the window's current height. + */ + height?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + } - interface WindowExternalProcessStartedEvent extends WindowBaseEvent { - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-started"; - } + interface AnimationOptions { + /** + * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. + */ + interrupt?: boolean; + /** + * Transition effect. Defaults to 'ease-in-out'. + */ + tween?: OpenFinTweenType; + } - interface WindowExternalProcessExited extends WindowBaseEvent { - /** - * the process exit code - */ - exitCode: number; - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-exited"; - } + interface WindowBounds { + /** + * the height of the window. + */ + height?: number; + /** + * left-most coordinate of the window. + */ + left?: number; + /** + * top-most coordinate of the window. + */ + top?: number; + /** + * the width of the window. + */ + width?: number; + } - interface WindowGroupChangedEvent extends WindowBaseEvent { - /** - * Which group array the window that the event listener was registered on is included in: - * 'source' The window is included in sourceGroup. - * 'target' The window is included in targetGroup. - * 'nothing' The window is not included in sourceGroup nor targetGroup. - */ - memberOf: "source" | "target" | "nothing"; - /** - * The reason this event was triggered. - * 'leave' A window has left the group due to a leave or merge with group. - * 'join' A window has joined the group. - * 'merge' Two groups have been merged together. - * 'disband' There are no other windows in the group. - */ - reason: "leave" | "join" | "merge" | "disband"; - /** - * All the windows in the group the sourceWindow originated from. - */ - sourceGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. - */ - sourceWindowAppUuid: string; - /** - * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. - */ - sourceWindowName: string; - /** - * All the windows in the group the targetWindow orginated from - */ - targetGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowAppUuid: string; - /** - * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowName: string; - type: "group-changed"; - } + interface ExternalApplicationInfo { + parent: { + uuid: string; + name: string; + }; + } - interface WindowOfGroupInfo { - /** - * The UUID of the application this window entry belongs to. - */ - appUuid: string; - /** - * The name of this window entry. - */ - windowName: string; - } + interface SessionChangedEvent { + /** + * the action that triggered this event: + */ + reason: "lock" + | "unlock" + | "remote-connect" + | "remote-disconnect" + | "unknown"; + topic: "system"; + type: "session-changed"; + } - interface WindowHiddenEvent extends WindowBaseEvent { - /** - * What action prompted the close. - * The reasons are: "hide", "hide-on-close" - */ - reason: "hide" | "hide-on-close"; - type: "hidden"; - } + interface LaunchInfo { + launchMode: "fin-protocol" + | "fins-protocol" + | "shortcut" + | "command-line" + | "adapter" + | "other" + | string; + } - interface Window_NavigationRejectedEvent { - name: string; - /** - * source of navigation window name - */ - sourceName: string; - topic: "navigation-rejected"; - /** - * Url that was not reached "http://blocked-content.url" - */ - url: string; - /** - * the UUID of the application the window belongs to. - */ - uuid: string; - } + type OpenFinTweenType = "linear" + | "ease-in" + | "ease-out" + | "ease-in-out" + | "ease-in-quad" + | "ease-out-quad" + | "ease-in-out-quad" + | "ease-in-cubic" + | "ease-out-cubic" + | "ease-in-out-cubic" + | "ease-out-bounce" + | "ease-in-back" + | "ease-out-back" + | "ease-in-out-back" + | "ease-in-elastic" + | "ease-out-elastic" + | "ease-in-out-elastic"; - interface AnimationTransition { - opacity?: { - /** - * This value is clamped from 0.0 to 1.0 - */ - opacity?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'opacity' as absolute or as a delta. Defaults to false. - */ - relative?: boolean; - }; - position?: { - /** - * Defaults to the window's current left position in virtual screen coordinates. - */ - left?: number; - /** - * Defaults to the window's current top position in virtual screen coordinates. - */ - top?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - size?: { - /** - * Optional if height is present. Defaults to the window's current width. - */ - width?: number; - /** - * Optional if width is present. Defaults to the window's current height. - */ - height?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - } + type OpenFinApplicationEventType = "closed" + | "connected" + | "crashed" + | "initialized" + | "manifest-changed" + | "not-responding" + | "out-of-memory" + | "responding" + | "run-requested" + | "started" + | "tray-icon-clicked" + | "window-alert-requested" + | "window-auth-requested" + | "window-closed" + | "window-created" + | "window-end-load" + | "window-navigation-rejected" + | "window-show-requested" + | "window-start-load"; - interface AnimationOptions { - /** - * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. - */ - interrupt?: boolean; - /** - * Transition effect. Defaults to 'ease-in-out'. - */ - tween?: OpenFinTweenType; - } + type OpenFinExternalApplicationEventType = "connected" + | "disconnected"; - interface WindowBounds { - /** - * the height of the window. - */ - height?: number; - /** - * left-most coordinate of the window. - */ - left?: number; - /** - * top-most coordinate of the window. - */ - top?: number; - /** - * the width of the window. - */ - width?: number; - } + type OpenFinSystemEventType = "application-closed" + | "application-crashed" + | "application-created" + | "application-started" + | "desktop-icon-clicked" + | "idle-state-changed" + | "monitor-info-changed" + | "session-changed"; - interface SessionChangedEvent { - /** - * the action that triggered this event: - */ - reason: "lock" - | "unlock" - | "remote-connect" - | "remote-disconnect" - | "unknown"; - topic: "system"; - type: "session-changed"; - } + type OpenFinWindowEventType = "auth-requested" + | "blurred" + | "bounds-changed" + | "bounds-changing" + | "close-requested" + | "closed" + | "disabled-frame-bounds-changed" + | "disabled-frame-bounds-changing" + | "embedded" + | "external-process-exited" + | "external-process-started" + | "focused" + | "frame-disabled" + | "frame-enabled" + | "group-changed" + | "hidden" + | "initialized" + | "maximized" + | "minimized" + | "navigation-rejected" + | "restored" + | "show-requested" + | "shown"; - interface LaunchInfo { - launchMode: "fin-protocol" - | "fins-protocol" - | "shortcut" - | "command-line" - | "adapter" - | "other" - | string; - } - - type OpenFinTweenType = "linear" - | "ease-in" - | "ease-out" - | "ease-in-out" - | "ease-in-quad" - | "ease-out-quad" - | "ease-in-out-quad" - | "ease-in-cubic" - | "ease-out-cubic" - | "ease-in-out-cubic" - | "ease-out-bounce" - | "ease-in-back" - | "ease-out-back" - | "ease-in-out-back" - | "ease-in-elastic" - | "ease-out-elastic" - | "ease-in-out-elastic"; - - type OpenFinApplicationEventType = "closed" - | "connected" - | "crashed" - | "initialized" - | "manifest-changed" - | "not-responding" - | "out-of-memory" - | "responding" - | "run-requested" - | "started" - | "tray-icon-clicked" - | "window-alert-requested" - | "window-auth-requested" - | "window-closed" - | "window-created" - | "window-end-load" - | "window-navigation-rejected" - | "window-show-requested" - | "window-start-load"; - - type OpenFinExternalApplicationEventType = "connected" - | "disconnected"; - - type OpenFinSystemEventType = "application-closed" - | "application-crashed" - | "application-created" - | "application-started" - | "desktop-icon-clicked" - | "idle-state-changed" - | "monitor-info-changed" - | "session-changed"; - - type OpenFinWindowEventType = "auth-requested" - | "blurred" - | "bounds-changed" - | "bounds-changing" - | "close-requested" - | "closed" - | "disabled-frame-bounds-changed" - | "disabled-frame-bounds-changing" - | "embedded" - | "external-process-exited" - | "external-process-started" - | "focused" - | "frame-disabled" - | "frame-enabled" - | "group-changed" - | "hidden" - | "initialized" - | "maximized" - | "minimized" - | "navigation-rejected" - | "restored" - | "show-requested" - | "shown"; - - type OpenFinAnchor = "top-left" - | "top-right" - | "bottom-left" - | "bottom-right"; + type OpenFinAnchor = "top-left" + | "top-right" + | "bottom-left" + | "bottom-right"; } diff --git a/types/openfin/openfin-tests.ts b/types/openfin/openfin-tests.ts index 61b819018f..6059f54de7 100644 --- a/types/openfin/openfin-tests.ts +++ b/types/openfin/openfin-tests.ts @@ -1,721 +1,800 @@ function test_application() { - let application: fin.OpenFinApplication; - // constructor - application = new fin.desktop.Application({ - url: "application.html", - uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", - name: "Application Name", - plugins: false, - mainWindowOptions: { - defaultHeight: 600, - defaultWidth: 800, - defaultTop: 300, - defaultLeft: 300, - autoShow: true - } - }, (successObj) => { - console.log("Application successfully created, HTTP response code:", successObj); - application.run(); - }, (error) => { - console.log("Error creating application:", error); - }); - // getCurrent - application = fin.desktop.Application.getCurrent(); - // wrap - application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); - // getWindow - application.getWindow(); - // addEventListener - application.addEventListener("closed", (event) => { - console.log("The application has closed"); - }, () => { - console.log("The registration was successful"); - }, reason => { - console.log("failure: " + reason); - }); - // close - application.close(); - // getChildWindows - application.getChildWindows(children => { - children.forEach(childWindow => { - console.log("Showing child: " + childWindow.name); - childWindow.show(); - }); - }); - // getGroups - application.getGroups(allGroups => { - console.log(`There are a total of ${allGroups.length} groups.`); + let application: fin.OpenFinApplication; + // constructor + application = new fin.desktop.Application({ + url: "application.html", + uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", + name: "Application Name", + plugins: false, + mainWindowOptions: { + defaultHeight: 600, + defaultWidth: 800, + defaultTop: 300, + defaultLeft: 300, + autoShow: true + } + }, (successObj) => { + console.log("Application successfully created, HTTP response code:", successObj); + application.run(); + }, (error) => { + console.log("Error creating application:", error); + }); + // createFromManifest + fin.desktop.Application.createFromManifest("http://stuf.com/app.json", (app) => { + console.log(app.uuid); + }, err => console.log(err)); + // getCurrent + application = fin.desktop.Application.getCurrent(); + // wrap + application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); + // getWindow + application.getWindow(); + // addEventListener + application.addEventListener("closed", (event) => { + console.log("The application has closed"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure: " + reason); + }); + // close + application.close(); + // getChildWindows + application.getChildWindows(children => { + children.forEach(childWindow => { + console.log("Showing child: " + childWindow.name); + childWindow.show(); + }); + }); + // getGroups + application.getGroups(allGroups => { + console.log(`There are a total of ${allGroups.length} groups.`); - let groupCounter = 1; - allGroups.forEach(windowGroup => { - console.log(`Group ${groupCounter} contains ${windowGroup.length} windows.`); - ++groupCounter; - }); - }); - // getManifest - application.getManifest(manifest => { - console.log("Application manifest:"); - console.log(manifest); - }); - // getParentUuid - application.getParentUuid(parentUuid => { - console.log("UUID of parent application:"); - console.log(parentUuid); - }); - // getShortcuts - application.getShortcuts(config => { - console.log("Desktop shortcut is enabled: ", config.desktop); - console.log("Start Menu shortcut is enabled: ", config.startMenu); - console.log("System Startup shortcut is enabled: ", config.systemStartup); - }); - // getInfo - application.getInfo(info => { - console.log(`Launch mode: ${info.launchMode}`); - }); - // isRunning - application.isRunning(running => { - console.log("the application is", running ? "running" : "not running"); - }); - // registerCustomData - application.registerCustomData({ - someData: "this is custom" + let groupCounter = 1; + allGroups.forEach(windowGroup => { + console.log(`Group ${groupCounter} contains ${windowGroup.length} windows.`); + ++groupCounter; + }); + }); + // getManifest + application.getManifest(manifest => { + console.log("Application manifest:"); + console.log(manifest); + }); + // getParentUuid + application.getParentUuid(parentUuid => { + console.log("UUID of parent application:"); + console.log(parentUuid); + }); + // getShortcuts + application.getShortcuts(config => { + console.log("Desktop shortcut is enabled: ", config.desktop); + console.log("Start Menu shortcut is enabled: ", config.startMenu); + console.log("System Startup shortcut is enabled: ", config.systemStartup); + }); + // getInfo + application.getInfo(info => { + console.log(`Launch mode: ${info.launchMode}`); + }); + // getTrayIconInfo + application.getTrayIconInfo(info => { + console.log(info.x, info.y, info.bounds.x, info.bounds.y, info.bounds.height, info.bounds.width, + info.monitorInfo.type, info.monitorInfo.reason); + }); + // isRunning + application.isRunning(running => { + console.log("the application is", running ? "running" : "not running"); + }); + // registerCustomData + application.registerUser("a", "b", () => console.log("done"), err => console.log(err)); + // removeEventListener + application.removeEventListener("closed", (event: any) => { + console.log(event); }, () => { - console.log("You will not read this."); - }, err => { - console.log("failure:", err); - }); - // removeEventListener - const previousCallback = (event: fin.WindowEvent) => { }; - application.removeEventListener("closed", previousCallback, () => { - console.log("The unregistration was successful"); - }, err => { - console.log("failure:", err); - }); - // removeTrayIcon - application.removeTrayIcon(() => { - console.log("Removed the tray icon."); - }, err => { - console.log("failure:", err); - }); - // restart - application.restart(() => { - console.log("You will not read this."); - }, err => { - console.log("failure:", err); - }); - // schedule restart - application.scheduleRestart(() => { - console.log("You will not read this."); - }, err => { - console.log("failure:", err); - }); - // setShortcuts - application.setShortcuts({ - desktop: true, - startMenu: false, - systemStartup: true - }, () => { - console.log("Successfully set new shortcut states"); - }, error => { - console.log("Failed to set new shortcut states. Error: ", error); - }); - // setTrayIcon - application.setTrayIcon("https://developer.openf.in/download/openfin.png", clickInfo => { - console.log(`The mouse has clicked at (${clickInfo.x}, ${clickInfo.y})`); - }); - // terminate - application.terminate(); - // wait - application.addEventListener("not-responding", () => { - console.log("waiting for hung application"); - application.wait(); - }); + console.log("The unregistration was successful"); + }, err => { + console.log("failure:", err); + }); + // removeTrayIcon + application.removeTrayIcon(() => { + console.log("Removed the tray icon."); + }, err => { + console.log("failure:", err); + }); + // restart + application.restart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // schedule restart + application.scheduleRestart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // setShortcuts + application.setShortcuts({ + desktop: true, + startMenu: false, + systemStartup: true + }, () => { + console.log("Successfully set new shortcut states"); + }, error => { + console.log("Failed to set new shortcut states. Error: ", error); + }); + // setTrayIcon + application.setTrayIcon("https://developer.openf.in/download/openfin.png", clickInfo => { + console.log(`The mouse has clicked at (${clickInfo.x}, ${clickInfo.y})`); + }); + // terminate + application.terminate(); + // wait + application.addEventListener("not-responding", () => { + console.log("waiting for hung application"); + application.wait(); + }); + // uuid + const hasUuid = application.uuid; } function test_external_application() { - let externalApp: fin.OpenFinExternalApplication; - // wrap - externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); - // addEventListener - externalApp.addEventListener('connected', () => { - console.log('external app connected'); - }, () => { - console.log('The registration was successful'); - }, (reason, err) => { - console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); - }); - // removeEventListener - const previousCallback = () => { }; - externalApp.removeEventListener('connected', previousCallback, () => { - console.log('The unregistration was successful'); - }, (reason, err) => { - console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); - }); + let externalApp: fin.OpenFinExternalApplication; + // wrap + externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); + // addEventListener + externalApp.addEventListener('connected', () => { + console.log('external app connected'); + }, () => { + console.log('The registration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); + // removeEventListener + const previousCallback = () => { }; + externalApp.removeEventListener('connected', previousCallback, () => { + console.log('The unregistration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); + + // getInfo + externalApp.getInfo(info => { + console.log(info.parent.uuid, info.parent.name); + }, err => console.log(err)); } function test_inter_application_bus() { - // addSubscribeListener - fin.desktop.InterApplicationBus.addSubscribeListener((uuid, topic, name) => { - console.log(`The application ${uuid} has subscribed to ${topic}`); - }); - // addUnsubscribeListener - fin.desktop.InterApplicationBus.addUnsubscribeListener((uuid, topic, name) => { - console.log(`The application ${uuid} has unsubscribed to ${topic}`); - }); - // removeSubscribeListener - const aRegisteredListener = (uuid: string, topic: string, name: string) => { }; - fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); - // removeUnsubscribeListener - fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); - // publish - fin.desktop.InterApplicationBus.publish("a topic", { - field1: "value1", - field2: "value2" - }); - // send - fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { - field1: "value1", - field2: "value2" - }); - // subscribe - fin.desktop.InterApplicationBus.subscribe("*", "a topic", (message, uuid, name) => { - console.log(`The application ${uuid} sent this message: ${message}`); - }); - // unsubscribe - const aRegisteredMessageListener = (message: any, senderUuid: string) => { - console.log(message, senderUuid); - }; - fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); + // addSubscribeListener + fin.desktop.InterApplicationBus.addSubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has subscribed to ${topic}`); + }); + // addUnsubscribeListener + fin.desktop.InterApplicationBus.addUnsubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has unsubscribed to ${topic}`); + }); + // removeSubscribeListener + const aRegisteredListener = (uuid: string, topic: string, name: string) => { }; + fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); + // removeUnsubscribeListener + fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); + // publish + fin.desktop.InterApplicationBus.publish("a topic", { + field1: "value1", + field2: "value2" + }); + // send + fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { + field1: "value1", + field2: "value2" + }); + // subscribe + fin.desktop.InterApplicationBus.subscribe("*", "a topic", (message, uuid, name) => { + console.log(`The application ${uuid} sent this message: ${message}`); + }); + // unsubscribe + const aRegisteredMessageListener = (message: any, senderUuid: string) => { + console.log(message, senderUuid); + }; + fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); } function test_notification() { - let notification: fin.OpenFinNotification; - // getCurrent - notification = fin.desktop.Notification.getCurrent(); - // close - notification.close(); - // sendMessage - notification = new fin.desktop.Notification({ - duration: 10, - url: "http://localhost:5000/Account/Register", - message: "Hello", - onShow: () => { }, - // onClose: () => { }, - onDismiss: () => { }, - // onClick: () => { }, - onMessage: () => { }, - onError: () => { } - }); - // sendMessageToApplication - notification.sendMessageToApplication("some message"); + let notification: fin.OpenFinNotification; + // getCurrent + notification = fin.desktop.Notification.getCurrent(); + // close + notification.close(); + // sendMessage + notification = new fin.desktop.Notification({ + duration: 10, + url: "http://localhost:5000/Account/Register", + message: "Hello", + onShow: () => { }, + // onClose: () => { }, + onDismiss: () => { }, + // onClick: () => { }, + onMessage: () => { }, + onError: () => { } + }); + // sendMessageToApplication + notification.sendMessageToApplication("some message"); } function test_system() { - // addEventListener - fin.desktop.System.addEventListener('monitor-info-changed', event => { - console.log("The monitor information has changed to: ", event); + // addEventListener + fin.desktop.System.addEventListener('monitor-info-changed', event => { + console.log("The monitor information has changed to: ", event); + }, () => { + console.log("The registration was successful"); + }, err => { + console.log("failure: " + err); + }); + // clearCache + fin.desktop.System.clearCache({ + cache: true, + cookies: true, + localStorage: true, + appcache: true, + userData: true + }); + // deleteCacheOnExit + fin.desktop.System.deleteCacheOnExit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // downloadAsset + const dirAppAsset = { + src: 'http://local:8000/dir.zip', + alias: 'dirApp', + version: '1.23.24', + target: 'dir.bat', + args: '' + }; + fin.desktop.System.downloadAsset(dirAppAsset, progress => { + const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); + console.log(`Downloaded ${downloadedPercent}%`); + }, p => { + console.log(`Downlod complete, can be found on ${p.path}`); + // lets launch our application asset. + // launchDirApp(); + }, (reason, err) => { + console.log(reason, err); + }); + // downloadRuntime + fin.desktop.System.downloadRuntime({ version: '9.61.31.56' }, progress => { + console.log(progress.downloadedBytes, progress.downloadedBytes); + }, () => console.log('download complete'), err => console.error(err)); + // downloadPreloadScript + const preloadScripts = [ + { url: 'http://whatever.com/script.js' } + ]; + fin.desktop.System.downloadPreloadScripts(preloadScripts, info => { + const downloadInfo = info[0]; + console.log(downloadInfo.success, downloadInfo.url, downloadInfo.error); + }, err => { + console.log(err); + }); + // exit + fin.desktop.System.exit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // flushCookieStore + fin.desktop.System.flushCookieStore(() => { + console.log('successful'); + }, err => { + console.log('failure', err); + }); + // getAllApplications + fin.desktop.System.getAllApplications(applicationInfoList => { + applicationInfoList.forEach(applicationInfo => { + console.log("Showing information for application with uuid: " + + applicationInfo.uuid); + console.log("isRunning: ", applicationInfo.isRunning); + }); + }); + // getAllExternalApplications + fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { + externalAppsInfoList.forEach(appInfo => { + console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); + }); + }); + // getAllWindows + fin.desktop.System.getAllWindows(windowInfoList => { + windowInfoList.forEach(windowInfo => { + console.log("Showing information for application with uuid: ", windowInfo.uuid); + console.log("Main window: ", windowInfo.mainWindow); + console.log("Child windows: ", windowInfo.childWindows); + }); + }); + // getAppAssetInfo + fin.desktop.System.getAppAssetInfo({ alias: 'myAppAsset' }, info => { + console.log(info.alias, info.args, info.mandatory, info.src, info.target, info.version); + }, err => console.log(err)); + // getCommandLineArguments + fin.desktop.System.getCommandLineArguments(args => { + console.log("The command line arguments are " + args); + }); + // getCookieInfo + fin.desktop.System.getCookies({ name: 'myCookie1'}, cookies => { + const cookie1 = cookies[0]; + console.log(cookie1.name, cookie1.domain, cookie1.path); + }, err => console.log(err)); + // getDeviceId + fin.desktop.System.getDeviceId(id => { + console.log("The id of the device is: " + id); + }); + // getDeviceUserId + fin.desktop.System.getDeviceUserId(id => console.log(id), err => console.error(err)); + // getEntityInfo + fin.desktop.System.getEntityInfo('uuid', 'name', info => { + console.log(info.entityType, info.name, info.uuid, info.parent.name, info.parent.uuid); + }, err => console.log(err)); + // getEnvironmentVariable + fin.desktop.System.getEnvironmentVariable("APPDATA", variable => { + console.log("this is the APPDATA value", variable); + }); + // getFocusedWindow + fin.desktop.System.getFocusedWindow(win => { + console.log(win.uuid, win.name); + }, err => console.log(err)); + // getHostSpecs + fin.desktop.System.getHostSpecs(info => { + console.log(info); + }, error => { + console.log('There was an error:', error); + }); + // getLog + fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', log => { + console.log(log); + }); + // getLogList + fin.desktop.System.getLogList(logList => { + logList.forEach(logInfo => { + console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); + }); + }); + // getMinLogLevel + fin.desktop.System.getMinLogLevel(level => console.log(level), err => console.log(err)); + // getMonitorInfo + fin.desktop.System.getMonitorInfo(monitorInfo => { + console.log("This object contains information about all monitors: ", monitorInfo); + }); + // getMousePosition + fin.desktop.System.getMousePosition(mousePosition => { + console.log(`The mouse is located at left: ${mousePosition.left}, top: ${mousePosition.top}`); + }); + // getProcessList + fin.desktop.System.getProcessList(list => { + list.forEach(process => { + console.log(`UUID: ${process.uuid}, Application Name: ${process.name}`); + }); + }); + // getProxySettings + fin.desktop.System.getProxySettings(proxy => { + console.log(proxy); + }); + // getRvmInfo + fin.desktop.System.getRvmInfo(rvmInfoObject => { + console.log("RVM version:", rvmInfoObject.version); + console.log("RVM has been running since:", rvmInfoObject["start-time"]); + }, err => { + console.log("Failed to get rvm info, error message:", err); + }); + // getVersion + fin.desktop.System.getVersion(version => { + console.log("The version is " + version); + }); + // launchExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // launch external process with an alias + fin.desktop.System.launchExternalProcess({ + // Additionally note that the executable found in the zip file specified in appAssets + // will default to the one mentioned by appAssets.target + // If the the path below refers to a specific path it will override this default + alias: "myApp", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + alias: "myApp", + arguments: "e f g", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", + arguments: "--version", + certificate: { + trusted: true, + subject: 'O=OpenFin INC., L=New York, S=NY, C=US', + thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' + }, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // log + fin.desktop.System.log("info", "An example log message", () => { + console.log("message successfully logged"); + }, err => { + console.log(err); + }); + // monitorExternalProcess + fin.desktop.System.monitorExternalProcess({ + pid: 2508, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log("The process is now being monitored: ", payload.uuid); + }, error => { + console.log("Error:", error); + }); + // openUrlWithBrowser + fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // readRegistryValue + fin.desktop.System.readRegistryValue('HKEY_SOMETHING', 'HARDWARE\\SOMETHING', 'BootSomething', info => { + console.log(info.data, info.rootKey, info.subkey, info.type, info.value); + }, err => console.log(err)); + // registerExternalConnection + fin.desktop.System.registerExternalConnection("remote-connection-uuid", (...args: any[]) => { + console.log(args); + }); + // releaseExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); + + // release it. + fin.desktop.System.releaseExternalProcess(result.uuid, () => { + console.log("Process has been unmapped!"); + }, reason => { + console.log("failure: " + reason); + }); + }); + // removeEventListener + fin.desktop.System.removeEventListener("monitor-info-changed", (event) => { + console.log(event); }, () => { - console.log("The registration was successful"); - }, err => { - console.log("failure: " + err); - }); - // clearCache - fin.desktop.System.clearCache({ - cache: true, - cookies: true, - localStorage: true, - appcache: true, - userData: true - }); - // deleteCacheOnExit - fin.desktop.System.deleteCacheOnExit(() => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // downloadAsset - const dirAppAsset = { - src: 'http://local:8000/dir.zip', - alias: 'dirApp', - version: '1.23.24', - target: 'dir.bat', - args: '' - }; - fin.desktop.System.downloadAsset(dirAppAsset, progress => { - const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); - console.log(`Downloaded ${downloadedPercent}%`); - }, p => { - console.log(`Downlod complete, can be found on ${p.path}`); - // lets launch our application asset. - // launchDirApp(); - }, (reason, err) => { - console.log(reason, err); - }); - // exit - fin.desktop.System.exit(() => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // getAllApplications - fin.desktop.System.getAllApplications(applicationInfoList => { - applicationInfoList.forEach(applicationInfo => { - console.log("Showing information for application with uuid: " - + applicationInfo.uuid); - console.log("isRunning: ", applicationInfo.isRunning); - }); - }); - // getAllExternalApplications - fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { - externalAppsInfoList.forEach(appInfo => { - console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); - }); - }); - // getAllWindows - fin.desktop.System.getAllWindows(windowInfoList => { - windowInfoList.forEach(windowInfo => { - console.log("Showing information for application with uuid: ", windowInfo.uuid); - console.log("Main window: ", windowInfo.mainWindow); - console.log("Child windows: ", windowInfo.childWindows); - }); - }); - // getCommandLineArguments - fin.desktop.System.getCommandLineArguments(args => { - console.log("The command line arguments are " + args); - }); - // getDeviceId - fin.desktop.System.getDeviceId(id => { - console.log("The id of the device is: " + id); - }); - // getEnvironmentVariable - fin.desktop.System.getEnvironmentVariable("APPDATA", variable => { - console.log("this is the APPDATA value", variable); - }); - // getHostSpecs - fin.desktop.System.getHostSpecs(info => { - console.log(info); - }, error => { - console.log('There was an error:', error); - }); - // getLog - fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', log => { - console.log(log); - }); - // getLogList - fin.desktop.System.getLogList(logList => { - logList.forEach(logInfo => { - console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); - }); - }); - // getMonitorInfo - fin.desktop.System.getMonitorInfo(monitorInfo => { - console.log("This object contains information about all monitors: ", monitorInfo); - }); - // getMousePosition - fin.desktop.System.getMousePosition(mousePosition => { - console.log(`The mouse is located at left: ${mousePosition.left}, top: ${mousePosition.top}`); - }); - // getProcessList - fin.desktop.System.getProcessList(list => { - list.forEach(process => { - console.log(`UUID: ${process.uuid}, Application Name: ${process.name}`); - }); - }); - // getProxySettings - fin.desktop.System.getProxySettings(proxy => { - console.log(proxy); - }); - // getRvmInfo - fin.desktop.System.getRvmInfo(rvmInfoObject => { - console.log("RVM version:", rvmInfoObject.version); - console.log("RVM has been running since:", rvmInfoObject["start-time"]); - }, err => { - console.log("Failed to get rvm info, error message:", err); - }); - // getVersion - fin.desktop.System.getVersion(version => { - console.log("The version is " + version); - }); - // launchExternalProcess - fin.desktop.System.launchExternalProcess({ - path: "notepad", - arguments: "", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - // Additionally note that the executable found in the zip file specified in appAssets - // will default to the one mentioned by appAssets.target - // If the the path below refers to a specific path it will override this default - alias: "myApp", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - alias: "myApp", - arguments: "e f g", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", - arguments: "--version", - certificate: { - trusted: true, - subject: 'O=OpenFin INC., L=New York, S=NY, C=US', - thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' - }, - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // log - fin.desktop.System.log("info", "An example log message", () => { - console.log("message successfully logged"); - }, err => { - console.log(err); - }); - // monitorExternalProcess - fin.desktop.System.monitorExternalProcess({ - pid: 2508, - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log("The process is now being monitored: ", payload.uuid); - }, error => { - console.log("Error:", error); - }); - // openUrlWithBrowser - fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // registerExternalConnection - fin.desktop.System.registerExternalConnection("remote-connection-uuid", (...args: any[]) => { - console.log(args); - }); - // releaseExternalProcess - fin.desktop.System.launchExternalProcess({ - path: "notepad", - arguments: "", - listener(result) { - console.log("The exit code", result.exitCode); - } - }, result => { - console.log("Result UUID is " + result.uuid); + console.log("successful"); + }, (err: any) => { + console.log("failure: " + err); + }); + // setMinLogLevel + fin.desktop.System.setMinLogLevel("log level", () => console.log('Success'), (err: any) => console.error(err)); + // showDeveloperTools + fin.desktop.System.showDeveloperTools("uuid", "name", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // terminateExternalProcess + fin.desktop.System.launchExternalProcess({ + // notepad is in the system's PATH + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); - // release it. - fin.desktop.System.releaseExternalProcess(result.uuid, () => { - console.log("Process has been unmapped!"); - }, reason => { - console.log("failure: " + reason); - }); - }); - // removeEventListener - const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; - fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // showDeveloperTools - fin.desktop.System.showDeveloperTools("uuid", "name", () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // terminateExternalProcess - fin.desktop.System.launchExternalProcess({ - // notepad is in the system's PATH - path: "notepad", - arguments: "", - listener(result) { - console.log("The exit code", result.exitCode); - } - }, result => { - console.log("Result UUID is " + result.uuid); - - // Attempt to close the process. Terminate after 4 seconds if it - // has not done so. - fin.desktop.System.terminateExternalProcess(result.uuid, 4000, info => { - console.log("Termination result " + info.result); - }, reason => { - console.log("failure: " + reason); - }); - }); - // updateProxySettings - fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, () => { - console.log('success'); - }, err => { - console.log(err); - }); + // Attempt to close the process. Terminate after 4 seconds if it + // has not done so. + fin.desktop.System.terminateExternalProcess(result.uuid, 4000, info => { + console.log("Termination result " + info.result); + }, reason => { + console.log("failure: " + reason); + }); + }); + // updateProxySettings + fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, () => { + console.log('success'); + }, err => { + console.log(err); + }); } function test_system_clipboard() { - // availableFormats - fin.desktop.System.Clipboard.availableFormats(null, formats => { - formats.forEach(format => console.log(`The format ${format} is available to read`)); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readHtml - fin.desktop.System.Clipboard.readHtml(null, html => { - console.log(`This is the html from the clipboard: ${html}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readRtf - fin.desktop.System.Clipboard.readRtf(null, rtf => { - console.log(`This is the rtf from the clipboard: ${rtf}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readText - fin.desktop.System.Clipboard.readText(null, text => { - console.log(`This is the text from the clipboard: ${text}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // write - fin.desktop.System.Clipboard.write({ - text: 'Hello Text!', - html: '

Hello Html

', - rtf: 'Hello Rtf' - }, null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeHtml - fin.desktop.System.Clipboard.writeHtml('

Hello World

', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeRtf - fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeText - fin.desktop.System.Clipboard.writeText('Hello World', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); + // availableFormats + fin.desktop.System.Clipboard.availableFormats(null, formats => { + formats.forEach(format => console.log(`The format ${format} is available to read`)); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readHtml + fin.desktop.System.Clipboard.readHtml(null, html => { + console.log(`This is the html from the clipboard: ${html}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readRtf + fin.desktop.System.Clipboard.readRtf(null, rtf => { + console.log(`This is the rtf from the clipboard: ${rtf}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readText + fin.desktop.System.Clipboard.readText(null, text => { + console.log(`This is the text from the clipboard: ${text}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // write + fin.desktop.System.Clipboard.write({ + text: 'Hello Text!', + html: '

Hello Html

', + rtf: 'Hello Rtf' + }, null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeHtml + fin.desktop.System.Clipboard.writeHtml('

Hello World

', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeRtf + fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeText + fin.desktop.System.Clipboard.writeText('Hello World', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); } function test_window() { - let finWindow: fin.OpenFinWindow; - // constructor - finWindow = new fin.desktop.Window({ - name: "childWindow", - url: "child.html", - defaultWidth: 320, - defaultHeight: 320, - defaultTop: 10, - defaultLeft: 300, - frame: false, - resizable: false, - state: "normal" - }, () => { - const _win = finWindow.getNativeWindow(); - _win.addEventListener("DOMContentLoaded", () => { finWindow.show(); }); - }, error => { - console.log("Error creating window:", error); - }); - // getCurrent - finWindow = fin.desktop.Window.getCurrent(); - // getNativeWindow - let nativeWindow: Window; - nativeWindow = finWindow.getNativeWindow(); - // getParentApplication - let parentApp: fin.OpenFinApplication; - parentApp = finWindow.getParentApplication(); - // getParentWindow - let parentFinWindow: fin.OpenFinWindow; - parentFinWindow = finWindow.getParentWindow(); - // wrap - finWindow = fin.desktop.Window.wrap("uuid", "name"); - // addEventListener - finWindow.addEventListener("bounds-changed", event => { - console.log("The window has been moved or resized"); - }, () => { - console.log("The registration was successful"); - }, reason => { - console.log("failure:" + reason); - }); - // animate - finWindow.animate({ - opacity: { - opacity: 0.15, - duration: 1000 - }, - position: { - left: 10, - top: 10, - duration: 3000 - } - }, { - interrupt: false - }, evt => { - // Callback will only fire after both "opacity" and "position" have finished animating. - }); - // authenticate - finWindow.addEventListener('auth-requested', evt => { - finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { - console.log("failure:", err); - }); - }); - // blur - finWindow.blur(); - // bringToFront - finWindow.bringToFront(); - // close - finWindow.close(); - // disableFrame - finWindow.disableFrame(); - // enableFrame - finWindow.enableFrame(); - // flash - finWindow.flash(); - // focus - finWindow.focus(); - // getBounds - finWindow.getBounds(bounds => { - console.log(`top: ${bounds.top} left: ${bounds.left} height: ${bounds.height} width: ${bounds.width}`); - }); - // getOptions - finWindow.getOptions(options => { - console.log(options); - }); - // getSnapshot - finWindow.getSnapshot(base64Snapshot => { - console.log("data:image/png;base64," + base64Snapshot); - }); - // getState - finWindow.getState(state => { - console.log("state: " + state); - }); - // getZoomLevel - finWindow.getZoomLevel(level => { - console.log("zoom level: " + level); - }, error => { - console.log('error:', error); - }); - // hide - finWindow.hide(); - // isShowing - finWindow.isShowing(showing => { - console.log("the window is " + (showing ? "showing" : "hidden")); - }); - // joinGroup - let secondWindow = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "secondWindow", - autoShow: true - }, () => { - // When mainWindow moves or is moved, secondWindow moves by the same amount - secondWindow.joinGroup(finWindow); - }); - // leaveGroup - secondWindow = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "secondWindow", - autoShow: true - }, () => { - // When finWindow moves or is moved, secondWindow moves by the same amount - secondWindow.joinGroup(finWindow, () => { - // once we are in the group, lets leave it. - secondWindow.leaveGroup(); - }); - }); - // maximize - finWindow.maximize(); - // mergeGroups - { - const finWindowOne = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowOne", - autoShow: true - }); - const finWindowTwo = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowTwo", - autoShow: true - }); - const finWindowThree = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowThree", - autoShow: true - }); - const finWindowFour = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowFour", - autoShow: true - }); - // When finWindowOne moves or is moved, finWindowTwo moves by the same amount - finWindowOne.joinGroup(finWindowTwo); - // When finWindowThree moves or is moved, finWindowFour moves by the same amount - finWindowThree.joinGroup(finWindowFour); - // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group - finWindowOne.mergeGroups(finWindowThree); - } - // minimize - finWindow.minimize(); - // moveBy - finWindow.moveBy(10, 10); - // moveTo - finWindow.moveTo(100, 200); - // removeEventListener - const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; - finWindow.removeEventListener("bounds-changed", aRegisteredListener); - // resizeBy - finWindow.resizeBy(10, 10, "top-right"); - // resizeTo - finWindow.resizeTo(10, 10, "top-right"); - // restore - finWindow.restore(); - // setAsForeground - finWindow.setAsForeground(); - // setBounds - finWindow.setBounds(100, 200, 400, 400); - // setZoomLevel - finWindow.setZoomLevel(10); - // show - finWindow.show(); - // showAt - finWindow.showAt(10, 10, false); - // stopFlashing - finWindow.stopFlashing(); - // updateOptions - finWindow.updateOptions({ - frame: false, - maxWidth: 500 + let finWindow: fin.OpenFinWindow; + // constructor + finWindow = new fin.desktop.Window({ + name: "childWindow", + url: "child.html", + defaultWidth: 320, + defaultHeight: 320, + defaultTop: 10, + defaultLeft: 300, + frame: false, + resizable: false, + state: "normal" + }, () => { + const _win = finWindow.getNativeWindow(); + _win.addEventListener("DOMContentLoaded", () => { finWindow.show(); }); + }, error => { + console.log("Error creating window:", error); + }); + // getCurrent + finWindow = fin.desktop.Window.getCurrent(); + // getNativeWindow + let nativeWindow: Window; + nativeWindow = finWindow.getNativeWindow(); + // getParentApplication + let parentApp: fin.OpenFinApplication; + parentApp = finWindow.getParentApplication(); + // getParentWindow + let parentFinWindow: fin.OpenFinWindow; + parentFinWindow = finWindow.getParentWindow(); + // wrap + finWindow = fin.desktop.Window.wrap("uuid", "name"); + // addEventListener + finWindow.addEventListener("bounds-changed", event => { + console.log("The window has been moved or resized"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure:" + reason); + }); + // animate + finWindow.animate({ + opacity: { + opacity: 0.15, + duration: 1000 + }, + position: { + left: 10, + top: 10, + duration: 3000 + } + }, { + interrupt: false + }, evt => { + // Callback will only fire after both "opacity" and "position" have finished animating. + }); + // authenticate + finWindow.addEventListener('auth-requested', evt => { + finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { + console.log("failure:", err); + }); + }); + // blur + finWindow.blur(); + // bringToFront + finWindow.bringToFront(); + // close + finWindow.close(); + // disableFrame + finWindow.disableFrame(); + // enableFrame + finWindow.enableFrame(); + // flash + finWindow.flash(); + // focus + finWindow.focus(); + // getBounds + finWindow.getBounds(bounds => { + console.log(`top: ${bounds.top} left: ${bounds.left} height: ${bounds.height} width: ${bounds.width}`); + }); + // getOptions + finWindow.getOptions(options => { + console.log(options); + }); + // getSnapshot + finWindow.getSnapshot(base64Snapshot => { + console.log("data:image/png;base64," + base64Snapshot); + }); + // getState + finWindow.getState(state => { + console.log("state: " + state); + }); + // getZoomLevel + finWindow.getZoomLevel(level => { + console.log("zoom level: " + level); + }, error => { + console.log('error:', error); + }); + // hide + finWindow.hide(); + // isShowing + finWindow.isShowing(showing => { + console.log("the window is " + (showing ? "showing" : "hidden")); + }); + // joinGroup + let secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When mainWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow); + }); + // leaveGroup + secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When finWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow, () => { + // once we are in the group, lets leave it. + secondWindow.leaveGroup(); + }); + }); + // maximize + finWindow.maximize(); + // mergeGroups + { + const finWindowOne = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowOne", + autoShow: true + }); + const finWindowTwo = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowTwo", + autoShow: true + }); + const finWindowThree = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowThree", + autoShow: true + }); + const finWindowFour = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowFour", + autoShow: true + }); + // When finWindowOne moves or is moved, finWindowTwo moves by the same amount + finWindowOne.joinGroup(finWindowTwo); + // When finWindowThree moves or is moved, finWindowFour moves by the same amount + finWindowThree.joinGroup(finWindowFour); + // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group + finWindowOne.mergeGroups(finWindowThree); + } + // minimize + finWindow.minimize(); + // moveBy + finWindow.moveBy(10, 10); + // moveTo + finWindow.moveTo(100, 200); + // removeEventListener + finWindow.removeEventListener("bounds-changed", event => { + console.log(event); }); + // resizeBy + finWindow.resizeBy(10, 10, "top-right"); + // resizeTo + finWindow.resizeTo(10, 10, "top-right"); + // restore + finWindow.restore(); + // setAsForeground + finWindow.setAsForeground(); + // setBounds + finWindow.setBounds(100, 200, 400, 400); + // setZoomLevel + finWindow.setZoomLevel(10); + // show + finWindow.show(); + // showAt + finWindow.showAt(10, 10, false); + // stopFlashing + finWindow.stopFlashing(); + // updateOptions + finWindow.updateOptions({ + frame: false, + maxWidth: 500 + }); +} + +function test_frame() { + // wrap + const frame = fin.desktop.Frame.wrap('uuid', 'name'); + // getCurrent + const currentFrame = fin.desktop.Frame.getCurrent(); + // addEventlistener + frame.addEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); + // removeEventListener + frame.removeEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); + // getInfo + frame.getInfo(info => { + console.log(info.uuid, info.name, info.entityType, info.parent.uuid, info.parent.name); + }, err => console.error(err)); + // getParentWindow + frame.getParentWindow(parent => { + console.log(parent.uuid, parent.name, parent.entityType, parent.parent.uuid, parent.parent.name); + }, err => console.error(err)); } diff --git a/types/openfin/tsconfig.json b/types/openfin/tsconfig.json index fd3199ceb7..5299a11917 100644 --- a/types/openfin/tsconfig.json +++ b/types/openfin/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", "openfin-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/openfin/tslint.json b/types/openfin/tslint.json index 64aace11d6..f93cf8562a 100644 --- a/types/openfin/tslint.json +++ b/types/openfin/tslint.json @@ -1,6 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "max-line-length": false - } + "extends": "dtslint/dt.json" } diff --git a/types/openfin/v17/index.d.ts b/types/openfin/v17/index.d.ts new file mode 100644 index 0000000000..30afded19b --- /dev/null +++ b/types/openfin/v17/index.d.ts @@ -0,0 +1,1732 @@ +// Type definitions for OpenFin API 17.0 +// Project: https://openfin.co/ +// Definitions by: Chris Barker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// based on v6.49.17.14 +// see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean + +/** + * JavaScript API + * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, + * can communicate with other applications and has access to sandboxed system-level features. + * + * API Ready + * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify + * that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly + * after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. + * + * Overview + * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API + * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. + */ +declare namespace fin { + const desktop: OpenFinDesktop; + + interface OpenFinDesktop { + main(f: () => any): void; + Application: OpenFinApplicationStatic; + ExternalApp: OpenFinExternalApplicationStatic; + InterApplicationBus: OpenFinInterApplicationBus; + Notification: OpenFinNotificationStatic; + System: OpenFinSystem; + Window: OpenFinWindowStatic; + } + + interface OpenFinApplicationStatic { + /** + * Creates a new Application. + * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. + */ + new ( + options: ApplicationOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + getCurrent(): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + wrap(uuid: string): OpenFinApplication; + } + + /** + * Application + * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. + */ + interface OpenFinApplication { + /** + * Returns an instance of the main Window of the application + */ + getWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinApplicationEventType, + listener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Closes the application and any child windows created by the application. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. + */ + getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. + */ + getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. + */ + getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. + */ + getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves current configuration of application's shortcuts. + */ + getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the application is currently running. + */ + isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Passes in custom data that will be relayed to the RVM + */ + registerCustomData(data: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinApplicationEventType, + previouslyRegisteredListener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => any, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the application's icon from the tray. + */ + removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restarts the application. + */ + restart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Runs the application. When the application is created, run must be called. + */ + run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Tells the rvm to relaunch the main application once upon a complete shutdown + */ + scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets new shortcut configuration for current application. + * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to + * be able to change shortcut states. + */ + setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Adds a customizable icon in the system tray and notifies the application when clicked. + */ + setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the application by terminating its process. + */ + terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application + * to continue and to generate another "not-responding" message after a certain period of time. + */ + wait(callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ShortCutConfig { + /** + * application has a shortcut on the desktop + */ + desktop?: boolean; + /** + * application has no shortcut in the start menu + */ + startMenu?: boolean; + /** + * application will be launched on system startup + */ + systemStartup?: boolean; + } + + interface SuccessObj { + httpResponseCode: number; + } + + interface NetworkErrorInfo extends ErrorInfo { + networkErrorCode: number; + } + + interface ErrorInfo { + stack: string; + message: string; + } + + interface ApplicationOptions { + /** + * The name of the application. + */ + name?: string; + /** + * The url to the application. + */ + url?: string; + /** + * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. + */ + uuid?: string; + /** + * Enable Flash at the application level. Default: false. + */ + plugins?: boolean; + /** + * The options of the main window of the application. + */ + mainWindowOptions?: WindowOptions; + } + + interface WindowOptions { + /** + * Enable keyboard shortcuts for devtools and zoom. Default: false for both. + */ + accelerator?: { + devtools?: boolean, + zoom?: boolean, + reload?: boolean, + reloadIgnoreCache?: boolean, + }; + /** + * A flag to always position the window at the top of the window stack. Default: false. + * Updatable + */ + alwaysOnTop?: boolean; + /** + * A flag to automatically show the Window when it is created. Default: false. + */ + autoShow?: boolean; + /** + * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true + * Updatable + */ + contextMenu?: boolean; + /** + * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. + * Updatable + */ + cornerRounding?: { + width?: number; + height?: number; + }; + /** + * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. + */ + customData?: any; + /** + * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the position from before the window was closed is used. + * This option overrides defaultLeft and defaultTop. Default: false. + */ + defaultCentered?: boolean; + /** + * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. + */ + defaultHeight?: number; + /** + * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. + */ + defaultWidth?: number; + /** + * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. + */ + defaultTop?: number; + /** + * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. + */ + defaultLeft?: number; + /** + * A flag to show the frame. Default: true. + * Updatable + */ + frame?: boolean; + /** + * A flag to allow a window to be hidden when the close button is clicked.Default: false. + * Updatable + */ + hideOnClose?: boolean; + /** + * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. + * Updatable + */ + icon?: string; + /** + * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxHeight?: number; + /** + * A flag that lets the window be maximized.Default: true. + * Updatable + */ + maximizable?: boolean; + /** + * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxWidth?: number; + /** + * The minimum height of a window.Default: 0. + * Updatable + */ + minHeight?: number; + /** + * A flag that lets the window be minimized.Default: true. + */ + minimizable?: boolean; + /** + * The minimum width of a window.Default: 0. + */ + minWidth?: number; + /** + * The name for the window which must be unique within the context of the invoking Application. + */ + name?: string; + /** + * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. + * Updatable + */ + opacity?: number; + /** + * A flag to drop to allow the user to resize the window.Default: true. + * Updatable + */ + resizable?: boolean; + /** + * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. + * Updatable + */ + resizeRegion?: { + /** + * The size in pixels (Default: 2), + */ + size?: number; + /** + * The size in pixels of an additional + * square resizable region located at the + * bottom right corner of a + * frameless window. (Default: 4) + */ + bottomRightCorner?: number; + }; + /** + * A flag to show the Window's icon in the taskbar. Default: true. + */ + showTaskbarIcon?: boolean; + /** + * A flag to cache the location of the window or not. Default: true. + */ + saveWindowState?: boolean; + /** + * Specify a taskbar group for the window. Default: app's uuid. + */ + taskbarIconGroup?: string; + /** + * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". + */ + state?: string; + /** + * The URL of the window. Default: "about:blank". + */ + url?: string; + /** + * When set to false, the window will render before the "load" event is fired on the content's window. + * Caution, when false you will see an initial empty white window. Default: true. + */ + waitForPageLoad?: boolean; + } + + /** + * Clipboard + * Clipboard API allows reading and writting to the clipboard in multiple formats. + */ + interface OpenFinClipboard { + /** + * Reads available formats for the clipboard type + */ + availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Reads available formats for the clipboard type + */ + readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as Rtf + */ + readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as plain text + */ + readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard + */ + write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Html + */ + writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Rtf + */ + writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as plain text + */ + writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + interface OpenFinExternalApplicationStatic { + /** + * Returns an External Application object that represents an existing external application. + */ + wrap(uuid: string): OpenFinExternalApplication; + } + /** + * ExternalApplication + * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. + */ + interface OpenFinExternalApplication { + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + /** + * InterApplicationBus + * A messaging bus that allows for pub/sub messaging between different applications. + */ + interface OpenFinInterApplicationBus { + /** + * Adds a listener that gets called when applications subscribe to the current application's messages. + */ + addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Adds a listener that gets called when applications unsubscribe to the current application's messages. + */ + addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered subscribe listener. + */ + removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered unsubscribe listener. + */ + removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. + */ + publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sends a message to a specific application on a specific topic. + */ + send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], + * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. + */ + subscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + subscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Unsubscribes to messages from the specified application on the specified topic. + */ + unsubscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + unsubscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + } + + interface OpenFinNotificationStatic { + /** + * ctor + */ + new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; + /** + * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. + */ + getCurrent(): OpenFinNotification; + } + + /** + * Notification + * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. + * A notification is typically used to alert the user of some important event which requires his or her attention. + * Notifications are a child or your application that are controlled by the runtime. + */ + interface OpenFinNotification { + /** + * Closes the notification. + */ + close(callback?: () => void): void; + /** + * Sends a message to the notification. + */ + sendMessage(message: any, callback?: () => void): void; + /** + * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. + */ + sendMessageToApplication(message: any, callback?: () => void): void; + } + + interface NotificationOptions { + /** + * A boolean that will force dismissal even if the mouse is hovering over the notification + */ + ignoreMouseOver?: boolean; + /** + * A message of any primitive or composite-primitive type to be passed to the notification upon creation. + */ + message?: any; + /** + * The timeout for displaying a notification.Can be in milliseconds or "never". + */ + duration?: number | "never"; + /** + * The url of the notification + */ + url?: string; + /** + * A function that is called when a notification is clicked. + */ + onClick?(callback: () => void): void; + /** + * Invoked when the notification is closed via .close() method on the created notification instance + * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). + * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss + */ + onClose?(callback: () => void): void; + /** + * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. + */ + onDismiss?(callback: () => void): void; + /** + * A function that is called when an error occurs.The reason for the error is passed as an argument. + */ + onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * The onMessage function will respond to messages sent from notification.sendMessageToApplication. + * The function is passed the message, which can be of any primitive or composite-primitive type. + */ + onMessage?(callback: (message: any) => void): void; + /** + * A function that is called when a notification is shown. + */ + onShow?(callback: (successObj: SuccessObj) => void): void; + } + + /** + * System + * An object representing the core of OpenFin Runtime. + * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. + */ + interface OpenFinSystem { + Clipboard: OpenFinClipboard; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Clears cached data containing window state/positions, + * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. + */ + clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Clears all cached data when OpenFin Runtime exits. + */ + deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Downloads the given application asset + */ + downloadAsset( + assetObj: AppAssetInfo, + progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, + callback?: (successObj: { path: string }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Exits the Runtime. + */ + exit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all applications. + */ + getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all external applications. + */ + getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data (name, ids, bounds) for all application windows. + */ + getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the command line argument string that started OpenFin Runtime. + */ + getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the configuration object that started the OpenFin Runtime. + */ + getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the value of a given environment variable on the computer on which the runtime is installed. + */ + getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves system information. + */ + getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the contents of the log with the specified filename. + */ + getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing information for each log file. + */ + getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. + */ + getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the mouse in virtual screen coordinates (left, top). + */ + getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of all of the runtime processes that are currently running. + * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. + */ + getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the Proxy settings. + */ + getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the running RVM in an object. + */ + getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. + */ + getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Runs an executable or batch file. + */ + launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Writes the passed message into both the log file and the console. + */ + log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Monitors a running process. + */ + monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * This function call will register a unique id and produce a token. The token can be used to broker an external connection. + */ + registerExternalConnection( + uuid: string, + callback?: (detail: { + /** + * this will be unique each time + */ + token: string; + /** + * "remote-connection-uuid" + */ + uuid: string; + }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). + */ + releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the Chrome Developer Tools for the specified window. + */ + showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. + */ + terminateExternalProcess( + processUuid: string, + timeout: number, + killTree: boolean, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + terminateExternalProcess( + processUuid: string, + timeout: number, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Update the OpenFin Runtime Proxy settings. + */ + updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface CacheOptions { + cache?: boolean; + cookies?: boolean; + localStorage?: boolean; + appcache?: boolean; + userData?: boolean; + } + + interface AppAssetInfo { + src?: string; + alias?: string; + version?: string; + target?: string; + args?: string; + } + + interface ApplicationInfo { + /** + * true when the application is running. + */ + isRunning?: boolean; + /** + * uuid of the application. + */ + uuid?: string; + /** + * uuid of the application that launches this application. + */ + parentUuid?: string; + } + + interface WindowDetails { + uuid?: string; + mainWindow?: WindowInfo; + childWindows?: WindowInfo[]; + } + + interface WindowInfo { + /** + * name of the child window + */ + name?: string; + /** + * top-most coordinate of the child window + */ + top?: number; + /** + * right-most coordinate of the child window + */ + right?: number; + /** + * bottom-most coordinate of the child window + */ + bottom?: number; + /** + * left-most coordinate of the child window + */ + left?: number; + } + + interface HostSpecInfo { + /** + * "x86" for 32-bit or "x86_64" for 64-bit + */ + arch: string; + /** + * Same payload as Node's os.cpus() + */ + cpus: NodeCpuInfo[]; + gpu: { + /** + * Graphics card name + */ + name: string; + }; + /** + * Same payload as Node's os.totalmem() + */ + memory: number; + /** + * OS name and version/edition + */ + name: string; + } + + interface NodeCpuInfo { + model: string; + /** + * in MHz + */ + speed: number; + times: { + /** + * The number of milliseconds the CPU has spent in user mode. + */ + user: number; + /** + * The number of milliseconds the CPU has spent in nice mode. + */ + nice: number; + /** + * The number of milliseconds the CPU has spent in sys mode. + */ + sys: number; + /** + * The number of milliseconds the CPU has spent in idle mode. + */ + idle: number; + /** + * The number of milliseconds the CPU has spent in irq mode. + */ + irq: number; + }; + } + + interface LogInfo { + /** + * the filename of the log + */ + name?: string; + /** + * the size of the log in bytes + */ + size?: number; + /** + * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" + */ + date?: string; + } + + interface ProcessInfo { + /** + * the percentage of total CPU usage + */ + cpuUsage?: number; + /** + * the application name + */ + name?: string; + /** + * the current nonpaged pool usage in bytes + */ + nonPagedPoolUsage?: number; + /** + * the number of page faults + */ + pageFaultCount?: number; + /** + * the current paged pool usage in bytes + */ + pagedPoolUsage?: number; + /** + * the total amount of memory in bytes that the memory manager has committed + */ + pagefileUsage?: number; + /** + * the peak nonpaged pool usage in bytes + */ + peakNonPagedPoolUsage?: number; + /** + * the peak paged pool usage in bytes + */ + peakPagedPoolUsage?: number; + /** + * the peak value in bytes of pagefileUsage during the lifetime of this process + */ + peakPagefileUsage?: number; + /** + * the peak working set size in bytes + */ + peakWorkingSetSize?: number; + /** + * the native process identifier + */ + processId?: number; + /** + * the application UUID + */ + uuid?: string; + /** + * the current working set size (both shared and private data) in bytes + */ + workingSetSize?: number; + } + + interface ProxyInfo { + /** + * the configured Proxy Address + */ + proxyAddress?: string; + /** + * the configured Proxy port + */ + proxyPort?: number; + /** + * Proxy Type + */ + type?: string; + } + + interface RvmInfo { + version?: string; + "start-time"?: string; + } + + interface ExternalProcessLaunchInfo { + path?: string; + /** + * Additionally note that the executable found in the zip file specified in appAssets + * will default to the one mentioned by appAssets.target + * If the the path below refers to a specific path it will override this default + */ + alias?: string; + /** + * When using alias; if no arguments are passed then the arguments (if any) + * are taken from the 'app.json' file, from the 'args' parameter + * of the 'appAssets' Object with the relevant 'alias'. + * If 'arguments' is passed as a parameter it takes precedence + * over any 'args' set in the 'app.json'. + */ + arguments?: string; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + certificate?: CertificationInfo; + } + + interface CertificationInfo { + /** + * A hex string with or without spaces + */ + serial?: string; + /** + * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields + */ + subject?: string; + /** + * A hex string with or without spaces + */ + publickey?: string; + /** + * A hex string with or without spaces + */ + thumbprint?: string; + /** + * A boolean indicating that the certificate is trusted and not revoked + */ + trusted?: boolean; + } + + interface ExternalProcessInfo { + pid?: number; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + } + + interface OpenFinWindowStatic { + /** + * Class: Window + * + * new Window(options, callbackopt, errorCallbackopt) + * + * Creates a new OpenFin Window + * + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + * @param options - The options of the window + * @param [callback] - Called if the window creation was successful + * @param [callback.successObj] - httpResponseCode + */ + new ( + options: WindowOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; + /** + * Returns an instance of the current window. + * @returns Current window + */ + getCurrent(): OpenFinWindow; + /** + * Returns a Window object that wraps an existing window. + */ + wrap(appUuid: string, windowName: string): OpenFinWindow; + } + + /** + * Window + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + */ + interface OpenFinWindow { + /** + * Name of window + */ + name: string; + /** + * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, + * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the + * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. + * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). + * @returns Native window + */ + getNativeWindow(): Window; + /** + * Gets the parent application. + * @returns Parent application + */ + getParentApplication(): OpenFinApplication; + /** + * Gets the parent window. + */ + getParentWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Performs the specified window transitions + */ + animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Provides credentials to authentication requests + */ + authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes focus from the window. + */ + blur(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Brings the window to the front of the OpenFin window stack. + */ + bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the window. + * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Prevents a user from changing a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-disabled' is generated when an enabled frame becomes disabled. + */ + disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Re-enables user changes to a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-enabled' is generated when a disabled frame has becomes enabled. + */ + enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Flashes the window's frame and taskbar icon until the window is activated. + */ + flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gives focus to the window. + */ + focus(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current bounds (top, left, width, height) of the window. + */ + getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. + * Please note that calling window is included in the result array. + */ + getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current settings of the window. + */ + getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets a base64 encoded PNG snapshot of the window. + */ + getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current state ("minimized", "maximized", or "restored") of the window. + */ + getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the zoom level of the window. + */ + getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; + /** + * Hides the window. + */ + hide(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the window is currently showing. + */ + isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Joins the same window group as the specified window. + */ + joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Leaves the current window group so that the window can be move independently of those in the group. + */ + leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Maximizes the window. + */ + maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Merges the instance's window group with the same window group as the specified window + */ + mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Minimizes the window. + */ + minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window by a specified amount. + */ + moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window to a specified location. + */ + moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restores the window to its normal state (i.e., unminimized, unmaximized). + */ + restore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Will bring the window to the front of the entire stack and give it focus. + */ + setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the window's size and position + */ + setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the zoom level of the window. + */ + setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden. + * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. + */ + show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. + */ + showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Stops the taskbar icon from flashing. + */ + stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Updates the window using the passed options + */ + updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ApplicationBaseEvent { + topic: string; + type: OpenFinApplicationEventType; + uuid: string; + } + + interface TrayIconClickedEvent extends ApplicationBaseEvent { + button: number; // 0 for left, 1 for middle, 2 for right + monitorInfo: MonitorInfo; + x: number; // the cursor x coordinate + y: number; // the cursor y coordinate + } + + interface WindowEvent extends ApplicationBaseEvent { + name: string; + } + + interface WindowAlertRequestedEvent extends WindowEvent { + message: string; + url: string; + } + + interface WindowAuthRequested extends WindowEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowNavigationRejectedEvent extends WindowEvent { + sourceName: string; + url: string; + } + + interface WindowEndLoadEvent extends WindowEvent { + documentName: string; + isMain: boolean; + } + + interface MonitorInfoChangedEvent extends MonitorInfo { + topic: "system"; + type: "monitor-info-changed"; + } + + interface MonitorInfo { + nonPrimaryMonitors: MonitorInfoDetail[]; + primaryMonitor: MonitorInfoDetail; + reason: string; + taskbar: { + edge: "left" | "right" | "top" | "bottom", + rect: MontiorCoordinates + }; + topic: "system"; + type: "monitor-info-changed"; + virtualScreen: MontiorCoordinates; + } + + interface MonitorInfoDetail { + availableRect: MontiorCoordinates; + deviceId: string; + displayDeviceActive: boolean; + monitorRect: MontiorCoordinates; + name: string; + } + + interface MontiorCoordinates { + bottom: number; + left: number; + right: number; + top: number; + } + + interface VirtualScreenCoordinates { + left: number; + top: number; + } + + interface SystemBaseEvent { + topic: string; + type: OpenFinSystemEventType; + uuid: string; + } + + interface DesktopIconClickedEvent { + mouse: { + /** + * the left virtual screen coordinate of the mouse + */ + left: number, + /** + * the top virtual screen coordinate of the mouse + */ + top: number + }; + /** + * the number of milliseconds that have elapsed since the system was started, + */ + tickCount: number; + topic: "system"; + type: "desktop-icon-clicked"; + } + + interface IdleStateChangedEvent { + /** + * How long in milliseconds since the user has been idle. + */ + elapsedTime: number; + /** + * true when the user is idle,false when the user has returned; + */ + isIdle: boolean; + topic: "system"; + type: "idle-state-changed"; + } + + interface WindowBaseEvent { + /** + * the name of the window + */ + name: string; + /** + * always window + */ + topic: "window"; + /** + * window event type + */ + type: OpenFinWindowEventType; + /** + * the UUID of the application the window belongs to + */ + uuid: string; + } + + interface WindowAuthRequestedEvent extends WindowBaseEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowBoundsEvent extends WindowBaseEvent { + /** + * describes what kind of change occurred. + * 0 means a change in position. + * 1 means a change in size. + * 2 means a change in position and size. + */ + changeType: number; + /** + * true when pending changes have been applied to the window. + */ + deferred: boolean; + /** + * the new height of the window. + */ + height: number; + /** + * the left-most coordinate of the window. + */ + left: number; + /** + * the top-most coordinate of the window. + */ + top: number; + + type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; + /** + * the new width of the window. + */ + width: number; + } + + interface WindowExternalProcessStartedEvent extends WindowBaseEvent { + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-started"; + } + + interface WindowExternalProcessExited extends WindowBaseEvent { + /** + * the process exit code + */ + exitCode: number; + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-exited"; + } + + interface WindowGroupChangedEvent extends WindowBaseEvent { + /** + * Which group array the window that the event listener was registered on is included in: + * 'source' The window is included in sourceGroup. + * 'target' The window is included in targetGroup. + * 'nothing' The window is not included in sourceGroup nor targetGroup. + */ + memberOf: "source" | "target" | "nothing"; + /** + * The reason this event was triggered. + * 'leave' A window has left the group due to a leave or merge with group. + * 'join' A window has joined the group. + * 'merge' Two groups have been merged together. + * 'disband' There are no other windows in the group. + */ + reason: "leave" | "join" | "merge" | "disband"; + /** + * All the windows in the group the sourceWindow originated from. + */ + sourceGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. + */ + sourceWindowAppUuid: string; + /** + * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. + */ + sourceWindowName: string; + /** + * All the windows in the group the targetWindow orginated from + */ + targetGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowAppUuid: string; + /** + * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowName: string; + type: "group-changed"; + } + + interface WindowOfGroupInfo { + /** + * The UUID of the application this window entry belongs to. + */ + appUuid: string; + /** + * The name of this window entry. + */ + windowName: string; + } + + interface WindowHiddenEvent extends WindowBaseEvent { + /** + * What action prompted the close. + * The reasons are: "hide", "hide-on-close" + */ + reason: "hide" | "hide-on-close"; + type: "hidden"; + } + + interface Window_NavigationRejectedEvent { + name: string; + /** + * source of navigation window name + */ + sourceName: string; + topic: "navigation-rejected"; + /** + * Url that was not reached "http://blocked-content.url" + */ + url: string; + /** + * the UUID of the application the window belongs to. + */ + uuid: string; + } + + interface AnimationTransition { + opacity?: { + /** + * This value is clamped from 0.0 to 1.0 + */ + opacity?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'opacity' as absolute or as a delta. Defaults to false. + */ + relative?: boolean; + }; + position?: { + /** + * Defaults to the window's current left position in virtual screen coordinates. + */ + left?: number; + /** + * Defaults to the window's current top position in virtual screen coordinates. + */ + top?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + size?: { + /** + * Optional if height is present. Defaults to the window's current width. + */ + width?: number; + /** + * Optional if width is present. Defaults to the window's current height. + */ + height?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + } + + interface AnimationOptions { + /** + * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. + */ + interrupt?: boolean; + /** + * Transition effect. Defaults to 'ease-in-out'. + */ + tween?: OpenFinTweenType; + } + + interface WindowBounds { + /** + * the height of the window. + */ + height?: number; + /** + * left-most coordinate of the window. + */ + left?: number; + /** + * top-most coordinate of the window. + */ + top?: number; + /** + * the width of the window. + */ + width?: number; + } + + interface SessionChangedEvent { + /** + * the action that triggered this event: + */ + reason: "lock" + | "unlock" + | "remote-connect" + | "remote-disconnect" + | "unknown"; + topic: "system"; + type: "session-changed"; + } + + interface LaunchInfo { + launchMode: "fin-protocol" + | "fins-protocol" + | "shortcut" + | "command-line" + | "adapter" + | "other" + | string; + } + + type OpenFinTweenType = "linear" + | "ease-in" + | "ease-out" + | "ease-in-out" + | "ease-in-quad" + | "ease-out-quad" + | "ease-in-out-quad" + | "ease-in-cubic" + | "ease-out-cubic" + | "ease-in-out-cubic" + | "ease-out-bounce" + | "ease-in-back" + | "ease-out-back" + | "ease-in-out-back" + | "ease-in-elastic" + | "ease-out-elastic" + | "ease-in-out-elastic"; + + type OpenFinApplicationEventType = "closed" + | "connected" + | "crashed" + | "initialized" + | "manifest-changed" + | "not-responding" + | "out-of-memory" + | "responding" + | "run-requested" + | "started" + | "tray-icon-clicked" + | "window-alert-requested" + | "window-auth-requested" + | "window-closed" + | "window-created" + | "window-end-load" + | "window-navigation-rejected" + | "window-show-requested" + | "window-start-load"; + + type OpenFinExternalApplicationEventType = "connected" + | "disconnected"; + + type OpenFinSystemEventType = "application-closed" + | "application-crashed" + | "application-created" + | "application-started" + | "desktop-icon-clicked" + | "idle-state-changed" + | "monitor-info-changed" + | "session-changed"; + + type OpenFinWindowEventType = "auth-requested" + | "blurred" + | "bounds-changed" + | "bounds-changing" + | "close-requested" + | "closed" + | "disabled-frame-bounds-changed" + | "disabled-frame-bounds-changing" + | "embedded" + | "external-process-exited" + | "external-process-started" + | "focused" + | "frame-disabled" + | "frame-enabled" + | "group-changed" + | "hidden" + | "initialized" + | "maximized" + | "minimized" + | "navigation-rejected" + | "restored" + | "show-requested" + | "shown"; + + type OpenFinAnchor = "top-left" + | "top-right" + | "bottom-left" + | "bottom-right"; +} diff --git a/types/openfin/v17/openfin-tests.ts b/types/openfin/v17/openfin-tests.ts new file mode 100644 index 0000000000..61b819018f --- /dev/null +++ b/types/openfin/v17/openfin-tests.ts @@ -0,0 +1,721 @@ +function test_application() { + let application: fin.OpenFinApplication; + // constructor + application = new fin.desktop.Application({ + url: "application.html", + uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", + name: "Application Name", + plugins: false, + mainWindowOptions: { + defaultHeight: 600, + defaultWidth: 800, + defaultTop: 300, + defaultLeft: 300, + autoShow: true + } + }, (successObj) => { + console.log("Application successfully created, HTTP response code:", successObj); + application.run(); + }, (error) => { + console.log("Error creating application:", error); + }); + // getCurrent + application = fin.desktop.Application.getCurrent(); + // wrap + application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); + // getWindow + application.getWindow(); + // addEventListener + application.addEventListener("closed", (event) => { + console.log("The application has closed"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure: " + reason); + }); + // close + application.close(); + // getChildWindows + application.getChildWindows(children => { + children.forEach(childWindow => { + console.log("Showing child: " + childWindow.name); + childWindow.show(); + }); + }); + // getGroups + application.getGroups(allGroups => { + console.log(`There are a total of ${allGroups.length} groups.`); + + let groupCounter = 1; + allGroups.forEach(windowGroup => { + console.log(`Group ${groupCounter} contains ${windowGroup.length} windows.`); + ++groupCounter; + }); + }); + // getManifest + application.getManifest(manifest => { + console.log("Application manifest:"); + console.log(manifest); + }); + // getParentUuid + application.getParentUuid(parentUuid => { + console.log("UUID of parent application:"); + console.log(parentUuid); + }); + // getShortcuts + application.getShortcuts(config => { + console.log("Desktop shortcut is enabled: ", config.desktop); + console.log("Start Menu shortcut is enabled: ", config.startMenu); + console.log("System Startup shortcut is enabled: ", config.systemStartup); + }); + // getInfo + application.getInfo(info => { + console.log(`Launch mode: ${info.launchMode}`); + }); + // isRunning + application.isRunning(running => { + console.log("the application is", running ? "running" : "not running"); + }); + // registerCustomData + application.registerCustomData({ + someData: "this is custom" + }, () => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // removeEventListener + const previousCallback = (event: fin.WindowEvent) => { }; + application.removeEventListener("closed", previousCallback, () => { + console.log("The unregistration was successful"); + }, err => { + console.log("failure:", err); + }); + // removeTrayIcon + application.removeTrayIcon(() => { + console.log("Removed the tray icon."); + }, err => { + console.log("failure:", err); + }); + // restart + application.restart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // schedule restart + application.scheduleRestart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // setShortcuts + application.setShortcuts({ + desktop: true, + startMenu: false, + systemStartup: true + }, () => { + console.log("Successfully set new shortcut states"); + }, error => { + console.log("Failed to set new shortcut states. Error: ", error); + }); + // setTrayIcon + application.setTrayIcon("https://developer.openf.in/download/openfin.png", clickInfo => { + console.log(`The mouse has clicked at (${clickInfo.x}, ${clickInfo.y})`); + }); + // terminate + application.terminate(); + // wait + application.addEventListener("not-responding", () => { + console.log("waiting for hung application"); + application.wait(); + }); +} + +function test_external_application() { + let externalApp: fin.OpenFinExternalApplication; + // wrap + externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); + // addEventListener + externalApp.addEventListener('connected', () => { + console.log('external app connected'); + }, () => { + console.log('The registration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); + // removeEventListener + const previousCallback = () => { }; + externalApp.removeEventListener('connected', previousCallback, () => { + console.log('The unregistration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); +} + +function test_inter_application_bus() { + // addSubscribeListener + fin.desktop.InterApplicationBus.addSubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has subscribed to ${topic}`); + }); + // addUnsubscribeListener + fin.desktop.InterApplicationBus.addUnsubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has unsubscribed to ${topic}`); + }); + // removeSubscribeListener + const aRegisteredListener = (uuid: string, topic: string, name: string) => { }; + fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); + // removeUnsubscribeListener + fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); + // publish + fin.desktop.InterApplicationBus.publish("a topic", { + field1: "value1", + field2: "value2" + }); + // send + fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { + field1: "value1", + field2: "value2" + }); + // subscribe + fin.desktop.InterApplicationBus.subscribe("*", "a topic", (message, uuid, name) => { + console.log(`The application ${uuid} sent this message: ${message}`); + }); + // unsubscribe + const aRegisteredMessageListener = (message: any, senderUuid: string) => { + console.log(message, senderUuid); + }; + fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); +} + +function test_notification() { + let notification: fin.OpenFinNotification; + // getCurrent + notification = fin.desktop.Notification.getCurrent(); + // close + notification.close(); + // sendMessage + notification = new fin.desktop.Notification({ + duration: 10, + url: "http://localhost:5000/Account/Register", + message: "Hello", + onShow: () => { }, + // onClose: () => { }, + onDismiss: () => { }, + // onClick: () => { }, + onMessage: () => { }, + onError: () => { } + }); + // sendMessageToApplication + notification.sendMessageToApplication("some message"); +} + +function test_system() { + // addEventListener + fin.desktop.System.addEventListener('monitor-info-changed', event => { + console.log("The monitor information has changed to: ", event); + }, () => { + console.log("The registration was successful"); + }, err => { + console.log("failure: " + err); + }); + // clearCache + fin.desktop.System.clearCache({ + cache: true, + cookies: true, + localStorage: true, + appcache: true, + userData: true + }); + // deleteCacheOnExit + fin.desktop.System.deleteCacheOnExit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // downloadAsset + const dirAppAsset = { + src: 'http://local:8000/dir.zip', + alias: 'dirApp', + version: '1.23.24', + target: 'dir.bat', + args: '' + }; + fin.desktop.System.downloadAsset(dirAppAsset, progress => { + const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); + console.log(`Downloaded ${downloadedPercent}%`); + }, p => { + console.log(`Downlod complete, can be found on ${p.path}`); + // lets launch our application asset. + // launchDirApp(); + }, (reason, err) => { + console.log(reason, err); + }); + // exit + fin.desktop.System.exit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // getAllApplications + fin.desktop.System.getAllApplications(applicationInfoList => { + applicationInfoList.forEach(applicationInfo => { + console.log("Showing information for application with uuid: " + + applicationInfo.uuid); + console.log("isRunning: ", applicationInfo.isRunning); + }); + }); + // getAllExternalApplications + fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { + externalAppsInfoList.forEach(appInfo => { + console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); + }); + }); + // getAllWindows + fin.desktop.System.getAllWindows(windowInfoList => { + windowInfoList.forEach(windowInfo => { + console.log("Showing information for application with uuid: ", windowInfo.uuid); + console.log("Main window: ", windowInfo.mainWindow); + console.log("Child windows: ", windowInfo.childWindows); + }); + }); + // getCommandLineArguments + fin.desktop.System.getCommandLineArguments(args => { + console.log("The command line arguments are " + args); + }); + // getDeviceId + fin.desktop.System.getDeviceId(id => { + console.log("The id of the device is: " + id); + }); + // getEnvironmentVariable + fin.desktop.System.getEnvironmentVariable("APPDATA", variable => { + console.log("this is the APPDATA value", variable); + }); + // getHostSpecs + fin.desktop.System.getHostSpecs(info => { + console.log(info); + }, error => { + console.log('There was an error:', error); + }); + // getLog + fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', log => { + console.log(log); + }); + // getLogList + fin.desktop.System.getLogList(logList => { + logList.forEach(logInfo => { + console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); + }); + }); + // getMonitorInfo + fin.desktop.System.getMonitorInfo(monitorInfo => { + console.log("This object contains information about all monitors: ", monitorInfo); + }); + // getMousePosition + fin.desktop.System.getMousePosition(mousePosition => { + console.log(`The mouse is located at left: ${mousePosition.left}, top: ${mousePosition.top}`); + }); + // getProcessList + fin.desktop.System.getProcessList(list => { + list.forEach(process => { + console.log(`UUID: ${process.uuid}, Application Name: ${process.name}`); + }); + }); + // getProxySettings + fin.desktop.System.getProxySettings(proxy => { + console.log(proxy); + }); + // getRvmInfo + fin.desktop.System.getRvmInfo(rvmInfoObject => { + console.log("RVM version:", rvmInfoObject.version); + console.log("RVM has been running since:", rvmInfoObject["start-time"]); + }, err => { + console.log("Failed to get rvm info, error message:", err); + }); + // getVersion + fin.desktop.System.getVersion(version => { + console.log("The version is " + version); + }); + // launchExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + // Additionally note that the executable found in the zip file specified in appAssets + // will default to the one mentioned by appAssets.target + // If the the path below refers to a specific path it will override this default + alias: "myApp", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + alias: "myApp", + arguments: "e f g", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", + arguments: "--version", + certificate: { + trusted: true, + subject: 'O=OpenFin INC., L=New York, S=NY, C=US', + thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' + }, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // log + fin.desktop.System.log("info", "An example log message", () => { + console.log("message successfully logged"); + }, err => { + console.log(err); + }); + // monitorExternalProcess + fin.desktop.System.monitorExternalProcess({ + pid: 2508, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log("The process is now being monitored: ", payload.uuid); + }, error => { + console.log("Error:", error); + }); + // openUrlWithBrowser + fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // registerExternalConnection + fin.desktop.System.registerExternalConnection("remote-connection-uuid", (...args: any[]) => { + console.log(args); + }); + // releaseExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); + + // release it. + fin.desktop.System.releaseExternalProcess(result.uuid, () => { + console.log("Process has been unmapped!"); + }, reason => { + console.log("failure: " + reason); + }); + }); + // removeEventListener + const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; + fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // showDeveloperTools + fin.desktop.System.showDeveloperTools("uuid", "name", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // terminateExternalProcess + fin.desktop.System.launchExternalProcess({ + // notepad is in the system's PATH + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); + + // Attempt to close the process. Terminate after 4 seconds if it + // has not done so. + fin.desktop.System.terminateExternalProcess(result.uuid, 4000, info => { + console.log("Termination result " + info.result); + }, reason => { + console.log("failure: " + reason); + }); + }); + // updateProxySettings + fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, () => { + console.log('success'); + }, err => { + console.log(err); + }); +} + +function test_system_clipboard() { + // availableFormats + fin.desktop.System.Clipboard.availableFormats(null, formats => { + formats.forEach(format => console.log(`The format ${format} is available to read`)); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readHtml + fin.desktop.System.Clipboard.readHtml(null, html => { + console.log(`This is the html from the clipboard: ${html}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readRtf + fin.desktop.System.Clipboard.readRtf(null, rtf => { + console.log(`This is the rtf from the clipboard: ${rtf}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readText + fin.desktop.System.Clipboard.readText(null, text => { + console.log(`This is the text from the clipboard: ${text}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // write + fin.desktop.System.Clipboard.write({ + text: 'Hello Text!', + html: '

Hello Html

', + rtf: 'Hello Rtf' + }, null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeHtml + fin.desktop.System.Clipboard.writeHtml('

Hello World

', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeRtf + fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeText + fin.desktop.System.Clipboard.writeText('Hello World', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); +} + +function test_window() { + let finWindow: fin.OpenFinWindow; + // constructor + finWindow = new fin.desktop.Window({ + name: "childWindow", + url: "child.html", + defaultWidth: 320, + defaultHeight: 320, + defaultTop: 10, + defaultLeft: 300, + frame: false, + resizable: false, + state: "normal" + }, () => { + const _win = finWindow.getNativeWindow(); + _win.addEventListener("DOMContentLoaded", () => { finWindow.show(); }); + }, error => { + console.log("Error creating window:", error); + }); + // getCurrent + finWindow = fin.desktop.Window.getCurrent(); + // getNativeWindow + let nativeWindow: Window; + nativeWindow = finWindow.getNativeWindow(); + // getParentApplication + let parentApp: fin.OpenFinApplication; + parentApp = finWindow.getParentApplication(); + // getParentWindow + let parentFinWindow: fin.OpenFinWindow; + parentFinWindow = finWindow.getParentWindow(); + // wrap + finWindow = fin.desktop.Window.wrap("uuid", "name"); + // addEventListener + finWindow.addEventListener("bounds-changed", event => { + console.log("The window has been moved or resized"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure:" + reason); + }); + // animate + finWindow.animate({ + opacity: { + opacity: 0.15, + duration: 1000 + }, + position: { + left: 10, + top: 10, + duration: 3000 + } + }, { + interrupt: false + }, evt => { + // Callback will only fire after both "opacity" and "position" have finished animating. + }); + // authenticate + finWindow.addEventListener('auth-requested', evt => { + finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { + console.log("failure:", err); + }); + }); + // blur + finWindow.blur(); + // bringToFront + finWindow.bringToFront(); + // close + finWindow.close(); + // disableFrame + finWindow.disableFrame(); + // enableFrame + finWindow.enableFrame(); + // flash + finWindow.flash(); + // focus + finWindow.focus(); + // getBounds + finWindow.getBounds(bounds => { + console.log(`top: ${bounds.top} left: ${bounds.left} height: ${bounds.height} width: ${bounds.width}`); + }); + // getOptions + finWindow.getOptions(options => { + console.log(options); + }); + // getSnapshot + finWindow.getSnapshot(base64Snapshot => { + console.log("data:image/png;base64," + base64Snapshot); + }); + // getState + finWindow.getState(state => { + console.log("state: " + state); + }); + // getZoomLevel + finWindow.getZoomLevel(level => { + console.log("zoom level: " + level); + }, error => { + console.log('error:', error); + }); + // hide + finWindow.hide(); + // isShowing + finWindow.isShowing(showing => { + console.log("the window is " + (showing ? "showing" : "hidden")); + }); + // joinGroup + let secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When mainWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow); + }); + // leaveGroup + secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When finWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow, () => { + // once we are in the group, lets leave it. + secondWindow.leaveGroup(); + }); + }); + // maximize + finWindow.maximize(); + // mergeGroups + { + const finWindowOne = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowOne", + autoShow: true + }); + const finWindowTwo = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowTwo", + autoShow: true + }); + const finWindowThree = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowThree", + autoShow: true + }); + const finWindowFour = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowFour", + autoShow: true + }); + // When finWindowOne moves or is moved, finWindowTwo moves by the same amount + finWindowOne.joinGroup(finWindowTwo); + // When finWindowThree moves or is moved, finWindowFour moves by the same amount + finWindowThree.joinGroup(finWindowFour); + // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group + finWindowOne.mergeGroups(finWindowThree); + } + // minimize + finWindow.minimize(); + // moveBy + finWindow.moveBy(10, 10); + // moveTo + finWindow.moveTo(100, 200); + // removeEventListener + const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; + finWindow.removeEventListener("bounds-changed", aRegisteredListener); + // resizeBy + finWindow.resizeBy(10, 10, "top-right"); + // resizeTo + finWindow.resizeTo(10, 10, "top-right"); + // restore + finWindow.restore(); + // setAsForeground + finWindow.setAsForeground(); + // setBounds + finWindow.setBounds(100, 200, 400, 400); + // setZoomLevel + finWindow.setZoomLevel(10); + // show + finWindow.show(); + // showAt + finWindow.showAt(10, 10, false); + // stopFlashing + finWindow.stopFlashing(); + // updateOptions + finWindow.updateOptions({ + frame: false, + maxWidth: 500 + }); +} diff --git a/types/openfin/v17/tsconfig.json b/types/openfin/v17/tsconfig.json new file mode 100644 index 0000000000..5f07a9e025 --- /dev/null +++ b/types/openfin/v17/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "openfin": [ + "openfin/v17" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "openfin-tests.ts" + ] +} diff --git a/types/openfin/v17/tslint.json b/types/openfin/v17/tslint.json new file mode 100644 index 0000000000..64aace11d6 --- /dev/null +++ b/types/openfin/v17/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "max-line-length": false + } +} diff --git a/types/openlayers/index.d.ts b/types/openlayers/index.d.ts index 9dc5461f5e..2a7d1b0949 100644 --- a/types/openlayers/index.d.ts +++ b/types/openlayers/index.d.ts @@ -11952,7 +11952,7 @@ export namespace olx { interface VectorTileOptions { renderBuffer?: number; renderMode?: (ol.layer.VectorTileRenderType | string); - renderOrder: (feature1: ol.Feature, feature2: ol.Feature) => number; + renderOrder?: (feature1: ol.Feature, feature2: ol.Feature) => number; map?: ol.Map; extent?: ol.Extent; minResolution?: number; diff --git a/types/ora/index.d.ts b/types/ora/index.d.ts index d43a01c7cf..a3099f6cd9 100644 --- a/types/ora/index.d.ts +++ b/types/ora/index.d.ts @@ -83,6 +83,7 @@ interface Options { interval?: number; stream?: NodeJS.WritableStream; enabled?: boolean; + hideCursor?: boolean; } interface PersistOptions { diff --git a/types/parcel-env/index.d.ts b/types/parcel-env/index.d.ts new file mode 100644 index 0000000000..3de90c93bf --- /dev/null +++ b/types/parcel-env/index.d.ts @@ -0,0 +1,177 @@ +// Type definitions for Parcel (module API) +// Project: https://github.com/parcel/parcel-bundler +// Definitions by: Fathy Boundjadj +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Based on @types/webpack-env + +/** + * Parcel module API - variables and global functions available inside modules + */ + +declare namespace __ParcelModuleApi { + interface RequireFunction { + /** + * Returns the exports from a dependency. The call is sync. No request to the server is fired. The compiler ensures that the dependency is available. + */ + (path: string): any; + (path: string): T; + } + + interface Module { + exports: any; + require(id: string): any; + require(id: string): T; + id: string; + filename: string; + loaded: boolean; + parent: any; + children: any[]; + hot?: Hot; + } + type ModuleId = string|number; + + interface Hot { + /** + * Accept code updates for the specified dependencies. The callback is called when dependencies were replaced. + * @param dependencies + * @param callback + */ + accept(dependencies: string[], callback: (updatedDependencies: ModuleId[]) => void): void; + /** + * Accept code updates for the specified dependencies. The callback is called when dependencies were replaced. + * @param dependency + * @param callback + */ + accept(dependency: string, callback: () => void): void; + /** + * Accept code updates for this module without notification of parents. + * This should only be used if the module doesn’t export anything. + * The errHandler can be used to handle errors that occur while loading the updated module. + * @param errHandler + */ + accept(errHandler?: (err: Error) => void): void; + /** + * Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline". + */ + decline(dependencies: string[]): void; + /** + * Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline". + */ + decline(dependency: string): void; + /** + * Flag the current module as not update-able. If updated the update code would fail with code "decline". + */ + decline(): void; + /** + * Add a one time handler, which is executed when the current module code is replaced. + * Here you should destroy/remove any persistent resource you have claimed/created. + * If you want to transfer state to the new module, add it to data object. + * The data will be available at module.hot.data on the new module. + * @param callback + */ + dispose(callback: (data: any) => void): void; + dispose(callback: (data: T) => void): void; + /** + * Add a one time handler, which is executed when the current module code is replaced. + * Here you should destroy/remove any persistent resource you have claimed/created. + * If you want to transfer state to the new module, add it to data object. + * The data will be available at module.hot.data on the new module. + * @param callback + */ + addDisposeHandler(callback: (data: any) => void): void; + addDisposeHandler(callback: (data: T) => void): void; + /** + * Remove a handler. + * This can useful to add a temporary dispose handler. You could i. e. replace code while in the middle of a multi-step async function. + * @param callback + */ + removeDisposeHandler(callback: (data: any) => void): void; + removeDisposeHandler(callback: (data: T) => void): void; + /** + * Throws an exceptions if status() is not idle. + * Check all currently loaded modules for updates and apply updates if found. + * If no update was found, the callback is called with null. + * If autoApply is truthy the callback will be called with all modules that were disposed. + * apply() is automatically called with autoApply as options parameter. + * If autoApply is not set the callback will be called with all modules that will be disposed on apply(). + * @param autoApply + * @param callback + */ + check(autoApply: boolean, callback: (err: Error, outdatedModules: ModuleId[]) => void): void; + /** + * Throws an exceptions if status() is not idle. + * Check all currently loaded modules for updates and apply updates if found. + * If no update was found, the callback is called with null. + * The callback will be called with all modules that will be disposed on apply(). + * @param callback + */ + check(callback: (err: Error, outdatedModules: ModuleId[]) => void): void; + /** + * If status() != "ready" it throws an error. + * Continue the update process. + * @param options + * @param callback + */ + apply(options: AcceptOptions, callback: (err: Error, outdatedModules: ModuleId[]) => void): void; + /** + * If status() != "ready" it throws an error. + * Continue the update process. + * @param callback + */ + apply(callback: (err: Error, outdatedModules: ModuleId[]) => void): void; + /** + * Return one of idle, check, watch, watch-delay, prepare, ready, dispose, apply, abort or fail. + */ + status(): string; + /** Register a callback on status change. */ + status(callback: (status: string) => void): void; + /** Register a callback on status change. */ + addStatusHandler(callback: (status: string) => void): void; + /** + * Remove a registered status change handler. + * @param callback + */ + removeStatusHandler(callback: (status: string) => void): void; + + active: boolean; + data: any; + } + + interface AcceptOptions { + /** + * If true the update process continues even if some modules are not accepted (and would bubble to the entry point). + */ + ignoreUnaccepted?: boolean; + /** + * Indicates that apply() is automatically called by check function + */ + autoApply?: boolean; + } + /** + * Inside env you can pass any variable + */ + interface NodeProcess { + env?: any; + } + + type __Require1 = (id: string) => any; + type __Require2 = (id: string) => T; + type RequireLambda = __Require1 & __Require2; +} + +interface NodeRequire extends __ParcelModuleApi.RequireFunction { +} + +declare var require: NodeRequire; + +interface NodeModule extends __ParcelModuleApi.Module {} + +declare var module: NodeModule; + +/** +* Declare process variable +*/ +declare namespace NodeJS { + interface Process extends __ParcelModuleApi.NodeProcess {} +} +declare var process: NodeJS.Process; diff --git a/types/parcel-env/parcel-env-tests.ts b/types/parcel-env/parcel-env-tests.ts new file mode 100644 index 0000000000..9c17be0748 --- /dev/null +++ b/types/parcel-env/parcel-env-tests.ts @@ -0,0 +1,76 @@ + + +interface SomeModule { + someMethod(): void; +} + +let someModule = require('./someModule'); +someModule.someMethod(); + +let otherModule = require('./otherModule'); +otherModule.otherMethod(); + +// check if HMR is enabled +if(module.hot) { + // accept update of dependency + module.hot.accept("./handler.js", function() { + //... + }); +} + +module.exports = null; + +// check if HMR is enabled +if(module.hot) { + + // accept itself + module.hot.accept(); + + // dispose handler + module.hot.dispose(function() { + // revoke the side effect + //... + }); +} + +class ModuleData { + updated: boolean; +} + +if (module.hot) { + module.hot.accept((err: Error) => { + //... + }); + + module.hot.decline("./someModule"); + + module.hot.dispose((data: ModuleData) => { + data.updated = true; + // ... + }); + + let disposeHandler: ((data: ModuleData) => void) = data => { + // ... + }; + module.hot.addDisposeHandler(disposeHandler); + module.hot.removeDisposeHandler(disposeHandler); + + module.hot.check(true, (err: Error, outdatedModules: (string|number)[]) => { + // ... + }); + + module.hot.apply({ ignoreUnaccepted: true }, (err: Error, outdatedModules: (string|number)[]) => { + // ... + }); + + var status: string = module.hot.status(); + let statusHandler: ((status: string) => void) = status => { + // ... + }; + module.hot.status(statusHandler); + module.hot.addStatusHandler(statusHandler); + module.hot.removeStatusHandler(statusHandler); +} + + + diff --git a/types/rrule/tsconfig.json b/types/parcel-env/tsconfig.json similarity index 85% rename from types/rrule/tsconfig.json rename to types/parcel-env/tsconfig.json index 3e64a1d17a..bf765d8bae 100644 --- a/types/rrule/tsconfig.json +++ b/types/parcel-env/tsconfig.json @@ -18,8 +18,6 @@ }, "files": [ "index.d.ts", - "test/rrule.ts", - "test/commonJs.ts", - "test/global.ts" + "parcel-env-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/parcel-env/tslint.json b/types/parcel-env/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/parcel-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/parse/index.d.ts b/types/parse/index.d.ts index 15d653a791..908281f84d 100644 --- a/types/parse/index.d.ts +++ b/types/parse/index.d.ts @@ -1,10 +1,11 @@ -// Type definitions for parse 2.4 -// Project: https://parse.com/ +// Type definitions for parse 1.11.1 +// Project: https://parseplatform.org/ // Definitions by: Ullisen Media Group // David Poetzsch-Heffter // Cedric Kemp // Flavio Negrão // Wes Grimes +// Otherwise SAS // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -88,6 +89,7 @@ declare namespace Parse { then(resolvedCallback: (...values: T[]) => IPromise, rejectedCallback?: (reason: any) => IPromise): IPromise; then(resolvedCallback: (...values: T[]) => U, rejectedCallback?: (reason: any) => IPromise): IPromise; then(resolvedCallback: (...values: T[]) => U, rejectedCallback?: (reason: any) => U): IPromise; + catch(resolvedCallback: (...values: T[]) => U, rejectedCallback?: (reason: any) => U): IPromise; } class Promise implements IPromise { @@ -109,6 +111,7 @@ declare namespace Parse { rejectedCallback?: (reason: any) => IPromise): IPromise; then(resolvedCallback: (...values: T[]) => U, rejectedCallback?: (reason: any) => U): IPromise; + catch(resolvedCallback: (...values: T[]) => U, rejectedCallback?: (reason: any) => U): IPromise; } interface Pointer { @@ -607,6 +610,7 @@ declare namespace Parse { static or(...var_args: Query[]): Query; + aggregate(pipeline: Query.AggregationOptions|Query.AggregationOptions[]): Query; addAscending(key: string): Query; addAscending(key: string[]): Query; addDescending(key: string): Query; @@ -623,6 +627,7 @@ declare namespace Parse { doesNotExist(key: string): Query; doesNotMatchKeyInQuery(key: string, queryKey: string, query: Query): Query; doesNotMatchQuery(key: string, query: Query): Query; + distinct(key: string): Query; each(callback: Function, options?: Query.EachOptions): Promise; endsWith(key: string, suffix: string): Query; equalTo(key: string, value: any): Query; @@ -659,6 +664,17 @@ declare namespace Parse { interface FindOptions extends SuccessFailureOptions, ScopeOptions { } interface FirstOptions extends SuccessFailureOptions, ScopeOptions { } interface GetOptions extends SuccessFailureOptions, ScopeOptions { } + + // According to http://docs.parseplatform.org/rest/guide/#aggregate-queries + interface AggregationOptions { + group?: { objectId?: string, [key:string]: any }; + match?: {[key: string]: any}; + project?: {[key: string]: any}; + limit?: number; + skip?: number; + // Sort documentation https://docs.mongodb.com/v3.2/reference/operator/aggregation/sort/#pipe._S_sort + sort?: {[key: string]: 1|-1}; + } } /** @@ -1151,4 +1167,4 @@ declare module "parse/node" { declare module "parse" { import * as parse from "parse/node"; export = parse -} \ No newline at end of file +} diff --git a/types/parse/parse-tests.ts b/types/parse/parse-tests.ts index ceb5693087..acb194ed6a 100644 --- a/types/parse/parse-tests.ts +++ b/types/parse/parse-tests.ts @@ -134,6 +134,16 @@ function test_query() { query.include("score"); query.include(["score.team"]); + // Find objects that match the aggregation pipeline + query.aggregate({ + group:{ + objectId: '$name' + } + }); + + // Find objects with distinct key + query.distinct('name'); + const testQuery = Parse.Query.or(query, query); } @@ -396,7 +406,7 @@ function test_cloud_functions() { Parse.Cloud.beforeSave('MyCustomClass', (request: Parse.Cloud.BeforeSaveRequest, response: Parse.Cloud.BeforeSaveResponse) => { - + if (request.object.isNew()) { if (!request.object.has('immutable')) return response.error('Field immutable is required') } else { @@ -504,6 +514,15 @@ function test_promise() { // failed }); + // Test promise with a query + const query = new Parse.Query('Test'); + query.find() + .then(() => { + // success + }).catch(() => { + // error + }); + // can check whether an object is a Parse.Promise object or not Parse.Promise.is(resolved); } diff --git a/types/passport-anonymous/index.d.ts b/types/passport-anonymous/index.d.ts index 6e45ed3a23..969f158526 100644 --- a/types/passport-anonymous/index.d.ts +++ b/types/passport-anonymous/index.d.ts @@ -6,6 +6,6 @@ import * as passport from "passport"; -export class Strategy implements passport.Strategy { - authenticate: () => void; +export class Strategy extends passport.Strategy { + authenticate(): void; } diff --git a/types/passport-beam/index.d.ts b/types/passport-beam/index.d.ts index 6d7d1de430..65096a9bd6 100644 --- a/types/passport-beam/index.d.ts +++ b/types/passport-beam/index.d.ts @@ -10,10 +10,10 @@ import * as passport from 'passport'; import * as express from 'express'; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: Strategy.IStrategyOption, verify: (accessToken: string, refreshToken: string, profile: Strategy.Profile, done: (error: any, user?: any) => void) => void); name: string; - authenticate: (req: express.Request, options?: Object) => void; + authenticate(req: express.Request, options?: Object): void; } export namespace Strategy { diff --git a/types/passport-discord/index.d.ts b/types/passport-discord/index.d.ts index 66b9474a2d..70553a25cd 100644 --- a/types/passport-discord/index.d.ts +++ b/types/passport-discord/index.d.ts @@ -8,10 +8,10 @@ import * as passport from 'passport'; import * as express from 'express'; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: Strategy.StrategyOption, verify: (accessToken: string, refreshToken: string, profile: Strategy.Profile, done: (error: any, user?: any) => void) => void); name: string; - authenticate: (req: express.Request, options?: object) => void; + authenticate(req: express.Request, options?: object): void; authorizationParams(options: any): any; diff --git a/types/passport-facebook/index.d.ts b/types/passport-facebook/index.d.ts index 5d20f0d39c..89ce91b093 100644 --- a/types/passport-facebook/index.d.ts +++ b/types/passport-facebook/index.d.ts @@ -47,10 +47,10 @@ export type VerifyFunction = export type VerifyFunctionWithRequest = (req: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOptionWithRequest, verify: VerifyFunctionWithRequest); constructor(options: StrategyOption, verify: VerifyFunction); name: string; - authenticate: (req: express.Request, options?: object) => void; + authenticate(req: express.Request, options?: object): void; } diff --git a/types/passport-github/index.d.ts b/types/passport-github/index.d.ts index c4a253016f..99c84bd391 100644 --- a/types/passport-github/index.d.ts +++ b/types/passport-github/index.d.ts @@ -26,10 +26,10 @@ export interface StrategyOption { userProfileURL?: string; } -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOption, verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void); userProfile: (accessToken: string, done?: (error: any, profile: Profile) => void) => void; name: string; - authenticate: (req: express.Request, options?: passport.AuthenticateOptions) => void; + authenticate(req: express.Request, options?: passport.AuthenticateOptions): void; } diff --git a/types/passport-github2/index.d.ts b/types/passport-github2/index.d.ts index b0310a6f3b..902bcea6e0 100644 --- a/types/passport-github2/index.d.ts +++ b/types/passport-github2/index.d.ts @@ -28,10 +28,10 @@ export interface StrategyOption { userProfileURL?: string; } -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOption, verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void); userProfile: (accessToken: string, done?: (error: any, profile: Profile) => void) => void; name: string; - authenticate: (req: express.Request, options?: passport.AuthenticateOptions) => void; + authenticate(req: express.Request, options?: passport.AuthenticateOptions): void; } diff --git a/types/passport-google-oauth/index.d.ts b/types/passport-google-oauth/index.d.ts index a56c91e73f..8b45504cb2 100644 --- a/types/passport-google-oauth/index.d.ts +++ b/types/passport-google-oauth/index.d.ts @@ -33,7 +33,7 @@ interface VerifyFunction { (error: any, user?: any, msg?: VerifyOptions): void; } -declare class OAuthStrategy implements passport.Strategy { +declare class OAuthStrategy extends passport.Strategy { constructor( options: IOAuthStrategyOption, verify: ( @@ -44,7 +44,7 @@ declare class OAuthStrategy implements passport.Strategy { ) => void ); name: string; - authenticate: (req: express.Request, options?: Object) => void; + authenticate(req: express.Request, options?: Object): void; } interface IOAuth2StrategyOption { diff --git a/types/passport-google-oauth2/index.d.ts b/types/passport-google-oauth2/index.d.ts index a2ba210c4b..cd40791eb7 100644 --- a/types/passport-google-oauth2/index.d.ts +++ b/types/passport-google-oauth2/index.d.ts @@ -12,6 +12,7 @@ export interface StrategyOptions { callbackURL: string; passReqToCallback?: true; scope?: string[]; + proxy?: boolean; } export interface StrategyOptionsWithRequest { diff --git a/types/passport-http-bearer/index.d.ts b/types/passport-http-bearer/index.d.ts index 698b0bfed5..58da308106 100644 --- a/types/passport-http-bearer/index.d.ts +++ b/types/passport-http-bearer/index.d.ts @@ -28,11 +28,11 @@ interface VerifyFunctionWithRequest { (req: express.Request, token: string, done: (error: any, user?: any, options?: IVerifyOptions | string) => void): void; } -declare class Strategy implements passport.Strategy { +declare class Strategy extends passport.Strategy { constructor(verify: VerifyFunction); constructor(options: IStrategyOptions, verify: VerifyFunction); constructor(options: IStrategyOptions, verify: VerifyFunctionWithRequest); name: string; - authenticate: (req: express.Request, options?: Object) => void; + authenticate(req: express.Request, options?: Object): void; } diff --git a/types/passport-http/index.d.ts b/types/passport-http/index.d.ts index fa3f968e7e..63527b6225 100644 --- a/types/passport-http/index.d.ts +++ b/types/passport-http/index.d.ts @@ -52,19 +52,19 @@ export type DigestValidateFunction = ( done: (error: any, valid: boolean) => void, ) => any; -export class BasicStrategy implements passport.Strategy { +export class BasicStrategy extends passport.Strategy { constructor(verify: BasicVerifyFunction); constructor(options: BasicStrategyOptions, verify: BasicVerifyFunction); constructor(options: BasicStrategyOptions, verify: BasicVerifyFunctionWithRequest); name: string; - authenticate: (req: express.Request, options?: object) => void; + authenticate(req: express.Request, options?: object): void; } -export class DigestStrategy implements passport.Strategy { +export class DigestStrategy extends passport.Strategy { constructor(secret: DigestSecretFunction, validate?: DigestValidateFunction); constructor(options: DigestStrategyOptions, secret: DigestSecretFunction, validate?: DigestValidateFunction); name: string; - authenticate: (req: express.Request, options?: object) => void; + authenticate(req: express.Request, options?: object): void; } diff --git a/types/passport-kakao/index.d.ts b/types/passport-kakao/index.d.ts index d99f608ab7..b005b45d98 100644 --- a/types/passport-kakao/index.d.ts +++ b/types/passport-kakao/index.d.ts @@ -27,9 +27,9 @@ export interface StrategyOption { export type VerifyFunction = (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOption, verify: VerifyFunction); - authenticate: (req: express.Request, options?: any) => void; + authenticate(req: express.Request, options?: any): void; userProfile: (accessToken: string, done: (error: any, user?: any) => void) => void; } diff --git a/types/passport-local/index.d.ts b/types/passport-local/index.d.ts index 2fe5bde949..9555046fed 100644 --- a/types/passport-local/index.d.ts +++ b/types/passport-local/index.d.ts @@ -6,20 +6,20 @@ /// - - -import { Strategy as PassportStrategy } from 'passport-strategy'; -import express = require('express'); +import { Strategy as PassportStrategy } from "passport-strategy"; +import express = require("express"); interface IStrategyOptions { usernameField?: string; passwordField?: string; + session?: boolean; passReqToCallback?: false; } interface IStrategyOptionsWithRequest { usernameField?: string; passwordField?: string; + session?: boolean; passReqToCallback: true; } @@ -28,15 +28,27 @@ interface IVerifyOptions { } interface VerifyFunctionWithRequest { - (req: express.Request, username: string, password: string, done: (error: any, user?: any, options?: IVerifyOptions) => void): void; + ( + req: express.Request, + username: string, + password: string, + done: (error: any, user?: any, options?: IVerifyOptions) => void + ): void; } interface VerifyFunction { - (username: string, password: string, done: (error: any, user?: any, options?: IVerifyOptions) => void): void; + ( + username: string, + password: string, + done: (error: any, user?: any, options?: IVerifyOptions) => void + ): void; } declare class Strategy extends PassportStrategy { - constructor(options: IStrategyOptionsWithRequest, verify: VerifyFunctionWithRequest); + constructor( + options: IStrategyOptionsWithRequest, + verify: VerifyFunctionWithRequest + ); constructor(options: IStrategyOptions, verify: VerifyFunction); constructor(verify: VerifyFunction); diff --git a/types/passport-naver/index.d.ts b/types/passport-naver/index.d.ts index 75c21b76ed..8bd022cd21 100644 --- a/types/passport-naver/index.d.ts +++ b/types/passport-naver/index.d.ts @@ -37,10 +37,10 @@ export interface StrategyOption { export type VerifyFunction = (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOption, verify: VerifyFunction); - authenticate: (req: express.Request, options?: any) => void; + authenticate(req: express.Request, options?: any): void; authorizationParams: (options: any) => any; userProfile: (accessToken: string, done: (error: any, user?: any) => void) => void; } diff --git a/types/passport-oauth2-client-password/index.d.ts b/types/passport-oauth2-client-password/index.d.ts index 2a93a87608..faab5d59d4 100644 --- a/types/passport-oauth2-client-password/index.d.ts +++ b/types/passport-oauth2-client-password/index.d.ts @@ -22,10 +22,10 @@ interface VerifyFunction { (clientId: string, clientSecret: string, done: (error: any, client?: any, info?: any) => void): void; } -declare class Strategy implements passport.Strategy { +declare class Strategy extends passport.Strategy { constructor(options: StrategyOptionsWithRequestInterface, verify: VerifyFunctionWithRequest); constructor(verify: VerifyFunction); name: string; - authenticate: (req: express.Request, options?: {}) => void; + authenticate(req: express.Request, options?: {}): void; } diff --git a/types/passport-oauth2/index.d.ts b/types/passport-oauth2/index.d.ts index 09facb2ef7..5dd811f342 100644 --- a/types/passport-oauth2/index.d.ts +++ b/types/passport-oauth2/index.d.ts @@ -7,7 +7,7 @@ import { Request } from 'express'; import { Strategy } from 'passport'; -declare class OAuth2Strategy implements Strategy { +declare class OAuth2Strategy extends Strategy { name: string; constructor(options: OAuth2Strategy.StrategyOptions, verify: OAuth2Strategy.VerifyFunction); diff --git a/types/passport-saml/index.d.ts b/types/passport-saml/index.d.ts index e93869ca87..5e24211008 100644 --- a/types/passport-saml/index.d.ts +++ b/types/passport-saml/index.d.ts @@ -24,7 +24,7 @@ export type VerifyWithRequest = (req: express.Request, profile: {}, done: Verifi export type VerifyWithoutRequest = (profile: {}, done: VerifiedCallback) => void; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(config: SamlConfig, verify: VerifyWithRequest | VerifyWithoutRequest); authenticate(req: express.Request, options: AuthenticateOptions | AuthorizeOptions): void; logout(req: express.Request, callback: (err: Error | null, url: string) => void): void; diff --git a/types/passport-strategy/index.d.ts b/types/passport-strategy/index.d.ts index 1a0b2dd4f5..f8b227bfd6 100644 --- a/types/passport-strategy/index.d.ts +++ b/types/passport-strategy/index.d.ts @@ -16,7 +16,7 @@ import passport = require('passport'); import express = require('express'); -declare class Strategy implements passport.Strategy { +declare class Strategy extends passport.Strategy { /** * Performs authentication for the request. * Note: Virtual function - re-implement in the strategy. diff --git a/types/passport-twitter/index.d.ts b/types/passport-twitter/index.d.ts index fe341a4b5b..ae8f192d79 100644 --- a/types/passport-twitter/index.d.ts +++ b/types/passport-twitter/index.d.ts @@ -44,12 +44,12 @@ interface IStrategyOptionWithRequest extends IStrategyOptionBase { passReqToCallback: true; } -declare class Strategy implements passport.Strategy { +declare class Strategy extends passport.Strategy { constructor(options: IStrategyOption, verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void); constructor(options: IStrategyOptionWithRequest, verify: (req: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void); name: string; - authenticate: (req: express.Request, options?: Object) => void; + authenticate(req: express.Request, options?: Object): void; } diff --git a/types/passport-unique-token/index.d.ts b/types/passport-unique-token/index.d.ts index 081a85b29d..66887cdcde 100644 --- a/types/passport-unique-token/index.d.ts +++ b/types/passport-unique-token/index.d.ts @@ -33,11 +33,11 @@ export interface VerifyOptions { export type VerifyFunctionWithRequest = (req: express.Request, token: string, done: (error: any, user?: any, options?: VerifyOptions) => void) => void; export type VerifyFunction = (token: string, done: (error: any, user?: any, options?: VerifyOptions) => void) => void; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOptionsWithRequest, verify: VerifyFunctionWithRequest); constructor(options: StrategyOptions, verify: VerifyFunction); constructor(verify: VerifyFunction); name: string; - authenticate: (req: express.Request, options?: object) => void; + authenticate(req: express.Request, options?: object): void; } diff --git a/types/passport/index.d.ts b/types/passport/index.d.ts index 06c7f0b9db..4a91d2b64b 100644 --- a/types/passport/index.d.ts +++ b/types/passport/index.d.ts @@ -73,6 +73,7 @@ declare namespace passport { interface PassportStatic extends Authenticator { Authenticator: { new(): Authenticator }; Passport: PassportStatic["Authenticator"]; + Strategy: { new(): Strategy & StrategyCreatedStatic }; } interface Strategy { diff --git a/types/passport/passport-tests.ts b/types/passport/passport-tests.ts index 630091afc7..f7d988c56c 100644 --- a/types/passport/passport-tests.ts +++ b/types/passport/passport-tests.ts @@ -2,14 +2,18 @@ import * as passport from 'passport'; import express = require('express'); import 'express-session'; -class TestStrategy implements passport.Strategy { +class TestStrategy extends passport.Strategy { name = 'test'; - constructor() { } - authenticate(this: passport.StrategyCreated, req: express.Request) { + + authenticate(req: express.Request) { const user: TestUser = { id: 0, }; - this.success(user); + if (Math.random() > 0.5) { + this.fail(); + } else { + this.success(user); + } } } diff --git a/types/path-is-inside/index.d.ts b/types/path-is-inside/index.d.ts new file mode 100644 index 0000000000..26a28e5db4 --- /dev/null +++ b/types/path-is-inside/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for path-is-inside 1.0 +// Project: https://github.com/domenic/path-is-inside#readme +// Definitions by: Alexander Marks +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function pathIsInside(thePath: string, + potentialParent: string): boolean; +export = pathIsInside; diff --git a/types/path-is-inside/path-is-inside-tests.ts b/types/path-is-inside/path-is-inside-tests.ts new file mode 100644 index 0000000000..723947124a --- /dev/null +++ b/types/path-is-inside/path-is-inside-tests.ts @@ -0,0 +1,3 @@ +import pathIsInside = require('path-is-inside'); + +pathIsInside('path', 'parent'); // $ExpectType boolean diff --git a/types/path-is-inside/tsconfig.json b/types/path-is-inside/tsconfig.json new file mode 100644 index 0000000000..50af237e9a --- /dev/null +++ b/types/path-is-inside/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", + "path-is-inside-tests.ts" + ] +} diff --git a/types/path-is-inside/tslint.json b/types/path-is-inside/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/path-is-inside/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/pdfmake/index.d.ts b/types/pdfmake/index.d.ts new file mode 100644 index 0000000000..9d5f8023c3 --- /dev/null +++ b/types/pdfmake/index.d.ts @@ -0,0 +1,70 @@ +// Type definitions for pdfmake 0.1 +// Project: http://pdfmake.org +// Definitions by: Milen Stefanov +// Rajab Shakirov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'pdfmake/build/vfs_fonts' { + let pdfMake: { + vfs: any; + [name: string]: any; + }; +} + +declare module 'pdfmake/build/pdfmake' { + let vfs: TFontFamily; + let fonts: { [name: string]: TFontFamilyTypes }; + function createPdf(documentDefinitions: TDocumentDefinitions): TCreatedPdf; + + type pageSizeType = + '4A0' | '2A0' | 'A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'A7' | 'A8' | 'A9' | 'A10' | + 'B0' | 'B1' | 'B2' | 'B3' | 'B4' | 'B5' | 'B6' | 'B7' | 'B8' | 'B9' | 'B10' | + 'C0' | 'C1' | 'C2' | 'C3' | 'C4' | 'C5' | 'C6' | 'C7' | 'C8' | 'C9' | 'C10' | + 'RA0' | 'RA1' | 'RA2' | 'RA3' | 'RA4' | + 'SRA0' | 'SRA1' | 'SRA2' | 'SRA3' | 'SRA4' | + 'EXECUTIVE' | 'FOLIO' | 'LEGAL' | 'LETTER' | 'TABLOID'; + + type pageOrientationType = "portrait" | "landscape"; + + let pdfMake: pdfMakeStatic; + + interface TFontFamily { + [fontName: string]: string; + } + + interface TFontFamilyTypes { + normal?: string; + bold?: string; + italics?: string; + bolditalics?: string; + } + + interface TDocumentDefinitions { + content: any; + styles?: any; + pageSize?: pageSizeType; + pageOrientation?: pageOrientationType; + pageMargins?: [number, number, number, number]; + defaultStyle?: { + font?: string; + }; + } + + type CreatedPdfParams = ( + defaultFileName?: string, + cb?: string, + options?: string + ) => void; + + interface TCreatedPdf { + download: CreatedPdfParams; + open: CreatedPdfParams; + print: CreatedPdfParams; + } + + interface pdfMakeStatic { + vfs: TFontFamily; + fonts: { [name: string]: TFontFamilyTypes }; + createPdf(documentDefinitions: TDocumentDefinitions): TCreatedPdf; + } +} diff --git a/types/pdfmake/pdfmake-tests.ts b/types/pdfmake/pdfmake-tests.ts new file mode 100644 index 0000000000..0f23e5c5d5 --- /dev/null +++ b/types/pdfmake/pdfmake-tests.ts @@ -0,0 +1,10 @@ +import * as pdfMake from 'pdfmake/build/pdfmake'; +import * as pdfFonts from 'pdfmake/build/vfs_fonts'; + +const docDefinition = { content: 'This is an sample PDF printed with pdfMake' }; + +const createPdf = () => { + const pdf = pdfMake; + pdf.vfs = pdfFonts.pdfMake.vfs; + pdfMake.createPdf(docDefinition).download(); +}; diff --git a/types/pdfmake/tsconfig.json b/types/pdfmake/tsconfig.json new file mode 100644 index 0000000000..2e8b5b10af --- /dev/null +++ b/types/pdfmake/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "esModuleInterop": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "pdfmake-tests.ts" + ] +} diff --git a/types/pdfmake/tslint.json b/types/pdfmake/tslint.json new file mode 100644 index 0000000000..aa858f144a --- /dev/null +++ b/types/pdfmake/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-declare-current-package": false + } +} \ No newline at end of file diff --git a/types/phonegap-nfc/phonegap-nfc-tests.ts b/types/phonegap-nfc/phonegap-nfc-tests.ts index 50eb34f293..b61009a7da 100644 --- a/types/phonegap-nfc/phonegap-nfc-tests.ts +++ b/types/phonegap-nfc/phonegap-nfc-tests.ts @@ -117,6 +117,7 @@ let ndefTagEvent = { AT_TARGET: 0, BUBBLING_PHASE: 0, CAPTURING_PHASE: 0, + NONE: 0, scoped: false, deepPath(): any { }, tag: ndefTag diff --git a/types/plupload/index.d.ts b/types/plupload/index.d.ts index 614ba27261..df313bcc54 100644 --- a/types/plupload/index.d.ts +++ b/types/plupload/index.d.ts @@ -18,7 +18,7 @@ interface plupload_settings { multipart_params?: any; /** Chunk */ - chunk_size?: number|string; + chunk_size?: number | string; /** Client-Side Image Resize */ resize?: plupload_resize; @@ -28,7 +28,7 @@ interface plupload_settings { /** Useful Options */ multi_selection?: boolean; - required_features?: string|any; + required_features?: string | any; unique_names?: boolean; /** Optional */ @@ -44,7 +44,7 @@ interface plupload_settings { interface plupload_filters { mime_types?: plupload_filters_mime_types[]; - max_file_size?: number|string; + max_file_size?: number | string; prevent_duplicates?: boolean; } @@ -73,31 +73,31 @@ interface plupload_queue_progress { } interface plupload_event { - (uploader: plupload): any; + (uploader: plupload.Uploader): any; } interface plupload_event_file { - (uploader: plupload, file: any): any; + (uploader: plupload.Uploader, file: any): any; } interface plupload_event_files { - (uploader: plupload, files: any[]): any; + (uploader: plupload.Uploader, files: any[]): any; } interface plupload_event_OptionChanged { - (uploader: plupload, name: string, value: any, oldValue: any): any; + (uploader: plupload.Uploader, name: string, value: any, oldValue: any): any; } interface plupload_event_FileUploaded { - (uploader: plupload, file: any, response: plupload_response): any; + (uploader: plupload.Uploader, file: any, response: plupload_response): any; } interface plupload_event_ChunkUploaded { - (uploader: plupload, file: any, response: plupload_chunk_response): any; + (uploader: plupload.Uploader, file: any, response: plupload_chunk_response): any; } interface plupload_event_Error { - (uploader: plupload, error: plupload_error): any; + (uploader: plupload.Uploader, error: plupload_error): any; } interface plupload_events { @@ -137,61 +137,634 @@ interface plupload_error extends plupload_response { file: any; } -declare class plupload { - static Uploader(settings: plupload_settings):void; +declare namespace plupload { - static VERSION: string; + class Uploader { - static STOPPED: number; - static STARTED: number; - static QUEUED: number; - static UPLOADING: number; - static FAILED: number; - static DONE: number; - static GENERIC_ERROR: number; - static HTTP_ERROR: number; - static IO_ERROR: number; - static SECURITY_ERROR: number; - static INIT_ERROR: number; - static FILE_SIZE_ERROR: number; - static FILE_EXTENSION_ERROR: number; - static FILE_DUPLICATE_ERROR: number; - static IMAGE_FORMAT_ERROR: number; - static MEMORY_ERROR: number; - static IMAGE_DIMENSIONS_ERROR: number; + constructor(settings: plupload_settings); - static mimeTypes: any; - static ua: any; + /** + * Unique id for the Uploader instance. + * + * @property id + * @type String + */ + id: string; - static typeOf(o: any): string; - static extend(target: any): any; - static guid(guid: string): string; + /** + * Current state of the total uploading progress. This one can either be plupload.STARTED or plupload.STOPPED. + * These states are controlled by the stop/start methods. The default value is STOPPED. + * + * @property state + * @type Number + */ + state: number; - /** Properties */ - id: string; - state: number; - features: string; - runtime: string; - files: any; - settings: any; - total: plupload_queue_progress; + /** + * Map of features that are available for the uploader runtime. Features will be filled + * before the init event is called, these features can then be used to alter the UI for the end user. + * Some of the current features that might be in this map is: dragdrop, chunks, jpgresize, pngresize. + * + * @property features + * @type Object + */ + features: any; - /** Methods */ - init(): any; - setOption(option: string|any, value?: any): any; - getOption(option?: string): any; - refresh(): any; - start(): any; - stop(): any; - disableBrowse(disable: boolean): any; - getFile(id: string): any; - addFile(file: any, fileName?: string): any; - removeFile(file: any): any; - splice(start?: number, length?: number): any; - trigger(name: string, Multiple: any): any; - hasEventListener(name: string): any; - bind(name: string, func: any, scope: any): any; - unbind(name: string, func: any): any; - unbindAll(): any; - destroy(): any; + /** + * Current runtime name. + * + * @property runtime + * @type String + */ + runtime: string; + + /** + * Current upload queue, an array of File instances. + * + * @property files + * @type Array + * @see plupload.File + */ + files: Array; + + /** + * Object with name/value settings. + * + * @property settings + * @type Object + */ + settings: any; + + /** + * Total progess information. How many files has been uploaded, total percent etc. + * + * @property total + * @type plupload.QueueProgress + */ + total: plupload_queue_progress; + + /** + * Initializes the Uploader instance and adds internal event listeners. + * + * @method init + */ + init(): void; + + /** + * Set the value for the specified option(s). + * + * @method setOption + * @since 2.1 + * @param {String|Object} option Name of the option to change or the set of key/value pairs + * @param {Mixed} [value] Value for the option (is ignored, if first argument is object) + */ + setOption(option: string | any, value?: any): void; + + /** + * Get the value for the specified option or the whole configuration, if not specified. + * + * @method getOption + * @since 2.1 + * @param {String} [option] Name of the option to get + * @return {Mixed} Value for the option or the whole set + */ + getOption(option?: string): any; + + /** + * Refreshes the upload instance by dispatching out a refresh event to all runtimes. + * This would for example reposition flash/silverlight shims on the page. + * + * @method refresh + */ + refresh(): void; + + /** + * Starts uploading the queued files. + * + * @method start + */ + start(): void; + + /** + * Stops the upload of the queued files. + * + * @method stop + */ + stop(): void; + + /** + * Disables/enables browse button on request. + * + * @method disableBrowse + * @param {Boolean} disable Whether to disable or enable (default: true) + */ + disableBrowse(disable: boolean): void; + + // TODO: Make plupload.File typing + /** + * Returns the specified file object by id. + * + * @method getFile + * @param {String} id File id to look for. + * @return {plupload.File} File object or undefined if it wasn't found; + */ + getFile(id: string): any; + + /** + * Adds file to the queue programmatically. Can be native file, instance of Plupload.File, + * instance of mOxie.File, input[type="file"] element, or array of these. Fires FilesAdded, + * if any files were added to the queue. Otherwise nothing happens. + * + * @method addFile + * @since 2.0 + * @param {plupload.File|mOxie.File|File|Node|Array} file File or files to add to the queue. + * @param {String} [fileName] If specified, will be used as a name for the file + */ + addFile(file: any, fileName?: string): void; + + /** + * Removes a specific file. + * + * @method removeFile + * @param {plupload.File|String} file File to remove from queue. + */ + removeFile(file: any): any; + + /** + * Removes part of the queue and returns the files removed. This will also trigger the + * FilesRemoved and QueueChanged events. + * + * @method splice + * @param {Number} [start=0] Start index to remove from. + * @param {Number} [length] Number of files to remove (defaults to number of files in the queue). + * @return {Array} Array of files that was removed. + */ + splice(start?: number, length?: number): any; + + /** + * Dispatches the specified event name and its arguments to all listeners. + * @method trigger + * @param {String} name Event name to fire. + * @param {Object..} Multiple arguments to pass along to the listener functions. + */ + trigger(name: string, Multiple: any): any; + + hasEventListener(name: string): any; + bind(name: string, func: any, scope?: any): any; + unbind(name: string, func: any): any; + unbindAll(): any; + destroy(): any; + } + + export const VERSION: string; + + /** + * The state of the queue before it has started and after it has finished + * + * @property STOPPED + * @static + * @final + */ + export const STOPPED: number; + + /** + * Upload process is running + * + * @property STARTED + * @static + * @final + */ + export const STARTED: number; + + /** + * File is queued for upload + * + * @property QUEUED + * @static + * @final + */ + export const QUEUED: number; + + /** + * File is being uploaded + * + * @property UPLOADING + * @static + * @final + */ + export const UPLOADING: number; + + /** + * File has failed to be uploaded + * + * @property FAILED + * @static + * @final + */ + export const FAILED: number; + + /** + * File has been uploaded successfully + * + * @property DONE + * @static + * @final + */ + export const DONE: number; + + /** + * Generic error for example if an exception is thrown inside Silverlight. + * + * @property GENERIC_ERROR + * @static + * @final + */ + export const GENERIC_ERROR: number; + + /** + * HTTP transport error. For example if the server produces a HTTP status other than 200. + * + * @property HTTP_ERROR + * @static + * @final + */ + export const HTTP_ERROR: number; + + /** + * Generic I/O error. For example if it wasn't possible to open the file stream on local machine. + * + * @property IO_ERROR + * @static + * @final + */ + export const IO_ERROR: number; + + /** + * @property SECURITY_ERROR + * @static + * @final + */ + export const SECURITY_ERROR: number; + + /** + * Initialization error. Will be triggered if no runtime was initialized. + * + * @property INIT_ERROR + * @static + * @final + */ + export const INIT_ERROR: number; + + /** + * File size error. If the user selects a file that is too large or is empty it will be blocked and + * an error of this type will be triggered. + * + * @property FILE_SIZE_ERROR + * @static + * @final + */ + export const FILE_SIZE_ERROR: number; + + /** + * File extension error. If the user selects a file that isn't valid according to the filters setting. + * + * @property FILE_EXTENSION_ERROR + * @static + * @final + */ + export const FILE_EXTENSION_ERROR: number; + + /** + * Duplicate file error. If prevent_duplicates is set to true and user selects the same file again. + * + * @property FILE_DUPLICATE_ERROR + * @static + * @final + */ + export const FILE_DUPLICATE_ERROR: number; + + /** + * Runtime will try to detect if image is proper one. Otherwise will throw this error. + * + * @property IMAGE_FORMAT_ERROR + * @static + * @final + */ + export const IMAGE_FORMAT_ERROR: number; + + /** + * While working on files runtime may run out of memory and will throw this error. + * + * @since 2.1.2 + * @property MEMORY_ERROR + * @static + * @final + */ + export const MEMORY_ERROR: number; + + /** + * Each runtime has an upper limit on a dimension of the image it can handle. If bigger, will throw this error. + * + * @property IMAGE_DIMENSIONS_ERROR + * @static + * @final + */ + export const IMAGE_DIMENSIONS_ERROR: number; + + export const mimeTypes: any; + export const ua: any; + + /** + * Gets the true type of the built-in object (better version of typeof). + * @credits Angus Croll (http://javascriptweblog.wordpress.com/) + * + * @method typeOf + * @static + * @param {Object} o Object to check. + * @return {String} Object [[Class]] + */ + function typeOf(o: any): string; + + /** + * Extends the specified object with another object. + * + * @method extend + * @static + * @param {Object} target Object to extend. + * @param {Object..} obj Multiple objects to extend with. + * @return {Object} Same as target, the extended object. + */ + function extend(target: any): any; + + /** + * Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers. + * The only way a user would be able to get the same ID is if the two persons at the same exact millisecond manages + * to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique. + * It's more probable for the earth to be hit with an asteriod. You can also if you want to be 100% sure set the plupload.guidPrefix property + * to an user unique key. + * + * @method guid + * @static + * @return {String} Virtually unique id. + */ + function guid(guid: string): string; + + /** Utility methods **/ + + /** + * Executes the callback function for each item in array/object. If you return false in the + * callback it will break the loop. + * + * @method each + * @static + * @param {Object} obj Object to iterate. + * @param {function} callback Callback function to execute for each item. + */ + function each(obj: any, callback: Function): void; + + /** + * Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields. + * + * @method getPos + * @static + * @param {Element} node HTML element or element id to get x, y position from. + * @param {Element} root Optional root element to stop calculations at. + * @return {object} Absolute position of the specified element object with x, y fields. + */ + function getPos(node: Element, root: Element): any; + + /** + * Returns the size of the specified node in pixels. + * + * @method getSize + * @static + * @param {Node} node Node to get the size of. + * @return {Object} Object with a w and h property. + */ + function getSize(node: Node): any; + + /** + * Encodes the specified string. + * + * @method xmlEncode + * @static + * @param {String} s String to encode. + * @return {String} Encoded string. + */ + function xmlEncode(str: string): string; + + /** + * Forces anything into an array. + * + * @method toArray + * @static + * @param {Object} obj Object with length field. + * @return {Array} Array object containing all items. + */ + function toArray(obj: any): Array; + + /** + * Find an element in array and return its index if present, otherwise return -1. + * + * @method inArray + * @static + * @param {mixed} needle Element to find + * @param {Array} array + * @return {Int} Index of the element, or -1 if not found + */ + function inArray(needle: any, array: Array): number; + + /** + Recieve an array of functions (usually async) to call in sequence, each function + receives a callback as first argument that it should call, when it completes. Finally, + after everything is complete, main callback is called. Passing truthy value to the + callback as a first argument will interrupt the sequence and invoke main callback + immediately. + @method inSeries + @static + @param {Array} queue Array of functions to call in sequence + @param {Function} cb Main callback that is called in the end, or in case of error + */ + function inSeries(queue: Array, callback: Function): void; + + /** + * Extends the language pack object with new items. + * + * @method addI18n + * @static + * @param {Object} pack Language pack items to add. + * @return {Object} Extended language pack object. + */ + function addI18n(pack: any): any; + + /** + * Translates the specified string by checking for the english string in the language pack lookup. + * + * @method translate + * @static + * @param {String} str String to look for. + * @return {String} Translated string or the input string if it wasn't found. + */ + function translate(str: string): string; + + /** + * Pseudo sprintf implementation - simple way to replace tokens with specified values. + * + * @param {String} str String with tokens + * @return {String} String with replaced tokens + */ + function sprintf(str: string): string; + + /** + * Checks if object is empty. + * + * @method isEmptyObj + * @static + * @param {Object} obj Object to check. + * @return {Boolean} + */ + function isEmptyObj(obj: any): boolean; + + /** + * Checks if specified DOM element has specified class. + * + * @method hasClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + function hasClass(obj: any, name: string): any; + + /** + * Adds specified className to specified DOM element. + * + * @method addClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + function addClass(obj: any, name: string): any; + + /** + * Removes specified className from specified DOM element. + * + * @method removeClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + function removeClass(obj: any, name: string): any; + + /** + * Returns a given computed style of a DOM element. + * + * @method getStyle + * @static + * @param {Object} obj DOM element like object. + * @param {String} name Style you want to get from the DOM element + */ + function getStyle(obj: any, name: string): any; + + /** + * Adds an event handler to the specified object and store reference to the handler + * in objects internal Plupload registry (@see removeEvent). + * + * @method addEvent + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Name to add event listener to. + * @param {Function} callback Function to call when event occurs. + * @param {String} (optional) key that might be used to add specifity to the event record. + */ + function addEvent(obj: any, name: string, callback: Function, key?: string): any; + + /** + * Remove event handler from the specified object. If third argument (callback) + * is not specified remove all events with the specified name. + * + * @method removeEvent + * @static + * @param {Object} obj DOM element to remove event listener(s) from. + * @param {String} name Name of event listener to remove. + * @param {Function|String} (optional) might be a callback or unique key to match. + */ + function removeEvent(obj: any, name: string, optional?: Function | string): any; + + /** + * Remove all kind of events from the specified object + * + * @method removeAllEvents + * @static + * @param {Object} obj DOM element to remove event listeners from. + * @param {String} (optional) unique key to match, when removing events. + */ + function removeAllEvents(obj: any, key?: string): any; + + /** + * Cleans the specified name from national characters (diacritics). The result will be a name with only a-z, 0-9 and _. + * + * @method cleanName + * @static + * @param {String} s String to clean up. + * @return {String} Cleaned string. + */ + function cleanName(name: string): string; + + /** + * Builds a full url out of a base URL and an object with items to append as query string items. + * + * @method buildUrl + * @static + * @param {String} url Base URL to append query string items to. + * @param {Object} items Name/value object to serialize as a querystring. + * @return {String} String with url + serialized query string items. + */ + function buildUrl(url: string, items: any): string; + + /** + * Formats the specified number as a size string for example 1024 becomes 1 KB. + * + * @method formatSize + * @static + * @param {Number} size Size to format as string. + * @return {String} Formatted size string. + */ + function formatSize(size: number): string; + + /** + * Parses the specified size string into a byte value. For example 10kb becomes 10240. + * + * @method parseSize + * @static + * @param {String|Number} size String to parse or number to just pass through. + * @return {Number} Size in bytes. + */ + function parseSize(size: number | string): number; + + + /** + * A way to predict what runtime will be choosen in the current environment with the + * specified settings. + * + * @method predictRuntime + * @static + * @param {Object|String} config Plupload settings to check + * @param {String} [runtimes] Comma-separated list of runtimes to check against + * @return {String} Type of compatible runtime + */ + function predictRuntime(config: any, runtimes: string): string; + + /** + * Registers a filter that will be executed for each file added to the queue. + * If callback returns false, file will not be added. + * + * Callback receives two arguments: a value for the filter as it was specified in settings.filters + * and a file to be filtered. Callback is executed in the context of uploader instance. + * + * @method addFileFilter + * @static + * @param {String} name Name of the filter by which it can be referenced in settings.filters + * @param {String} cb Callback - the actual routine that every added file must pass + */ + function addFileFilter(name: string, cb: Function): void; } diff --git a/types/plupload/plupload-tests.ts b/types/plupload/plupload-tests.ts index e69de29bb2..2e57c45c27 100644 --- a/types/plupload/plupload-tests.ts +++ b/types/plupload/plupload-tests.ts @@ -0,0 +1,51 @@ +import 'plupload'; + +{ + const uploader = new plupload.Uploader({ + browse_button: 'browse', // this can be an id of a DOM element or the DOM element itself + url: 'upload.php' + }); + + uploader.init(); + uploader.start(); + + uploader.bind('FilesAdded', function (up: any, files: any) { + var html = ''; + plupload.each(files, function (file: any) { + html += '
  • ' + file.name + ' (' + plupload.formatSize(file.size) + ')
  • '; + }); + document.getElementById('filelist').innerHTML += html; + }); + + uploader.bind('Error', function (up: any, err: any) { + document.getElementById('console').innerHTML += "\nError #" + err.code + ": " + err.message; + }); + + if (!uploader.features.chunks || !uploader.features.multipart) { + window.alert('Your browser does not support a feature required for uploads. Try installing Flash or Silverlight.'); + } +} + +{ + const settings: plupload_settings = { + runtimes: 'html5', + browse_button: '#button', + container: '#container', + chunk_size: '1mb', + url: 'https://fakesite.com/upload', + flash_swf_url: './plupload.flash.swf', + silverlight_xap_url: '/Scripts/plupload/js/plupload.silverlight.xap', + filters: + { + max_file_size: '50mb', + mime_types: [{ title: 'title', extensions: '*' }] + }, + init: { + Error: function (up, args) { + } + } + }; + + const uploader = new plupload.Uploader(settings); + uploader.init(); +} diff --git a/types/plupload/tsconfig.json b/types/plupload/tsconfig.json index fc46738339..d7dc70a3bd 100644 --- a/types/plupload/tsconfig.json +++ b/types/plupload/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/pngjs/index.d.ts b/types/pngjs/index.d.ts index ece3434de1..d5476e9e1f 100644 --- a/types/pngjs/index.d.ts +++ b/types/pngjs/index.d.ts @@ -24,7 +24,7 @@ export class PNG extends Duplex { static sync: { read(buffer: Buffer, options?: ParserOptions): PNG; - write(buffer: Buffer, options?: PackerOptions): PNG; + write(png: PNG, options?: PackerOptions): Buffer; }; constructor(options?: PNGOptions); diff --git a/types/polymer/index.d.ts b/types/polymer/index.d.ts index eee6a6250f..a4eca3e70b 100644 --- a/types/polymer/index.d.ts +++ b/types/polymer/index.d.ts @@ -139,6 +139,8 @@ declare global { unshift?(path: string, ...item: any[]): number; + notifySplices?(path: string, splices: ReadonlyArray): void; + // ResolveUrl resolveUrl?(url: string): string; @@ -312,6 +314,18 @@ declare global { whenReady(cb: Function): void; } + interface PolymerSplice { + index: number; + removed: Array<{}>; + addedCount: number; + object: Array<{}>; + type: string; + } + + interface ArraySplice { + calculateSplices(current: ReadonlyArray, previous: ReadonlyArray): PolymerSplice[]; + } + interface ImportStatus extends RenderStatus { whenLoaded(cb: Function): void; } @@ -329,6 +343,8 @@ declare global { RenderStatus: RenderStatus + ArraySplice: ArraySplice; + /** @deprecated */ ImportStatus: ImportStatus } diff --git a/types/polymer/polymer-tests.ts b/types/polymer/polymer-tests.ts index dcad66f871..2b6631ffb7 100644 --- a/types/polymer/polymer-tests.ts +++ b/types/polymer/polymer-tests.ts @@ -82,3 +82,11 @@ class MyElement3 implements polymer.Base { } Polymer(MyElement3); + +// Test splice computation +const splices: polymer.PolymerSplice[] = Polymer.ArraySplice.calculateSplices( + [1,2,3], [1,2]); + +// Test that readonly arrays also work. +const splices2: polymer.PolymerSplice[] = Polymer.ArraySplice.calculateSplices( + Object.freeze([1,2,3]), Object.freeze([1,2])); diff --git a/types/pouchdb-core/index.d.ts b/types/pouchdb-core/index.d.ts index e636c3e7c1..4b1d56d860 100644 --- a/types/pouchdb-core/index.d.ts +++ b/types/pouchdb-core/index.d.ts @@ -514,6 +514,12 @@ declare namespace PouchDB { * How many old revisions we keep track (not a copy) of. */ revs_limit?: number; + /** + * Size of the database (Most significant for Safari) + * option to set the max size in MB that Safari will grant to the local database. Valid options are: 10, 50, 100, 500 and 1000 + * ex_ new PouchDB("dbName", {size:100}); + */ + size?: number; } interface RemoteRequesterConfiguration { diff --git a/types/power-assert/index.d.ts b/types/power-assert/index.d.ts index fa23620b8e..ab066b28bc 100644 --- a/types/power-assert/index.d.ts +++ b/types/power-assert/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for power-assert 1.4.1 +// Type definitions for power-assert 1.5.0 // Project: https://github.com/twada/power-assert // Definitions by: vvakame // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -62,6 +62,8 @@ declare namespace assert { export function ifError(value:any):void; + export const strict: typeof assert; + export interface Options { assertion?: empower.Options; output?: powerAssertFormatter.Options; diff --git a/types/power-assert/power-assert-tests.ts b/types/power-assert/power-assert-tests.ts index 0ec099b32c..a60f99964d 100644 --- a/types/power-assert/power-assert-tests.ts +++ b/types/power-assert/power-assert-tests.ts @@ -1,5 +1,3 @@ - - import assert = require("power-assert"); assert(1 + 1 - 2 === 0, "The universe isn't how it should."); @@ -16,13 +14,13 @@ assert.notDeepStrictEqual([{a:1}], [{a:1}], "uses === comparator"); assert.throws(() => { throw "a hammer at your face"; -}, undefined, "DODGED IT"); +}, "DODGED IT"); assert.doesNotThrow(() => { if (!!false) { throw "a hammer at your face"; } -}, undefined, "What the...*crunch*"); +}, "What the...*crunch*"); var customizedAssert1 = assert.customize({ @@ -41,13 +39,13 @@ customizedAssert1.notStrictEqual(2, "2", "uses === comparator"); customizedAssert1.throws(() => { throw "a hammer at your face"; -}, undefined, "DODGED IT"); +}, "DODGED IT"); customizedAssert1.doesNotThrow(() => { if (!!false) { throw "a hammer at your face"; } -}, undefined, "What the...*crunch*"); +}, "What the...*crunch*"); var customizedAssert2 = assert.customize({ @@ -85,3 +83,5 @@ var customizedAssert2 = assert.customize({ ] } }); + +(): typeof assert => assert.strict; diff --git a/types/prettier/index.d.ts b/types/prettier/index.d.ts index b323a0979b..e2fc00be38 100644 --- a/types/prettier/index.d.ts +++ b/types/prettier/index.d.ts @@ -1,12 +1,22 @@ -// Type definitions for prettier 1.10 +// Type definitions for prettier 1.12 // Project: https://github.com/prettier/prettier // Definitions by: Ika // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 export type AST = any; -export type Doc = any; // https://github.com/prettier/prettier/blob/master/commands.md -export type FastPath = any; // https://github.com/prettier/prettier/blob/master/src/common/fast-path.js +export type Doc = doc.builders.Doc; + +// https://github.com/prettier/prettier/blob/master/src/common/fast-path.js +export interface FastPath { + getName(): string | null; + getValue(): any; + getNode(count?: number): any; + getParentNode(count?: number): any; + call(callback: (path: this) => T, ...names: string[]): T; + each(callback: (path: this) => void, ...names: string[]): void; + map(callback: (path: this, index: number) => T, ...names: string[]): T[]; +} export type BuiltInParser = (text: string, options?: any) => AST; export type BuiltInParserName = @@ -24,72 +34,61 @@ export type BuiltInParserName = export type CustomParser = (text: string, parsers: Record, options: Options) => AST; -export interface Options { - /** - * Specify the line length that the printer will wrap on. - */ - printWidth?: number; - /** - * Specify the number of spaces per indentation-level. - */ - tabWidth?: number; - /** - * Indent lines with tabs instead of spaces - */ - useTabs?: boolean; +export interface Options extends Partial {} +export interface RequiredOptions extends doc.printer.Options { /** * Print semicolons at the ends of statements. */ - semi?: boolean; + semi: boolean; /** * Use single quotes instead of double quotes. */ - singleQuote?: boolean; + singleQuote: boolean; /** * Print trailing commas wherever possible. */ - trailingComma?: 'none' | 'es5' | 'all'; + trailingComma: 'none' | 'es5' | 'all'; /** * Print spaces between brackets in object literals. */ - bracketSpacing?: boolean; + bracketSpacing: boolean; /** * Put the `>` of a multi-line JSX element at the end of the last line instead of being alone on the next line. */ - jsxBracketSameLine?: boolean; + jsxBracketSameLine: boolean; /** * Format only a segment of a file. */ - rangeStart?: number; + rangeStart: number; /** * Format only a segment of a file. */ - rangeEnd?: number; + rangeEnd: number; /** * Specify which parser to use. */ - parser?: BuiltInParserName | CustomParser; + parser: BuiltInParserName | CustomParser; /** * Specify the input filepath. This will be used to do parser inference. */ - filepath?: string; + filepath: string; /** * Prettier can restrict itself to only format files that contain a special comment, called a pragma, at the top of the file. * This is very useful when gradually transitioning large, unformatted codebases to prettier. */ - requirePragma?: boolean; + requirePragma: boolean; /** * Prettier can insert a special @format marker at the top of files specifying that * the file has been formatted with prettier. This works well when used in tandem with * the --require-pragma option. If there is already a docblock at the top of * the file then this option will add a newline to it with the @format marker. */ - insertPragma?: boolean; + insertPragma: boolean; /** * By default, Prettier will wrap markdown text as-is since some services use a linebreak-sensitive renderer. * In some cases you may want to rely on editor/viewer soft wrapping instead, so this option allows you to opt out. */ - proseWrap?: + proseWrap: | boolean // deprecated | 'always' | 'never' @@ -97,11 +96,16 @@ export interface Options { /** * Include parentheses around a sole arrow function parameter. */ - arrowParens?: 'avoid' | 'always'; + arrowParens: 'avoid' | 'always'; /** * The plugin API is in a beta state. */ - plugins?: Array; + plugins: Array; +} + +export interface ParserOptions extends RequiredOptions { + locStart: (node: any) => number; + locEnd: (node: any) => number; } export interface Plugin { @@ -111,22 +115,41 @@ export interface Plugin { } export interface Parser { - parse: (text: string, parsers: { [parserName: string]: Parser }, options: object) => AST; + parse: (text: string, parsers: { [parserName: string]: Parser }, options: ParserOptions) => AST; astFormat: string; + hasPragma?: (text: string) => boolean; + locStart: (node: any) => number; + locEnd: (node: any) => number; } export interface Printer { print( path: FastPath, - options: object, + options: ParserOptions, print: (path: FastPath) => Doc, ): Doc; embed( path: FastPath, print: (path: FastPath) => Doc, - textToDoc: (text: string, options: object) => Doc, - options: object, + textToDoc: (text: string, options: Options) => Doc, + options: ParserOptions, ): Doc | null; + insertPragma?: (text: string) => string; + /** + * @returns `null` if you want to remove this node + * @returns `void` if you want to use modified newNode + * @returns anything if you want to replace the node with it + */ + massageAstNode?: (node: any, newNode: any, parent: any) => any; + hasPrettierIgnore?: (path: FastPath) => boolean; + canAttachComment?: (node: any) => boolean; + willPrintOwnComments?: (path: FastPath) => boolean; + printComments?: (path: FastPath, print: (path: FastPath) => Doc, options: ParserOptions, needsSemi: boolean) => Doc; + handleComments?: { + ownLine?: (commentNode: any, text: string, options: ParserOptions, ast: any, isLastComment: boolean) => boolean; + endOfLine?: (commentNode: any, text: string, options: ParserOptions, ast: any, isLastComment: boolean) => boolean; + remaining?: (commentNode: any, text: string, options: ParserOptions, ast: any, isLastComment: boolean) => boolean; + }; } export interface CursorOptions extends Options { @@ -226,6 +249,7 @@ export interface SupportLanguage { export interface SupportOption { since: string; type: 'int' | 'boolean' | 'choice' | 'path'; + array?: boolean; deprecated?: string; redirect?: SupportOptionRedirect; description: string; @@ -272,3 +296,136 @@ export function getSupportInfo(version?: string): SupportInfo; * `version` field in `package.json` */ export const version: string; + +// https://github.com/prettier/prettier/blob/master/src/common/util-shared.js +export namespace util { + function isNextLineEmpty(text: string, node: any, options: ParserOptions): boolean; + function isNextLineEmptyAfterIndex(text: string, index: number): boolean; + function getNextNonSpaceNonCommentCharacterIndex(text: string, node: any, options: ParserOptions): number; + function makeString(rawContent: string, enclosingQuote: "'" | '"', unescapeUnnecessaryEscapes: boolean): string; + function addLeadingComment(node: any, commentNode: any): void; + function addDanglingComment(node: any, commentNode: any): void; + function addTrailingComment(node: any, commentNode: any): void; +} + +// https://github.com/prettier/prettier/blob/master/src/doc/index.js +export namespace doc { + namespace builders { + type Doc = + | string + | Align + | BreakParent + | Concat + | Fill + | Group + | IfBreak + | Indent + | Line + | LineSuffix + | LineSuffixBoundary; + + interface Align { + type: 'align'; + contents: Doc; + n: number | string | { type: 'root' }; + } + + interface BreakParent { + type: 'break-parent'; + } + + interface Concat { + type: 'concat'; + parts: Doc[]; + } + + interface Fill { + type: 'fill'; + parts: Doc[]; + } + + interface Group { + type: 'group'; + contents: Doc; + break: boolean; + expandedStates: Doc[]; + } + + interface IfBreak { + type: 'if-break'; + breakContents: Doc; + flatContents: Doc; + } + + interface Indent { + type: 'indent'; + contents: Doc; + } + + interface Line { + type: 'line'; + soft?: boolean; + hard?: boolean; + literal?: boolean; + } + + interface LineSuffix { + type: 'line-suffix'; + contents: Doc; + } + + interface LineSuffixBoundary { + type: 'line-suffix-boundary'; + } + + function addAlignmentToDoc(doc: Doc, size: number, tabWidth: number): Doc; + function align(n: Align['n'], contents: Doc): Align; + const breakParent: BreakParent; + function concat(contents: Doc[]): Concat; + function conditionalGroup(states: Doc[], opts?: { shouldBreak: boolean }): Group; + function dedent(contents: Doc): Align; + function dedentToRoot(contents: Doc): Align; + function fill(parts: Doc[]): Fill; + function group(contents: Doc, opts?: { shouldBreak: boolean }): Group; + const hardline: Concat; + function ifBreak(breakContents: Doc, flatContents: Doc): IfBreak; + function indent(contents: Doc): Indent; + function join(separator: Doc, parts: Doc[]): Concat; + const line: Line; + function lineSuffix(contents: Doc): LineSuffix; + const lineSuffixBoundary: LineSuffixBoundary; + const literalline: Concat; + function markAsRoot(contents: Doc): Align; + const softline: Line; + } + namespace debug { + function printDocToDebug(doc: Doc): string; + } + namespace printer { + function printDocToString(doc: Doc, options: Options): string; + interface Options { + /** + * Specify the line length that the printer will wrap on. + */ + printWidth: number; + /** + * Specify the number of spaces per indentation-level. + */ + tabWidth: number; + /** + * Indent lines with tabs instead of spaces + */ + useTabs: boolean; + } + } + namespace utils { + function isEmpty(doc: Doc): boolean; + function isLineNext(doc: Doc): boolean; + function willBreak(doc: Doc): boolean; + function traverseDoc(doc: Doc, onEnter?: (doc: Doc) => void | boolean, onExit?: (doc: Doc) => void, shouldTraverseConditionalGroups?: boolean): void; + function mapDoc(doc: Doc, callback: (doc: Doc) => T): T; + function propagateBreaks(doc: Doc): void; + function removeLines(doc: Doc): Doc; + function stripTrailingHardline(doc: Doc): Doc; + } +} diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts index 2afb026648..9298d6c631 100644 --- a/types/puppeteer/index.d.ts +++ b/types/puppeteer/index.d.ts @@ -1041,6 +1041,12 @@ export interface Page extends EventEmitter, FrameBase { */ select(selector: string, ...values: string[]): Promise; + /** + * Determines whether cache is enabled on the page. + * @param enabled Whether or not to enable cache on the page. + */ + setCacheEnabled(enabled: boolean): Promise; + /** * Sets the cookies on the page. * @param cookies The cookies to set. diff --git a/types/q/index.d.ts b/types/q/index.d.ts index 724925d802..bdcd3c68ca 100644 --- a/types/q/index.d.ts +++ b/types/q/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for Q 1.0 +// Type definitions for Q 1.5 // Project: https://github.com/kriskowal/q // Definitions by: Barrie Nemetchek // Andrew Gaspar // John Reilly // Michel Boudreau +// TeamworkGuy2 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -28,74 +29,99 @@ declare namespace Q { export interface Deferred { promise: Promise; + /** + * Calling resolve with a pending promise causes promise to wait on the passed promise, becoming fulfilled with its + * fulfillment value or rejected with its rejection reason (or staying pending forever, if the passed promise does). + * Calling resolve with a rejected promise causes promise to be rejected with the passed promise's rejection reason. + * Calling resolve with a fulfilled promise causes promise to be fulfilled with the passed promise's fulfillment value. + * Calling resolve with a non-promise value causes promise to be fulfilled with that value. + */ resolve(value?: IWhenable): void; + /** + * Calling reject with a reason causes promise to be rejected with that reason. + */ reject(reason?: any): void; + /** + * Calling notify with a value causes promise to be notified of progress with that value. That is, any onProgress + * handlers registered with promise or promises derived from promise will be called with the progress value. + */ notify(value: any): void; + /** + * Returns a function suitable for passing to a Node.js API. That is, it has a signature (err, result) and will + * reject deferred.promise with err if err is given, or fulfill it with result if that is given. + */ makeNodeResolver(): (reason: any, value: T) => void; } export interface Promise { /** - * Like a finally clause, allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful for collecting resources - * regardless of whether a job succeeded, like closing a database connection, shutting a server down, or deleting an unneeded key from an object. finally returns a promise, which will become - * resolved with the same fulfillment value or rejection reason as promise. However, if callback returns a promise, the resolution of the returned promise will be delayed until the promise - * returned from callback is finished. + * The then method from the Promises/A+ specification, with an additional progress handler. */ - fin(finallyCallback: () => any): Promise; + then(onFulfill?: ((value: T) => IWhenable) | null, onReject?: ((error: any) => IWhenable) | null, onProgress?: ((progress: any) => any) | null): Promise; /** - * Like a finally clause, allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful for collecting resources - * regardless of whether a job succeeded, like closing a database connection, shutting a server down, or deleting an unneeded key from an object. finally returns a promise, which will become - * resolved with the same fulfillment value or rejection reason as promise. However, if callback returns a promise, the resolution of the returned promise will be delayed until the promise - * returned from callback is finished. + * Like a finally clause, allows you to observe either the fulfillment or rejection of a promise, but to do so + * without modifying the final value. This is useful for collecting resources regardless of whether a job succeeded, + * like closing a database connection, shutting a server down, or deleting an unneeded key from an object. + * finally returns a promise, which will become resolved with the same fulfillment value or rejection reason + * as promise. However, if callback returns a promise, the resolution of the returned promise will be delayed + * until the promise returned from callback is finished. Furthermore, if the returned promise rejects, that + * rejection will be passed down the chain instead of the previous result. */ finally(finallyCallback: () => any): Promise; /** - * The then method from the Promises/A+ specification, with an additional progress handler. + * Alias for finally() (for non-ES5 browsers) */ - then(onFulfill?: (value: T) => IWhenable, onReject?: (error: any) => IWhenable, onProgress?: (progress: any) => any): Promise; + fin(finallyCallback: () => any): Promise; /** - * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's - * rejection reason. - * + * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are + * rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all */ spread(onFulfill: (...args: any[]) => IWhenable, onReject?: (reason: any) => IWhenable): Promise; - fail(onRejected: (reason: any) => IWhenable): Promise; - /** * A sugar method, equivalent to promise.then(undefined, onRejected). */ catch(onRejected: (reason: any) => IWhenable): Promise; + /** + * Alias for catch() (for non-ES5 browsers) + */ + fail(onRejected: (reason: any) => IWhenable): Promise; + /** * A sugar method, equivalent to promise.then(undefined, undefined, onProgress). */ progress(onProgress: (progress: any) => any): Promise; /** - * Much like then, but with different behavior around unhandled rejection. If there is an unhandled rejection, either because promise is rejected and no onRejected callback was provided, or - * because onFulfilled or onRejected threw an error or returned a rejected promise, the resulting rejection reason is thrown as an exception in a future turn of the event loop. - * - * This method should be used to terminate chains of promises that will not be passed elsewhere. Since exceptions thrown in then callbacks are consumed and transformed into rejections, - * exceptions at the end of the chain are easy to accidentally, silently ignore. By arranging for the exception to be thrown in a future turn of the event loop, so that it won't be caught, it - * causes an onerror event on the browser window, or an uncaughtException event on Node.js's process object. - * - * Exceptions thrown by done will have long stack traces, if Q.longStackSupport is set to true. If Q.onerror is set, exceptions will be delivered there instead of thrown in a future turn. - * - * The Golden Rule of done vs. then usage is: either return your promise to someone else, or if the chain ends with you, call done to terminate it. + * Much like then, but with different behavior around unhandled rejection. If there is an unhandled rejection, + * either because promise is rejected and no onRejected callback was provided, or because onFulfilled or onRejected + * threw an error or returned a rejected promise, the resulting rejection reason is thrown as an exception in a + * future turn of the event loop. + * This method should be used to terminate chains of promises that will not be passed elsewhere. Since exceptions + * thrown in then callbacks are consumed and transformed into rejections, exceptions at the end of the chain are + * easy to accidentally, silently ignore. By arranging for the exception to be thrown in a future turn of the + * event loop, so that it won't be caught, it causes an onerror event on the browser window, or an uncaughtException + * event on Node.js's process object. + * Exceptions thrown by done will have long stack traces, if Q.longStackSupport is set to true. If Q.onerror is set, + * exceptions will be delivered there instead of thrown in a future turn. + * The Golden Rule of done vs. then usage is: either return your promise to someone else, or if the chain ends + * with you, call done to terminate it. Terminating with catch is not sufficient because the catch handler may + * itself throw an error. */ - done(onFulfilled?: (value: T) => any, onRejected?: (reason: any) => any, onProgress?: (progress: any) => any): void; + done(onFulfilled?: ((value: T) => any) | null, onRejected?: ((reason: any) => any) | null, onProgress?: ((progress: any) => any) | null): void; /** - * If callback is a function, assumes it's a Node.js-style callback, and calls it as either callback(rejectionReason) when/if promise becomes rejected, or as callback(null, fulfillmentValue) - * when/if promise becomes fulfilled. If callback is not a function, simply returns promise. + * If callback is a function, assumes it's a Node.js-style callback, and calls it as either callback(rejectionReason) + * when/if promise becomes rejected, or as callback(null, fulfillmentValue) when/if promise becomes fulfilled. + * If callback is not a function, simply returns promise. */ nodeify(callback: (reason: any, value: any) => void): Promise; @@ -112,8 +138,8 @@ declare namespace Q { delete(propertyName: string): Promise; /** - * Returns a promise for the result of calling the named method of an object with the given array of arguments. The object itself is this in the function, just like a synchronous method call. - * Essentially equivalent to + * Returns a promise for the result of calling the named method of an object with the given array of arguments. + * The object itself is this in the function, just like a synchronous method call. Essentially equivalent to * * @example * promise.then(function (o) { return o[methodName].apply(o, args); }); @@ -121,14 +147,11 @@ declare namespace Q { post(methodName: string, args: any[]): Promise; /** - * Returns a promise for the result of calling the named method of an object with the given variadic arguments. The object itself is this in the function, just like a synchronous method call. + * Returns a promise for the result of calling the named method of an object with the given variadic arguments. + * The object itself is this in the function, just like a synchronous method call. */ invoke(methodName: string, ...args: any[]): Promise; - fapply(args: any[]): Promise; - - fcall(...args: any[]): Promise; - /** * Returns a promise for an array of the property names of an object. Essentially equivalent to * @@ -137,6 +160,35 @@ declare namespace Q { */ keys(): Promise; + /** + * Returns a promise for the result of calling a function, with the given array of arguments. Essentially equivalent to + * + * @example + * promise.then(function (f) { + * return f.apply(undefined, args); + * }); + */ + fapply(args: any[]): Promise; + + /** + * Returns a promise for the result of calling a function, with the given variadic arguments. Has the same return + * value/thrown exception translation as explained above for fbind. + * In its static form, it is aliased as Q.try, since it has semantics similar to a try block (but handling both + * synchronous exceptions and asynchronous rejections). This allows code like + * + * @example + * Q.try(function () { + * if (!isConnectedToCloud()) { + * throw new Error("The cloud is down!"); + * } + * return syncToCloud(); + * }) + * .catch(function (error) { + * console.error("Couldn't sync to the cloud", error); + * }); + */ + fcall(...args: any[]): Promise; + /** * A sugar method, equivalent to promise.then(function () { return value; }). */ @@ -148,30 +200,39 @@ declare namespace Q { thenReject(reason?: any): Promise; /** - * Attaches a handler that will observe the value of the promise when it becomes fulfilled, returning a promise for that same value, perhaps deferred but not replaced by the promise returned - * by the onFulfilled handler. + * Attaches a handler that will observe the value of the promise when it becomes fulfilled, returning a promise for + * that same value, perhaps deferred but not replaced by the promise returned by the onFulfilled handler. */ tap(onFulfilled: (value: T) => any): Promise; + /** + * Returns a promise that will have the same result as promise, except that if promise is not fulfilled or rejected + * before ms milliseconds, the returned promise will be rejected with an Error with the given message. If message + * is not supplied, the message will be "Timed out after " + ms + " ms". + */ timeout(ms: number, message?: string): Promise; /** - * Returns a promise that will have the same result as promise, but will only be fulfilled or rejected after at least ms milliseconds have passed. + * Returns a promise that will have the same result as promise, but will only be fulfilled or rejected after at least + * ms milliseconds have passed. */ delay(ms: number): Promise; /** - * Returns whether a given promise is in the fulfilled state. When the static version is used on non-promises, the result is always true. + * Returns whether a given promise is in the fulfilled state. When the static version is used on non-promises, the + * result is always true. */ isFulfilled(): boolean; /** - * Returns whether a given promise is in the rejected state. When the static version is used on non-promises, the result is always false. + * Returns whether a given promise is in the rejected state. When the static version is used on non-promises, the + * result is always false. */ isRejected(): boolean; /** - * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the result is always false. + * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the + * result is always false. */ isPending(): boolean; @@ -193,6 +254,30 @@ declare namespace Q { reason?: any; } + /** + * Returns a "deferred" object with a: + * promise property + * resolve(value) method + * reject(reason) method + * notify(value) method + * makeNodeResolver() method + */ + export function defer(): Deferred; + + /** + * Calling resolve with a pending promise causes promise to wait on the passed promise, becoming fulfilled with its + * fulfillment value or rejected with its rejection reason (or staying pending forever, if the passed promise does). + * Calling resolve with a rejected promise causes promise to be rejected with the passed promise's rejection reason. + * Calling resolve with a fulfilled promise causes promise to be fulfilled with the passed promise's fulfillment value. + * Calling resolve with a non-promise value causes promise to be fulfilled with that value. + */ + export function resolve(object?: IWhenable): Promise; + + /** + * Returns a promise that is rejected with reason. + */ + export function reject(reason?: any): Promise; + // If no value provided, returned promise will be of void type export function when(): Promise; @@ -200,38 +285,168 @@ declare namespace Q { export function when(value: IWhenable): Promise; // If a non-promise value is provided, it will not reject or progress - export function when(value: IWhenable, onFulfilled: (val: T) => IWhenable, onRejected?: (reason: any) => IWhenable, onProgress?: (progress: any) => any): Promise; + export function when(value: IWhenable, onFulfilled: (val: T) => IWhenable, onRejected?: ((reason: any) => IWhenable) | null, onProgress?: ((progress: any) => any) | null): Promise; + /** + * (Deprecated) Returns a new function that calls a function asynchronously with the given variadic arguments, and returns a promise. + * Notably, any synchronous return values or thrown exceptions are transformed, respectively, into fulfillment values + * or rejection reasons for the promise returned by this new function. + * This method is especially useful in its static form for wrapping functions to ensure that they are always + * asynchronous, and that any thrown exceptions (intentional or accidental) are appropriately transformed into a + * returned rejected promise. For example: + * + * @example + * var getUserData = Q.fbind(function (userName) { + * if (!userName) { + * throw new Error("userName must be truthy!"); + * } + * if (localCache.has(userName)) { + * return localCache.get(userName); + * } + * return getUserFromCloud(userName); + * }); + */ export function fbind(method: (...args: any[]) => IWhenable, ...args: any[]): (...args: any[]) => Promise; + /** + * Returns a promise for the result of calling a function, with the given variadic arguments. Has the same return + * value/thrown exception translation as explained above for fbind. + * In its static form, it is aliased as Q.try, since it has semantics similar to a try block (but handling both synchronous + * exceptions and asynchronous rejections). This allows code like + * + * @example + * Q.try(function () { + * if (!isConnectedToCloud()) { + * throw new Error("The cloud is down!"); + * } + * return syncToCloud(); + * }) + * .catch(function (error) { + * console.error("Couldn't sync to the cloud", error); + * }); + */ export function fcall(method: (...args: any[]) => T, ...args: any[]): Promise; - // Try is an alias for fcall, but 'try' is a reserved word. This is the only way to get around this + // but 'try' is a reserved word. This is the only way to get around this + /** + * Alias for fcall() + */ export {fcall as try}; - export function send(obj: any, functionName: string, ...args: any[]): Promise; - + /** + * Returns a promise for the result of calling the named method of an object with the given variadic arguments. + * The object itself is this in the function, just like a synchronous method call. + */ export function invoke(obj: any, functionName: string, ...args: any[]): Promise; + /** + * Alias for invoke() + */ + export function send(obj: any, functionName: string, ...args: any[]): Promise; + + /** + * Alias for invoke() + */ export function mcall(obj: any, functionName: string, ...args: any[]): Promise; - export function denodeify(nodeFunction: (...args: any[]) => any, ...args: any[]): (...args: any[]) => Promise; - - export function nbind(nodeFunction: (...args: any[]) => any, thisArg: any, ...args: any[]): (...args: any[]) => Promise; - + /** + * Creates a promise-returning function from a Node.js-style function, optionally binding it with the given + * variadic arguments. An example: + * + * @example + * var readFile = Q.nfbind(FS.readFile); + * readFile("foo.txt", "utf-8").done(function (text) { + * //... + * }); + * + * Note that if you have a method that uses the Node.js callback pattern, as opposed to just a function, you will + * need to bind its this value before passing it to nfbind, like so: + * + * @example + * var Kitty = mongoose.model("Kitty"); + * var findKitties = Q.nfbind(Kitty.find.bind(Kitty)); + * + * The better strategy for methods would be to use Q.nbind, as shown below. + */ export function nfbind(nodeFunction: (...args: any[]) => any, ...args: any[]): (...args: any[]) => Promise; - export function nfcall(nodeFunction: (...args: any[]) => any, ...args: any[]): Promise; + /** + * Alias for nfbind() + */ + export function denodeify(nodeFunction: (...args: any[]) => any, ...args: any[]): (...args: any[]) => Promise; + /** + * Creates a promise-returning function from a Node.js-style method, optionally binding it with the given + * variadic arguments. An example: + * + * @example + * var Kitty = mongoose.model("Kitty"); + * var findKitties = Q.nbind(Kitty.find, Kitty); + * findKitties({ cute: true }).done(function (theKitties) { + * //... + * }); + */ + export function nbind(nodeFunction: (...args: any[]) => any, thisArg: any, ...args: any[]): (...args: any[]) => Promise; + + /** + * Calls a Node.js-style function with the given array of arguments, returning a promise that is fulfilled if the + * Node.js function calls back with a result, or rejected if it calls back with an error + * (or throws one synchronously). An example: + * + * @example + * Q.nfapply(FS.readFile, ["foo.txt", "utf-8"]).done(function (text) { + * }); + * + * Note that this example only works because FS.readFile is a function exported from a module, not a method on + * an object. For methods, e.g. redisClient.get, you must bind the method to an instance before passing it to + * Q.nfapply (or, generally, as an argument to any function call): + * + * @example + * Q.nfapply(redisClient.get.bind(redisClient), ["user:1:id"]).done(function (user) { + * }); + * + * The better strategy for methods would be to use Q.npost, as shown below. + */ export function nfapply(nodeFunction: (...args: any[]) => any, args: any[]): Promise; - export function ninvoke(nodeModule: any, functionName: string, ...args: any[]): Promise; + /** + * Calls a Node.js-style function with the given variadic arguments, returning a promise that is fulfilled if the + * Node.js function calls back with a result, or rejected if it calls back with an error + * (or throws one synchronously). An example: + * + * @example + * Q.nfcall(FS.readFile, "foo.txt", "utf-8").done(function (text) { + * }); + * + * The same warning about functions vs. methods applies for nfcall as it does for nfapply. In this case, the better + * strategy would be to use Q.ninvoke. + */ + export function nfcall(nodeFunction: (...args: any[]) => any, ...args: any[]): Promise; + /** + * Calls a Node.js-style method with the given arguments array, returning a promise that is fulfilled if the method + * calls back with a result, or rejected if it calls back with an error (or throws one synchronously). An example: + * + * @example + * Q.npost(redisClient, "get", ["user:1:id"]).done(function (user) { + * }); + */ export function npost(nodeModule: any, functionName: string, args: any[]): Promise; - export function nsend(nodeModule: any, functionName: string, ...args: any[]): Promise; + /** + * Calls a Node.js-style method with the given variadic arguments, returning a promise that is fulfilled if the + * method calls back with a result, or rejected if it calls back with an error (or throws one synchronously). An example: + * + * @example + * Q.ninvoke(redisClient, "get", "user:1:id").done(function (user) { + * }); + */ + export function ninvoke(nodeModule: any, functionName: string, ...args: any[]): Promise; - export function nmcall(nodeModule: any, functionName: string, ...args: any[]): Promise; + /** + * Alias for ninvoke() + */ + export function nsend(nodeModule: any, functionName: string, ...args: any[]): Promise; /** * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. @@ -267,21 +482,27 @@ declare namespace Q { export function race(promises: Array>): Promise; /** - * Returns a promise that is fulfilled with an array of promise state snapshots, but only after all the original promises have settled, i.e. become either fulfilled or rejected. + * Returns a promise that is fulfilled with an array of promise state snapshots, but only after all the original promises + * have settled, i.e. become either fulfilled or rejected. */ export function allSettled(promises: IWhenable>>): Promise>>; + /** + * Deprecated Alias for allSettled() + */ export function allResolved(promises: IWhenable>>): Promise>>; /** - * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection - * reason. This is especially useful in conjunction with all. + * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are + * rejected, instead calls onRejected with the first rejected promise's rejection reason. This is especially useful + * in conjunction with all. */ export function spread(promises: Array>, onFulfilled: (...args: T[]) => IWhenable, onRejected?: (reason: any) => IWhenable): Promise; /** - * Returns a promise that will have the same result as promise, except that if promise is not fulfilled or rejected before ms milliseconds, the returned promise will be rejected with an Error - * with the given message. If message is not supplied, the message will be "Timed out after " + ms + " ms". + * Returns a promise that will have the same result as promise, except that if promise is not fulfilled or rejected + * before ms milliseconds, the returned promise will be rejected with an Error with the given message. If message + * is not supplied, the message will be "Timed out after " + ms + " ms". */ export function timeout(promise: Promise, ms: number, message?: string): Promise; @@ -310,75 +531,64 @@ declare namespace Q { export function isPending(promiseOrObject: Promise | any): boolean; /** - * Returns a "deferred" object with a: - * promise property - * resolve(value) method - * reject(reason) method - * notify(value) method - * makeNodeResolver() method + * Synchronously calls resolver(resolve, reject, notify) and returns a promise whose state is controlled by the + * functions passed to resolver. This is an alternative promise-creation API that has the same power as the deferred + * concept, but without introducing another conceptual entity. + * If resolver throws an exception, the returned promise will be rejected with that thrown exception as the rejection reason. + * note: In the latest github, this method is called Q.Promise, but if you are using the npm package version 0.9.7 + * or below, the method is called Q.promise (lowercase vs uppercase p). */ - export function defer(): Deferred; - - /** - * Returns a promise that is rejected with reason. - */ - export function reject(reason?: any): Promise; - export function Promise(resolver: (resolve: (val?: IWhenable) => void, reject: (reason?: any) => void, notify: (progress: any) => void) => void): Promise; /** - * Creates a new version of func that accepts any combination of promise and non-promise values, converting them to their fulfillment values before calling the original func. The returned version - * also always returns a promise: if func does a return or throw, then Q.promised(func) will return fulfilled or rejected promise, respectively. - * - * This can be useful for creating functions that accept either promises or non-promise values, and for ensuring that the function always returns a promise even in the face of unintentional - * thrown exceptions. + * Creates a new version of func that accepts any combination of promise and non-promise values, converting them to their + * fulfillment values before calling the original func. The returned version also always returns a promise: if func does + * a return or throw, then Q.promised(func) will return fulfilled or rejected promise, respectively. + * This can be useful for creating functions that accept either promises or non-promise values, and for ensuring that + * the function always returns a promise even in the face of unintentional thrown exceptions. */ export function promised(callback: (...args: any[]) => T): (...args: any[]) => Promise; /** * Returns whether the given value is a Q promise. */ - export function isPromise(object: any): boolean; + export function isPromise(object: any): object is Promise; /** * Returns whether the given value is a promise (i.e. it's an object with a then function). */ - export function isPromiseAlike(object: any): boolean; + export function isPromiseAlike(object: any): object is IPromise; /** * If an object is not a promise, it is as "near" as possible. * If a promise is rejected, it is as "near" as possible too. - * If it’s a fulfilled promise, the fulfillment value is nearer. - * If it’s a deferred promise and the deferred has been resolved, the + * If it's a fulfilled promise, the fulfillment value is nearer. + * If it's a deferred promise and the deferred has been resolved, the * resolution is "nearer". */ export function nearer(promise: Promise): T; /** - * This is an experimental tool for converting a generator function into a deferred function. This has the potential of reducing nested callbacks in engines that support yield. + * This is an experimental tool for converting a generator function into a deferred function. This has the potential + * of reducing nested callbacks in engines that support yield. */ export function async(generatorFunction: any): (...args: any[]) => Promise; export function nextTick(callback: (...args: any[]) => any): void; /** - * A settable property that will intercept any uncaught errors that would otherwise be thrown in the next tick of the event loop, usually as a result of done. Can be useful for getting the full + * A settable property that will intercept any uncaught errors that would otherwise be thrown in the next tick of the + * event loop, usually as a result of done. Can be useful for getting the full * stack trace of an error in browsers, which is not usually possible with window.onerror. */ export let onerror: (reason: any) => void; /** - * A settable property that lets you turn on long stack trace support. If turned on, "stack jumps" will be tracked across asynchronous promise operations, so that if an uncaught error is thrown - * by done or a rejection reason's stack property is inspected in a rejection callback, a long stack trace is produced. + * A settable property that lets you turn on long stack trace support. If turned on, "stack jumps" will be tracked + * across asynchronous promise operations, so that if an uncaught error is thrown by done or a rejection reason's stack + * property is inspected in a rejection callback, a long stack trace is produced. */ export let longStackSupport: boolean; - /** - * Calling resolve with a pending promise causes promise to wait on the passed promise, becoming fulfilled with its fulfillment value or rejected with its rejection reason (or staying pending - * forever, if the passed promise does). Calling resolve with a rejected promise causes promise to be rejected with the passed promise's rejection reason. Calling resolve with a fulfilled promise - * causes promise to be fulfilled with the passed promise's fulfillment value. Calling resolve with a non-promise value causes promise to be fulfilled with that value. - */ - export function resolve(object?: IWhenable): Promise; - /** * Resets the global "Q" variable to the value it has before Q was loaded. * This will either be undefined if there was no version or the version of Q which was already loaded before. diff --git a/types/q/q-tests.ts b/types/q/q-tests.ts index c0c29d9642..226d86ced8 100644 --- a/types/q/q-tests.ts +++ b/types/q/q-tests.ts @@ -1,18 +1,20 @@ /// -import Q = require('q'); +import Q = require("q"); -Q(8).then(x => console.log(x.toExponential())); +const _when: Q.IWhenable = Q.resolve(0); // was an issue when strictFunctionTypes were enforced on all of DefinitelyTyped + +Q(8).then((x) => console.log(x.toExponential())); Q().then(() => console.log("nothing")); -const delay = (delay: number) => { +function delay(delay: number): Q.Promise { const d = Q.defer(); setTimeout(d.resolve, delay); return d.promise; -}; +} Q.when(delay(1000), (val) => { - console.log('Hello, World!'); + console.log("Hello, World!"); return; }); @@ -20,15 +22,15 @@ Q.when(delay(1000), (val) => { const otherPromise = Q.defer().promise; Q.defer().resolve(otherPromise); -Q.timeout(Q(new Date()), 1000, "My dates never arrived. :(").then(d => d.toJSON()); +Q.timeout(Q(new Date()), 1000, "My dates never arrived. :(").then((d) => d.toJSON()); -Q.delay(Q(8), 1000).then(x => x.toExponential()); -Q.delay(8, 1000).then(x => x.toExponential()); -Q.delay(Q("asdf"), 1000).then(x => x.length); -Q.delay("asdf", 1000).then(x => x.length); +Q.delay(Q(8), 1000).then((x) => x.toExponential()); +Q.delay(8, 1000).then((x) => x.toExponential()); +Q.delay(Q("asdf"), 1000).then((x) => x.length); +Q.delay("asdf", 1000).then((x) => x.length); -const eventualAdd = Q.promised((a?: number, b?: number) => a + b); -eventualAdd(Q(1), Q(2)).then(x => x.toExponential()); +const eventualAdd = Q.promised((a?: number, b?: number) => a + b); +eventualAdd(Q(1), Q(2)).then((x) => x.toExponential()); function eventually(eventually: T) { return Q.delay(eventually, 1000); @@ -36,6 +38,7 @@ function eventually(eventually: T) { const x = Q.all([1, 2, 3].map(eventually)); Q.when(x, (x) => { + const _x: number[] = x; console.log(x); }); @@ -81,10 +84,11 @@ Q.allResolved([]) Q(42) .tap(() => "hello") - .tap(x => { + .tap((x) => { console.log(x); }) - .then(x => { + .then((x) => { + const _x: number = x; console.log("42 == " + x); }); @@ -94,34 +98,34 @@ declare let stringPromise: Q.IPromise; declare function returnsNumPromise(text: string): Q.Promise; declare function returnsNumPromise(text: string): JQueryPromise; -Q(arrayPromise) // type specification required - .then(arr => arr.join(',')) - .then(returnsNumPromise) // requires specification - .then(num => num.toFixed()); +Q(arrayPromise) + .then((arr) => arr.join(',')) + .then(returnsNumPromise) // requires specification + .then((num) => num.toFixed()); declare let jPromise: JQueryPromise; // if jQuery promises definition supported generics, this could be more interesting example -Q(jPromise).then(str => str.split(',')); +Q(jPromise).then((str) => str.split(',')); jPromise.then(returnsNumPromise); // watch the typing flow through from jQueryPromise to Q.Promise -Q(jPromise).then(str => str.split(',')); +Q(jPromise).then((str) => str.split(',')); declare let promiseArray: Array>; -const qPromiseArray = promiseArray.map(p => { +const qPromiseArray = promiseArray.map((p) => { return Q(p); }); const myNums: any[] = [2, 3, Q(4), 5, Q(6), Q(7)]; -Q.all(promiseArray).then(nums => nums.map(num => num.toPrecision(2)).join(',')); +Q.all(promiseArray).then((nums) => nums.map((num) => num.toPrecision(2)).join(',')); -Q.all(myNums).then(nums => nums.map(Math.round)); +Q.all(myNums).then((nums) => nums.map(Math.round)); -Q.fbind((dateString?: string) => new Date(dateString), "11/11/1991")().then(d => d.toLocaleDateString()); +Q.fbind((dateString?: string) => new Date( dateString), "11/11/1991")().then((d) => d.toLocaleDateString()); -Q.when(8, num => num + "!"); -Q.when(Q(8), num => num + "!").then(str => str.split(',')); +Q.when(8, (num) => num + "!"); +Q.when(Q(8), (num) => num + "!").then((str) => str.split(',')); const voidPromise: Q.Promise = Q.when(); declare function saveToDisk(): Q.Promise; @@ -147,22 +151,27 @@ Q.nfapply(nodeStyle, ["foo"]).done((result: string) => { }); Q.nfcall(nodeStyle, "foo").done((result: string) => { }); -Q.denodeify(nodeStyle)('foo').done((result: string) => { +Q.denodeify(nodeStyle)("foo").done((result: string) => { }); -Q.nfbind(nodeStyle)('foo').done((result: string) => { +Q.nfbind(nodeStyle)("foo").done((result: string) => { }); +interface Kitty { + name: string; + cute: boolean; +} + class Repo { - private readonly items: any[] = [ - {name: 'Max', cute: false}, - {name: 'Annie', cute: true} + private readonly items: Kitty[] = [ + {name: "Max", cute: false}, + {name: "Annie", cute: true} ]; - find(options: any): Q.Promise { + find(options: {[K in keyof Kitty]: Kitty[K] }): Q.Promise { let result = this.items; for (const key in options) { - result = result.filter(i => i[key] === options[key]); + result = result.filter((i) => i[ key] === options[ key]); } return Q(result); @@ -170,7 +179,8 @@ class Repo { } const kitty = new Repo(); -Q.nbind(kitty.find, kitty)({cute: true}).done((kitties: any[]) => { +Q.nbind(kitty.find, kitty)({ cute: true }).done((kitties) => { + const _kitties: Kitty[] = kitties; }); /** @@ -194,10 +204,6 @@ function TestCanRethrowRejectedPromises() { .fail((error) => { console.log("Intermediate error handling"); - /* - * Cannot do this, because: - * error TS2322: Type 'Promise' is not assignable to type 'Promise' - */ return Q.reject(error); }); } @@ -206,10 +212,14 @@ function TestCanRethrowRejectedPromises() { .finally(() => { console.log("Cleanup"); }) - .done(); + .done((foo) => { + const _foo: Foo = foo; + }); } -// test Q.Promise.all +/** + * test Q.Promise.all + */ const y1 = Q().then(() => { const s = Q("hello"); const n = Q(1); @@ -222,9 +232,9 @@ const y2 = Q().then(() => { return <[typeof s, typeof n]> [s, n]; }); -const p2: Q.Promise<[string, number]> = y1.then(val => Q.all(val)); +const p2: Q.Promise<[string, number]> = y1.then((val) => Q.all(val)); const p3: Q.Promise<[string, number]> = Q.all(y1); -const p5: Q.Promise<[string, number]> = y2.then(val => Q.all(val)); +const p5: Q.Promise<[string, number]> = y2.then((val) => Q.all(val)); const p6: Q.Promise<[string, number]> = Q.all(y2); Q.try(() => { @@ -238,8 +248,8 @@ Q.try(() => { // thenReject, returning a Promise of the same type as the Promise it is called on function thenRejectSameType(arg: any): Q.Promise { if (!arg) { - return returnsNumPromise('') - .thenReject(new Error('failed')); + return returnsNumPromise("") + .thenReject(new Error("failed")); } return Q.resolve(2); } @@ -248,10 +258,10 @@ function thenRejectSameType(arg: any): Q.Promise { // The generic type argument is specified. function thenRejectSpecificOtherType(arg: any): Q.Promise { if (!arg) { - return returnsNumPromise('') - .thenReject(new Error('failed')); + return returnsNumPromise("") + .thenReject(new Error("failed")); } - return Q.resolve(''); + return Q.resolve(""); } // thenReject, returning a Promise of a different type to the Promise it is called on. @@ -262,9 +272,9 @@ function thenRejectSpecificOtherType(arg: any): Q.Promise { /* function thenRejectInferredOtherType(arg: any): Q.Promise { if (!arg) { - return returnsNumPromise('') - .thenReject(new Error('failed')); + return returnsNumPromise("") + .thenReject(new Error("failed")); } - return Q.resolve(''); + return Q.resolve(""); } */ diff --git a/types/q/tsconfig.json b/types/q/tsconfig.json index d78aa85a14..ba7c0d33d6 100644 --- a/types/q/tsconfig.json +++ b/types/q/tsconfig.json @@ -7,8 +7,8 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": false, + "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/radium/index.d.ts b/types/radium/index.d.ts index d861783e92..ce5ae3776a 100644 --- a/types/radium/index.d.ts +++ b/types/radium/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for radium 0.18.1 +// Type definitions for radium 0.24.0 // Project: https://github.com/formidablelabs/radium // Definitions by: Alex Gorbatchev , Philipp Holzer , Alexey Svetliakov , Mikael Hermansson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,7 +6,7 @@ import * as React from 'react'; -export = Radium; +export default Radium; // @Radium decorator declare function Radium(component: TElement): TElement; diff --git a/types/radium/radium-tests.tsx b/types/radium/radium-tests.tsx index 6b7aaa1a46..d7fece99c7 100644 --- a/types/radium/radium-tests.tsx +++ b/types/radium/radium-tests.tsx @@ -1,6 +1,6 @@ import * as React from "react"; -import { StyleRoot, Style } from "radium"; -import Radium = require('radium'); +import Radium from "radium"; + @Radium class TestComponent extends React.Component<{ a: number }> { @@ -29,7 +29,7 @@ class TestComponentWithConfig extends React.Component<{ a?: number }> { return (
    - - +
    ) @@ -62,7 +62,7 @@ class TestComponentWithConfigInStyleRoot userAgent: "test", matchMedia: window.matchMedia }} > - - + ) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 9b4ebf5a24..eb4b4569c6 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -1481,6 +1481,7 @@ declare namespace R { */ prop

    (p: P, obj: T): T[P]; prop

    (p: P): (obj: Record) => T; + prop

    (p: P): (obj: Record) => T; /** * Determines whether the given property of an object has a specific @@ -1519,6 +1520,7 @@ declare namespace R { */ props

    (ps: ReadonlyArray

    , obj: Record): T[]; props

    (ps: ReadonlyArray

    ): (obj: Record) => T[]; + props

    (ps: ReadonlyArray

    ): (obj: Record) => T[]; /** * Returns true if the specified object property satisfies the given predicate; false otherwise. diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index 933b468f09..dbb697e658 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -724,7 +724,9 @@ interface Obj { const list: Book[] = [{id: "xyz", title: "A"}, {id: "abc", title: "B"}]; const a1 = R.indexBy(R.prop("id"), list); const a2 = R.indexBy(R.prop("id"))(list); - const a3 = R.indexBy<{ id: string }>(R.prop("id"))(list); + const a3 = R.indexBy<{ id: string }>(R.prop("id"))(list); + const a4 = R.indexBy(R.prop<"id", string>("id"))(list); + const a5 = R.indexBy<{ id: string }>(R.prop<"id", string>("id"))(list); const titlesIndexedByTitles: { [k: string]: string } = R.pipe( R.map((x: Book) => x.title), @@ -1161,7 +1163,8 @@ type Pair = KeyValuePair; () => { const x = R.prop("x"); - const a: boolean = R.tryCatch(R.prop("x"), R.F)({x: true}); // => true + const a: boolean = R.tryCatch(R.prop("x"), R.F)({x: true}); // => true + const a1: boolean = R.tryCatch(R.prop<"x", true>("x"), R.F)({x: true}); // => true const b: boolean = R.tryCatch(R.prop("x"), R.F)(null); // => false const c: boolean = R.tryCatch(R.and, R.F)(true, true); // => true }; @@ -1754,7 +1757,7 @@ class Rectangle { const format = R.converge( R.call, [ - R.pipe<{}, number, (s: string) => string>(R.prop("indent"), indentN), + R.pipe(R.prop<"indent", number>("indent"), indentN), R.prop("value") ] ); diff --git a/types/react-beautiful-dnd/index.d.ts b/types/react-beautiful-dnd/index.d.ts index e1dd58a179..8d25e79407 100644 --- a/types/react-beautiful-dnd/index.d.ts +++ b/types/react-beautiful-dnd/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for react-beautiful-dnd 4.0 +// Type definitions for react-beautiful-dnd 6.0 // Project: https://github.com/atlassian/react-beautiful-dnd // Definitions by: varHarrie // Bradley Ayers +// Austin Turner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -11,13 +12,19 @@ export type Id = string; export type DraggableId = Id; export type DroppableId = Id; export type TypeId = Id; -export type ZIndex = number | string; +export type ZIndex = React.CSSProperties['zIndex']; +export type DropReason = 'DROP' | 'CANCEL'; +export type Announce = (message: string) => void; export interface DraggableLocation { droppableId: DroppableId; index: number; } +export interface HookProvided { + announce: Announce; +} + /** * DragDropContext */ @@ -32,17 +39,14 @@ export interface DragUpdate extends DragStart { destination?: DraggableLocation | null; } -export interface DropResult { - draggableId: DraggableId; - type: TypeId; - source: DraggableLocation; - destination?: DraggableLocation | null; +export interface DropResult extends DragUpdate { + reason: DropReason; } export interface DragDropContextProps { - onDragStart?(initial: DragStart): void; - onDragUpdate?(initial: DragUpdate): void; - onDragEnd(result: DropResult): void; + onDragStart?(initial: DragStart, provided: HookProvided): void; + onDragUpdate?(initial: DragUpdate, provided: HookProvided): void; + onDragEnd(result: DropResult, provided: HookProvided): void; } export class DragDropContext extends React.Component {} @@ -51,9 +55,14 @@ export class DragDropContext extends React.Component {} * Droppable */ +export interface DroppableProvidedProps { + // used for shared global styles + 'data-react-beautiful-dnd-droppable': string; +} export interface DroppableProvided { innerRef(element: HTMLElement | null): any; placeholder?: React.ReactElement | null; + droppableProps: DroppableProvidedProps; } export interface DroppableStateSnapshot { @@ -103,12 +112,14 @@ export interface DraggableProvidedDraggableProps { export interface DraggableProvidedDragHandleProps { onMouseDown: React.MouseEventHandler; onKeyDown: React.KeyboardEventHandler; - onClick: React.MouseEventHandler; + onTouchStart: React.TouchEventHandler; + onTouchMove: React.TouchEventHandler; + 'data-react-beautiful-dnd-drag-handle': string; + 'aria-roledescription': string; tabIndex: number; 'aria-grabbed': boolean; draggable: boolean; - onDragStart(): void; - onDrop(): void; + onDragStart: React.DragEventHandler; } export interface DraggableProvided { diff --git a/types/react-beautiful-dnd/react-beautiful-dnd-tests.tsx b/types/react-beautiful-dnd/react-beautiful-dnd-tests.tsx index b05ff46550..882b28a9ad 100644 --- a/types/react-beautiful-dnd/react-beautiful-dnd-tests.tsx +++ b/types/react-beautiful-dnd/react-beautiful-dnd-tests.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; -import { DragDropContext, Draggable, Droppable, DropResult } from 'react-beautiful-dnd'; +import { DragDropContext, Draggable, Droppable, DropResult, DragStart, DragUpdate, HookProvided } from 'react-beautiful-dnd'; interface Item { id: string; @@ -49,7 +49,15 @@ class App extends React.Component<{}, AppState> { this.onDragEnd = this.onDragEnd.bind(this); } - onDragEnd(result: DropResult) { + onDragStart(dragStart: DragStart, provided: HookProvided) { + // + } + + onDragUpdate(dragUpdate: DragUpdate, provided: HookProvided) { + // + } + + onDragEnd(result: DropResult, provided: HookProvided) { if (!result.destination) { return; } @@ -65,10 +73,10 @@ class App extends React.Component<{}, AppState> { render() { return ( - + {(provided, snapshot) => ( -

    +
    {this.state.items.map((item, index) => ( {(provided, snapshot) => ( diff --git a/types/react-bootstrap-table/index.d.ts b/types/react-bootstrap-table/index.d.ts index 1ad6b3be73..6e9fd1dea8 100644 --- a/types/react-bootstrap-table/index.d.ts +++ b/types/react-bootstrap-table/index.d.ts @@ -1857,7 +1857,7 @@ export interface KeyboardNavigation { /** * Return a style object which will be applied on the navigating cell. */ - customStyle?: CSSProperties; + customStyle?(cell: any, row: any): CSSProperties; /** * Set to false to disable click to navigate, usually user wants to click to select row instead of navigation. */ @@ -1865,7 +1865,7 @@ export interface KeyboardNavigation { /** * Return a style object which will be applied on the both of navigating and editing cell. */ - customStyleOnEditCell?: CSSProperties; + customStyleOnEditCell?(cell: any, row: any): CSSProperties; /** * When set to true, pressing ENTER will begin to edit the cell if cellEdit is also enabled. */ diff --git a/types/react-bootstrap/index.d.ts b/types/react-bootstrap/index.d.ts index ccbc01d31a..45a645fc32 100644 --- a/types/react-bootstrap/index.d.ts +++ b/types/react-bootstrap/index.d.ts @@ -11,6 +11,7 @@ // Vito Samson , // Karol Janyst // Aaron Beall +// Johann Rakotoharisoa // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 diff --git a/types/react-bootstrap/lib/Fade.d.ts b/types/react-bootstrap/lib/Fade.d.ts index cb6e456417..4b30c04a5c 100644 --- a/types/react-bootstrap/lib/Fade.d.ts +++ b/types/react-bootstrap/lib/Fade.d.ts @@ -5,7 +5,8 @@ declare namespace Fade { export interface FadeProps extends TransitionCallbacks, React.HTMLProps { in?: boolean; timeout?: number; - transitionAppear?: boolean; + mountOnEnter?: boolean; + appear?: boolean; unmountOnExit?: boolean; } } diff --git a/types/react-bootstrap/lib/TabPane.d.ts b/types/react-bootstrap/lib/TabPane.d.ts index c1ea0cf501..fefe101923 100644 --- a/types/react-bootstrap/lib/TabPane.d.ts +++ b/types/react-bootstrap/lib/TabPane.d.ts @@ -7,6 +7,7 @@ declare namespace TabPane { 'aria-labelledby'?: string; bsClass?: string; eventKey?: any; + mountOnEnter?: boolean; unmountOnExit?: boolean; } } diff --git a/types/react-confirm/react-confirm-tests.tsx b/types/react-confirm/react-confirm-tests.tsx index a062b1e2a2..cfa3499ffc 100644 --- a/types/react-confirm/react-confirm-tests.tsx +++ b/types/react-confirm/react-confirm-tests.tsx @@ -6,13 +6,13 @@ interface CustomModalProps { } class CustomModal extends React.Component { - modalStyle(): string { - return this.props.show ? "display: none;" : ""; + modalStyle() { + return this.props.show ? { display: 'none' } : undefined; } render() { return ( -
    +

    {this.props.title}

    diff --git a/types/react-data-grid/index.d.ts b/types/react-data-grid/index.d.ts index 27f12bccb6..af6edce257 100644 --- a/types/react-data-grid/index.d.ts +++ b/types/react-data-grid/index.d.ts @@ -97,6 +97,11 @@ declare namespace AdazzleReactDataGrid { * @default rowHeight */ headerRowHeight?: number + /** + * The height of the header filter row in pixels. + * @default 45 + */ + headerFiltersHeight?: number /** * The minimum width of each column in pixels. * @default 80 @@ -163,11 +168,11 @@ declare namespace AdazzleReactDataGrid { enableCellSelect?: boolean /** - * Enables cells to be dragged and dropped + * Enables cells to be dragged and dropped * @default false */ enableDragAndDrop?: boolean - + /** * Called when a cell is selected. * @param coordinates The row and column indices of the selected cell. @@ -211,10 +216,10 @@ declare namespace AdazzleReactDataGrid { * @param props OnRowExpandToggle object */ onRowExpandToggle?: (props: OnRowExpandToggle ) => void - + /** * Responsible for returning an Array of values that can be used for filtering - * a column that is column.filterable and using a column.filterRenderer that + * a column that is column.filterable and using a column.filterRenderer that * displays a list of options. * @param columnKey the column key that we are looking to pull values from */ @@ -485,7 +490,7 @@ declare namespace AdazzleReactDataGrid { * Excel-like grid component built with React, with editors, keyboard navigation, copy & paste, and the like * http://adazzle.github.io/react-data-grid/ */ - export class ReactDataGrid extends React.Component { + export class ReactDataGrid extends React.Component { /** * Opens the editor for the cell (idx) in the given row (rowIdx). If the column is not editable then nothing will happen. */ diff --git a/types/react-daterange-picker/index.d.ts b/types/react-daterange-picker/index.d.ts index e6fac4c33d..9d1d3ec565 100644 --- a/types/react-daterange-picker/index.d.ts +++ b/types/react-daterange-picker/index.d.ts @@ -12,7 +12,7 @@ import * as momentRange from "moment-range"; export default class DateRangePicker extends React.Component { } export as namespace ReactDateRangePicker; -export interface Props extends React.Props<{}> { +export interface Props extends React.Props { bemBlock?: string; bemNamespace?: string; dateStates?: DateState[]; @@ -57,7 +57,7 @@ export interface StateDefinition { selectable?: boolean; } -export interface PaginationArrowProps extends React.Props<{}> { +export interface PaginationArrowProps extends React.Props { disabled?: boolean; onTrigger?(): void; direction?: 'next' | 'previous'; diff --git a/types/react-dom/index.d.ts b/types/react-dom/index.d.ts index da494182d6..bd9541217d 100644 --- a/types/react-dom/index.d.ts +++ b/types/react-dom/index.d.ts @@ -16,7 +16,7 @@ import { DOMAttributes, DOMElement, ReactNode, ReactPortal } from 'react'; -export function findDOMNode(instance: ReactInstance): Element; +export function findDOMNode(instance: ReactInstance): Element | null | Text; export function unmountComponentAtNode(container: Element): boolean; export function createPortal(children: ReactNode, container: Element): ReactPortal; diff --git a/types/react-flatpickr/index.d.ts b/types/react-flatpickr/index.d.ts index 68d79a2b6c..9683835e32 100644 --- a/types/react-flatpickr/index.d.ts +++ b/types/react-flatpickr/index.d.ts @@ -5,12 +5,12 @@ // TypeScript Version: 2.6 import { Component } from 'react'; -import { Options } from 'flatpickr'; +import flatpickr from 'flatpickr'; export interface DateTimePickerProps { defaultValue?: string; - options?: Options.Options; - onChange?: Options.Hook; + options?: flatpickr.Options.Options; + onChange?: flatpickr.Options.Hook; value?: string; } diff --git a/types/react-flatpickr/react-flatpickr-tests.tsx b/types/react-flatpickr/react-flatpickr-tests.tsx index c3dc0f4adc..fbbb6f45a7 100644 --- a/types/react-flatpickr/react-flatpickr-tests.tsx +++ b/types/react-flatpickr/react-flatpickr-tests.tsx @@ -1,4 +1,4 @@ -import { Instance } from 'flatpickr'; +import flatpickr from 'flatpickr'; import * as React from 'react'; import DatePicker from 'react-flatpickr'; @@ -12,7 +12,7 @@ const options = { const optionsElement = ; const onChange = ( - selectedDates: Date[], dateStr: string, instance: Instance, + selectedDates: Date[], dateStr: string, instance: flatpickr.Instance, elem: HTMLElement ) => null; const onChangeElement = ; diff --git a/types/react-form/index.d.ts b/types/react-form/index.d.ts index e2c2823d7f..4ae175d83b 100644 --- a/types/react-form/index.d.ts +++ b/types/react-form/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for react-form 2.12 +// Type definitions for react-form 2.16 // Project: https://github.com/tannerlinsley/react-form#readme // Definitions by: Cameron McAteer +// Mathieu Masy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -18,7 +19,7 @@ export interface FormErrors { [key: string]: FormError; } export type NestedErrors = Nested; -export type RenderReturn = JSX.Element | false | null; +export type RenderReturn = JSX.Element | false | null | never[]; export interface FormState { values: FormValues; @@ -29,7 +30,10 @@ export interface FormState { } export interface FormProps { + component?: React.ReactType<{ formApi: FormApi }>; + render?: (formApi: FormApi) => RenderReturn; dontValidateOnMount?: boolean; + validateOnSubmit?: boolean; defaultValues?: FormValues; onSubmit?(values: FormValues, submissionEvent: React.SyntheticEvent, formApi: FormApi): void; preSubmit?(values: FormValues, formApi: FormApi): FormValues; @@ -43,6 +47,7 @@ export interface FormProps { [field: string]: (value: FormValue) => Promise }; dontPreventDefault?: boolean; + getApi?: (formApi: FormApi) => void; } export interface FormApi { @@ -137,6 +142,7 @@ export type SelectOptions = Array<{ export interface SelectProps extends FieldProps, React.SelectHTMLAttributes { options: SelectOptions; + placeholder?: string; } export const Select: React.StatelessComponent; diff --git a/types/react-form/react-form-tests.tsx b/types/react-form/react-form-tests.tsx index 2d08cc4b8a..36aa86db94 100644 --- a/types/react-form/react-form-tests.tsx +++ b/types/react-form/react-form-tests.tsx @@ -21,6 +21,50 @@ import { FormApi } from 'react-form'; +// Form Api +class FormApiMethods extends React.Component { + constructor(props: {}) { + super(props); + this.state = {}; + } + + render() { + const FormContent = (props: { formApi?: FormApi }) => ( +
    {}}> + + + + ); + + return ( +
    +
    + { formApi => ( + + + + + )} + + +
    ( + + + + + )}> + + +
    + + + +
    +
    + ); + } +} + // Basic Form Example const statusOptions = [ { diff --git a/types/react-form/tsconfig.json b/types/react-form/tsconfig.json index d6c6d41dca..d3a981a1be 100644 --- a/types/react-form/tsconfig.json +++ b/types/react-form/tsconfig.json @@ -22,4 +22,4 @@ "index.d.ts", "react-form-tests.tsx" ] -} \ No newline at end of file +} diff --git a/types/react-geosuggest/index.d.ts b/types/react-geosuggest/index.d.ts index 2537754b02..344e768b08 100644 --- a/types/react-geosuggest/index.d.ts +++ b/types/react-geosuggest/index.d.ts @@ -16,7 +16,15 @@ export default class Geosuggest extends Component { selectSuggest(value?: Suggest): void; } -export interface GeosuggestProps extends InputHTMLAttributes { +// Replace with Exclude once on 2.8+ +export type Diff = ( + & { [P in T]: P } + & { [P in U]: never } + & { [x: string]: never } +)[T]; +export type Omit = Pick>; + +export interface GeosuggestProps extends Omit, 'style'> { placeholder?: string; initialValue?: string; className?: string; diff --git a/types/react-i18next/src/I18n.d.ts b/types/react-i18next/src/I18n.d.ts index 122249c6e8..6bc1cf8f0f 100644 --- a/types/react-i18next/src/I18n.d.ts +++ b/types/react-i18next/src/I18n.d.ts @@ -8,7 +8,7 @@ export interface Options { export interface i18nProps { wait?: boolean; - ns: string | string[]; + ns?: string | string[]; nsMode?: string; bindI18n?: string; bindStore?: string; diff --git a/types/react-infinite-calendar/index.d.ts b/types/react-infinite-calendar/index.d.ts new file mode 100644 index 0000000000..0264c70d91 --- /dev/null +++ b/types/react-infinite-calendar/index.d.ts @@ -0,0 +1,66 @@ +// Type definitions for react-infinite-calendar 2.3 +// Project: https://github.com/clauderic/react-infinite-calendar +// Definitions by: Christian Chown +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; + +export interface ReactInfiniteCalendarProps { + selected?: Date | boolean; + width?: number | 'auto'; + height?: number | 'auto'; + min?: Date; + max?: Date; + minDate?: Date; + maxDate?: Date; + disabledDays?: Array<0 | 1 | 2 | 3 | 4 | 5 | 6>; + disabledDates?: Date[]; + display?: 'days' | 'years'; + displayOptions?: { + hideYearsOnSelect?: boolean; + layout?: 'portrait' | 'landscape'; + overscanMonthCount?: number; + shouldHeaderAnimate?: boolean; + showHeader?: boolean; + showMonthsForYears?: boolean; + showOverlay?: boolean; + showTodayHelper?: boolean; + showWeekdays?: boolean; + todayHelperRowOffset?: number; + }; + locale?: { + blank?: string; + headerFormat?: string; + todayLabel?: { + long: string; + }; + weekdays?: string[]; + weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6; + }; + theme?: { + accentColor?: string; + floatingNav?: { + background?: string; + chevron?: string; + color?: string; + }; + headerColor?: string; + selectionColor?: string; + textColor?: { + active?: string; + default?: string; + }; + todayColor?: string; + weekdayColor?: string; + }; + className?: string; + onSelect?: (date: string) => void; + onScroll?: (scrollTop: number) => void; + onScrollEnd?: (scrollTop: number) => void; + rowHeight?: number; + autoFocus?: boolean; + tabIndex?: number; +} + +export default class ReactInfiniteCalendar extends React.Component {} diff --git a/types/react-infinite-calendar/react-infinite-calendar-tests.tsx b/types/react-infinite-calendar/react-infinite-calendar-tests.tsx new file mode 100644 index 0000000000..ff1918d539 --- /dev/null +++ b/types/react-infinite-calendar/react-infinite-calendar-tests.tsx @@ -0,0 +1,61 @@ +import * as React from 'react'; +import ReactInfiniteCalendar from 'react-infinite-calendar'; + +const test: React.SFC = () => ( + {}} + onScroll={(scrollTop: number) => { console.log(scrollTop); }} + onScrollEnd={(scrollTop: number) => { console.log(scrollTop); }} + rowHeight={40} + autoFocus={false} + tabIndex={1} + /> +); diff --git a/types/react-infinite-calendar/tsconfig.json b/types/react-infinite-calendar/tsconfig.json new file mode 100644 index 0000000000..dab62fb64c --- /dev/null +++ b/types/react-infinite-calendar/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-infinite-calendar-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/react-infinite-calendar/tslint.json b/types/react-infinite-calendar/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/react-infinite-calendar/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/react-intl/index.d.ts b/types/react-intl/index.d.ts index 72d5d69f51..7da9dbd487 100644 --- a/types/react-intl/index.d.ts +++ b/types/react-intl/index.d.ts @@ -142,6 +142,7 @@ declare namespace ReactIntl { interface Props extends MessageDescriptor { values?: {[key: string]: MessageValue | JSX.Element}; tagName?: string; + children?: (formattedMessage: string[]) => React.ReactNode; } } class FormattedMessage extends React.Component { } diff --git a/types/react-intl/react-intl-tests.tsx b/types/react-intl/react-intl-tests.tsx index 726802a8bb..75490a5ca1 100644 --- a/types/react-intl/react-intl-tests.tsx +++ b/types/react-intl/react-intl-tests.tsx @@ -143,6 +143,13 @@ class SomeComponent extends React.Component + + {(text) =>
    {text}
    } +
    + // Ian Ker-Seymer // Tomek Łaziuk +// Ian Mobley // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 diff --git a/types/react-loadable/test/webpack.ts b/types/react-loadable/test/webpack.ts new file mode 100644 index 0000000000..ecfa79cd53 --- /dev/null +++ b/types/react-loadable/test/webpack.ts @@ -0,0 +1,25 @@ +import webpack = require('webpack'); +import Loadable = require('react-loadable/webpack'); + +const config: webpack.Configuration = { + plugins: [ + new Loadable.ReactLoadablePlugin(), + new Loadable.ReactLoadablePlugin({ + filename: 'react-loadable.json' + }) + ] +}; + +const manifest = { + react: [ + { + id: 0, + name: './node_modules/react/index.js', + file: 'main.js' + } + ] +}; + +const manifestIds = ['react']; + +const bundles = Loadable.getBundles(manifest, manifestIds); diff --git a/types/react-loadable/tsconfig.json b/types/react-loadable/tsconfig.json index 9d46ae0de9..a2ad20875b 100644 --- a/types/react-loadable/tsconfig.json +++ b/types/react-loadable/tsconfig.json @@ -19,8 +19,10 @@ }, "files": [ "index.d.ts", + "webpack.d.ts", "test/index.tsx", + "test/webpack.ts", "test/imports/no-default.tsx", "test/imports/with-default.tsx" ] -} \ No newline at end of file +} diff --git a/types/react-loadable/webpack.d.ts b/types/react-loadable/webpack.d.ts new file mode 100644 index 0000000000..54732527d8 --- /dev/null +++ b/types/react-loadable/webpack.d.ts @@ -0,0 +1,30 @@ +import webpack = require("webpack"); + +declare namespace LoadableExport { + interface Options { + filename: string; + } + + class ReactLoadablePlugin extends webpack.Plugin { + constructor(opts?: Options); + } + + interface Bundle { + id: number; + name: string; + file: string; + } + + interface Manifest { + [moduleId: string]: Bundle[]; + } + + function getBundles(manifest: Manifest, moduleIds: string[]): Bundle[]; +} + +declare const exports: { + getBundles: typeof LoadableExport.getBundles; + ReactLoadablePlugin: typeof LoadableExport.ReactLoadablePlugin; +}; + +export = exports; diff --git a/types/react-mailchimp-subscribe/index.d.ts b/types/react-mailchimp-subscribe/index.d.ts new file mode 100644 index 0000000000..558c6a92cd --- /dev/null +++ b/types/react-mailchimp-subscribe/index.d.ts @@ -0,0 +1,51 @@ +// Type definitions for react-mailchimp-subscribe 2.0 +// Project: https://revolunet.github.io/react-mailchimp-subscribe/ +// Definitions by: Omar Diab +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import { Component, ReactNode } from "react"; + +// A few common set of form fields, based on defaults in Mailchimp's website +export interface EmailFormFields { + EMAIL: string; +} + +export interface NameFormFields extends EmailFormFields { + FNAME: string; + LNAME: string; +} + +export interface ClassicFormFields extends NameFormFields { + "BIRTHDAY[month]": number; + "BIRTHDAY[day]": number; +} + +// library default form just sends EMAIL +export type DefaultFormFields = EmailFormFields; + +export interface ResponseArgs { + status: "success" | "error"; + message: string; +} + +export interface PendingArgs { + status: "sending" | null; + message: null; +} + +export interface SubscribeArg { + subscribe: (data: FormFields) => void; +} + +export type FormHooks = SubscribeArg & + (ResponseArgs | PendingArgs); + +export interface Props { + render?: (hooks: FormHooks) => ReactNode; + url: string; +} + +export default class MailchimpSubscribe extends Component< + Props +> {} diff --git a/types/react-mailchimp-subscribe/react-mailchimp-subscribe-tests.tsx b/types/react-mailchimp-subscribe/react-mailchimp-subscribe-tests.tsx new file mode 100644 index 0000000000..0507d7657a --- /dev/null +++ b/types/react-mailchimp-subscribe/react-mailchimp-subscribe-tests.tsx @@ -0,0 +1,57 @@ +import * as React from "react"; +import MailchimpSubscribe, { + NameFormFields +} from "react-mailchimp-subscribe"; + +const Example: React.StatelessComponent = () => ( + <> + (<> + { hooks.status === "error" && + hooks.message + } + { hooks.status === "sending" && + Sending! + } + { hooks.status === "success" && + It's been sent! {hooks.message} + } + { + e.preventDefault(); + hooks.subscribe({ EMAIL: "8675309@aol.com" }); + }} + /> + )} + url="spam.biz/subscribe" + /> + { /* once Typescript 2.9 is out, generics in components will be allowed, at that point uncomment these. */ } + { /* https://github.com/Microsoft/TypeScript/pull/22415 */ } + {/* + render={(hooks) => ( + { + e.preventDefault(); + hooks.subscribe({ myArbitraryData: "is here!" }); + }} + /> + )} + url="spam.biz/subscribe" + /> + + render={(hooks) => ( + { + e.preventDefault(); + hooks.subscribe({ + FNAME: "大", + LNAME: "哥", + EMAIL: "da.ge@qq.com", + }); + }} + /> + )} + url="spam.biz/subscribe" + /> */} + +); diff --git a/types/react-mailchimp-subscribe/tsconfig.json b/types/react-mailchimp-subscribe/tsconfig.json new file mode 100644 index 0000000000..4f2f142ca5 --- /dev/null +++ b/types/react-mailchimp-subscribe/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-mailchimp-subscribe-tests.tsx" + ] +} diff --git a/types/react-mailchimp-subscribe/tslint.json b/types/react-mailchimp-subscribe/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-mailchimp-subscribe/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-native-android-taskdescription/index.d.ts b/types/react-native-android-taskdescription/index.d.ts new file mode 100644 index 0000000000..0f395e91f2 --- /dev/null +++ b/types/react-native-android-taskdescription/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for react-native-android-taskdescription 1.0 +// Project: https://github.com/jwarby/react-native-android-taskdescription +// Definitions by: Christian Chown +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; + +export interface ReactNativeAndroidTaskDescriptionProps { + backgroundColor?: string; + label?: string; +} + +export default class ReactNativeAndroidTaskDescription extends React.Component {} diff --git a/types/react-native-android-taskdescription/react-native-android-taskdescription-tests.tsx b/types/react-native-android-taskdescription/react-native-android-taskdescription-tests.tsx new file mode 100644 index 0000000000..a49036e519 --- /dev/null +++ b/types/react-native-android-taskdescription/react-native-android-taskdescription-tests.tsx @@ -0,0 +1,9 @@ +import * as React from 'react'; +import ReactNativeAndroidTaskDescription from 'react-native-android-taskdescription'; + +const test: React.SFC = () => ( + +); diff --git a/types/react-native-android-taskdescription/tsconfig.json b/types/react-native-android-taskdescription/tsconfig.json new file mode 100644 index 0000000000..e36bea114b --- /dev/null +++ b/types/react-native-android-taskdescription/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react-native", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-native-android-taskdescription-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/react-native-android-taskdescription/tslint.json b/types/react-native-android-taskdescription/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/react-native-android-taskdescription/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/react-native-bluetooth-serial/index.d.ts b/types/react-native-bluetooth-serial/index.d.ts new file mode 100644 index 0000000000..8dc4d9c1a1 --- /dev/null +++ b/types/react-native-bluetooth-serial/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for react-native-bluetooth-serial 1.0 +// Project: https://github.com/rusel1989/react-native-bluetooth-serial +// Definitions by: Rodrigo Weber +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 +import * as React from "react"; +import * as ReactNative from "react-native"; + +export type Buffer = (data: number[]) => void; + +export namespace BluetoothSerial { + function on(eventName: string, handler: () => void): void; + function removeListener(eventName: string, handler: () => void): void; + function write(data: Buffer | string): Promise; + function list(): Promise>; + function isEnabled(): Promise; + function connect(id: string): Promise; + function disconnect(): Promise; + function isConnected(): Promise; +} diff --git a/types/react-native-bluetooth-serial/react-native-bluetooth-serial-tests.tsx b/types/react-native-bluetooth-serial/react-native-bluetooth-serial-tests.tsx new file mode 100644 index 0000000000..fc03d1a702 --- /dev/null +++ b/types/react-native-bluetooth-serial/react-native-bluetooth-serial-tests.tsx @@ -0,0 +1,22 @@ +import * as React from 'react'; +import { View, Text } from 'react-native'; +import { BluetoothSerial } from 'react-native-bluetooth-serial'; + +class Example extends React.Component { + async componentDidMount() { + const devices = await BluetoothSerial.list(); + + await BluetoothSerial.connect(devices[0].id); + + BluetoothSerial.write("Hello"); + + await BluetoothSerial.disconnect(); + } + render() { + return ( + + Printer + + ); + } +} diff --git a/types/catalog/tsconfig.json b/types/react-native-bluetooth-serial/tsconfig.json similarity index 90% rename from types/catalog/tsconfig.json rename to types/react-native-bluetooth-serial/tsconfig.json index ee00ec7af2..213f3fd025 100644 --- a/types/catalog/tsconfig.json +++ b/types/react-native-bluetooth-serial/tsconfig.json @@ -20,6 +20,6 @@ }, "files": [ "index.d.ts", - "catalog-tests.tsx" + "react-native-bluetooth-serial-tests.tsx" ] } \ No newline at end of file diff --git a/types/react-native-bluetooth-serial/tslint.json b/types/react-native-bluetooth-serial/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-bluetooth-serial/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-native-elevated-view/index.d.ts b/types/react-native-elevated-view/index.d.ts new file mode 100644 index 0000000000..4ad853294b --- /dev/null +++ b/types/react-native-elevated-view/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for react-native-elevated-view 0.0 +// Project: https://github.com/alekhurst/react-native-elevated-view +// Definitions by: fhelwanger +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; +import * as ReactNative from 'react-native'; + +export interface ElevatedViewProperties extends ReactNative.ViewProperties { + elevation?: number; +} + +export default class ElevatedView extends React.Component {} diff --git a/types/react-native-elevated-view/react-native-elevated-view-tests.tsx b/types/react-native-elevated-view/react-native-elevated-view-tests.tsx new file mode 100644 index 0000000000..f66932b1bf --- /dev/null +++ b/types/react-native-elevated-view/react-native-elevated-view-tests.tsx @@ -0,0 +1,10 @@ +import * as React from "react"; +import ElevatedView from "react-native-elevated-view"; + +() => { + ; +}; + +() => { + ; +}; diff --git a/types/react-native-elevated-view/tsconfig.json b/types/react-native-elevated-view/tsconfig.json new file mode 100644 index 0000000000..89b476781c --- /dev/null +++ b/types/react-native-elevated-view/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-native-elevated-view-tests.tsx" + ] +} diff --git a/types/react-native-elevated-view/tslint.json b/types/react-native-elevated-view/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-elevated-view/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-native-i18n/index.d.ts b/types/react-native-i18n/index.d.ts new file mode 100644 index 0000000000..00d50e3caf --- /dev/null +++ b/types/react-native-i18n/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for react-native-i18n 2.0 +// Project: https://github.com/AlexanderZaytsev/react-native-i18n +// Definitions by: Vincent Langlet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import I18n = require("i18n-js"); + +export function getLanguages(): Promise; + +export default I18n; diff --git a/types/react-native-i18n/react-native-i18n-tests.ts b/types/react-native-i18n/react-native-i18n-tests.ts new file mode 100644 index 0000000000..1ab2134c69 --- /dev/null +++ b/types/react-native-i18n/react-native-i18n-tests.ts @@ -0,0 +1,10 @@ +import I18n, { getLanguages } from 'react-native-i18n'; + +getLanguages().then(languages => languages[0]); + +I18n.defaultLocale = 'en'; +I18n.fallbacks = true; +I18n.translations = {}; +I18n.locale = 'fr'; + +const currentLocale: string = I18n.currentLocale(); diff --git a/types/react-native-i18n/tsconfig.json b/types/react-native-i18n/tsconfig.json new file mode 100644 index 0000000000..f6a744565f --- /dev/null +++ b/types/react-native-i18n/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-native-i18n-tests.ts" + ] +} diff --git a/types/react-native-i18n/tslint.json b/types/react-native-i18n/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-i18n/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-native-keyboard-spacer/index.d.ts b/types/react-native-keyboard-spacer/index.d.ts new file mode 100644 index 0000000000..0c7ec24262 --- /dev/null +++ b/types/react-native-keyboard-spacer/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for react-native-keyboard-spacer 0.4 +// Project: https://github.com/Andr3wHur5t/react-native-keyboard-spacer#readme +// Definitions by: Vincent Langlet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; +import * as ReactNative from 'react-native'; + +export interface KeyboardSpacerProps { + topSpacing?: number; + onToggle?: (keyboardIsOpen: boolean, keyboardSpace: number) => void; + style?: ReactNative.StyleProp; +} + +export default class KeyboardSpacer extends React.Component { } diff --git a/types/react-native-keyboard-spacer/react-native-keyboard-spacer-tests.tsx b/types/react-native-keyboard-spacer/react-native-keyboard-spacer-tests.tsx new file mode 100644 index 0000000000..7deb9798ef --- /dev/null +++ b/types/react-native-keyboard-spacer/react-native-keyboard-spacer-tests.tsx @@ -0,0 +1,6 @@ +import * as React from 'react'; +import KeyboardSpacer from 'react-native-keyboard-spacer'; + +() => { + ; +}; diff --git a/types/react-native-keyboard-spacer/tsconfig.json b/types/react-native-keyboard-spacer/tsconfig.json new file mode 100644 index 0000000000..04110630ce --- /dev/null +++ b/types/react-native-keyboard-spacer/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-native-keyboard-spacer-tests.tsx" + ] +} diff --git a/types/react-native-keyboard-spacer/tslint.json b/types/react-native-keyboard-spacer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-keyboard-spacer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-native-material-ui/index.d.ts b/types/react-native-material-ui/index.d.ts index e643b4198f..89b01d13bc 100644 --- a/types/react-native-material-ui/index.d.ts +++ b/types/react-native-material-ui/index.d.ts @@ -426,6 +426,7 @@ export interface Searchable { onSearchClosed?(): void; onSearchPressed?(): void; onSubmitEditing?(): void; + onSearchCloseRequested?(): void; } export interface ToolBarRightElement { diff --git a/types/react-native-material-ui/react-native-material-ui-tests.tsx b/types/react-native-material-ui/react-native-material-ui-tests.tsx index b4380fc388..5aed665ec4 100644 --- a/types/react-native-material-ui/react-native-material-ui-tests.tsx +++ b/types/react-native-material-ui/react-native-material-ui-tests.tsx @@ -11,7 +11,8 @@ import { Checkbox, Dialog, DialogDefaultActions, - BottomNavigation + BottomNavigation, + Toolbar } from 'react-native-material-ui'; const theme = { @@ -113,3 +114,27 @@ class BottomNavigationExample extends React.Component { ); } } + +class ToolbarExample extends React.Component<{}, {search: string}> { + state = { + search: '' + }; + + handleResults(search: string) { + this.setState({ search }); + } + + render() { + return ( + this.handleResults(text), + onSearchCloseRequested: () => this.handleResults(''), + }} + /> + ); + } +} diff --git a/types/react-native-navigation/index.d.ts b/types/react-native-navigation/index.d.ts index 6699f5bf9f..5541f207c7 100644 --- a/types/react-native-navigation/index.d.ts +++ b/types/react-native-navigation/index.d.ts @@ -187,7 +187,7 @@ export interface NavigatorStyle { navBarSubtitleFontFamily?: string; navBarSubtitleFontSize?: number; screenBackgroundColor?: string; - orientation?: 'auto ' | 'landscape' | 'portrait'; + orientation?: 'auto' | 'landscape' | 'portrait'; disabledButtonColor?: string; // iOS only statusBarTextColorSchemeSingleScreen?: string; @@ -241,6 +241,8 @@ export type SystemItemIOS = 'done' | 'cancel' | 'edit' | 'save' | 'add' | 'bookmarks' | 'search' | 'refresh' | 'stop' | 'camera' | 'trash' | 'play' | 'pause' | 'rewind' | 'fastForward' | 'undo' | 'redo'; +export type ShowAsActionAndroid = 'ifRoom' | 'always' | 'withText' | 'never'; + export interface NavigatorButton { id: string | IdAndroid; title?: string; @@ -254,6 +256,7 @@ export interface NavigatorButton { buttonFontSize?: number; buttonFontWeight?: string | number; systemItem?: SystemItemIOS; + showAsAction?: ShowAsActionAndroid; } export interface FABAndroid { diff --git a/types/react-native-permissions/index.d.ts b/types/react-native-permissions/index.d.ts new file mode 100644 index 0000000000..274bdf2134 --- /dev/null +++ b/types/react-native-permissions/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for react-native-permissions 1.1 +// Project: https://github.com/yonahforst/react-native-permissions +// Definitions by: Vincent Langlet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export type Status = 'authorized' | 'denied' | 'restricted' | 'undetermined'; + +export interface Rationale { + title: string; + message: string; +} + +export type CheckOptions = string | { type: string }; + +export type RequestOptions = string | { type: string, rationale?: Rationale }; + +export interface ReactNativePermissions { + canOpenSettings: () => Promise; + openSettings: () => Promise; + getTypes: () => string[]; + check: (permission: string, options?: CheckOptions) => Promise; + request: (permission: string, options?: RequestOptions) => Promise; + checkMultiple: (permissions: string[]) => Promise<{ [key: string]: string }>; +} + +declare const Permissions: ReactNativePermissions; + +export default Permissions; diff --git a/types/react-native-permissions/react-native-permissions-tests.ts b/types/react-native-permissions/react-native-permissions-tests.ts new file mode 100644 index 0000000000..f4595f558c --- /dev/null +++ b/types/react-native-permissions/react-native-permissions-tests.ts @@ -0,0 +1,9 @@ +import Permissions from 'react-native-permissions'; + +const firstType = Permissions.getTypes()[0]; + +Permissions.canOpenSettings().then(); +Permissions.openSettings().then(); +Permissions.check('geolocation').then(); +Permissions.request('geolocation').then(); +Permissions.checkMultiple(['geolocation', 'notification']).then(); diff --git a/types/react-native-permissions/tsconfig.json b/types/react-native-permissions/tsconfig.json new file mode 100644 index 0000000000..6c1dc92447 --- /dev/null +++ b/types/react-native-permissions/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", + "react-native-permissions-tests.ts" + ] +} diff --git a/types/react-native-permissions/tslint.json b/types/react-native-permissions/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-permissions/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-native-photo-view/index.d.ts b/types/react-native-photo-view/index.d.ts new file mode 100644 index 0000000000..8979635288 --- /dev/null +++ b/types/react-native-photo-view/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for react-native-photo-view 1.5 +// Project: https://github.com/alwx/react-native-photo-view +// Definitions by: Christian Chown +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; +import { ImagePropertiesSourceOptions, ViewProperties } from 'react-native'; + +export interface ReactNativePhotoViewProps { + source?: ImagePropertiesSourceOptions; + loadingIndicatorSource?: ImagePropertiesSourceOptions; + fadeDuration?: number; + minimumZoomScale?: number; + maximumZoomScale?: number; + showsHorizontalScrollIndicator?: boolean; + showsVerticalScrollIndicator?: boolean; + scale?: number; + androidZoomTransitionDuration?: number; + androidScaleType?: 'center' | 'centerCrop' | 'centerInside' | 'fitCenter' | 'fitStart' | 'fitEnd' | 'fitXY'; + onLoadStart?: () => void; + onLoad?: () => void; + onLoadEnd?: () => void; + onProgress?: (loaded: number, total: number) => void; + onTap?: (point: {x: number, y: number}, target?: React.ReactElement) => void; + onViewTap?: (point: {x: number, y: number}, target?: React.ReactElement) => void; + onScale?: (scale: number, target?: React.ReactElement) => void; +} + +export default class ReactNativePhotoView extends React.Component {} diff --git a/types/react-native-photo-view/react-native-photo-view-tests.tsx b/types/react-native-photo-view/react-native-photo-view-tests.tsx new file mode 100644 index 0000000000..f83168d280 --- /dev/null +++ b/types/react-native-photo-view/react-native-photo-view-tests.tsx @@ -0,0 +1,38 @@ +import * as React from 'react'; +import ReactNativePhotoView from 'react-native-photo-view'; + +const test: React.SFC = () => ( + { + console.log('onLoadStart'); + }} + onLoad={() => { + console.log('onLoad'); + }} + onLoadEnd={() => { + console.log('onLoadEnd'); + }} + onProgress={(loaded: number, total: number) => { + console.log(`onProgress ${loaded}/${total}`); + }} + onTap={(point: {x: number; y: number}, target?: React.ReactElement) => { + console.log('onTap'); + }} + onViewTap={(point: {x: number; y: number}, target?: React.ReactElement) => { + console.log(`onViewTap ${point.x},${point.y} ${!!target ? 'targetted' : ''}`); + }} + onScale={(scale: number, target?: React.ReactElement) => { + console.log(`onScale ${scale} ${!!target ? 'targetted' : ''}`); + }} + /> +); diff --git a/types/react-native-photo-view/tsconfig.json b/types/react-native-photo-view/tsconfig.json new file mode 100644 index 0000000000..f6147e7192 --- /dev/null +++ b/types/react-native-photo-view/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react-native", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-native-photo-view-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/react-native-photo-view/tslint.json b/types/react-native-photo-view/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/react-native-photo-view/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/react-native-vector-icons/Icon.d.ts b/types/react-native-vector-icons/Icon.d.ts index 98bda708b3..4b64503452 100644 --- a/types/react-native-vector-icons/Icon.d.ts +++ b/types/react-native-vector-icons/Icon.d.ts @@ -157,6 +157,9 @@ export class Icon extends React.Component { static loadFont( file?: string ): Promise; + static hasIcon( + name: string, + ): boolean; } export namespace Icon { diff --git a/types/react-native-vector-icons/index.d.ts b/types/react-native-vector-icons/index.d.ts index 05a140e3bb..2a2ef8fdce 100644 --- a/types/react-native-vector-icons/index.d.ts +++ b/types/react-native-vector-icons/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-native-vector-icons 4.4 +// Type definitions for react-native-vector-icons 4.6 // Project: https://github.com/oblador/react-native-vector-icons // Definitions by: Kyle Roach // Tim Wang diff --git a/types/react-native-version-number/index.d.ts b/types/react-native-version-number/index.d.ts new file mode 100644 index 0000000000..313f19fe5b --- /dev/null +++ b/types/react-native-version-number/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for react-native-version-number 0.3 +// Project: https://github.com/APSL/react-native-version-number +// Definitions by: Vincent Langlet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface VersionNumber { + appVersion?: string; + buildVersion?: string; + bundleIdentifier?: string; +} + +declare const VersionNumber: VersionNumber; + +export default VersionNumber; diff --git a/types/react-native-version-number/react-native-version-number-tests.ts b/types/react-native-version-number/react-native-version-number-tests.ts new file mode 100644 index 0000000000..e218345a8e --- /dev/null +++ b/types/react-native-version-number/react-native-version-number-tests.ts @@ -0,0 +1,22 @@ +import VersionNumber from 'react-native-version-number'; + +const FullVersionNumber: VersionNumber = { + appVersion: '1.0', + buildVersion: '42', + bundleIdentifier: 'com.foo.bar.MyApp', +}; + +const MissingAppVersionNumber: VersionNumber = { + buildVersion: '42', + bundleIdentifier: 'com.foo.bar.MyApp', +}; + +const MissingBuildVersionNumber: VersionNumber = { + appVersion: '1.0', + bundleIdentifier: 'com.foo.bar.MyApp', +}; + +const MissingBundleVersionNumber: VersionNumber = { + appVersion: '1.0', + buildVersion: '42', +}; diff --git a/types/react-native-version-number/tsconfig.json b/types/react-native-version-number/tsconfig.json new file mode 100644 index 0000000000..15e55211ff --- /dev/null +++ b/types/react-native-version-number/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", + "react-native-version-number-tests.ts" + ] +} diff --git a/types/react-native-version-number/tslint.json b/types/react-native-version-number/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-version-number/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index ee2ad9adc1..288dfada20 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-native 0.52 +// Type definitions for react-native 0.55 // Project: https://github.com/facebook/react-native // Definitions by: Eloy Durán // HuHuanming @@ -6,6 +6,9 @@ // Tim Wang // Kamal Mahyuddin // Naoufal El Yousfi +// Alex Dunne +// Manuel Alabor +// Michele Bombardi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -338,6 +341,9 @@ export function createElement

    ( export type Runnable = (appParameters: any) => void; +type Task = (taskData: any) => Promise; +type TaskProvider = () => Task; + type NodeHandle = number; // Similar to React.SyntheticEvent except for nativeEvent @@ -465,6 +471,8 @@ export namespace AppRegistry { function unmountApplicationComponentAtRootTag(rootTag: number): void; function runApplication(appKey: string, appParameters: any): void; + + function registerHeadlessTask(appKey: string, task: TaskProvider): void; } export interface LayoutAnimationTypes { @@ -1043,10 +1051,12 @@ export type KeyboardTypeIOS = | "twitter" | "web-search"; export type KeyboardTypeAndroid = "visible-password"; +export type KeyboardTypeOptions = KeyboardType | KeyboardTypeAndroid | KeyboardTypeIOS export type ReturnKeyType = "done" | "go" | "next" | "search" | "send"; export type ReturnKeyTypeAndroid = "none" | "previous"; export type ReturnKeyTypeIOS = "default" | "google" | "join" | "route" | "yahoo" | "emergency-call"; +export type ReturnKeyTypeOptions = ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS /** * @see https://facebook.github.io/react-native/docs/textinput.html#props @@ -1082,6 +1092,11 @@ export interface TextInputProperties */ blurOnSubmit?: boolean; + /** + * If true, caret is hidden. The default value is false. + */ + caretHidden?: boolean + /** * Provides an initial value that will change when the user starts typing. * Useful for simple use-cases where you don't want to deal with listening to events @@ -1102,7 +1117,7 @@ export interface TextInputProperties * The following values work on iOS: - ascii-capable - numbers-and-punctuation - url - number-pad - name-phone-pad - decimal-pad - twitter - web-search * The following values work on Android: - visible-password */ - keyboardType?: KeyboardType | KeyboardTypeIOS | KeyboardTypeAndroid; + keyboardType?: KeyboardTypeOptions; /** * Limits the maximum number of characters that can be entered. @@ -1183,7 +1198,7 @@ export interface TextInputProperties * enum('default', 'go', 'google', 'join', 'next', 'route', 'search', 'send', 'yahoo', 'done', 'emergency-call') * Determines how the return key should look. */ - returnKeyType?: ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS; + returnKeyType?: ReturnKeyTypeOptions; /** * If true, the text input obscures the text entered so that sensitive text like passwords stay secure. @@ -1217,6 +1232,13 @@ export interface TextInputProperties */ testID?: string; + /** + * Used to connect to an InputAccessoryView. Not part of react-natives documentation, but present in examples and + * code. + * See https://facebook.github.io/react-native/docs/inputaccessoryview.html for more information. + */ + inputAccessoryViewID?: string; + /** * The value to show for the text input. TextInput is a controlled component, * which means the native value will be forced to match this value prop if provided. @@ -1523,7 +1545,7 @@ export interface GestureResponderHandlers { * So if a parent View wants to prevent the child from becoming responder on a touch start, * it should have a onStartShouldSetResponderCapture handler which returns true. */ - onMoveShouldSetResponderCapture?: () => void; + onMoveShouldSetResponderCapture?: (event: GestureResponderEvent) => boolean; } // @see https://facebook.github.io/react-native/docs/view.html#style @@ -2248,6 +2270,27 @@ export interface SegmentedControlIOSProperties extends ViewProperties { */ export interface SafeAreaViewStatic extends NativeMethodsMixin, React.ClassicComponentClass {} + +/** + * A component which enables customization of the keyboard input accessory view on iOS. The input accessory view is + * displayed above the keyboard whenever a TextInput has focus. This component can be used to create custom toolbars. + * + * To use this component wrap your custom toolbar with the InputAccessoryView component, and set a nativeID. Then, pass + * that nativeID as the inputAccessoryViewID of whatever TextInput you desire. + */ +export interface InputAccessoryViewStatic extends React.ClassicComponentClass {} + +export interface InputAccessoryViewProperties { + backgroundColor?: string; + + /** + * An ID which is used to associate this InputAccessoryView to specified TextInput(s). + */ + nativeID?: string; + + style?: StyleProp; +} + /** * Use `SegmentedControlIOS` to render a UISegmentedControl iOS. * @@ -3291,6 +3334,7 @@ interface ImagePropertiesAndroid { /** * @see https://facebook.github.io/react-native/docs/image.html */ +export type ImagePropertiesSourceOptions = ImageURISource | ImageURISource[] | ImageRequireSource; export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndroid, AccessibilityProperties { /** * onLayout function @@ -3386,7 +3430,7 @@ export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndr * their width and height. The native side will then choose the best `uri` to display * based on the measured size of the image container. */ - source: ImageURISource | ImageURISource[] | ImageRequireSource; + source: ImagePropertiesSourceOptions; /** * similarly to `source`, this property represents the resource used to render @@ -3692,7 +3736,7 @@ export interface SectionListData extends SectionBase { [key: string]: any; } -export interface SectionListProperties extends VirtualizedListProperties { +export interface SectionListProperties extends ScrollViewProperties { /** * Rendered in between adjacent Items within each section. */ @@ -3711,7 +3755,7 @@ export interface SectionListProperties extends VirtualizedListProperties< /** * Rendered at the very beginning of the list. */ - ListHeaderComponent?: React.ComponentClass | (() => React.ReactElement) | null; + ListHeaderComponent?: React.ComponentClass | React.ReactElement | (() => React.ReactElement) | null; /** * Rendered in between each section. @@ -3766,7 +3810,7 @@ export interface SectionListProperties extends VirtualizedListProperties< /** * Default renderer for every item in every section. Can be over-ridden on a per-section basis. */ - renderItem: ListRenderItem; + renderItem?: ListRenderItem; /** * Rendered at the top of each section. Sticky headers are not yet supported. @@ -3895,6 +3939,8 @@ export interface VirtualizedListProperties extends ScrollViewProperties { keyExtractor?: (item: ItemT, index: number) => string; + listKey?: string; + /** * The maximum number of items to render in each incremental render batch. The more rendered at * once, the better the fill rate, but responsiveness my suffer because rendering content may @@ -4395,6 +4441,11 @@ export interface ModalProperties { * @platform ios */ onDismiss?: () => void; + /** + * The `presentationStyle` determines the style of modal to show + * @platform ios + */ + presentationStyle?: "fullScreen" | "pageSheet" | "formSheet" | "overFullScreen"; } export interface ModalStatic extends React.ComponentClass {} @@ -4796,9 +4847,9 @@ export namespace StyleSheet { * the alternative use. */ export function flatten(style?: RegisteredStyle): T; - export function flatten(style?: StyleProp): ViewStyle; export function flatten(style?: StyleProp): TextStyle; export function flatten(style?: StyleProp): ImageStyle; + export function flatten(style?: StyleProp): ViewStyle; /** * This is defined as the width of a thin line on the platform. It can be @@ -7287,13 +7338,36 @@ export interface PushNotificationIOSStatic { * * The type MUST be 'notification' */ - addEventListener(type: PushNotificationEventName, handler: (notification: PushNotification) => void): void; + addEventListener(type: "notification" | "localNotification", handler: (notification: PushNotification) => void): void; + + /** + * Fired when the user registers for remote notifications. + * + * The handler will be invoked with a hex string representing the deviceToken. + * + * The type MUST be 'register' + */ + addEventListener(type: "register", handler: (deviceToken: string) => void): void; + + /** + * Fired when the user fails to register for remote notifications. + * Typically occurs when APNS is having issues, or the device is a simulator. + * + * The handler will be invoked with {message: string, code: number, details: any}. + * + * The type MUST be 'registrationError' + */ + addEventListener(type: "registrationError", handler: (error: { message: string, code: number, details: any }) => void): void; /** * Removes the event listener. Do this in `componentWillUnmount` to prevent * memory leaks */ - removeEventListener(type: PushNotificationEventName, handler: (notification: PushNotification) => void): void; + removeEventListener(type: PushNotificationEventName, + handler: ((notification: PushNotification) => void) + | ((deviceToken: string) => void) + | ((error: { message: string, code: number, details: any }) => void) + ): void; /** * Requests all notification permissions from iOS, prompting the user's @@ -8258,26 +8332,71 @@ interface ImageEditorStatic { ): void; } -export interface ARTShapeProps { - d: string; - strokeWidth: number; +export interface ARTNodeMixin { + opacity?: number; + originX?: number; + originY?: number; + scaleX?: number; + scaleY?: number; + scale?: number; + title?: string; + x?: number; + y?: number; + visible?: boolean; +} + +export interface ARTGroupProps extends ARTNodeMixin { + width?: number; + height?: number; +} + +export interface ARTClippingRectangleProps extends ARTNodeMixin { + width?: number; + height?: number; +} + +export interface ARTRenderableMixin extends ARTNodeMixin { + fill?: string; + stroke?: string; + strokeCap?: "butt" | "square" | "round"; strokeDash?: number[]; - stroke: string; + strokeJoin?: "bevel" | "miter" | "round"; + strokeWidth?: number; +} + +export interface ARTShapeProps extends ARTRenderableMixin { + d: string; + width?: number; + height?: number; +} + +export interface ARTTextProps extends ARTRenderableMixin { + font?: string; + alignment?: string; } export interface ARTSurfaceProps { - style: StyleProp; + style?: StyleProp; width: number; height: number; } +export interface ClippingRectangleStatic extends React.ComponentClass {} + +export interface GroupStatic extends React.ComponentClass {} + export interface ShapeStatic extends React.ComponentClass {} export interface SurfaceStatic extends React.ComponentClass {} +export interface ARTTextStatic extends React.ComponentClass {} + export interface ARTStatic { + ClippingRectangle: ClippingRectangleStatic; + Group: GroupStatic; Shape: ShapeStatic; Surface: SurfaceStatic; + Text: ARTTextStatic; } export interface KeyboardStatic extends NativeEventEmitter { @@ -8316,6 +8435,9 @@ export type ImageBackground = ImageBackgroundStatic; export var ImagePickerIOS: ImagePickerIOSStatic; export type ImagePickerIOS = ImagePickerIOSStatic; +export var InputAccessoryView: InputAccessoryViewStatic; +export type InputAccessoryView = InputAccessoryViewStatic; + export var FlatList: FlatListStatic; export type FlatList = FlatListStatic; @@ -8695,7 +8817,7 @@ declare global { * * @see https://github.com/facebook/react-native/issues/934 */ - var originalXMLHttpRequest: Object; + var originalXMLHttpRequest: any; var __BUNDLE_START_TIME__: number; var ErrorUtils: ErrorUtils; diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index 65db445695..8d3925d4bd 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -22,10 +22,12 @@ import { DataSourceAssetCallback, DeviceEventEmitterStatic, Dimensions, + ImageStyle, InteractionManager, ListView, ListViewDataSource, StyleSheet, + StyleProp, Systrace, Text, TextStyle, @@ -45,6 +47,8 @@ import { TabBarIOS, NativeModules, MaskedViewIOS, + TextInput, + InputAccessoryView, } from "react-native"; declare module "react-native" { @@ -125,6 +129,20 @@ const stylesAlt = StyleSheet.create({ const welcomeFontSize = StyleSheet.flatten(styles.welcome).fontSize; +const viewStyle: StyleProp = { + backgroundColor: "#F5FCFF", +} +const textStyle: StyleProp = { + fontSize: 20, +} +const imageStyle: StyleProp = { + resizeMode: 'contain', +} + +const viewProperty = StyleSheet.flatten(viewStyle).backgroundColor; +const textProperty = StyleSheet.flatten(textStyle).fontSize; +const imageProperty = StyleSheet.flatten(imageStyle).resizeMode; + class CustomView extends React.Component { render() { return Custom View; @@ -369,6 +387,17 @@ class MaskedViewTest extends React.Component { } } +class InputAccessoryViewTest extends React.Component { + render() { + const uniqueID = "foobar"; + return ( + + + + ) + } +} + // DataSourceAssetCallback const dataSourceAssetCallback1: DataSourceAssetCallback = { rowHasChanged: (r1, r2) => true, diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 0e6bb2d94c..9aafc994fb 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-navigation 1.2 +// Type definitions for react-navigation 1.5 // Project: https://github.com/react-navigation/react-navigation // Definitions by: Huhuanming // mhcgrq @@ -31,6 +31,7 @@ import * as React from 'react'; import { Animated, TextStyle, + ViewProperties, ViewStyle, StyleProp, } from 'react-native'; @@ -45,7 +46,6 @@ export interface HeaderProps extends NavigationSceneRendererProps { mode: HeaderMode; router: NavigationRouter< NavigationState, - NavigationAction, NavigationStackScreenOptions >; getScreenDetails: (navigationScene: NavigationScene) => NavigationScreenDetails< @@ -75,9 +75,9 @@ export interface NavigationState { routes: any[]; } -export type NavigationRoute = NavigationLeafRoute | NavigationStateRoute; +export type NavigationRoute = NavigationLeafRoute | NavigationStateRoute; -export interface NavigationLeafRoute { +export interface NavigationLeafRoute { /** * React's key used by some navigators. No need to specify these manually, * they will be defined by the router. @@ -96,23 +96,23 @@ export interface NavigationLeafRoute { * Params passed to this route when navigating to it, * e.g. `{ car_id: 123 }` in a route that displays a car. */ - params?: NavigationParams; + params?: Params; } -export type NavigationStateRoute = NavigationLeafRoute & NavigationState; +export type NavigationStateRoute = NavigationLeafRoute & NavigationState; export type NavigationScreenOptionsGetter = ( - navigation: NavigationScreenProp, + navigation: NavigationScreenProp>, screenProps?: { [key: string]: any } ) => Options; -export interface NavigationRouter { +export interface NavigationRouter { /** * The reducer that outputs the new navigation state for a given action, with * an optional previous state. When the action is considered handled but the * state is unchanged, the output state is null. */ - getStateForAction: (action: Action, lastState?: State) => (State | null); + getStateForAction: (action: NavigationAction, lastState?: State) => (State | null); /** * Maps a URI-like string to an action. This can be mapped to a state @@ -121,7 +121,7 @@ export interface NavigationRouter { getActionForPathAndParams: ( path: string, params?: NavigationParams - ) => (Action | null); + ) => (NavigationAction | null); getPathAndParamsForState: ( state: State @@ -174,17 +174,24 @@ export type NavigationScreenConfig = }) => Options); export type NavigationComponent = - NavigationScreenComponent - | NavigationNavigator; + NavigationScreenComponent + | NavigationNavigator; -export interface NavigationScreenComponent extends React.ComponentClass { - navigationOptions?: NavigationScreenConfig; -} +export type NavigationScreenComponent< + Params = NavigationParams, + Options = {}, + Props = {} +> = React.ComponentType & Props> & +{ navigationOptions?: NavigationScreenConfig }; -export interface NavigationNavigator extends React.ComponentClass { - router?: NavigationRouter; - navigationOptions?: NavigationScreenConfig; -} +export type NavigationNavigator< + State = NavigationState, + Options = {}, + Props = {} +> = React.ComponentType & Props> & { + router: NavigationRouter, + navigationOptions?: NavigationScreenConfig, +}; export interface NavigationParams { [key: string]: any; @@ -196,6 +203,8 @@ export interface NavigationNavigateActionPayload { // The action to run inside the sub-router action?: NavigationNavigateAction; + + key?: string; } export interface NavigationNavigateAction extends NavigationNavigateActionPayload { @@ -271,7 +280,11 @@ export interface NavigationStackViewConfig { mode?: 'card' | 'modal'; headerMode?: HeaderMode; cardStyle?: StyleProp; - transitionConfig?: () => TransitionConfig; + transitionConfig?: ( + transitionProps: NavigationTransitionProps, + prevTransitionProps: NavigationTransitionProps, + isModal: boolean, + ) => TransitionConfig; onTransitionStart?: () => void; onTransitionEnd?: () => void; } @@ -424,16 +437,17 @@ export interface NavigationScreenProp { goBack: (routeKey?: string | null) => boolean; navigate(options: { routeName: string; - params?: P; + params?: NavigationParams; action?: NavigationAction; key?: string; }): boolean; navigate( routeNameOrOptions: string, - params?: P, + params?: NavigationParams, action?: NavigationAction, ): boolean; - setParams: (newParams: NavigationParams) => boolean; + getParam: (param: T, fallback?: P[T]) => P[T]; + setParams: (newParams: P) => boolean; addListener: ( eventName: string, callback: NavigationEventCallback @@ -452,10 +466,10 @@ export interface NavigationScreenProp { popToTop: (params?: { immediate?: boolean }) => boolean; } -export interface NavigationNavigatorProps { +export interface NavigationNavigatorProps { navigation?: NavigationProp; screenProps?: { [key: string]: any }; - navigationOptions?: any; + navigationOptions?: O; } /** @@ -587,7 +601,7 @@ export interface NavigationContainerProps { export interface NavigationContainer extends React.ComponentClass< NavigationContainerProps & NavigationNavigatorProps > { - router: NavigationRouter; + router: NavigationRouter; screenProps: { [key: string]: any }; navigationOptions: any; state: { nav: NavigationState | null }; @@ -695,6 +709,7 @@ export function TabNavigator( export interface TabBarTopProps { activeTintColor: string; inactiveTintColor: string; + indicatorStyle: StyleProp; showIcon: boolean; showLabel: boolean; upperCaseLabel: boolean; @@ -810,7 +825,7 @@ export class Transitioner extends React.Component< export function TabRouter( routeConfigs: NavigationRouteConfigMap, config: NavigationTabRouterConfig -): NavigationRouter; +): NavigationRouter; /** * Stack Router @@ -820,19 +835,19 @@ export function TabRouter( export function StackRouter( routeConfigs: NavigationRouteConfigMap, config: NavigationTabRouterConfig -): NavigationRouter; +): NavigationRouter; /** * Create Navigator * * @see https://github.com/react-navigation/react-navigation/blob/master/src/navigators/createNavigator.js */ -export function createNavigator( - router: NavigationRouter, +export function createNavigator( + router: NavigationRouter, routeConfigs?: NavigationRouteConfigMap, navigatorConfig?: {} | null, navigatorType?: NavigatorType -): (NavigationView: React.ComponentClass) => NavigationNavigator; +): (NavigationView: React.ComponentClass) => NavigationNavigator; /** * Create an HOC that injects the navigation and manages the navigation state @@ -843,7 +858,7 @@ export function createNavigator( * @see https://github.com/react-navigation/react-navigation/blob/master/src/createNavigationContainer.js */ export function createNavigationContainer( - Component: NavigationNavigator + Component: NavigationNavigator ): NavigationContainer; /** * END MANUAL DEFINITIONS OUTSIDE OF TYPEDEFINITION.JS @@ -853,10 +868,10 @@ export function createNavigationContainer( * BEGIN CUSTOM CONVENIENCE INTERFACES */ -export interface NavigationScreenProps { - navigation: NavigationScreenProp; +export interface NavigationScreenProps { + navigation: NavigationScreenProp, Params>; screenProps?: { [key: string]: any }; - navigationOptions?: NavigationScreenConfig; + navigationOptions?: NavigationScreenConfig; } /** @@ -896,3 +911,20 @@ export function withNavigation( export function withNavigationFocus( Component: React.ComponentType ): React.ComponentType; + +/** + * SafeAreaView Component + */ +export type SafeAreaViewForceInsetValue = 'always' | 'never'; +export interface SafeAreaViewProps extends ViewProperties { + forceInset?: { + top?: SafeAreaViewForceInsetValue; + bottom?: SafeAreaViewForceInsetValue; + left?: SafeAreaViewForceInsetValue; + right?: SafeAreaViewForceInsetValue; + horizontal?: SafeAreaViewForceInsetValue; + vertical?: SafeAreaViewForceInsetValue; + }; +} + +export const SafeAreaView: React.ComponentClass; diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index d0e65dfc8e..7e956d2c1a 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -36,6 +36,7 @@ import { NavigationParams, NavigationPopAction, NavigationPopToTopAction, + NavigationScreenComponent, } from 'react-navigation'; // Constants @@ -48,14 +49,19 @@ const viewStyle: ViewStyle = { const ROUTE_NAME_START_SCREEN = "StartScreen"; +interface StartScreenNavigationParams { + id: number; + s: string; +} + /** * @desc Simple screen component class with typed component props that should * receive the navigation prop from the AppNavigator. */ -class StartScreen extends React.Component { +class StartScreen extends React.Component> { render() { // Implicit type checks. - const navigationStateParams = this.props.navigation.state.params; + const navigationStateParams: StartScreenNavigationParams | undefined = this.props.navigation.state.params; const id = this.props.navigation.state.params && this.props.navigation.state.params.id; const s = this.props.navigation.state.params && this.props.navigation.state.params.s; @@ -84,12 +90,17 @@ class StartScreen extends React.Component { const ROUTE_NAME_NEXT_SCREEN = "NextScreen"; -class NextScreen extends React.Component { +interface NextScreenNavigationParams { + id: number; + name: string; +} + +class NextScreen extends React.Component> { render() { // Implicit type checks. - const navigationStateParams = this.props.navigation.state.params; + const navigationStateParams: NextScreenNavigationParams | undefined = this.props.navigation.state.params; const id = this.props.navigation.state.params && this.props.navigation.state.params.id; - const name = this.props.navigation.state.params && this.props.navigation.state.params.name; + const name = this.props.navigation.getParam('name', 'Peter'); return ( @@ -100,7 +111,7 @@ class NextScreen extends React.Component { const navigationOptions = { headerBackTitle: null, }; -const initialRouteParams: NavigationParams = { +const initialRouteParams: StartScreenNavigationParams = { id: 1, s: "Start", }; @@ -123,6 +134,23 @@ export const AppNavigator = StackNavigator( }, ); +interface StatelessScreenParams { + testID: string; +} + +const StatelessScreen: NavigationScreenComponent = (props) => + ; + +StatelessScreen.navigationOptions = { title: 'Stateless' }; + +const SimpleStackNavigator = StackNavigator( + { + simple: { + screen: StatelessScreen, + }, + } +); + /** * Router. */ diff --git a/types/react-notification-system/index.d.ts b/types/react-notification-system/index.d.ts index 8176ad097c..a993f6cc4d 100644 --- a/types/react-notification-system/index.d.ts +++ b/types/react-notification-system/index.d.ts @@ -12,6 +12,7 @@ declare namespace NotificationSystem { addNotification(notification: Notification): Notification; removeNotification(uidOrNotification: number | string | Notification): void; clearNotifications(): void; + editNotification(uidOrNotification: number | string | Notification, newNotification: Notification): void; } export type CallBackFunction = (notification: Notification) => void; diff --git a/types/react-onsenui/index.d.ts b/types/react-onsenui/index.d.ts index 27a664d27a..00437e099b 100644 --- a/types/react-onsenui/index.d.ts +++ b/types/react-onsenui/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for React Onsen UI (react-onsenui) 2.8 +// Type definitions for React Onsen UI (react-onsenui) 2.9 // Project: https://onsen.io/v2/docs/guide/react/ // Definitions by: Ozytis , Salim , Jemmyw // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -336,6 +336,18 @@ export class Range extends Component<{ disabled?: boolean, }, any> {} +export class Select extends Component<{ + modifier?: string, + disabled?: boolean, + onChange?: (e: React.ChangeEvent) => void, + value?: string, + multiple?: boolean, + autofocus?: boolean, + required?: boolean, + form?: string, + size?: string +}, any> {} + export class Switch extends Component<{ onChange?(e: SwitchChangeEvent): void, checked?: boolean, diff --git a/types/react-overlays/lib/Overlay.d.ts b/types/react-overlays/lib/Overlay.d.ts index 7df97f3cc3..3b6cd22be9 100644 --- a/types/react-overlays/lib/Overlay.d.ts +++ b/types/react-overlays/lib/Overlay.d.ts @@ -4,31 +4,32 @@ import { TransitionProps } from 'react-transition-group/Transition'; import { PortalProps } from './Portal'; import { PositionProps } from './Position'; -declare class Overlay extends React.Component { } -declare namespace Overlay { } +declare class Overlay extends React.Component { } export = Overlay; -interface OverlayProps extends TransitionCallbacks, PortalProps, PositionProps { - /** - * Set the visibility of the Overlay - */ - show?: boolean; +declare namespace Overlay { + interface OverlayProps extends TransitionCallbacks, PortalProps, PositionProps { + /** + * Set the visibility of the Overlay + */ + show?: boolean; - /** - * Specify whether the overlay should trigger `onHide` when the user clicks outside the overlay - */ - rootClose?: boolean; + /** + * Specify whether the overlay should trigger `onHide` when the user clicks outside the overlay + */ + rootClose?: boolean; - /** - * A Callback fired by the Overlay when it wishes to be hidden. - * - * __required__ when `rootClose` is `true`. - */ - onHide?(props: PortalProps, ...args: any[]): any; + /** + * A Callback fired by the Overlay when it wishes to be hidden. + * + * __required__ when `rootClose` is `true`. + */ + onHide?(props: PortalProps, ...args: any[]): any; - /** - * A `react-transition-group@2.0.0` `` component - * used to animate the overlay as it changes visibility. - */ - transition?: React.ComponentType; + /** + * A `react-transition-group@2.0.0` `` component + * used to animate the overlay as it changes visibility. + */ + transition?: React.ComponentType; + } } diff --git a/types/react-overlays/test/react-overlays-tests-individual.tsx b/types/react-overlays/test/react-overlays-tests-individual.tsx index b066a40ec3..9201604d49 100644 --- a/types/react-overlays/test/react-overlays-tests-individual.tsx +++ b/types/react-overlays/test/react-overlays-tests-individual.tsx @@ -22,6 +22,10 @@ class TestAffix extends React.Component { } } +interface OverlayTriggerProps extends Overlay.OverlayProps { + overlay: any; +} + class TestOverlay extends React.Component<{}, {open: boolean}> { target: HTMLElement | null = null; state = {open: false}; diff --git a/types/react-places-autocomplete/index.d.ts b/types/react-places-autocomplete/index.d.ts index 73a8e7ae55..667106d916 100644 --- a/types/react-places-autocomplete/index.d.ts +++ b/types/react-places-autocomplete/index.d.ts @@ -21,6 +21,7 @@ export interface PropTypes { name?: string; placeholder?: string; onBlur?: (event: React.FocusEvent) => void; + disabled?: boolean; }; onError?: (status: string, clearSuggestion: () => void) => void; onSelect?: (address: string, placeID: string) => void; diff --git a/types/react-recaptcha/index.d.ts b/types/react-recaptcha/index.d.ts index ecfd0db003..595cc1916e 100644 --- a/types/react-recaptcha/index.d.ts +++ b/types/react-recaptcha/index.d.ts @@ -34,4 +34,5 @@ declare class Recaptcha extends Component { static propTypes: any; static defaultProps: Recaptcha.RecaptchaProps; reset(): void; + execute(): void; } diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index 1528d58af5..52cc28b9a5 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -10,14 +10,14 @@ // Prashant Deva // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 - + // Known Issue: -// There is a known issue in TypeScript, which doesn't allow decorators to change the signature of the classes +// There is a known issue in TypeScript, which doesn't allow decorators to change the signature of the classes // they are decorating. Due to this, if you are using @connect() decorator in your code, // you will see a bunch of errors from TypeScript. The current workaround is to use connect() as a function call on // a separate line instead of as a decorator. Discussed in this github issue: // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/20796 - + import * as React from 'react'; import * as Redux from 'redux'; @@ -80,17 +80,17 @@ export interface Connect { ( mapStateToProps: MapStateToPropsParam - ): InferableComponentEnhancerWithProps, TOwnProps>; + ): InferableComponentEnhancerWithProps & TOwnProps, TOwnProps>; ( mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsParam - ): InferableComponentEnhancerWithProps; + ): InferableComponentEnhancerWithProps; ( mapStateToProps: MapStateToPropsParam, mapDispatchToProps: MapDispatchToPropsParam - ): InferableComponentEnhancerWithProps; + ): InferableComponentEnhancerWithProps; ( mapStateToProps: MapStateToPropsParam, diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index 393c4d09da..07b81ff082 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -899,3 +899,25 @@ namespace TestCreateProvider { //

    A is 2

    ReactDOM.render(, document.body); } + +namespace TestTypeInference { + interface State { a: number }; + + const OnlyState = connect( + (state: {a: number}, props: {b: number}) => ({a: state.a, c: state.a + props.b}) + )(props => {props.a} + {props.b} = {props.c}) + interface State { a: number }; + ReactDOM.render(, document.body); + + const OnlyDispatch = connect( + undefined, + (dispatch, props: {b: number}) => ({action: () => dispatch({type: 'action', b: props.b})}) + )(props => {props.b}) + ReactDOM.render(, document.body); + + const StateAndDispatch = connect( + (state: {a: number}, props: {b: number}) => ({a: state.a, c: state.a + props.b}), + (dispatch, props: {b: number}) => ({action: () => dispatch({type: 'action', b: props.b})}) + )(props => {props.a} + {props.b} = {props.c}) + ReactDOM.render(, document.body); +} diff --git a/types/react-router-dom/index.d.ts b/types/react-router-dom/index.d.ts index c5b795761c..9165f1182e 100644 --- a/types/react-router-dom/index.d.ts +++ b/types/react-router-dom/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/ReactTraining/react-router // Definitions by: Tanguy Krotoff // Huy Nguyen +// Philip Jackson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -44,6 +45,7 @@ export class HashRouter extends React.Component {} export interface LinkProps extends React.AnchorHTMLAttributes { to: H.LocationDescriptor; replace?: boolean; + innerRef?: (node: HTMLAnchorElement | null) => void; } export class Link extends React.Component {} diff --git a/types/react-router-dom/react-router-dom-tests.tsx b/types/react-router-dom/react-router-dom-tests.tsx index c748405580..0fedbe412e 100644 --- a/types/react-router-dom/react-router-dom-tests.tsx +++ b/types/react-router-dom/react-router-dom-tests.tsx @@ -2,7 +2,8 @@ import * as React from 'react'; import { NavLink, NavLinkProps, - match + match, + Link } from 'react-router-dom'; import * as H from 'history'; @@ -19,3 +20,8 @@ export default function(props: Props) { ); } + +; + +const acceptRef = (node: HTMLAnchorElement | null) => {}; +; diff --git a/types/react-router-native/index.d.ts b/types/react-router-native/index.d.ts index 17601361bd..ea2a5f766c 100644 --- a/types/react-router-native/index.d.ts +++ b/types/react-router-native/index.d.ts @@ -33,7 +33,7 @@ export class AndroidBackButton extends React.Component {} export class DeepLinking extends React.Component {} export interface LinkProps { - component?: React.Component | React.ComponentClass; + component?: React.ComponentType; replace?: boolean; style?: any; to: H.LocationDescriptor; diff --git a/types/react-router-native/react-router-native-tests.tsx b/types/react-router-native/react-router-native-tests.tsx index 2cbdfac1b2..5b7dcfa4e7 100644 --- a/types/react-router-native/react-router-native-tests.tsx +++ b/types/react-router-native/react-router-native-tests.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { StyleSheet, Text, View } from 'react-native'; -import { NativeRouter as Router, Route, Link, AndroidBackButton, BackButton } from 'react-router-native'; +import { StyleSheet, Text, TouchableOpacity, TouchableOpacityProperties, View } from 'react-native'; +import { AndroidBackButton, BackButton, Link, NativeRouter as Router, Route } from 'react-router-native'; const Home: React.SFC = () => { return ( @@ -24,6 +24,14 @@ const About: React.SFC = () => { ); }; +interface ButtonTextProps extends TouchableOpacityProperties { + text: string; +} + +const ButtonText: React.SFC = ({ text, ...props }) => ( + {text} +); + export default class App extends React.Component { render() { return ( @@ -35,9 +43,7 @@ export default class App extends React.Component { Home - - About - + diff --git a/types/react-router-redux/index.d.ts b/types/react-router-redux/index.d.ts index 0ce965b397..7c8d78ccc9 100644 --- a/types/react-router-redux/index.d.ts +++ b/types/react-router-redux/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/ReactTraining/react-router/tree/master/packages/react-router-redux // Definitions by: Huy Nguyen // Shoya Tanaka +// Mykolas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -19,6 +20,7 @@ import { LocationDescriptor } from 'history'; import * as React from 'react'; +import { match } from 'react-router'; export interface ConnectedRouterProps { store?: Store; @@ -77,3 +79,5 @@ export interface LocationChangeAction { } export function routerMiddleware(history: History): Middleware; + +export function createMatchSelector(path: string): (state: { router: RouterState }) => match<{}> | null; diff --git a/types/react-router-redux/react-router-redux-tests.tsx b/types/react-router-redux/react-router-redux-tests.tsx index b6927fb7bf..bf2575ae26 100644 --- a/types/react-router-redux/react-router-redux-tests.tsx +++ b/types/react-router-redux/react-router-redux-tests.tsx @@ -7,7 +7,7 @@ import { Provider } from 'react-redux'; import createHistory from 'history/createBrowserHistory'; import { Route } from 'react-router'; -import { ConnectedRouter, routerReducer, routerMiddleware, push, RouterState } from 'react-router-redux'; +import { ConnectedRouter, routerReducer, routerMiddleware, push, RouterState, createMatchSelector } from 'react-router-redux'; // Create a history of your choosing (we're using a browser history in this case) const history = createHistory(); @@ -44,3 +44,7 @@ ReactDOM.render( // Now you can dispatch navigation actions from anywhere! store.dispatch(push('/foo')); + +// And match location path using createMatchSelector +const matchSelector = createMatchSelector('/:foo'); +const match = matchSelector(store.getState()); diff --git a/types/react-select/index.d.ts b/types/react-select/index.d.ts index 7adf0d0750..e2a0520154 100644 --- a/types/react-select/index.d.ts +++ b/types/react-select/index.d.ts @@ -11,6 +11,7 @@ // Ian Johnson // Anton Novik // David Schkalee +// Arthur Udalov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -18,12 +19,15 @@ import * as React from 'react'; export default class ReactSelectClass extends React.Component> { focus(): void; + setValue(value: Option): void; } // Other components export class Creatable extends React.Component> { } export class Async extends React.Component> { } export class AsyncCreatable extends React.Component> { } +export type OptionComponentType = React.ComponentType>; + export type HandlerRendererResult = JSX.Element | null | false; // Handlers @@ -128,6 +132,16 @@ export interface MenuRendererProps { * Array of currently selected options. */ valueArray: Options; + + /** + * Callback to remove selection from option; receives the option as a parameter. + */ + removeValue: SelectValueHandler; + + /** + * function which returns a custom way to render the options in the menu + */ + optionRenderer: OptionRendererHandler; } export interface OptionComponentProps { @@ -196,6 +210,11 @@ export interface ArrowRendererProps { * Arrow mouse down event handler. */ onMouseDown: React.MouseEventHandler; + + /** + * whether the Select is open or not. + */ + isOpen: boolean; } export interface ReactSelectProps extends React.Props> { @@ -449,7 +468,7 @@ export interface ReactSelectProps extends React.Props>; + optionComponent?: OptionComponentType; /** * function which returns a custom way to render the options in the menu */ diff --git a/types/react-select/lib/Option/index.d.ts b/types/react-select/lib/Option/index.d.ts new file mode 100644 index 0000000000..0f9e97d540 --- /dev/null +++ b/types/react-select/lib/Option/index.d.ts @@ -0,0 +1,5 @@ +import { OptionComponentType } from '../../'; + +declare const OptionComponent: OptionComponentType; + +export default OptionComponent; diff --git a/types/react-select/lib/utils/defaultMenuRenderer/index.d.ts b/types/react-select/lib/utils/defaultMenuRenderer/index.d.ts new file mode 100644 index 0000000000..baf530d59d --- /dev/null +++ b/types/react-select/lib/utils/defaultMenuRenderer/index.d.ts @@ -0,0 +1,3 @@ +import { MenuRendererProps } from '../../../'; + +export default function defaultMenuRenderer(props: MenuRendererProps): JSX.Element[]; diff --git a/types/react-select/react-select-tests.tsx b/types/react-select/react-select-tests.tsx index 3635fe3145..a6b450f513 100644 --- a/types/react-select/react-select-tests.tsx +++ b/types/react-select/react-select-tests.tsx @@ -1,5 +1,7 @@ import * as React from "react"; import ReactSelect, * as ReactSelectModule from "react-select"; +import defaultMenuRenderer from 'react-select/lib/utils/defaultMenuRenderer'; +import DefaultOptionComponent from 'react-select/lib/Option'; declare function describe(desc: string, f: () => void): void; declare function it(desc: string, f: () => void): void; @@ -126,6 +128,22 @@ describe("react-select", () => { } }); + it("setValue method", () => { + class Component extends React.PureComponent { + private readonly selectRef = (component: ReactSelect) => { + component.setValue({ + value: 'value' + }); + } + + render() { + return ; + } + } + }); + it("Overriding default key-down behavior with onInputKeyDown", () => { const keyDownHandler: ReactSelectModule.OnInputKeyDownHandler = (event => { const divEvent = event as React.KeyboardEvent; @@ -246,7 +264,13 @@ describe("Examples", () => { private readonly menuRenderer: ReactSelectModule.MenuRendererHandler = props => { const options = props.options.map(option => { - return
    {option.label}
    ; + return ( +
    +
    {option.label}
    +
    {props.optionRenderer({})}
    +
    + ); }); return
    {options}
    ; @@ -289,6 +313,41 @@ describe("Examples", () => { } }); + it("Extend default menu renderer", () => { + return class Component extends React.Component { + private readonly menuRenderer: ReactSelectModule.MenuRendererHandler = props => { + return
    defaultMenuRenderer(props)
    ; + } + + render() { + return ; + } + }; + }); + + it("Extend default Option component", () => { + function OptionComponent(props: ReactSelectModule.OptionComponentProps) { + const {option, isFocused, isSelected} = props; + + return ( + + + {isSelected ? '+' : '-'} + {option.label} + + + ); + } + + return ( + + ); + }); + it("Input render example", () => { class Component extends React.Component { private readonly onSelectChange: ReactSelectModule.OnChangeSingleHandler = option => { @@ -330,6 +389,19 @@ describe("Examples", () => { />; }); + it("Arrow render example", () => { + return ( + ( +
    + )} + /> + ); + }); + it("Option render with custom value option", () => { const optionRenderer = (option: ReactSelectModule.Option): ReactSelectModule.HandlerRendererResult => null; diff --git a/types/react-select/tsconfig.json b/types/react-select/tsconfig.json index 727747e72c..7855eceaf1 100644 --- a/types/react-select/tsconfig.json +++ b/types/react-select/tsconfig.json @@ -1,6 +1,8 @@ { "files": [ "index.d.ts", + "lib/Option/index.d.ts", + "lib/utils/defaultMenuRenderer/index.d.ts", "react-select-tests.tsx" ], "compilerOptions": { @@ -22,4 +24,4 @@ "noEmit": true, "forceConsistentCasingInFileNames": true } -} \ No newline at end of file +} diff --git a/types/react-sortable-tree/index.d.ts b/types/react-sortable-tree/index.d.ts index 441e0bb61b..0a0efc7f31 100644 --- a/types/react-sortable-tree/index.d.ts +++ b/types/react-sortable-tree/index.d.ts @@ -51,13 +51,12 @@ export interface ExtendedNodeData extends NodeData { export interface OnVisibilityToggleData extends FullTree, TreeNode { expanded: boolean; } -export interface PreviousAnNextLocation { - prevPath: number[]; - prevParent: TreeItem; +export interface PreviousAndNextLocation { prevTreeIndex: number; - nextPath: number[]; - nextParent: TreeItem; + prevPath: number[]; nextTreeIndex: number; + nextPath: number[]; + nextParentNode: TreeItem; } export type NodeRenderer = React.ComponentClass; @@ -113,7 +112,7 @@ export interface ReactSortableTreeProps { onMoveNode?(data: NodeData & FullTree): void; onVisibilityToggle?(data: OnVisibilityToggleData): void; canDrag?: ((data: ExtendedNodeData) => boolean) | boolean; - canDrop?(data: PreviousAnNextLocation & NodeData): boolean; + canDrop?(data: PreviousAndNextLocation & NodeData): boolean; reactVirtualizedListProps?: ListProps; rowHeight?: ((info: Index) => number) | number; slideRegionSize?: number; diff --git a/types/react-sortable-tree/react-sortable-tree-tests.tsx b/types/react-sortable-tree/react-sortable-tree-tests.tsx index 154a7284c6..d67e6ad123 100644 --- a/types/react-sortable-tree/react-sortable-tree-tests.tsx +++ b/types/react-sortable-tree/react-sortable-tree-tests.tsx @@ -11,7 +11,7 @@ import SortableTree, ExtendedNodeData, FullTree, OnVisibilityToggleData, - PreviousAnNextLocation, + PreviousAndNextLocation, PlaceholderRendererProps } from "react-sortable-tree"; import { ListProps, ListRowRenderer } from "react-virtualized"; @@ -55,7 +55,7 @@ class Test extends React.Component { onMoveNode={(data: NodeData & FullTree) => {}} onVisibilityToggle={(data: OnVisibilityToggleData) => {}} canDrag={true} - canDrop={(data: PreviousAnNextLocation & NodeData) => true} + canDrop={(data: PreviousAndNextLocation & NodeData) => true} reactVirtualizedListProps={reactVirtualizedListProps} rowHeight={62} slideRegionSize={100} diff --git a/types/react-timeout/index.d.ts b/types/react-timeout/index.d.ts new file mode 100644 index 0000000000..b214318a23 --- /dev/null +++ b/types/react-timeout/index.d.ts @@ -0,0 +1,32 @@ +// Type definitions for react-timeout 1.1 +// Project: https://github.com/plougsgaard/react-timeout +// Definitions by: Kerwyn Rojas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/// + +import * as React from 'react'; + +export = ReactTimeout; + +declare function ReactTimeout( + SourceComponent: React.ComponentClass | React.StatelessComponent +): React.ComponentClass; + +declare namespace ReactTimeout { + type Timer = NodeJS.Timer | number; + + type Id = number; + + interface ReactTimeoutProps { + setTimeout?: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timer; + clearTimeout?: (timer: Timer) => void; + setInterval?: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Id; + clearInterval?: (id: Id) => void; + setImmediate?: (callback: (...args: any[]) => void, ...args: any[]) => Id; + clearImmediate?: (id: Id) => void; + requestAnimationFrame?: (callback: (...args: any[]) => void) => Id; + cancelAnimationFrame?: (id: Id) => void; + } +} diff --git a/types/react-timeout/tsconfig.json b/types/react-timeout/tsconfig.json new file mode 100644 index 0000000000..71e6b79545 --- /dev/null +++ b/types/react-timeout/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} diff --git a/types/react-timeout/tslint.json b/types/react-timeout/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/react-timeout/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/react-tooltip/react-tooltip-tests.tsx b/types/react-tooltip/react-tooltip-tests.tsx index 3fee5dba3e..97b7a085ea 100644 --- a/types/react-tooltip/react-tooltip-tests.tsx +++ b/types/react-tooltip/react-tooltip-tests.tsx @@ -91,7 +91,7 @@ export class ReactTooltipTest extends React.PureComponent {