123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084 |
- /// <reference types="react" />
- import * as React from 'react';
- import React__default, { ClipboardEventHandler, CompositionEventHandler, ReactEventHandler, FormEventHandler, AriaAttributes, DOMAttributes as DOMAttributes$1, AriaRole, CSSProperties, HTMLAttributeAnchorTarget, HTMLAttributeReferrerPolicy, ReactNode, RefObject, ReactElement, FocusEvent as FocusEvent$1, KeyboardEvent as KeyboardEvent$1, SyntheticEvent, JSX, ElementType, JSXElementConstructor, HTMLAttributes, ReactDOM, DOMFactory, SVGProps, Key as Key$2, Dispatch, SetStateAction, ReactHTML, ForwardedRef } from 'react';
-
- declare const SignatureSaveMode: {
- readonly ALWAYS: "ALWAYS";
- readonly NEVER: "NEVER";
- readonly USING_UI: "USING_UI";
- };
- type ISignatureSaveMode = (typeof SignatureSaveMode)[keyof typeof SignatureSaveMode];
-
- /**
- * Copyright (c) 2014-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
- /**
- * Immutable data encourages pure functions (data-in, data-out) and lends itself
- * to much simpler application development and enabling techniques from
- * functional programming such as lazy evaluation.
- *
- * While designed to bring these powerful functional concepts to JavaScript, it
- * presents an Object-Oriented API familiar to Javascript engineers and closely
- * mirroring that of Array, Map, and Set. It is easy and efficient to convert to
- * and from plain Javascript types.
- *
- * ## How to read these docs
- *
- * In order to better explain what kinds of values the Immutable.js API expects
- * and produces, this documentation is presented in a statically typed dialect of
- * JavaScript (like [Flow][] or [TypeScript][]). You *don't need* to use these
- * type checking tools in order to use Immutable.js, however becoming familiar
- * with their syntax will help you get a deeper understanding of this API.
- *
- * **A few examples and how to read them.**
- *
- * All methods describe the kinds of data they accept and the kinds of data
- * they return. For example a function which accepts two numbers and returns
- * a number would look like this:
- *
- * ```js
- * sum(first: number, second: number): number
- * ```
- *
- * Sometimes, methods can accept different kinds of data or return different
- * kinds of data, and this is described with a *type variable*, which is
- * typically in all-caps. For example, a function which always returns the same
- * kind of data it was provided would look like this:
- *
- * ```js
- * identity<T>(value: T): T
- * ```
- *
- * Type variables are defined with classes and referred to in methods. For
- * example, a class that holds onto a value for you might look like this:
- *
- * ```js
- * class Box<T> {
- * constructor(value: T)
- * getValue(): T
- * }
- * ```
- *
- * In order to manipulate Immutable data, methods that we're used to affecting
- * a Collection instead return a new Collection of the same type. The type
- * `this` refers to the same kind of class. For example, a List which returns
- * new Lists when you `push` a value onto it might look like:
- *
- * ```js
- * class List<T> {
- * push(value: T): this
- * }
- * ```
- *
- * Many methods in Immutable.js accept values which implement the JavaScript
- * [Iterable][] protocol, and might appear like `Iterable<string>` for something
- * which represents sequence of strings. Typically in JavaScript we use plain
- * Arrays (`[]`) when an Iterable is expected, but also all of the Immutable.js
- * collections are iterable themselves!
- *
- * For example, to get a value deep within a structure of data, we might use
- * `getIn` which expects an `Iterable` path:
- *
- * ```
- * getIn(path: Iterable<string | number>): any
- * ```
- *
- * To use this method, we could pass an array: `data.getIn([ "key", 2 ])`.
- *
- *
- * Note: All examples are presented in the modern [ES2015][] version of
- * JavaScript. Use tools like Babel to support older browsers.
- *
- * For example:
- *
- * ```js
- * // ES2015
- * const mappedFoo = foo.map(x => x * x);
- * // ES5
- * var mappedFoo = foo.map(function (x) { return x * x; });
- * ```
- *
- * [ES2015]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla
- * [TypeScript]: http://www.typescriptlang.org/
- * [Flow]: https://flowtype.org/
- * [Iterable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols
- */
-
-
-
- /**
- * Lists are ordered indexed dense collections, much like a JavaScript
- * Array.
- *
- * Lists are immutable and fully persistent with O(log32 N) gets and sets,
- * and O(1) push and pop.
- *
- * Lists implement Deque, with efficient addition and removal from both the
- * end (`push`, `pop`) and beginning (`unshift`, `shift`).
- *
- * Unlike a JavaScript Array, there is no distinction between an
- * "unset" index and an index set to `undefined`. `List#forEach` visits all
- * indices from 0 to size, regardless of whether they were explicitly defined.
- */
- declare module List {
-
- /**
- * True if the provided value is a List
- *
- * <!-- runkit:activate -->
- * ```js
- * const { List } = require('immutable');
- * List.isList([]); // false
- * List.isList(List()); // true
- * ```
- */
- function isList(maybeList: any): maybeList is List<any>;
-
- /**
- * Creates a new List containing `values`.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { List } = require('immutable');
- * List.of(1, 2, 3, 4)
- * // List [ 1, 2, 3, 4 ]
- * ```
- *
- * Note: Values are not altered or converted in any way.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { List } = require('immutable');
- * List.of({x:1}, 2, [3], 4)
- * // List [ { x: 1 }, 2, [ 3 ], 4 ]
- * ```
- */
- function of<T>(...values: Array<T>): List<T>;
- }
-
- /**
- * Create a new immutable List containing the values of the provided
- * collection-like.
- *
- * Note: `List` is a factory function and not a class, and does not use the
- * `new` keyword during construction.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { List, Set } = require('immutable')
- *
- * const emptyList = List()
- * // List []
- *
- * const plainArray = [ 1, 2, 3, 4 ]
- * const listFromPlainArray = List(plainArray)
- * // List [ 1, 2, 3, 4 ]
- *
- * const plainSet = Set([ 1, 2, 3, 4 ])
- * const listFromPlainSet = List(plainSet)
- * // List [ 1, 2, 3, 4 ]
- *
- * const arrayIterator = plainArray[Symbol.iterator]()
- * const listFromCollectionArray = List(arrayIterator)
- * // List [ 1, 2, 3, 4 ]
- *
- * listFromPlainArray.equals(listFromCollectionArray) // true
- * listFromPlainSet.equals(listFromCollectionArray) // true
- * listFromPlainSet.equals(listFromPlainArray) // true
- * ```
- */
- declare function List(): List<any>;
- declare function List<T>(): List<T>;
- declare function List<T>(collection: Iterable<T>): List<T>;
-
- interface List<T> extends Collection$1.Indexed<T> {
-
- /**
- * The number of items in this List.
- */
- readonly size: number;
-
- // Persistent changes
-
- /**
- * Returns a new List which includes `value` at `index`. If `index` already
- * exists in this List, it will be replaced.
- *
- * `index` may be a negative number, which indexes back from the end of the
- * List. `v.set(-1, "value")` sets the last item in the List.
- *
- * If `index` larger than `size`, the returned List's `size` will be large
- * enough to include the `index`.
- *
- * <!-- runkit:activate
- * { "preamble": "const { List } = require('immutable');" }
- * -->
- * ```js
- * const originalList = List([ 0 ]);
- * // List [ 0 ]
- * originalList.set(1, 1);
- * // List [ 0, 1 ]
- * originalList.set(0, 'overwritten');
- * // List [ "overwritten" ]
- * originalList.set(2, 2);
- * // List [ 0, undefined, 2 ]
- *
- * List().set(50000, 'value').size;
- * // 50001
- * ```
- *
- * Note: `set` can be used in `withMutations`.
- */
- set(index: number, value: T): List<T>;
-
- /**
- * Returns a new List which excludes this `index` and with a size 1 less
- * than this List. Values at indices above `index` are shifted down by 1 to
- * fill the position.
- *
- * This is synonymous with `list.splice(index, 1)`.
- *
- * `index` may be a negative number, which indexes back from the end of the
- * List. `v.delete(-1)` deletes the last item in the List.
- *
- * Note: `delete` cannot be safely used in IE8
- *
- * <!-- runkit:activate
- * { "preamble": "const { List } = require('immutable');" }
- * -->
- * ```js
- * List([ 0, 1, 2, 3, 4 ]).delete(0);
- * // List [ 1, 2, 3, 4 ]
- * ```
- *
- * Since `delete()` re-indexes values, it produces a complete copy, which
- * has `O(N)` complexity.
- *
- * Note: `delete` *cannot* be used in `withMutations`.
- *
- * @alias remove
- */
- delete(index: number): List<T>;
- remove(index: number): List<T>;
-
- /**
- * Returns a new List with `value` at `index` with a size 1 more than this
- * List. Values at indices above `index` are shifted over by 1.
- *
- * This is synonymous with `list.splice(index, 0, value)`.
- *
- * <!-- runkit:activate
- * { "preamble": "const { List } = require('immutable');" }
- * -->
- * ```js
- * List([ 0, 1, 2, 3, 4 ]).insert(6, 5)
- * // List [ 0, 1, 2, 3, 4, 5 ]
- * ```
- *
- * Since `insert()` re-indexes values, it produces a complete copy, which
- * has `O(N)` complexity.
- *
- * Note: `insert` *cannot* be used in `withMutations`.
- */
- insert(index: number, value: T): List<T>;
-
- /**
- * Returns a new List with 0 size and no values in constant time.
- *
- * <!-- runkit:activate
- * { "preamble": "const { List } = require('immutable');" }
- * -->
- * ```js
- * List([ 1, 2, 3, 4 ]).clear()
- * // List []
- * ```
- *
- * Note: `clear` can be used in `withMutations`.
- */
- clear(): List<T>;
-
- /**
- * Returns a new List with the provided `values` appended, starting at this
- * List's `size`.
- *
- * <!-- runkit:activate
- * { "preamble": "const { List } = require('immutable');" }
- * -->
- * ```js
- * List([ 1, 2, 3, 4 ]).push(5)
- * // List [ 1, 2, 3, 4, 5 ]
- * ```
- *
- * Note: `push` can be used in `withMutations`.
- */
- push(...values: Array<T>): List<T>;
-
- /**
- * Returns a new List with a size ones less than this List, excluding
- * the last index in this List.
- *
- * Note: this differs from `Array#pop` because it returns a new
- * List rather than the removed value. Use `last()` to get the last value
- * in this List.
- *
- * ```js
- * List([ 1, 2, 3, 4 ]).pop()
- * // List[ 1, 2, 3 ]
- * ```
- *
- * Note: `pop` can be used in `withMutations`.
- */
- pop(): List<T>;
-
- /**
- * Returns a new List with the provided `values` prepended, shifting other
- * values ahead to higher indices.
- *
- * <!-- runkit:activate
- * { "preamble": "const { List } = require('immutable');" }
- * -->
- * ```js
- * List([ 2, 3, 4]).unshift(1);
- * // List [ 1, 2, 3, 4 ]
- * ```
- *
- * Note: `unshift` can be used in `withMutations`.
- */
- unshift(...values: Array<T>): List<T>;
-
- /**
- * Returns a new List with a size ones less than this List, excluding
- * the first index in this List, shifting all other values to a lower index.
- *
- * Note: this differs from `Array#shift` because it returns a new
- * List rather than the removed value. Use `first()` to get the first
- * value in this List.
- *
- * <!-- runkit:activate
- * { "preamble": "const { List } = require('immutable');" }
- * -->
- * ```js
- * List([ 0, 1, 2, 3, 4 ]).shift();
- * // List [ 1, 2, 3, 4 ]
- * ```
- *
- * Note: `shift` can be used in `withMutations`.
- */
- shift(): List<T>;
-
- /**
- * Returns a new List with an updated value at `index` with the return
- * value of calling `updater` with the existing value, or `notSetValue` if
- * `index` was not set. If called with a single argument, `updater` is
- * called with the List itself.
- *
- * `index` may be a negative number, which indexes back from the end of the
- * List. `v.update(-1)` updates the last item in the List.
- *
- * <!-- runkit:activate
- * { "preamble": "const { List } = require('immutable');" }
- * -->
- * ```js
- * const list = List([ 'a', 'b', 'c' ])
- * const result = list.update(2, val => val.toUpperCase())
- * // List [ "a", "b", "C" ]
- * ```
- *
- * This can be very useful as a way to "chain" a normal function into a
- * sequence of methods. RxJS calls this "let" and lodash calls it "thru".
- *
- * For example, to sum a List after mapping and filtering:
- *
- * <!-- runkit:activate
- * { "preamble": "const { List } = require('immutable');" }
- * -->
- * ```js
- * function sum(collection) {
- * return collection.reduce((sum, x) => sum + x, 0)
- * }
- *
- * List([ 1, 2, 3 ])
- * .map(x => x + 1)
- * .filter(x => x % 2 === 0)
- * .update(sum)
- * // 6
- * ```
- *
- * Note: `update(index)` can be used in `withMutations`.
- *
- * @see `Map#update`
- */
- update(index: number, notSetValue: T, updater: (value: T) => T): this;
- update(index: number, updater: (value: T) => T): this;
- update<R>(updater: (value: this) => R): R;
-
- /**
- * Returns a new List with size `size`. If `size` is less than this
- * List's size, the new List will exclude values at the higher indices.
- * If `size` is greater than this List's size, the new List will have
- * undefined values for the newly available indices.
- *
- * When building a new List and the final size is known up front, `setSize`
- * used in conjunction with `withMutations` may result in the more
- * performant construction.
- */
- setSize(size: number): List<T>;
-
-
- // Deep persistent changes
-
- /**
- * Returns a new List having set `value` at this `keyPath`. If any keys in
- * `keyPath` do not exist, a new immutable Map will be created at that key.
- *
- * Index numbers are used as keys to determine the path to follow in
- * the List.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { List } = require('immutable')
- * const list = List([ 0, 1, 2, List([ 3, 4 ])])
- * list.setIn([3, 0], 999);
- * // List [ 0, 1, 2, List [ 999, 4 ] ]
- * ```
- *
- * Plain JavaScript Object or Arrays may be nested within an Immutable.js
- * Collection, and setIn() can update those values as well, treating them
- * immutably by creating new copies of those values with the changes applied.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { List } = require('immutable')
- * const list = List([ 0, 1, 2, { plain: 'object' }])
- * list.setIn([3, 'plain'], 'value');
- * // List([ 0, 1, 2, { plain: 'value' }])
- * ```
- *
- * Note: `setIn` can be used in `withMutations`.
- */
- setIn(keyPath: Iterable<any>, value: any): this;
-
- /**
- * Returns a new List having removed the value at this `keyPath`. If any
- * keys in `keyPath` do not exist, no change will occur.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { List } = require('immutable')
- * const list = List([ 0, 1, 2, List([ 3, 4 ])])
- * list.deleteIn([3, 0]);
- * // List [ 0, 1, 2, List [ 4 ] ]
- * ```
- *
- * Plain JavaScript Object or Arrays may be nested within an Immutable.js
- * Collection, and removeIn() can update those values as well, treating them
- * immutably by creating new copies of those values with the changes applied.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { List } = require('immutable')
- * const list = List([ 0, 1, 2, { plain: 'object' }])
- * list.removeIn([3, 'plain']);
- * // List([ 0, 1, 2, {}])
- * ```
- *
- * Note: `deleteIn` *cannot* be safely used in `withMutations`.
- *
- * @alias removeIn
- */
- deleteIn(keyPath: Iterable<any>): this;
- removeIn(keyPath: Iterable<any>): this;
-
- /**
- * Note: `updateIn` can be used in `withMutations`.
- *
- * @see `Map#updateIn`
- */
- updateIn(keyPath: Iterable<any>, notSetValue: any, updater: (value: any) => any): this;
- updateIn(keyPath: Iterable<any>, updater: (value: any) => any): this;
-
- /**
- * Note: `mergeIn` can be used in `withMutations`.
- *
- * @see `Map#mergeIn`
- */
- mergeIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
-
- /**
- * Note: `mergeDeepIn` can be used in `withMutations`.
- *
- * @see `Map#mergeDeepIn`
- */
- mergeDeepIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
-
- // Transient changes
-
- /**
- * Note: Not all methods can be safely used on a mutable collection or within
- * `withMutations`! Check the documentation for each method to see if it
- * allows being used in `withMutations`.
- *
- * @see `Map#withMutations`
- */
- withMutations(mutator: (mutable: this) => any): this;
-
- /**
- * An alternative API for withMutations()
- *
- * Note: Not all methods can be safely used on a mutable collection or within
- * `withMutations`! Check the documentation for each method to see if it
- * allows being used in `withMutations`.
- *
- * @see `Map#asMutable`
- */
- asMutable(): this;
-
- /**
- * @see `Map#wasAltered`
- */
- wasAltered(): boolean;
-
- /**
- * @see `Map#asImmutable`
- */
- asImmutable(): this;
-
- // Sequence algorithms
-
- /**
- * Returns a new List with other values or collections concatenated to this one.
- *
- * Note: `concat` can be used in `withMutations`.
- *
- * @alias merge
- */
- concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): List<T | C>;
- merge<C>(...collections: Array<Iterable<C>>): List<T | C>;
-
- /**
- * Returns a new List with values passed through a
- * `mapper` function.
- *
- * <!-- runkit:activate
- * { "preamble": "const { List } = require('immutable');" }
- * -->
- * ```js
- * List([ 1, 2 ]).map(x => 10 * x)
- * // List [ 10, 20 ]
- * ```
- */
- map<M>(
- mapper: (value: T, key: number, iter: this) => M,
- context?: any
- ): List<M>;
-
- /**
- * Flat-maps the List, returning a new List.
- *
- * Similar to `list.map(...).flatten(true)`.
- */
- flatMap<M>(
- mapper: (value: T, key: number, iter: this) => Iterable<M>,
- context?: any
- ): List<M>;
-
- /**
- * Returns a new List with only the values for which the `predicate`
- * function returns true.
- *
- * Note: `filter()` always returns a new instance, even if it results in
- * not filtering out any values.
- */
- filter<F extends T>(
- predicate: (value: T, index: number, iter: this) => value is F,
- context?: any
- ): List<F>;
- filter(
- predicate: (value: T, index: number, iter: this) => any,
- context?: any
- ): this;
-
- /**
- * Returns a List "zipped" with the provided collection.
- *
- * Like `zipWith`, but using the default `zipper`: creating an `Array`.
- *
- * <!-- runkit:activate
- * { "preamble": "const { List } = require('immutable');" }
- * -->
- * ```js
- * const a = List([ 1, 2, 3 ]);
- * const b = List([ 4, 5, 6 ]);
- * const c = a.zip(b); // List [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ]
- * ```
- */
- zip<U>(other: Collection$1<any, U>): List<[T,U]>;
- zip<U,V>(other: Collection$1<any, U>, other2: Collection$1<any,V>): List<[T,U,V]>;
- zip(...collections: Array<Collection$1<any, any>>): List<any>;
-
- /**
- * Returns a List "zipped" with the provided collections.
- *
- * Unlike `zip`, `zipAll` continues zipping until the longest collection is
- * exhausted. Missing values from shorter collections are filled with `undefined`.
- *
- * <!-- runkit:activate
- * { "preamble": "const { List } = require('immutable');" }
- * -->
- * ```js
- * const a = List([ 1, 2 ]);
- * const b = List([ 3, 4, 5 ]);
- * const c = a.zipAll(b); // List [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ]
- * ```
- *
- * Note: Since zipAll will return a collection as large as the largest
- * input, some results may contain undefined values. TypeScript cannot
- * account for these without cases (as of v2.5).
- */
- zipAll<U>(other: Collection$1<any, U>): List<[T,U]>;
- zipAll<U,V>(other: Collection$1<any, U>, other2: Collection$1<any,V>): List<[T,U,V]>;
- zipAll(...collections: Array<Collection$1<any, any>>): List<any>;
-
- /**
- * Returns a List "zipped" with the provided collections by using a
- * custom `zipper` function.
- *
- * <!-- runkit:activate
- * { "preamble": "const { List } = require('immutable');" }
- * -->
- * ```js
- * const a = List([ 1, 2, 3 ]);
- * const b = List([ 4, 5, 6 ]);
- * const c = a.zipWith((a, b) => a + b, b);
- * // List [ 5, 7, 9 ]
- * ```
- */
- zipWith<U, Z>(
- zipper: (value: T, otherValue: U) => Z,
- otherCollection: Collection$1<any, U>
- ): List<Z>;
- zipWith<U, V, Z>(
- zipper: (value: T, otherValue: U, thirdValue: V) => Z,
- otherCollection: Collection$1<any, U>,
- thirdCollection: Collection$1<any, V>
- ): List<Z>;
- zipWith<Z>(
- zipper: (...any: Array<any>) => Z,
- ...collections: Array<Collection$1<any, any>>
- ): List<Z>;
- }
-
-
- /**
- * Immutable Map is an unordered Collection.Keyed of (key, value) pairs with
- * `O(log32 N)` gets and `O(log32 N)` persistent sets.
- *
- * Iteration order of a Map is undefined, however is stable. Multiple
- * iterations of the same Map will iterate in the same order.
- *
- * Map's keys can be of any type, and use `Immutable.is` to determine key
- * equality. This allows the use of any value (including NaN) as a key.
- *
- * Because `Immutable.is` returns equality based on value semantics, and
- * Immutable collections are treated as values, any Immutable collection may
- * be used as a key.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map, List } = require('immutable');
- * Map().set(List([ 1 ]), 'listofone').get(List([ 1 ]));
- * // 'listofone'
- * ```
- *
- * Any JavaScript object may be used as a key, however strict identity is used
- * to evaluate key equality. Two similar looking objects will represent two
- * different keys.
- *
- * Implemented by a hash-array mapped trie.
- */
- declare module Map$1 {
-
- /**
- * True if the provided value is a Map
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * Map.isMap({}) // false
- * Map.isMap(Map()) // true
- * ```
- */
- function isMap(maybeMap: any): maybeMap is Map$1<any, any>;
-
- /**
- * Creates a new Map from alternating keys and values
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * Map.of(
- * 'key', 'value',
- * 'numerical value', 3,
- * 0, 'numerical key'
- * )
- * // Map { 0: "numerical key", "key": "value", "numerical value": 3 }
- * ```
- *
- * @deprecated Use Map([ [ 'k', 'v' ] ]) or Map({ k: 'v' })
- */
- function of(...keyValues: Array<any>): Map$1<any, any>;
- }
-
- /**
- * Creates a new Immutable Map.
- *
- * Created with the same key value pairs as the provided Collection.Keyed or
- * JavaScript Object or expects a Collection of [K, V] tuple entries.
- *
- * Note: `Map` is a factory function and not a class, and does not use the
- * `new` keyword during construction.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * Map({ key: "value" })
- * Map([ [ "key", "value" ] ])
- * ```
- *
- * Keep in mind, when using JS objects to construct Immutable Maps, that
- * JavaScript Object properties are always strings, even if written in a
- * quote-less shorthand, while Immutable Maps accept keys of any type.
- *
- * <!-- runkit:activate
- * { "preamble": "const { Map } = require('immutable');" }
- * -->
- * ```js
- * let obj = { 1: "one" }
- * Object.keys(obj) // [ "1" ]
- * assert.equal(obj["1"], obj[1]) // "one" === "one"
- *
- * let map = Map(obj)
- * assert.notEqual(map.get("1"), map.get(1)) // "one" !== undefined
- * ```
- *
- * Property access for JavaScript Objects first converts the key to a string,
- * but since Immutable Map keys can be of any type the argument to `get()` is
- * not altered.
- */
- declare function Map$1<K, V>(collection: Iterable<[K, V]>): Map$1<K, V>;
- declare function Map$1<T>(collection: Iterable<Iterable<T>>): Map$1<T, T>;
- declare function Map$1<V>(obj: {[key: string]: V}): Map$1<string, V>;
- declare function Map$1<K, V>(): Map$1<K, V>;
- declare function Map$1(): Map$1<any, any>;
-
- interface Map$1<K, V> extends Collection$1.Keyed<K, V> {
-
- /**
- * The number of entries in this Map.
- */
- readonly size: number;
-
- // Persistent changes
-
- /**
- * Returns a new Map also containing the new key, value pair. If an equivalent
- * key already exists in this Map, it will be replaced.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * const originalMap = Map()
- * const newerMap = originalMap.set('key', 'value')
- * const newestMap = newerMap.set('key', 'newer value')
- *
- * originalMap
- * // Map {}
- * newerMap
- * // Map { "key": "value" }
- * newestMap
- * // Map { "key": "newer value" }
- * ```
- *
- * Note: `set` can be used in `withMutations`.
- */
- set(key: K, value: V): this;
-
- /**
- * Returns a new Map which excludes this `key`.
- *
- * Note: `delete` cannot be safely used in IE8, but is provided to mirror
- * the ES6 collection API.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * const originalMap = Map({
- * key: 'value',
- * otherKey: 'other value'
- * })
- * // Map { "key": "value", "otherKey": "other value" }
- * originalMap.delete('otherKey')
- * // Map { "key": "value" }
- * ```
- *
- * Note: `delete` can be used in `withMutations`.
- *
- * @alias remove
- */
- delete(key: K): this;
- remove(key: K): this;
-
- /**
- * Returns a new Map which excludes the provided `keys`.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * const names = Map({ a: "Aaron", b: "Barry", c: "Connor" })
- * names.deleteAll([ 'a', 'c' ])
- * // Map { "b": "Barry" }
- * ```
- *
- * Note: `deleteAll` can be used in `withMutations`.
- *
- * @alias removeAll
- */
- deleteAll(keys: Iterable<K>): this;
- removeAll(keys: Iterable<K>): this;
-
- /**
- * Returns a new Map containing no keys or values.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * Map({ key: 'value' }).clear()
- * // Map {}
- * ```
- *
- * Note: `clear` can be used in `withMutations`.
- */
- clear(): this;
-
- /**
- * Returns a new Map having updated the value at this `key` with the return
- * value of calling `updater` with the existing value.
- *
- * Similar to: `map.set(key, updater(map.get(key)))`.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * const aMap = Map({ key: 'value' })
- * const newMap = aMap.update('key', value => value + value)
- * // Map { "key": "valuevalue" }
- * ```
- *
- * This is most commonly used to call methods on collections within a
- * structure of data. For example, in order to `.push()` onto a nested `List`,
- * `update` and `push` can be used together:
- *
- * <!-- runkit:activate
- * { "preamble": "const { Map, List } = require('immutable');" }
- * -->
- * ```js
- * const aMap = Map({ nestedList: List([ 1, 2, 3 ]) })
- * const newMap = aMap.update('nestedList', list => list.push(4))
- * // Map { "nestedList": List [ 1, 2, 3, 4 ] }
- * ```
- *
- * When a `notSetValue` is provided, it is provided to the `updater`
- * function when the value at the key does not exist in the Map.
- *
- * <!-- runkit:activate
- * { "preamble": "const { Map } = require('immutable');" }
- * -->
- * ```js
- * const aMap = Map({ key: 'value' })
- * const newMap = aMap.update('noKey', 'no value', value => value + value)
- * // Map { "key": "value", "noKey": "no valueno value" }
- * ```
- *
- * However, if the `updater` function returns the same value it was called
- * with, then no change will occur. This is still true if `notSetValue`
- * is provided.
- *
- * <!-- runkit:activate
- * { "preamble": "const { Map } = require('immutable');" }
- * -->
- * ```js
- * const aMap = Map({ apples: 10 })
- * const newMap = aMap.update('oranges', 0, val => val)
- * // Map { "apples": 10 }
- * assert.strictEqual(newMap, map);
- * ```
- *
- * For code using ES2015 or later, using `notSetValue` is discourged in
- * favor of function parameter default values. This helps to avoid any
- * potential confusion with identify functions as described above.
- *
- * The previous example behaves differently when written with default values:
- *
- * <!-- runkit:activate
- * { "preamble": "const { Map } = require('immutable');" }
- * -->
- * ```js
- * const aMap = Map({ apples: 10 })
- * const newMap = aMap.update('oranges', (val = 0) => val)
- * // Map { "apples": 10, "oranges": 0 }
- * ```
- *
- * If no key is provided, then the `updater` function return value is
- * returned as well.
- *
- * <!-- runkit:activate
- * { "preamble": "const { Map } = require('immutable');" }
- * -->
- * ```js
- * const aMap = Map({ key: 'value' })
- * const result = aMap.update(aMap => aMap.get('key'))
- * // "value"
- * ```
- *
- * This can be very useful as a way to "chain" a normal function into a
- * sequence of methods. RxJS calls this "let" and lodash calls it "thru".
- *
- * For example, to sum the values in a Map
- *
- * <!-- runkit:activate
- * { "preamble": "const { Map } = require('immutable');" }
- * -->
- * ```js
- * function sum(collection) {
- * return collection.reduce((sum, x) => sum + x, 0)
- * }
- *
- * Map({ x: 1, y: 2, z: 3 })
- * .map(x => x + 1)
- * .filter(x => x % 2 === 0)
- * .update(sum)
- * // 6
- * ```
- *
- * Note: `update(key)` can be used in `withMutations`.
- */
- update(key: K, notSetValue: V, updater: (value: V) => V): this;
- update(key: K, updater: (value: V) => V): this;
- update<R>(updater: (value: this) => R): R;
-
- /**
- * Returns a new Map resulting from merging the provided Collections
- * (or JS objects) into this Map. In other words, this takes each entry of
- * each collection and sets it on this Map.
- *
- * Note: Values provided to `merge` are shallowly converted before being
- * merged. No nested values are altered.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * const one = Map({ a: 10, b: 20, c: 30 })
- * const two = Map({ b: 40, a: 50, d: 60 })
- * one.merge(two) // Map { "a": 50, "b": 40, "c": 30, "d": 60 }
- * two.merge(one) // Map { "b": 20, "a": 10, "d": 60, "c": 30 }
- * ```
- *
- * Note: `merge` can be used in `withMutations`.
- *
- * @alias concat
- */
- merge<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): Map$1<K | KC, V | VC>;
- merge<C>(...collections: Array<{[key: string]: C}>): Map$1<K | string, V | C>;
- concat<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): Map$1<K | KC, V | VC>;
- concat<C>(...collections: Array<{[key: string]: C}>): Map$1<K | string, V | C>;
-
- /**
- * Like `merge()`, `mergeWith()` returns a new Map resulting from merging
- * the provided Collections (or JS objects) into this Map, but uses the
- * `merger` function for dealing with conflicts.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * const one = Map({ a: 10, b: 20, c: 30 })
- * const two = Map({ b: 40, a: 50, d: 60 })
- * one.mergeWith((oldVal, newVal) => oldVal / newVal, two)
- * // { "a": 0.2, "b": 0.5, "c": 30, "d": 60 }
- * two.mergeWith((oldVal, newVal) => oldVal / newVal, one)
- * // { "b": 2, "a": 5, "d": 60, "c": 30 }
- * ```
- *
- * Note: `mergeWith` can be used in `withMutations`.
- */
- mergeWith(
- merger: (oldVal: V, newVal: V, key: K) => V,
- ...collections: Array<Iterable<[K, V]> | {[key: string]: V}>
- ): this;
-
- /**
- * Like `merge()`, but when two Collections conflict, it merges them as well,
- * recursing deeply through the nested data.
- *
- * Note: Values provided to `merge` are shallowly converted before being
- * merged. No nested values are altered unless they will also be merged at
- * a deeper level.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * const one = Map({ a: Map({ x: 10, y: 10 }), b: Map({ x: 20, y: 50 }) })
- * const two = Map({ a: Map({ x: 2 }), b: Map({ y: 5 }), c: Map({ z: 3 }) })
- * one.mergeDeep(two)
- * // Map {
- * // "a": Map { "x": 2, "y": 10 },
- * // "b": Map { "x": 20, "y": 5 },
- * // "c": Map { "z": 3 }
- * // }
- * ```
- *
- * Note: `mergeDeep` can be used in `withMutations`.
- */
- mergeDeep(...collections: Array<Iterable<[K, V]> | {[key: string]: V}>): this;
-
- /**
- * Like `mergeDeep()`, but when two non-Collections conflict, it uses the
- * `merger` function to determine the resulting value.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * const one = Map({ a: Map({ x: 10, y: 10 }), b: Map({ x: 20, y: 50 }) })
- * const two = Map({ a: Map({ x: 2 }), b: Map({ y: 5 }), c: Map({ z: 3 }) })
- * one.mergeDeepWith((oldVal, newVal) => oldVal / newVal, two)
- * // Map {
- * // "a": Map { "x": 5, "y": 10 },
- * // "b": Map { "x": 20, "y": 10 },
- * // "c": Map { "z": 3 }
- * // }
- * ```
-
- * Note: `mergeDeepWith` can be used in `withMutations`.
- */
- mergeDeepWith(
- merger: (oldVal: any, newVal: any, key: any) => any,
- ...collections: Array<Iterable<[K, V]> | {[key: string]: V}>
- ): this;
-
-
- // Deep persistent changes
-
- /**
- * Returns a new Map having set `value` at this `keyPath`. If any keys in
- * `keyPath` do not exist, a new immutable Map will be created at that key.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * const originalMap = Map({
- * subObject: Map({
- * subKey: 'subvalue',
- * subSubObject: Map({
- * subSubKey: 'subSubValue'
- * })
- * })
- * })
- *
- * const newMap = originalMap.setIn(['subObject', 'subKey'], 'ha ha!')
- * // Map {
- * // "subObject": Map {
- * // "subKey": "ha ha!",
- * // "subSubObject": Map { "subSubKey": "subSubValue" }
- * // }
- * // }
- *
- * const newerMap = originalMap.setIn(
- * ['subObject', 'subSubObject', 'subSubKey'],
- * 'ha ha ha!'
- * )
- * // Map {
- * // "subObject": Map {
- * // "subKey": "subvalue",
- * // "subSubObject": Map { "subSubKey": "ha ha ha!" }
- * // }
- * // }
- * ```
- *
- * Plain JavaScript Object or Arrays may be nested within an Immutable.js
- * Collection, and setIn() can update those values as well, treating them
- * immutably by creating new copies of those values with the changes applied.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * const originalMap = Map({
- * subObject: {
- * subKey: 'subvalue',
- * subSubObject: {
- * subSubKey: 'subSubValue'
- * }
- * }
- * })
- *
- * originalMap.setIn(['subObject', 'subKey'], 'ha ha!')
- * // Map {
- * // "subObject": {
- * // subKey: "ha ha!",
- * // subSubObject: { subSubKey: "subSubValue" }
- * // }
- * // }
- * ```
- *
- * If any key in the path exists but cannot be updated (such as a primitive
- * like number or a custom Object like Date), an error will be thrown.
- *
- * Note: `setIn` can be used in `withMutations`.
- */
- setIn(keyPath: Iterable<any>, value: any): this;
-
- /**
- * Returns a new Map having removed the value at this `keyPath`. If any keys
- * in `keyPath` do not exist, no change will occur.
- *
- * Note: `deleteIn` can be used in `withMutations`.
- *
- * @alias removeIn
- */
- deleteIn(keyPath: Iterable<any>): this;
- removeIn(keyPath: Iterable<any>): this;
-
- /**
- * Returns a new Map having applied the `updater` to the entry found at the
- * keyPath.
- *
- * This is most commonly used to call methods on collections nested within a
- * structure of data. For example, in order to `.push()` onto a nested `List`,
- * `updateIn` and `push` can be used together:
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map, List } = require('immutable')
- * const map = Map({ inMap: Map({ inList: List([ 1, 2, 3 ]) }) })
- * const newMap = map.updateIn(['inMap', 'inList'], list => list.push(4))
- * // Map { "inMap": Map { "inList": List [ 1, 2, 3, 4 ] } }
- * ```
- *
- * If any keys in `keyPath` do not exist, new Immutable `Map`s will
- * be created at those keys. If the `keyPath` does not already contain a
- * value, the `updater` function will be called with `notSetValue`, if
- * provided, otherwise `undefined`.
- *
- * <!-- runkit:activate
- * { "preamble": "const { Map } = require('immutable')" }
- * -->
- * ```js
- * const map = Map({ a: Map({ b: Map({ c: 10 }) }) })
- * const newMap = map.updateIn(['a', 'b', 'c'], val => val * 2)
- * // Map { "a": Map { "b": Map { "c": 20 } } }
- * ```
- *
- * If the `updater` function returns the same value it was called with, then
- * no change will occur. This is still true if `notSetValue` is provided.
- *
- * <!-- runkit:activate
- * { "preamble": "const { Map } = require('immutable')" }
- * -->
- * ```js
- * const map = Map({ a: Map({ b: Map({ c: 10 }) }) })
- * const newMap = map.updateIn(['a', 'b', 'x'], 100, val => val)
- * // Map { "a": Map { "b": Map { "c": 10 } } }
- * assert.strictEqual(newMap, aMap)
- * ```
- *
- * For code using ES2015 or later, using `notSetValue` is discourged in
- * favor of function parameter default values. This helps to avoid any
- * potential confusion with identify functions as described above.
- *
- * The previous example behaves differently when written with default values:
- *
- * <!-- runkit:activate
- * { "preamble": "const { Map } = require('immutable')" }
- * -->
- * ```js
- * const map = Map({ a: Map({ b: Map({ c: 10 }) }) })
- * const newMap = map.updateIn(['a', 'b', 'x'], (val = 100) => val)
- * // Map { "a": Map { "b": Map { "c": 10, "x": 100 } } }
- * ```
- *
- * Plain JavaScript Object or Arrays may be nested within an Immutable.js
- * Collection, and updateIn() can update those values as well, treating them
- * immutably by creating new copies of those values with the changes applied.
- *
- * <!-- runkit:activate
- * { "preamble": "const { Map } = require('immutable')" }
- * -->
- * ```js
- * const map = Map({ a: { b: { c: 10 } } })
- * const newMap = map.updateIn(['a', 'b', 'c'], val => val * 2)
- * // Map { "a": { b: { c: 20 } } }
- * ```
- *
- * If any key in the path exists but cannot be updated (such as a primitive
- * like number or a custom Object like Date), an error will be thrown.
- *
- * Note: `updateIn` can be used in `withMutations`.
- */
- updateIn(keyPath: Iterable<any>, notSetValue: any, updater: (value: any) => any): this;
- updateIn(keyPath: Iterable<any>, updater: (value: any) => any): this;
-
- /**
- * A combination of `updateIn` and `merge`, returning a new Map, but
- * performing the merge at a point arrived at by following the keyPath.
- * In other words, these two lines are equivalent:
- *
- * ```js
- * map.updateIn(['a', 'b', 'c'], abc => abc.merge(y))
- * map.mergeIn(['a', 'b', 'c'], y)
- * ```
- *
- * Note: `mergeIn` can be used in `withMutations`.
- */
- mergeIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
-
- /**
- * A combination of `updateIn` and `mergeDeep`, returning a new Map, but
- * performing the deep merge at a point arrived at by following the keyPath.
- * In other words, these two lines are equivalent:
- *
- * ```js
- * map.updateIn(['a', 'b', 'c'], abc => abc.mergeDeep(y))
- * map.mergeDeepIn(['a', 'b', 'c'], y)
- * ```
- *
- * Note: `mergeDeepIn` can be used in `withMutations`.
- */
- mergeDeepIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
-
- // Transient changes
-
- /**
- * Every time you call one of the above functions, a new immutable Map is
- * created. If a pure function calls a number of these to produce a final
- * return value, then a penalty on performance and memory has been paid by
- * creating all of the intermediate immutable Maps.
- *
- * If you need to apply a series of mutations to produce a new immutable
- * Map, `withMutations()` creates a temporary mutable copy of the Map which
- * can apply mutations in a highly performant manner. In fact, this is
- * exactly how complex mutations like `merge` are done.
- *
- * As an example, this results in the creation of 2, not 4, new Maps:
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * const map1 = Map()
- * const map2 = map1.withMutations(map => {
- * map.set('a', 1).set('b', 2).set('c', 3)
- * })
- * assert.equal(map1.size, 0)
- * assert.equal(map2.size, 3)
- * ```
- *
- * Note: Not all methods can be used on a mutable collection or within
- * `withMutations`! Read the documentation for each method to see if it
- * is safe to use in `withMutations`.
- */
- withMutations(mutator: (mutable: this) => any): this;
-
- /**
- * Another way to avoid creation of intermediate Immutable maps is to create
- * a mutable copy of this collection. Mutable copies *always* return `this`,
- * and thus shouldn't be used for equality. Your function should never return
- * a mutable copy of a collection, only use it internally to create a new
- * collection.
- *
- * If possible, use `withMutations` to work with temporary mutable copies as
- * it provides an easier to use API and considers many common optimizations.
- *
- * Note: if the collection is already mutable, `asMutable` returns itself.
- *
- * Note: Not all methods can be used on a mutable collection or within
- * `withMutations`! Read the documentation for each method to see if it
- * is safe to use in `withMutations`.
- *
- * @see `Map#asImmutable`
- */
- asMutable(): this;
-
- /**
- * Returns true if this is a mutable copy (see `asMutable()`) and mutative
- * alterations have been applied.
- *
- * @see `Map#asMutable`
- */
- wasAltered(): boolean;
-
- /**
- * The yin to `asMutable`'s yang. Because it applies to mutable collections,
- * this operation is *mutable* and may return itself (though may not
- * return itself, i.e. if the result is an empty collection). Once
- * performed, the original mutable copy must no longer be mutated since it
- * may be the immutable result.
- *
- * If possible, use `withMutations` to work with temporary mutable copies as
- * it provides an easier to use API and considers many common optimizations.
- *
- * @see `Map#asMutable`
- */
- asImmutable(): this;
-
- // Sequence algorithms
-
- /**
- * Returns a new Map with values passed through a
- * `mapper` function.
- *
- * Map({ a: 1, b: 2 }).map(x => 10 * x)
- * // Map { a: 10, b: 20 }
- */
- map<M>(
- mapper: (value: V, key: K, iter: this) => M,
- context?: any
- ): Map$1<K, M>;
-
- /**
- * @see Collection.Keyed.mapKeys
- */
- mapKeys<M>(
- mapper: (key: K, value: V, iter: this) => M,
- context?: any
- ): Map$1<M, V>;
-
- /**
- * @see Collection.Keyed.mapEntries
- */
- mapEntries<KM, VM>(
- mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
- context?: any
- ): Map$1<KM, VM>;
-
- /**
- * Flat-maps the Map, returning a new Map.
- *
- * Similar to `data.map(...).flatten(true)`.
- */
- flatMap<KM, VM>(
- mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
- context?: any
- ): Map$1<KM, VM>;
-
- /**
- * Returns a new Map with only the entries for which the `predicate`
- * function returns true.
- *
- * Note: `filter()` always returns a new instance, even if it results in
- * not filtering out any values.
- */
- filter<F extends V>(
- predicate: (value: V, key: K, iter: this) => value is F,
- context?: any
- ): Map$1<K, F>;
- filter(
- predicate: (value: V, key: K, iter: this) => any,
- context?: any
- ): this;
-
- /**
- * @see Collection.Keyed.flip
- */
- flip(): Map$1<V, K>;
- }
-
-
- /**
- * A type of Map that has the additional guarantee that the iteration order of
- * entries will be the order in which they were set().
- *
- * The iteration behavior of OrderedMap is the same as native ES6 Map and
- * JavaScript Object.
- *
- * Note that `OrderedMap` are more expensive than non-ordered `Map` and may
- * consume more memory. `OrderedMap#set` is amortized O(log32 N), but not
- * stable.
- */
-
- declare module OrderedMap {
-
- /**
- * True if the provided value is an OrderedMap.
- */
- function isOrderedMap(maybeOrderedMap: any): maybeOrderedMap is OrderedMap<any, any>;
- }
-
- /**
- * Creates a new Immutable OrderedMap.
- *
- * Created with the same key value pairs as the provided Collection.Keyed or
- * JavaScript Object or expects a Collection of [K, V] tuple entries.
- *
- * The iteration order of key-value pairs provided to this constructor will
- * be preserved in the OrderedMap.
- *
- * let newOrderedMap = OrderedMap({key: "value"})
- * let newOrderedMap = OrderedMap([["key", "value"]])
- *
- * Note: `OrderedMap` is a factory function and not a class, and does not use
- * the `new` keyword during construction.
- */
- declare function OrderedMap<K, V>(collection: Iterable<[K, V]>): OrderedMap<K, V>;
- declare function OrderedMap<T>(collection: Iterable<Iterable<T>>): OrderedMap<T, T>;
- declare function OrderedMap<V>(obj: {[key: string]: V}): OrderedMap<string, V>;
- declare function OrderedMap<K, V>(): OrderedMap<K, V>;
- declare function OrderedMap(): OrderedMap<any, any>;
-
- interface OrderedMap<K, V> extends Map$1<K, V> {
-
- /**
- * The number of entries in this OrderedMap.
- */
- readonly size: number;
-
- /**
- * Returns a new OrderedMap also containing the new key, value pair. If an
- * equivalent key already exists in this OrderedMap, it will be replaced
- * while maintaining the existing order.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { OrderedMap } = require('immutable')
- * const originalMap = OrderedMap({a:1, b:1, c:1})
- * const updatedMap = originalMap.set('b', 2)
- *
- * originalMap
- * // OrderedMap {a: 1, b: 1, c: 1}
- * updatedMap
- * // OrderedMap {a: 1, b: 2, c: 1}
- * ```
- *
- * Note: `set` can be used in `withMutations`.
- */
- set(key: K, value: V): this;
-
- /**
- * Returns a new OrderedMap resulting from merging the provided Collections
- * (or JS objects) into this OrderedMap. In other words, this takes each
- * entry of each collection and sets it on this OrderedMap.
- *
- * Note: Values provided to `merge` are shallowly converted before being
- * merged. No nested values are altered.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { OrderedMap } = require('immutable')
- * const one = OrderedMap({ a: 10, b: 20, c: 30 })
- * const two = OrderedMap({ b: 40, a: 50, d: 60 })
- * one.merge(two) // OrderedMap { "a": 50, "b": 40, "c": 30, "d": 60 }
- * two.merge(one) // OrderedMap { "b": 20, "a": 10, "d": 60, "c": 30 }
- * ```
- *
- * Note: `merge` can be used in `withMutations`.
- *
- * @alias concat
- */
- merge<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): OrderedMap<K | KC, V | VC>;
- merge<C>(...collections: Array<{[key: string]: C}>): OrderedMap<K | string, V | C>;
- concat<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): OrderedMap<K | KC, V | VC>;
- concat<C>(...collections: Array<{[key: string]: C}>): OrderedMap<K | string, V | C>;
-
- // Sequence algorithms
-
- /**
- * Returns a new OrderedMap with values passed through a
- * `mapper` function.
- *
- * OrderedMap({ a: 1, b: 2 }).map(x => 10 * x)
- * // OrderedMap { "a": 10, "b": 20 }
- *
- * Note: `map()` always returns a new instance, even if it produced the same
- * value at every step.
- */
- map<M>(
- mapper: (value: V, key: K, iter: this) => M,
- context?: any
- ): OrderedMap<K, M>;
-
- /**
- * @see Collection.Keyed.mapKeys
- */
- mapKeys<M>(
- mapper: (key: K, value: V, iter: this) => M,
- context?: any
- ): OrderedMap<M, V>;
-
- /**
- * @see Collection.Keyed.mapEntries
- */
- mapEntries<KM, VM>(
- mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
- context?: any
- ): OrderedMap<KM, VM>;
-
- /**
- * Flat-maps the OrderedMap, returning a new OrderedMap.
- *
- * Similar to `data.map(...).flatten(true)`.
- */
- flatMap<KM, VM>(
- mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
- context?: any
- ): OrderedMap<KM, VM>;
-
- /**
- * Returns a new OrderedMap with only the entries for which the `predicate`
- * function returns true.
- *
- * Note: `filter()` always returns a new instance, even if it results in
- * not filtering out any values.
- */
- filter<F extends V>(
- predicate: (value: V, key: K, iter: this) => value is F,
- context?: any
- ): OrderedMap<K, F>;
- filter(
- predicate: (value: V, key: K, iter: this) => any,
- context?: any
- ): this;
-
- /**
- * @see Collection.Keyed.flip
- */
- flip(): OrderedMap<V, K>;
- }
-
-
- /**
- * A Collection of unique values with `O(log32 N)` adds and has.
- *
- * When iterating a Set, the entries will be (value, value) pairs. Iteration
- * order of a Set is undefined, however is stable. Multiple iterations of the
- * same Set will iterate in the same order.
- *
- * Set values, like Map keys, may be of any type. Equality is determined using
- * `Immutable.is`, enabling Sets to uniquely include other Immutable
- * collections, custom value types, and NaN.
- */
- declare module Set$1 {
-
- /**
- * True if the provided value is a Set
- */
- function isSet(maybeSet: any): maybeSet is Set$1<any>;
-
- /**
- * Creates a new Set containing `values`.
- */
- function of<T>(...values: Array<T>): Set$1<T>;
-
- /**
- * `Set.fromKeys()` creates a new immutable Set containing the keys from
- * this Collection or JavaScript Object.
- */
- function fromKeys<T>(iter: Collection$1<T, any>): Set$1<T>;
- function fromKeys(obj: {[key: string]: any}): Set$1<string>;
-
- /**
- * `Set.intersect()` creates a new immutable Set that is the intersection of
- * a collection of other sets.
- *
- * ```js
- * const { Set } = require('immutable')
- * const intersected = Set.intersect([
- * Set([ 'a', 'b', 'c' ])
- * Set([ 'c', 'a', 't' ])
- * ])
- * // Set [ "a", "c"" ]
- * ```
- */
- function intersect<T>(sets: Iterable<Iterable<T>>): Set$1<T>;
-
- /**
- * `Set.union()` creates a new immutable Set that is the union of a
- * collection of other sets.
- *
- * ```js
- * const { Set } = require('immutable')
- * const unioned = Set.union([
- * Set([ 'a', 'b', 'c' ])
- * Set([ 'c', 'a', 't' ])
- * ])
- * // Set [ "a", "b", "c", "t"" ]
- * ```
- */
- function union<T>(sets: Iterable<Iterable<T>>): Set$1<T>;
- }
-
- /**
- * Create a new immutable Set containing the values of the provided
- * collection-like.
- *
- * Note: `Set` is a factory function and not a class, and does not use the
- * `new` keyword during construction.
- */
- declare function Set$1(): Set$1<any>;
- declare function Set$1<T>(): Set$1<T>;
- declare function Set$1<T>(collection: Iterable<T>): Set$1<T>;
-
- interface Set$1<T> extends Collection$1.Set<T> {
-
- /**
- * The number of items in this Set.
- */
- readonly size: number;
-
- // Persistent changes
-
- /**
- * Returns a new Set which also includes this value.
- *
- * Note: `add` can be used in `withMutations`.
- */
- add(value: T): this;
-
- /**
- * Returns a new Set which excludes this value.
- *
- * Note: `delete` can be used in `withMutations`.
- *
- * Note: `delete` **cannot** be safely used in IE8, use `remove` if
- * supporting old browsers.
- *
- * @alias remove
- */
- delete(value: T): this;
- remove(value: T): this;
-
- /**
- * Returns a new Set containing no values.
- *
- * Note: `clear` can be used in `withMutations`.
- */
- clear(): this;
-
- /**
- * Returns a Set including any value from `collections` that does not already
- * exist in this Set.
- *
- * Note: `union` can be used in `withMutations`.
- * @alias merge
- * @alias concat
- */
- union<C>(...collections: Array<Iterable<C>>): Set$1<T | C>;
- merge<C>(...collections: Array<Iterable<C>>): Set$1<T | C>;
- concat<C>(...collections: Array<Iterable<C>>): Set$1<T | C>;
-
- /**
- * Returns a Set which has removed any values not also contained
- * within `collections`.
- *
- * Note: `intersect` can be used in `withMutations`.
- */
- intersect(...collections: Array<Iterable<T>>): this;
-
- /**
- * Returns a Set excluding any values contained within `collections`.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { OrderedSet } = require('immutable')
- * OrderedSet([ 1, 2, 3 ]).subtract([1, 3])
- * // OrderedSet [2]
- * ```
- *
- * Note: `subtract` can be used in `withMutations`.
- */
- subtract(...collections: Array<Iterable<T>>): this;
-
-
- // Transient changes
-
- /**
- * Note: Not all methods can be used on a mutable collection or within
- * `withMutations`! Check the documentation for each method to see if it
- * mentions being safe to use in `withMutations`.
- *
- * @see `Map#withMutations`
- */
- withMutations(mutator: (mutable: this) => any): this;
-
- /**
- * Note: Not all methods can be used on a mutable collection or within
- * `withMutations`! Check the documentation for each method to see if it
- * mentions being safe to use in `withMutations`.
- *
- * @see `Map#asMutable`
- */
- asMutable(): this;
-
- /**
- * @see `Map#wasAltered`
- */
- wasAltered(): boolean;
-
- /**
- * @see `Map#asImmutable`
- */
- asImmutable(): this;
-
- // Sequence algorithms
-
- /**
- * Returns a new Set with values passed through a
- * `mapper` function.
- *
- * Set([1,2]).map(x => 10 * x)
- * // Set [10,20]
- */
- map<M>(
- mapper: (value: T, key: T, iter: this) => M,
- context?: any
- ): Set$1<M>;
-
- /**
- * Flat-maps the Set, returning a new Set.
- *
- * Similar to `set.map(...).flatten(true)`.
- */
- flatMap<M>(
- mapper: (value: T, key: T, iter: this) => Iterable<M>,
- context?: any
- ): Set$1<M>;
-
- /**
- * Returns a new Set with only the values for which the `predicate`
- * function returns true.
- *
- * Note: `filter()` always returns a new instance, even if it results in
- * not filtering out any values.
- */
- filter<F extends T>(
- predicate: (value: T, key: T, iter: this) => value is F,
- context?: any
- ): Set$1<F>;
- filter(
- predicate: (value: T, key: T, iter: this) => any,
- context?: any
- ): this;
- }
-
-
- /**
- * A type of Set that has the additional guarantee that the iteration order of
- * values will be the order in which they were `add`ed.
- *
- * The iteration behavior of OrderedSet is the same as native ES6 Set.
- *
- * Note that `OrderedSet` are more expensive than non-ordered `Set` and may
- * consume more memory. `OrderedSet#add` is amortized O(log32 N), but not
- * stable.
- */
- declare module OrderedSet {
-
- /**
- * True if the provided value is an OrderedSet.
- */
- function isOrderedSet(maybeOrderedSet: any): boolean;
-
- /**
- * Creates a new OrderedSet containing `values`.
- */
- function of<T>(...values: Array<T>): OrderedSet<T>;
-
- /**
- * `OrderedSet.fromKeys()` creates a new immutable OrderedSet containing
- * the keys from this Collection or JavaScript Object.
- */
- function fromKeys<T>(iter: Collection$1<T, any>): OrderedSet<T>;
- function fromKeys(obj: {[key: string]: any}): OrderedSet<string>;
- }
-
- /**
- * Create a new immutable OrderedSet containing the values of the provided
- * collection-like.
- *
- * Note: `OrderedSet` is a factory function and not a class, and does not use
- * the `new` keyword during construction.
- */
- declare function OrderedSet(): OrderedSet<any>;
- declare function OrderedSet<T>(): OrderedSet<T>;
- declare function OrderedSet<T>(collection: Iterable<T>): OrderedSet<T>;
-
- interface OrderedSet<T> extends Set$1<T> {
-
- /**
- * The number of items in this OrderedSet.
- */
- readonly size: number;
-
- /**
- * Returns an OrderedSet including any value from `collections` that does
- * not already exist in this OrderedSet.
- *
- * Note: `union` can be used in `withMutations`.
- * @alias merge
- * @alias concat
- */
- union<C>(...collections: Array<Iterable<C>>): OrderedSet<T | C>;
- merge<C>(...collections: Array<Iterable<C>>): OrderedSet<T | C>;
- concat<C>(...collections: Array<Iterable<C>>): OrderedSet<T | C>;
-
- // Sequence algorithms
-
- /**
- * Returns a new Set with values passed through a
- * `mapper` function.
- *
- * OrderedSet([ 1, 2 ]).map(x => 10 * x)
- * // OrderedSet [10, 20]
- */
- map<M>(
- mapper: (value: T, key: T, iter: this) => M,
- context?: any
- ): OrderedSet<M>;
-
- /**
- * Flat-maps the OrderedSet, returning a new OrderedSet.
- *
- * Similar to `set.map(...).flatten(true)`.
- */
- flatMap<M>(
- mapper: (value: T, key: T, iter: this) => Iterable<M>,
- context?: any
- ): OrderedSet<M>;
-
- /**
- * Returns a new OrderedSet with only the values for which the `predicate`
- * function returns true.
- *
- * Note: `filter()` always returns a new instance, even if it results in
- * not filtering out any values.
- */
- filter<F extends T>(
- predicate: (value: T, key: T, iter: this) => value is F,
- context?: any
- ): OrderedSet<F>;
- filter(
- predicate: (value: T, key: T, iter: this) => any,
- context?: any
- ): this;
-
- /**
- * Returns an OrderedSet of the same type "zipped" with the provided
- * collections.
- *
- * Like `zipWith`, but using the default `zipper`: creating an `Array`.
- *
- * ```js
- * const a = OrderedSet([ 1, 2, 3 ])
- * const b = OrderedSet([ 4, 5, 6 ])
- * const c = a.zip(b)
- * // OrderedSet [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ]
- * ```
- */
- zip<U>(other: Collection$1<any, U>): OrderedSet<[T,U]>;
- zip<U,V>(other1: Collection$1<any, U>, other2: Collection$1<any, V>): OrderedSet<[T,U,V]>;
- zip(...collections: Array<Collection$1<any, any>>): OrderedSet<any>;
-
- /**
- * Returns a OrderedSet of the same type "zipped" with the provided
- * collections.
- *
- * Unlike `zip`, `zipAll` continues zipping until the longest collection is
- * exhausted. Missing values from shorter collections are filled with `undefined`.
- *
- * ```js
- * const a = OrderedSet([ 1, 2 ]);
- * const b = OrderedSet([ 3, 4, 5 ]);
- * const c = a.zipAll(b); // OrderedSet [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ]
- * ```
- *
- * Note: Since zipAll will return a collection as large as the largest
- * input, some results may contain undefined values. TypeScript cannot
- * account for these without cases (as of v2.5).
- */
- zipAll<U>(other: Collection$1<any, U>): OrderedSet<[T,U]>;
- zipAll<U,V>(other1: Collection$1<any, U>, other2: Collection$1<any, V>): OrderedSet<[T,U,V]>;
- zipAll(...collections: Array<Collection$1<any, any>>): OrderedSet<any>;
-
- /**
- * Returns an OrderedSet of the same type "zipped" with the provided
- * collections by using a custom `zipper` function.
- *
- * @see Seq.Indexed.zipWith
- */
- zipWith<U, Z>(
- zipper: (value: T, otherValue: U) => Z,
- otherCollection: Collection$1<any, U>
- ): OrderedSet<Z>;
- zipWith<U, V, Z>(
- zipper: (value: T, otherValue: U, thirdValue: V) => Z,
- otherCollection: Collection$1<any, U>,
- thirdCollection: Collection$1<any, V>
- ): OrderedSet<Z>;
- zipWith<Z>(
- zipper: (...any: Array<any>) => Z,
- ...collections: Array<Collection$1<any, any>>
- ): OrderedSet<Z>;
-
- }
-
-
- /**
- * Stacks are indexed collections which support very efficient O(1) addition
- * and removal from the front using `unshift(v)` and `shift()`.
- *
- * For familiarity, Stack also provides `push(v)`, `pop()`, and `peek()`, but
- * be aware that they also operate on the front of the list, unlike List or
- * a JavaScript Array.
- *
- * Note: `reverse()` or any inherent reverse traversal (`reduceRight`,
- * `lastIndexOf`, etc.) is not efficient with a Stack.
- *
- * Stack is implemented with a Single-Linked List.
- */
- declare module Stack {
-
- /**
- * True if the provided value is a Stack
- */
- function isStack(maybeStack: any): maybeStack is Stack<any>;
-
- /**
- * Creates a new Stack containing `values`.
- */
- function of<T>(...values: Array<T>): Stack<T>;
- }
-
- /**
- * Create a new immutable Stack containing the values of the provided
- * collection-like.
- *
- * The iteration order of the provided collection is preserved in the
- * resulting `Stack`.
- *
- * Note: `Stack` is a factory function and not a class, and does not use the
- * `new` keyword during construction.
- */
- declare function Stack(): Stack<any>;
- declare function Stack<T>(): Stack<T>;
- declare function Stack<T>(collection: Iterable<T>): Stack<T>;
-
- interface Stack<T> extends Collection$1.Indexed<T> {
-
- /**
- * The number of items in this Stack.
- */
- readonly size: number;
-
- // Reading values
-
- /**
- * Alias for `Stack.first()`.
- */
- peek(): T | undefined;
-
-
- // Persistent changes
-
- /**
- * Returns a new Stack with 0 size and no values.
- *
- * Note: `clear` can be used in `withMutations`.
- */
- clear(): Stack<T>;
-
- /**
- * Returns a new Stack with the provided `values` prepended, shifting other
- * values ahead to higher indices.
- *
- * This is very efficient for Stack.
- *
- * Note: `unshift` can be used in `withMutations`.
- */
- unshift(...values: Array<T>): Stack<T>;
-
- /**
- * Like `Stack#unshift`, but accepts a collection rather than varargs.
- *
- * Note: `unshiftAll` can be used in `withMutations`.
- */
- unshiftAll(iter: Iterable<T>): Stack<T>;
-
- /**
- * Returns a new Stack with a size ones less than this Stack, excluding
- * the first item in this Stack, shifting all other values to a lower index.
- *
- * Note: this differs from `Array#shift` because it returns a new
- * Stack rather than the removed value. Use `first()` or `peek()` to get the
- * first value in this Stack.
- *
- * Note: `shift` can be used in `withMutations`.
- */
- shift(): Stack<T>;
-
- /**
- * Alias for `Stack#unshift` and is not equivalent to `List#push`.
- */
- push(...values: Array<T>): Stack<T>;
-
- /**
- * Alias for `Stack#unshiftAll`.
- */
- pushAll(iter: Iterable<T>): Stack<T>;
-
- /**
- * Alias for `Stack#shift` and is not equivalent to `List#pop`.
- */
- pop(): Stack<T>;
-
-
- // Transient changes
-
- /**
- * Note: Not all methods can be used on a mutable collection or within
- * `withMutations`! Check the documentation for each method to see if it
- * mentions being safe to use in `withMutations`.
- *
- * @see `Map#withMutations`
- */
- withMutations(mutator: (mutable: this) => any): this;
-
- /**
- * Note: Not all methods can be used on a mutable collection or within
- * `withMutations`! Check the documentation for each method to see if it
- * mentions being safe to use in `withMutations`.
- *
- * @see `Map#asMutable`
- */
- asMutable(): this;
-
- /**
- * @see `Map#wasAltered`
- */
- wasAltered(): boolean;
-
- /**
- * @see `Map#asImmutable`
- */
- asImmutable(): this;
-
- // Sequence algorithms
-
- /**
- * Returns a new Stack with other collections concatenated to this one.
- */
- concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): Stack<T | C>;
-
- /**
- * Returns a new Stack with values passed through a
- * `mapper` function.
- *
- * Stack([ 1, 2 ]).map(x => 10 * x)
- * // Stack [ 10, 20 ]
- *
- * Note: `map()` always returns a new instance, even if it produced the same
- * value at every step.
- */
- map<M>(
- mapper: (value: T, key: number, iter: this) => M,
- context?: any
- ): Stack<M>;
-
- /**
- * Flat-maps the Stack, returning a new Stack.
- *
- * Similar to `stack.map(...).flatten(true)`.
- */
- flatMap<M>(
- mapper: (value: T, key: number, iter: this) => Iterable<M>,
- context?: any
- ): Stack<M>;
-
- /**
- * Returns a new Set with only the values for which the `predicate`
- * function returns true.
- *
- * Note: `filter()` always returns a new instance, even if it results in
- * not filtering out any values.
- */
- filter<F extends T>(
- predicate: (value: T, index: number, iter: this) => value is F,
- context?: any
- ): Set$1<F>;
- filter(
- predicate: (value: T, index: number, iter: this) => any,
- context?: any
- ): this;
-
- /**
- * Returns a Stack "zipped" with the provided collections.
- *
- * Like `zipWith`, but using the default `zipper`: creating an `Array`.
- *
- * ```js
- * const a = Stack([ 1, 2, 3 ]);
- * const b = Stack([ 4, 5, 6 ]);
- * const c = a.zip(b); // Stack [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ]
- * ```
- */
- zip<U>(other: Collection$1<any, U>): Stack<[T,U]>;
- zip<U,V>(other: Collection$1<any, U>, other2: Collection$1<any,V>): Stack<[T,U,V]>;
- zip(...collections: Array<Collection$1<any, any>>): Stack<any>;
-
- /**
- * Returns a Stack "zipped" with the provided collections.
- *
- * Unlike `zip`, `zipAll` continues zipping until the longest collection is
- * exhausted. Missing values from shorter collections are filled with `undefined`.
- *
- * ```js
- * const a = Stack([ 1, 2 ]);
- * const b = Stack([ 3, 4, 5 ]);
- * const c = a.zipAll(b); // Stack [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ]
- * ```
- *
- * Note: Since zipAll will return a collection as large as the largest
- * input, some results may contain undefined values. TypeScript cannot
- * account for these without cases (as of v2.5).
- */
- zipAll<U>(other: Collection$1<any, U>): Stack<[T,U]>;
- zipAll<U,V>(other: Collection$1<any, U>, other2: Collection$1<any,V>): Stack<[T,U,V]>;
- zipAll(...collections: Array<Collection$1<any, any>>): Stack<any>;
-
- /**
- * Returns a Stack "zipped" with the provided collections by using a
- * custom `zipper` function.
- *
- * ```js
- * const a = Stack([ 1, 2, 3 ]);
- * const b = Stack([ 4, 5, 6 ]);
- * const c = a.zipWith((a, b) => a + b, b);
- * // Stack [ 5, 7, 9 ]
- * ```
- */
- zipWith<U, Z>(
- zipper: (value: T, otherValue: U) => Z,
- otherCollection: Collection$1<any, U>
- ): Stack<Z>;
- zipWith<U, V, Z>(
- zipper: (value: T, otherValue: U, thirdValue: V) => Z,
- otherCollection: Collection$1<any, U>,
- thirdCollection: Collection$1<any, V>
- ): Stack<Z>;
- zipWith<Z>(
- zipper: (...any: Array<any>) => Z,
- ...collections: Array<Collection$1<any, any>>
- ): Stack<Z>;
- }
-
-
- /**
- * A record is similar to a JS object, but enforces a specific set of allowed
- * string keys, and has default values.
- *
- * The `Record()` function produces new Record Factories, which when called
- * create Record instances.
- *
- * ```js
- * const { Record } = require('immutable')
- * const ABRecord = Record({ a: 1, b: 2 })
- * const myRecord = ABRecord({ b: 3 })
- * ```
- *
- * Records always have a value for the keys they define. `remove`ing a key
- * from a record simply resets it to the default value for that key.
- *
- * ```js
- * myRecord.size // 2
- * myRecord.get('a') // 1
- * myRecord.get('b') // 3
- * const myRecordWithoutB = myRecord.remove('b')
- * myRecordWithoutB.get('b') // 2
- * myRecordWithoutB.size // 2
- * ```
- *
- * Values provided to the constructor not found in the Record type will
- * be ignored. For example, in this case, ABRecord is provided a key "x" even
- * though only "a" and "b" have been defined. The value for "x" will be
- * ignored for this record.
- *
- * ```js
- * const myRecord = ABRecord({ b: 3, x: 10 })
- * myRecord.get('x') // undefined
- * ```
- *
- * Because Records have a known set of string keys, property get access works
- * as expected, however property sets will throw an Error.
- *
- * Note: IE8 does not support property access. Only use `get()` when
- * supporting IE8.
- *
- * ```js
- * myRecord.b // 3
- * myRecord.b = 5 // throws Error
- * ```
- *
- * Record Types can be extended as well, allowing for custom methods on your
- * Record. This is not a common pattern in functional environments, but is in
- * many JS programs.
- *
- * However Record Types are more restricted than typical JavaScript classes.
- * They do not use a class constructor, which also means they cannot use
- * class properties (since those are technically part of a constructor).
- *
- * While Record Types can be syntactically created with the JavaScript `class`
- * form, the resulting Record function is actually a factory function, not a
- * class constructor. Even though Record Types are not classes, JavaScript
- * currently requires the use of `new` when creating new Record instances if
- * they are defined as a `class`.
- *
- * ```
- * class ABRecord extends Record({ a: 1, b: 2 }) {
- * getAB() {
- * return this.a + this.b;
- * }
- * }
- *
- * var myRecord = new ABRecord({b: 3})
- * myRecord.getAB() // 4
- * ```
- *
- *
- * **Flow Typing Records:**
- *
- * Immutable.js exports two Flow types designed to make it easier to use
- * Records with flow typed code, `RecordOf<TProps>` and `RecordFactory<TProps>`.
- *
- * When defining a new kind of Record factory function, use a flow type that
- * describes the values the record contains along with `RecordFactory<TProps>`.
- * To type instances of the Record (which the factory function returns),
- * use `RecordOf<TProps>`.
- *
- * Typically, new Record definitions will export both the Record factory
- * function as well as the Record instance type for use in other code.
- *
- * ```js
- * import type { RecordFactory, RecordOf } from 'immutable';
- *
- * // Use RecordFactory<TProps> for defining new Record factory functions.
- * type Point3DProps = { x: number, y: number, z: number };
- * const defaultValues: Point3DProps = { x: 0, y: 0, z: 0 };
- * const makePoint3D: RecordFactory<Point3DProps> = Record(defaultValues);
- * export makePoint3D;
- *
- * // Use RecordOf<T> for defining new instances of that Record.
- * export type Point3D = RecordOf<Point3DProps>;
- * const some3DPoint: Point3D = makePoint3D({ x: 10, y: 20, z: 30 });
- * ```
- *
- * **Flow Typing Record Subclasses:**
- *
- * Records can be subclassed as a means to add additional methods to Record
- * instances. This is generally discouraged in favor of a more functional API,
- * since Subclasses have some minor overhead. However the ability to create
- * a rich API on Record types can be quite valuable.
- *
- * When using Flow to type Subclasses, do not use `RecordFactory<TProps>`,
- * instead apply the props type when subclassing:
- *
- * ```js
- * type PersonProps = {name: string, age: number};
- * const defaultValues: PersonProps = {name: 'Aristotle', age: 2400};
- * const PersonRecord = Record(defaultValues);
- * class Person extends PersonRecord<PersonProps> {
- * getName(): string {
- * return this.get('name')
- * }
- *
- * setName(name: string): this {
- * return this.set('name', name);
- * }
- * }
- * ```
- *
- * **Choosing Records vs plain JavaScript objects**
- *
- * Records offer a persistently immutable alternative to plain JavaScript
- * objects, however they're not required to be used within Immutable.js
- * collections. In fact, the deep-access and deep-updating functions
- * like `getIn()` and `setIn()` work with plain JavaScript Objects as well.
- *
- * Deciding to use Records or Objects in your application should be informed
- * by the tradeoffs and relative benefits of each:
- *
- * - *Runtime immutability*: plain JS objects may be carefully treated as
- * immutable, however Record instances will *throw* if attempted to be
- * mutated directly. Records provide this additional guarantee, however at
- * some marginal runtime cost. While JS objects are mutable by nature, the
- * use of type-checking tools like [Flow](https://medium.com/@gcanti/immutability-with-flow-faa050a1aef4)
- * can help gain confidence in code written to favor immutability.
- *
- * - *Value equality*: Records use value equality when compared with `is()`
- * or `record.equals()`. That is, two Records with the same keys and values
- * are equal. Plain objects use *reference equality*. Two objects with the
- * same keys and values are not equal since they are different objects.
- * This is important to consider when using objects as keys in a `Map` or
- * values in a `Set`, which use equality when retrieving values.
- *
- * - *API methods*: Records have a full featured API, with methods like
- * `.getIn()`, and `.equals()`. These can make working with these values
- * easier, but comes at the cost of not allowing keys with those names.
- *
- * - *Default values*: Records provide default values for every key, which
- * can be useful when constructing Records with often unchanging values.
- * However default values can make using Flow and TypeScript more laborious.
- *
- * - *Serialization*: Records use a custom internal representation to
- * efficiently store and update their values. Converting to and from this
- * form isn't free. If converting Records to plain objects is common,
- * consider sticking with plain objects to begin with.
- */
- declare module Record$1 {
-
- /**
- * True if `maybeRecord` is an instance of a Record.
- */
- export function isRecord(maybeRecord: any): maybeRecord is Record$1<any>;
-
- /**
- * Records allow passing a second parameter to supply a descriptive name
- * that appears when converting a Record to a string or in any error
- * messages. A descriptive name for any record can be accessed by using this
- * method. If one was not provided, the string "Record" is returned.
- *
- * ```js
- * const { Record } = require('immutable')
- * const Person = Record({
- * name: null
- * }, 'Person')
- *
- * var me = Person({ name: 'My Name' })
- * me.toString() // "Person { "name": "My Name" }"
- * Record.getDescriptiveName(me) // "Person"
- * ```
- */
- export function getDescriptiveName(record: Record$1<any>): string;
-
- /**
- * A Record.Factory is created by the `Record()` function. Record instances
- * are created by passing it some of the accepted values for that Record
- * type:
- *
- * <!-- runkit:activate
- * { "preamble": "const { Record } = require('immutable')" }
- * -->
- * ```js
- * // makePerson is a Record Factory function
- * const makePerson = Record({ name: null, favoriteColor: 'unknown' });
- *
- * // alan is a Record instance
- * const alan = makePerson({ name: 'Alan' });
- * ```
- *
- * Note that Record Factories return `Record<TProps> & Readonly<TProps>`,
- * this allows use of both the Record instance API, and direct property
- * access on the resulting instances:
- *
- * <!-- runkit:activate
- * { "preamble": "const { Record } = require('immutable');const makePerson = Record({ name: null, favoriteColor: 'unknown' });const alan = makePerson({ name: 'Alan' });" }
- * -->
- * ```js
- * // Use the Record API
- * console.log('Record API: ' + alan.get('name'))
- *
- * // Or direct property access (Readonly)
- * console.log('property access: ' + alan.name)
- * ```
- *
- * **Flow Typing Records:**
- *
- * Use the `RecordFactory<TProps>` Flow type to get high quality type checking of
- * Records:
- *
- * ```js
- * import type { RecordFactory, RecordOf } from 'immutable';
- *
- * // Use RecordFactory<TProps> for defining new Record factory functions.
- * type PersonProps = { name: ?string, favoriteColor: string };
- * const makePerson: RecordFactory<PersonProps> = Record({ name: null, favoriteColor: 'unknown' });
- *
- * // Use RecordOf<T> for defining new instances of that Record.
- * type Person = RecordOf<PersonProps>;
- * const alan: Person = makePerson({ name: 'Alan' });
- * ```
- */
- export module Factory {}
-
- export interface Factory<TProps extends Object> {
- (values?: Partial<TProps> | Iterable<[string, any]>): Record$1<TProps> & Readonly<TProps>;
- new (values?: Partial<TProps> | Iterable<[string, any]>): Record$1<TProps> & Readonly<TProps>;
- }
-
- export function Factory<TProps extends Object>(values?: Partial<TProps> | Iterable<[string, any]>): Record$1<TProps> & Readonly<TProps>;
- }
-
- /**
- * Unlike other types in Immutable.js, the `Record()` function creates a new
- * Record Factory, which is a function that creates Record instances.
- *
- * See above for examples of using `Record()`.
- *
- * Note: `Record` is a factory function and not a class, and does not use the
- * `new` keyword during construction.
- */
- declare function Record$1<TProps extends object>(defaultValues: TProps, name?: string): Record$1.Factory<TProps>;
-
- interface Record$1<TProps extends Object> {
-
- // Reading values
-
- has(key: string): key is keyof TProps & string;
-
- /**
- * Returns the value associated with the provided key, which may be the
- * default value defined when creating the Record factory function.
- *
- * If the requested key is not defined by this Record type, then
- * notSetValue will be returned if provided. Note that this scenario would
- * produce an error when using Flow or TypeScript.
- */
- get<K extends keyof TProps>(key: K, notSetValue?: any): TProps[K];
- get<T>(key: string, notSetValue: T): T;
-
- // Reading deep values
-
- hasIn(keyPath: Iterable<any>): boolean;
- getIn(keyPath: Iterable<any>): any;
-
- // Value equality
-
- equals(other: any): boolean;
- hashCode(): number;
-
- // Persistent changes
-
- set<K extends keyof TProps>(key: K, value: TProps[K]): this;
- update<K extends keyof TProps>(key: K, updater: (value: TProps[K]) => TProps[K]): this;
- merge(...collections: Array<Partial<TProps> | Iterable<[string, any]>>): this;
- mergeDeep(...collections: Array<Partial<TProps> | Iterable<[string, any]>>): this;
-
- mergeWith(
- merger: (oldVal: any, newVal: any, key: keyof TProps) => any,
- ...collections: Array<Partial<TProps> | Iterable<[string, any]>>
- ): this;
- mergeDeepWith(
- merger: (oldVal: any, newVal: any, key: any) => any,
- ...collections: Array<Partial<TProps> | Iterable<[string, any]>>
- ): this;
-
- /**
- * Returns a new instance of this Record type with the value for the
- * specific key set to its default value.
- *
- * @alias remove
- */
- delete<K extends keyof TProps>(key: K): this;
- remove<K extends keyof TProps>(key: K): this;
-
- /**
- * Returns a new instance of this Record type with all values set
- * to their default values.
- */
- clear(): this;
-
- // Deep persistent changes
-
- setIn(keyPath: Iterable<any>, value: any): this;
- updateIn(keyPath: Iterable<any>, updater: (value: any) => any): this;
- mergeIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
- mergeDeepIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
-
- /**
- * @alias removeIn
- */
- deleteIn(keyPath: Iterable<any>): this;
- removeIn(keyPath: Iterable<any>): this;
-
- // Conversion to JavaScript types
-
- /**
- * Deeply converts this Record to equivalent native JavaScript Object.
- *
- * Note: This method may not be overridden. Objects with custom
- * serialization to plain JS may override toJSON() instead.
- */
- toJS(): { [K in keyof TProps]: any };
-
- /**
- * Shallowly converts this Record to equivalent native JavaScript Object.
- */
- toJSON(): TProps;
-
- /**
- * Shallowly converts this Record to equivalent JavaScript Object.
- */
- toObject(): TProps;
-
- // Transient changes
-
- /**
- * Note: Not all methods can be used on a mutable collection or within
- * `withMutations`! Only `set` may be used mutatively.
- *
- * @see `Map#withMutations`
- */
- withMutations(mutator: (mutable: this) => any): this;
-
- /**
- * @see `Map#asMutable`
- */
- asMutable(): this;
-
- /**
- * @see `Map#wasAltered`
- */
- wasAltered(): boolean;
-
- /**
- * @see `Map#asImmutable`
- */
- asImmutable(): this;
-
- // Sequence algorithms
-
- toSeq(): Seq.Keyed<keyof TProps, TProps[keyof TProps]>;
-
- [Symbol.iterator](): IterableIterator<[keyof TProps, TProps[keyof TProps]]>;
- }
-
- /**
- * `Seq` describes a lazy operation, allowing them to efficiently chain
- * use of all the higher-order collection methods (such as `map` and `filter`)
- * by not creating intermediate collections.
- *
- * **Seq is immutable** — Once a Seq is created, it cannot be
- * changed, appended to, rearranged or otherwise modified. Instead, any
- * mutative method called on a `Seq` will return a new `Seq`.
- *
- * **Seq is lazy** — `Seq` does as little work as necessary to respond to any
- * method call. Values are often created during iteration, including implicit
- * iteration when reducing or converting to a concrete data structure such as
- * a `List` or JavaScript `Array`.
- *
- * For example, the following performs no work, because the resulting
- * `Seq`'s values are never iterated:
- *
- * ```js
- * const { Seq } = require('immutable')
- * const oddSquares = Seq([ 1, 2, 3, 4, 5, 6, 7, 8 ])
- * .filter(x => x % 2 !== 0)
- * .map(x => x * x)
- * ```
- *
- * Once the `Seq` is used, it performs only the work necessary. In this
- * example, no intermediate arrays are ever created, filter is called three
- * times, and map is only called once:
- *
- * ```js
- * oddSquares.get(1); // 9
- * ```
- *
- * Any collection can be converted to a lazy Seq with `Seq()`.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * const map = Map({ a: 1, b: 2, c: 3 }
- * const lazySeq = Seq(map)
- * ```
- *
- * `Seq` allows for the efficient chaining of operations, allowing for the
- * expression of logic that can otherwise be very tedious:
- *
- * ```js
- * lazySeq
- * .flip()
- * .map(key => key.toUpperCase())
- * .flip()
- * // Seq { A: 1, B: 1, C: 1 }
- * ```
- *
- * As well as expressing logic that would otherwise seem memory or time
- * limited, for example `Range` is a special kind of Lazy sequence.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Range } = require('immutable')
- * Range(1, Infinity)
- * .skip(1000)
- * .map(n => -n)
- * .filter(n => n % 2 === 0)
- * .take(2)
- * .reduce((r, n) => r * n, 1)
- * // 1006008
- * ```
- *
- * Seq is often used to provide a rich collection API to JavaScript Object.
- *
- * ```js
- * Seq({ x: 0, y: 1, z: 2 }).map(v => v * 2).toObject();
- * // { x: 0, y: 2, z: 4 }
- * ```
- */
-
- declare module Seq {
- /**
- * True if `maybeSeq` is a Seq, it is not backed by a concrete
- * structure such as Map, List, or Set.
- */
- function isSeq(maybeSeq: any): maybeSeq is Seq.Indexed<any> | Seq.Keyed<any, any> | Seq.Set<any>;
-
-
- /**
- * `Seq` which represents key-value pairs.
- */
- export module Keyed {}
-
- /**
- * Always returns a Seq.Keyed, if input is not keyed, expects an
- * collection of [K, V] tuples.
- *
- * Note: `Seq.Keyed` is a conversion function and not a class, and does not
- * use the `new` keyword during construction.
- */
- export function Keyed<K, V>(collection: Iterable<[K, V]>): Seq.Keyed<K, V>;
- export function Keyed<V>(obj: {[key: string]: V}): Seq.Keyed<string, V>;
- export function Keyed<K, V>(): Seq.Keyed<K, V>;
- export function Keyed(): Seq.Keyed<any, any>;
-
- export interface Keyed<K, V> extends Seq<K, V>, Collection$1.Keyed<K, V> {
- /**
- * Deeply converts this Keyed Seq to equivalent native JavaScript Object.
- *
- * Converts keys to Strings.
- */
- toJS(): Object;
-
- /**
- * Shallowly converts this Keyed Seq to equivalent native JavaScript Object.
- *
- * Converts keys to Strings.
- */
- toJSON(): { [key: string]: V };
-
- /**
- * Shallowly converts this collection to an Array.
- */
- toArray(): Array<[K, V]>;
-
- /**
- * Returns itself
- */
- toSeq(): this;
-
- /**
- * Returns a new Seq with other collections concatenated to this one.
- *
- * All entries will be present in the resulting Seq, even if they
- * have the same key.
- */
- concat<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): Seq.Keyed<K | KC, V | VC>;
- concat<C>(...collections: Array<{[key: string]: C}>): Seq.Keyed<K | string, V | C>;
-
- /**
- * Returns a new Seq.Keyed with values passed through a
- * `mapper` function.
- *
- * ```js
- * const { Seq } = require('immutable')
- * Seq.Keyed({ a: 1, b: 2 }).map(x => 10 * x)
- * // Seq { "a": 10, "b": 20 }
- * ```
- *
- * Note: `map()` always returns a new instance, even if it produced the
- * same value at every step.
- */
- map<M>(
- mapper: (value: V, key: K, iter: this) => M,
- context?: any
- ): Seq.Keyed<K, M>;
-
- /**
- * @see Collection.Keyed.mapKeys
- */
- mapKeys<M>(
- mapper: (key: K, value: V, iter: this) => M,
- context?: any
- ): Seq.Keyed<M, V>;
-
- /**
- * @see Collection.Keyed.mapEntries
- */
- mapEntries<KM, VM>(
- mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
- context?: any
- ): Seq.Keyed<KM, VM>;
-
- /**
- * Flat-maps the Seq, returning a Seq of the same type.
- *
- * Similar to `seq.map(...).flatten(true)`.
- */
- flatMap<KM, VM>(
- mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
- context?: any
- ): Seq.Keyed<KM, VM>;
-
- /**
- * Returns a new Seq with only the entries for which the `predicate`
- * function returns true.
- *
- * Note: `filter()` always returns a new instance, even if it results in
- * not filtering out any values.
- */
- filter<F extends V>(
- predicate: (value: V, key: K, iter: this) => value is F,
- context?: any
- ): Seq.Keyed<K, F>;
- filter(
- predicate: (value: V, key: K, iter: this) => any,
- context?: any
- ): this;
-
- /**
- * @see Collection.Keyed.flip
- */
- flip(): Seq.Keyed<V, K>;
- }
-
-
- /**
- * `Seq` which represents an ordered indexed list of values.
- */
- module Indexed {
-
- /**
- * Provides an Seq.Indexed of the values provided.
- */
- function of<T>(...values: Array<T>): Seq.Indexed<T>;
- }
-
- /**
- * Always returns Seq.Indexed, discarding associated keys and
- * supplying incrementing indices.
- *
- * Note: `Seq.Indexed` is a conversion function and not a class, and does
- * not use the `new` keyword during construction.
- */
- export function Indexed(): Seq.Indexed<any>;
- export function Indexed<T>(): Seq.Indexed<T>;
- export function Indexed<T>(collection: Iterable<T>): Seq.Indexed<T>;
-
- export interface Indexed<T> extends Seq<number, T>, Collection$1.Indexed<T> {
- /**
- * Deeply converts this Indexed Seq to equivalent native JavaScript Array.
- */
- toJS(): Array<any>;
-
- /**
- * Shallowly converts this Indexed Seq to equivalent native JavaScript Array.
- */
- toJSON(): Array<T>;
-
- /**
- * Shallowly converts this collection to an Array.
- */
- toArray(): Array<T>;
-
- /**
- * Returns itself
- */
- toSeq(): this
-
- /**
- * Returns a new Seq with other collections concatenated to this one.
- */
- concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): Seq.Indexed<T | C>;
-
- /**
- * Returns a new Seq.Indexed with values passed through a
- * `mapper` function.
- *
- * ```js
- * const { Seq } = require('immutable')
- * Seq.Indexed([ 1, 2 ]).map(x => 10 * x)
- * // Seq [ 10, 20 ]
- * ```
- *
- * Note: `map()` always returns a new instance, even if it produced the
- * same value at every step.
- */
- map<M>(
- mapper: (value: T, key: number, iter: this) => M,
- context?: any
- ): Seq.Indexed<M>;
-
- /**
- * Flat-maps the Seq, returning a a Seq of the same type.
- *
- * Similar to `seq.map(...).flatten(true)`.
- */
- flatMap<M>(
- mapper: (value: T, key: number, iter: this) => Iterable<M>,
- context?: any
- ): Seq.Indexed<M>;
-
- /**
- * Returns a new Seq with only the values for which the `predicate`
- * function returns true.
- *
- * Note: `filter()` always returns a new instance, even if it results in
- * not filtering out any values.
- */
- filter<F extends T>(
- predicate: (value: T, index: number, iter: this) => value is F,
- context?: any
- ): Seq.Indexed<F>;
- filter(
- predicate: (value: T, index: number, iter: this) => any,
- context?: any
- ): this;
-
- /**
- * Returns a Seq "zipped" with the provided collections.
- *
- * Like `zipWith`, but using the default `zipper`: creating an `Array`.
- *
- * ```js
- * const a = Seq([ 1, 2, 3 ]);
- * const b = Seq([ 4, 5, 6 ]);
- * const c = a.zip(b); // Seq [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ]
- * ```
- */
- zip<U>(other: Collection$1<any, U>): Seq.Indexed<[T,U]>;
- zip<U,V>(other: Collection$1<any, U>, other2: Collection$1<any, V>): Seq.Indexed<[T,U,V]>;
- zip(...collections: Array<Collection$1<any, any>>): Seq.Indexed<any>;
-
- /**
- * Returns a Seq "zipped" with the provided collections.
- *
- * Unlike `zip`, `zipAll` continues zipping until the longest collection is
- * exhausted. Missing values from shorter collections are filled with `undefined`.
- *
- * ```js
- * const a = Seq([ 1, 2 ]);
- * const b = Seq([ 3, 4, 5 ]);
- * const c = a.zipAll(b); // Seq [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ]
- * ```
- */
- zipAll<U>(other: Collection$1<any, U>): Seq.Indexed<[T,U]>;
- zipAll<U,V>(other: Collection$1<any, U>, other2: Collection$1<any, V>): Seq.Indexed<[T,U,V]>;
- zipAll(...collections: Array<Collection$1<any, any>>): Seq.Indexed<any>;
-
- /**
- * Returns a Seq "zipped" with the provided collections by using a
- * custom `zipper` function.
- *
- * ```js
- * const a = Seq([ 1, 2, 3 ]);
- * const b = Seq([ 4, 5, 6 ]);
- * const c = a.zipWith((a, b) => a + b, b);
- * // Seq [ 5, 7, 9 ]
- * ```
- */
- zipWith<U, Z>(
- zipper: (value: T, otherValue: U) => Z,
- otherCollection: Collection$1<any, U>
- ): Seq.Indexed<Z>;
- zipWith<U, V, Z>(
- zipper: (value: T, otherValue: U, thirdValue: V) => Z,
- otherCollection: Collection$1<any, U>,
- thirdCollection: Collection$1<any, V>
- ): Seq.Indexed<Z>;
- zipWith<Z>(
- zipper: (...any: Array<any>) => Z,
- ...collections: Array<Collection$1<any, any>>
- ): Seq.Indexed<Z>;
- }
-
-
- /**
- * `Seq` which represents a set of values.
- *
- * Because `Seq` are often lazy, `Seq.Set` does not provide the same guarantee
- * of value uniqueness as the concrete `Set`.
- */
- export module Set {
-
- /**
- * Returns a Seq.Set of the provided values
- */
- function of<T>(...values: Array<T>): Seq.Set<T>;
- }
-
- /**
- * Always returns a Seq.Set, discarding associated indices or keys.
- *
- * Note: `Seq.Set` is a conversion function and not a class, and does not
- * use the `new` keyword during construction.
- */
- export function Set(): Seq.Set<any>;
- export function Set<T>(): Seq.Set<T>;
- export function Set<T>(collection: Iterable<T>): Seq.Set<T>;
-
- export interface Set<T> extends Seq<T, T>, Collection$1.Set<T> {
- /**
- * Deeply converts this Set Seq to equivalent native JavaScript Array.
- */
- toJS(): Array<any>;
-
- /**
- * Shallowly converts this Set Seq to equivalent native JavaScript Array.
- */
- toJSON(): Array<T>;
-
- /**
- * Shallowly converts this collection to an Array.
- */
- toArray(): Array<T>;
-
- /**
- * Returns itself
- */
- toSeq(): this
-
- /**
- * Returns a new Seq with other collections concatenated to this one.
- *
- * All entries will be present in the resulting Seq, even if they
- * are duplicates.
- */
- concat<U>(...collections: Array<Iterable<U>>): Seq.Set<T | U>;
-
- /**
- * Returns a new Seq.Set with values passed through a
- * `mapper` function.
- *
- * ```js
- * Seq.Set([ 1, 2 ]).map(x => 10 * x)
- * // Seq { 10, 20 }
- * ```
- *
- * Note: `map()` always returns a new instance, even if it produced the
- * same value at every step.
- */
- map<M>(
- mapper: (value: T, key: T, iter: this) => M,
- context?: any
- ): Seq.Set<M>;
-
- /**
- * Flat-maps the Seq, returning a Seq of the same type.
- *
- * Similar to `seq.map(...).flatten(true)`.
- */
- flatMap<M>(
- mapper: (value: T, key: T, iter: this) => Iterable<M>,
- context?: any
- ): Seq.Set<M>;
-
- /**
- * Returns a new Seq with only the values for which the `predicate`
- * function returns true.
- *
- * Note: `filter()` always returns a new instance, even if it results in
- * not filtering out any values.
- */
- filter<F extends T>(
- predicate: (value: T, key: T, iter: this) => value is F,
- context?: any
- ): Seq.Set<F>;
- filter(
- predicate: (value: T, key: T, iter: this) => any,
- context?: any
- ): this;
- }
-
- }
-
- /**
- * Creates a Seq.
- *
- * Returns a particular kind of `Seq` based on the input.
- *
- * * If a `Seq`, that same `Seq`.
- * * If an `Collection`, a `Seq` of the same kind (Keyed, Indexed, or Set).
- * * If an Array-like, an `Seq.Indexed`.
- * * If an Iterable Object, an `Seq.Indexed`.
- * * If an Object, a `Seq.Keyed`.
- *
- * Note: An Iterator itself will be treated as an object, becoming a `Seq.Keyed`,
- * which is usually not what you want. You should turn your Iterator Object into
- * an iterable object by defining a Symbol.iterator (or @@iterator) method which
- * returns `this`.
- *
- * Note: `Seq` is a conversion function and not a class, and does not use the
- * `new` keyword during construction.
- */
- declare function Seq<S extends Seq<any, any>>(seq: S): S;
- declare function Seq<K, V>(collection: Collection$1.Keyed<K, V>): Seq.Keyed<K, V>;
- declare function Seq<T>(collection: Collection$1.Indexed<T>): Seq.Indexed<T>;
- declare function Seq<T>(collection: Collection$1.Set<T>): Seq.Set<T>;
- declare function Seq<T>(collection: Iterable<T>): Seq.Indexed<T>;
- declare function Seq<V>(obj: {[key: string]: V}): Seq.Keyed<string, V>;
- declare function Seq(): Seq<any, any>;
-
- interface Seq<K, V> extends Collection$1<K, V> {
-
- /**
- * Some Seqs can describe their size lazily. When this is the case,
- * size will be an integer. Otherwise it will be undefined.
- *
- * For example, Seqs returned from `map()` or `reverse()`
- * preserve the size of the original `Seq` while `filter()` does not.
- *
- * Note: `Range`, `Repeat` and `Seq`s made from `Array`s and `Object`s will
- * always have a size.
- */
- readonly size: number | undefined;
-
-
- // Force evaluation
-
- /**
- * Because Sequences are lazy and designed to be chained together, they do
- * not cache their results. For example, this map function is called a total
- * of 6 times, as each `join` iterates the Seq of three values.
- *
- * var squares = Seq([ 1, 2, 3 ]).map(x => x * x)
- * squares.join() + squares.join()
- *
- * If you know a `Seq` will be used multiple times, it may be more
- * efficient to first cache it in memory. Here, the map function is called
- * only 3 times.
- *
- * var squares = Seq([ 1, 2, 3 ]).map(x => x * x).cacheResult()
- * squares.join() + squares.join()
- *
- * Use this method judiciously, as it must fully evaluate a Seq which can be
- * a burden on memory and possibly performance.
- *
- * Note: after calling `cacheResult`, a Seq will always have a `size`.
- */
- cacheResult(): this;
-
- // Sequence algorithms
-
- /**
- * Returns a new Seq with values passed through a
- * `mapper` function.
- *
- * ```js
- * const { Seq } = require('immutable')
- * Seq([ 1, 2 ]).map(x => 10 * x)
- * // Seq [ 10, 20 ]
- * ```
- *
- * Note: `map()` always returns a new instance, even if it produced the same
- * value at every step.
- */
- map<M>(
- mapper: (value: V, key: K, iter: this) => M,
- context?: any
- ): Seq<K, M>;
-
- /**
- * Returns a new Seq with values passed through a
- * `mapper` function.
- *
- * ```js
- * const { Seq } = require('immutable')
- * Seq([ 1, 2 ]).map(x => 10 * x)
- * // Seq [ 10, 20 ]
- * ```
- *
- * Note: `map()` always returns a new instance, even if it produced the same
- * value at every step.
- * Note: used only for sets.
- */
- map<M>(
- mapper: (value: V, key: K, iter: this) => M,
- context?: any
- ): Seq<M, M>;
-
- /**
- * Flat-maps the Seq, returning a Seq of the same type.
- *
- * Similar to `seq.map(...).flatten(true)`.
- */
- flatMap<M>(
- mapper: (value: V, key: K, iter: this) => Iterable<M>,
- context?: any
- ): Seq<K, M>;
-
- /**
- * Flat-maps the Seq, returning a Seq of the same type.
- *
- * Similar to `seq.map(...).flatten(true)`.
- * Note: Used only for sets.
- */
- flatMap<M>(
- mapper: (value: V, key: K, iter: this) => Iterable<M>,
- context?: any
- ): Seq<M, M>;
-
- /**
- * Returns a new Seq with only the values for which the `predicate`
- * function returns true.
- *
- * Note: `filter()` always returns a new instance, even if it results in
- * not filtering out any values.
- */
- filter<F extends V>(
- predicate: (value: V, key: K, iter: this) => value is F,
- context?: any
- ): Seq<K, F>;
- filter(
- predicate: (value: V, key: K, iter: this) => any,
- context?: any
- ): this;
- }
-
- /**
- * The `Collection` is a set of (key, value) entries which can be iterated, and
- * is the base class for all collections in `immutable`, allowing them to
- * make use of all the Collection methods (such as `map` and `filter`).
- *
- * Note: A collection is always iterated in the same order, however that order
- * may not always be well defined, as is the case for the `Map` and `Set`.
- *
- * Collection is the abstract base class for concrete data structures. It
- * cannot be constructed directly.
- *
- * Implementations should extend one of the subclasses, `Collection.Keyed`,
- * `Collection.Indexed`, or `Collection.Set`.
- */
- declare module Collection$1 {
-
- /**
- * @deprecated use `const { isKeyed } = require('immutable')`
- */
- function isKeyed(maybeKeyed: any): maybeKeyed is Collection$1.Keyed<any, any>;
-
- /**
- * @deprecated use `const { isIndexed } = require('immutable')`
- */
- function isIndexed(maybeIndexed: any): maybeIndexed is Collection$1.Indexed<any>;
-
- /**
- * @deprecated use `const { isAssociative } = require('immutable')`
- */
- function isAssociative(maybeAssociative: any): maybeAssociative is Collection$1.Keyed<any, any> | Collection$1.Indexed<any>;
-
- /**
- * @deprecated use `const { isOrdered } = require('immutable')`
- */
- function isOrdered(maybeOrdered: any): boolean;
-
-
- /**
- * Keyed Collections have discrete keys tied to each value.
- *
- * When iterating `Collection.Keyed`, each iteration will yield a `[K, V]`
- * tuple, in other words, `Collection#entries` is the default iterator for
- * Keyed Collections.
- */
- export module Keyed {}
-
- /**
- * Creates a Collection.Keyed
- *
- * Similar to `Collection()`, however it expects collection-likes of [K, V]
- * tuples if not constructed from a Collection.Keyed or JS Object.
- *
- * Note: `Collection.Keyed` is a conversion function and not a class, and
- * does not use the `new` keyword during construction.
- */
- export function Keyed<K, V>(collection: Iterable<[K, V]>): Collection$1.Keyed<K, V>;
- export function Keyed<V>(obj: {[key: string]: V}): Collection$1.Keyed<string, V>;
-
- export interface Keyed<K, V> extends Collection$1<K, V> {
- /**
- * Deeply converts this Keyed collection to equivalent native JavaScript Object.
- *
- * Converts keys to Strings.
- */
- toJS(): Object;
-
- /**
- * Shallowly converts this Keyed collection to equivalent native JavaScript Object.
- *
- * Converts keys to Strings.
- */
- toJSON(): { [key: string]: V };
-
- /**
- * Shallowly converts this collection to an Array.
- */
- toArray(): Array<[K, V]>;
-
- /**
- * Returns Seq.Keyed.
- * @override
- */
- toSeq(): Seq.Keyed<K, V>;
-
-
- // Sequence functions
-
- /**
- * Returns a new Collection.Keyed of the same type where the keys and values
- * have been flipped.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * Map({ a: 'z', b: 'y' }).flip()
- * // Map { "z": "a", "y": "b" }
- * ```
- */
- flip(): Collection$1.Keyed<V, K>;
-
- /**
- * Returns a new Collection with other collections concatenated to this one.
- */
- concat<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): Collection$1.Keyed<K | KC, V | VC>;
- concat<C>(...collections: Array<{[key: string]: C}>): Collection$1.Keyed<K | string, V | C>;
-
- /**
- * Returns a new Collection.Keyed with values passed through a
- * `mapper` function.
- *
- * ```js
- * const { Collection } = require('immutable')
- * Collection.Keyed({ a: 1, b: 2 }).map(x => 10 * x)
- * // Seq { "a": 10, "b": 20 }
- * ```
- *
- * Note: `map()` always returns a new instance, even if it produced the
- * same value at every step.
- */
- map<M>(
- mapper: (value: V, key: K, iter: this) => M,
- context?: any
- ): Collection$1.Keyed<K, M>;
-
- /**
- * Returns a new Collection.Keyed of the same type with keys passed through
- * a `mapper` function.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * Map({ a: 1, b: 2 }).mapKeys(x => x.toUpperCase())
- * // Map { "A": 1, "B": 2 }
- * ```
- *
- * Note: `mapKeys()` always returns a new instance, even if it produced
- * the same key at every step.
- */
- mapKeys<M>(
- mapper: (key: K, value: V, iter: this) => M,
- context?: any
- ): Collection$1.Keyed<M, V>;
-
- /**
- * Returns a new Collection.Keyed of the same type with entries
- * ([key, value] tuples) passed through a `mapper` function.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * Map({ a: 1, b: 2 })
- * .mapEntries(([ k, v ]) => [ k.toUpperCase(), v * 2 ])
- * // Map { "A": 2, "B": 4 }
- * ```
- *
- * Note: `mapEntries()` always returns a new instance, even if it produced
- * the same entry at every step.
- */
- mapEntries<KM, VM>(
- mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
- context?: any
- ): Collection$1.Keyed<KM, VM>;
-
- /**
- * Flat-maps the Collection, returning a Collection of the same type.
- *
- * Similar to `collection.map(...).flatten(true)`.
- */
- flatMap<KM, VM>(
- mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
- context?: any
- ): Collection$1.Keyed<KM, VM>;
-
- /**
- * Returns a new Collection with only the values for which the `predicate`
- * function returns true.
- *
- * Note: `filter()` always returns a new instance, even if it results in
- * not filtering out any values.
- */
- filter<F extends V>(
- predicate: (value: V, key: K, iter: this) => value is F,
- context?: any
- ): Collection$1.Keyed<K, F>;
- filter(
- predicate: (value: V, key: K, iter: this) => any,
- context?: any
- ): this;
-
- [Symbol.iterator](): IterableIterator<[K, V]>;
- }
-
-
- /**
- * Indexed Collections have incrementing numeric keys. They exhibit
- * slightly different behavior than `Collection.Keyed` for some methods in order
- * to better mirror the behavior of JavaScript's `Array`, and add methods
- * which do not make sense on non-indexed Collections such as `indexOf`.
- *
- * Unlike JavaScript arrays, `Collection.Indexed`s are always dense. "Unset"
- * indices and `undefined` indices are indistinguishable, and all indices from
- * 0 to `size` are visited when iterated.
- *
- * All Collection.Indexed methods return re-indexed Collections. In other words,
- * indices always start at 0 and increment until size. If you wish to
- * preserve indices, using them as keys, convert to a Collection.Keyed by
- * calling `toKeyedSeq`.
- */
- export module Indexed {}
-
- /**
- * Creates a new Collection.Indexed.
- *
- * Note: `Collection.Indexed` is a conversion function and not a class, and
- * does not use the `new` keyword during construction.
- */
- export function Indexed<T>(collection: Iterable<T>): Collection$1.Indexed<T>;
-
- export interface Indexed<T> extends Collection$1<number, T> {
- /**
- * Deeply converts this Indexed collection to equivalent native JavaScript Array.
- */
- toJS(): Array<any>;
-
- /**
- * Shallowly converts this Indexed collection to equivalent native JavaScript Array.
- */
- toJSON(): Array<T>;
-
- /**
- * Shallowly converts this collection to an Array.
- */
- toArray(): Array<T>;
-
- // Reading values
-
- /**
- * Returns the value associated with the provided index, or notSetValue if
- * the index is beyond the bounds of the Collection.
- *
- * `index` may be a negative number, which indexes back from the end of the
- * Collection. `s.get(-1)` gets the last item in the Collection.
- */
- get<NSV>(index: number, notSetValue: NSV): T | NSV;
- get(index: number): T | undefined;
-
-
- // Conversion to Seq
-
- /**
- * Returns Seq.Indexed.
- * @override
- */
- toSeq(): Seq.Indexed<T>;
-
- /**
- * If this is a collection of [key, value] entry tuples, it will return a
- * Seq.Keyed of those entries.
- */
- fromEntrySeq(): Seq.Keyed<any, any>;
-
-
- // Combination
-
- /**
- * Returns a Collection of the same type with `separator` between each item
- * in this Collection.
- */
- interpose(separator: T): this;
-
- /**
- * Returns a Collection of the same type with the provided `collections`
- * interleaved into this collection.
- *
- * The resulting Collection includes the first item from each, then the
- * second from each, etc.
- *
- * <!-- runkit:activate
- * { "preamble": "require('immutable')"}
- * -->
- * ```js
- * const { List } = require('immutable')
- * List([ 1, 2, 3 ]).interleave(List([ 'A', 'B', 'C' ]))
- * // List [ 1, "A", 2, "B", 3, "C"" ]
- * ```
- *
- * The shortest Collection stops interleave.
- *
- * <!-- runkit:activate
- * { "preamble": "const { List } = require('immutable')" }
- * -->
- * ```js
- * List([ 1, 2, 3 ]).interleave(
- * List([ 'A', 'B' ]),
- * List([ 'X', 'Y', 'Z' ])
- * )
- * // List [ 1, "A", "X", 2, "B", "Y"" ]
- * ```
- *
- * Since `interleave()` re-indexes values, it produces a complete copy,
- * which has `O(N)` complexity.
- *
- * Note: `interleave` *cannot* be used in `withMutations`.
- */
- interleave(...collections: Array<Collection$1<any, T>>): this;
-
- /**
- * Splice returns a new indexed Collection by replacing a region of this
- * Collection with new values. If values are not provided, it only skips the
- * region to be removed.
- *
- * `index` may be a negative number, which indexes back from the end of the
- * Collection. `s.splice(-2)` splices after the second to last item.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { List } = require('immutable')
- * List([ 'a', 'b', 'c', 'd' ]).splice(1, 2, 'q', 'r', 's')
- * // List [ "a", "q", "r", "s", "d" ]
- * ```
- *
- * Since `splice()` re-indexes values, it produces a complete copy, which
- * has `O(N)` complexity.
- *
- * Note: `splice` *cannot* be used in `withMutations`.
- */
- splice(
- index: number,
- removeNum: number,
- ...values: Array<T>
- ): this;
-
- /**
- * Returns a Collection of the same type "zipped" with the provided
- * collections.
- *
- * Like `zipWith`, but using the default `zipper`: creating an `Array`.
- *
- *
- * <!-- runkit:activate
- * { "preamble": "const { List } = require('immutable')" }
- * -->
- * ```js
- * const a = List([ 1, 2, 3 ]);
- * const b = List([ 4, 5, 6 ]);
- * const c = a.zip(b); // List [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ]
- * ```
- */
- zip<U>(other: Collection$1<any, U>): Collection$1.Indexed<[T,U]>;
- zip<U,V>(other: Collection$1<any, U>, other2: Collection$1<any, V>): Collection$1.Indexed<[T,U,V]>;
- zip(...collections: Array<Collection$1<any, any>>): Collection$1.Indexed<any>;
-
- /**
- * Returns a Collection "zipped" with the provided collections.
- *
- * Unlike `zip`, `zipAll` continues zipping until the longest collection is
- * exhausted. Missing values from shorter collections are filled with `undefined`.
- *
- * ```js
- * const a = List([ 1, 2 ]);
- * const b = List([ 3, 4, 5 ]);
- * const c = a.zipAll(b); // List [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ]
- * ```
- */
- zipAll<U>(other: Collection$1<any, U>): Collection$1.Indexed<[T,U]>;
- zipAll<U,V>(other: Collection$1<any, U>, other2: Collection$1<any, V>): Collection$1.Indexed<[T,U,V]>;
- zipAll(...collections: Array<Collection$1<any, any>>): Collection$1.Indexed<any>;
-
- /**
- * Returns a Collection of the same type "zipped" with the provided
- * collections by using a custom `zipper` function.
- *
- * <!-- runkit:activate
- * { "preamble": "const { List } = require('immutable')" }
- * -->
- * ```js
- * const a = List([ 1, 2, 3 ]);
- * const b = List([ 4, 5, 6 ]);
- * const c = a.zipWith((a, b) => a + b, b);
- * // List [ 5, 7, 9 ]
- * ```
- */
- zipWith<U, Z>(
- zipper: (value: T, otherValue: U) => Z,
- otherCollection: Collection$1<any, U>
- ): Collection$1.Indexed<Z>;
- zipWith<U, V, Z>(
- zipper: (value: T, otherValue: U, thirdValue: V) => Z,
- otherCollection: Collection$1<any, U>,
- thirdCollection: Collection$1<any, V>
- ): Collection$1.Indexed<Z>;
- zipWith<Z>(
- zipper: (...any: Array<any>) => Z,
- ...collections: Array<Collection$1<any, any>>
- ): Collection$1.Indexed<Z>;
-
-
- // Search for value
-
- /**
- * Returns the first index at which a given value can be found in the
- * Collection, or -1 if it is not present.
- */
- indexOf(searchValue: T): number;
-
- /**
- * Returns the last index at which a given value can be found in the
- * Collection, or -1 if it is not present.
- */
- lastIndexOf(searchValue: T): number;
-
- /**
- * Returns the first index in the Collection where a value satisfies the
- * provided predicate function. Otherwise -1 is returned.
- */
- findIndex(
- predicate: (value: T, index: number, iter: this) => boolean,
- context?: any
- ): number;
-
- /**
- * Returns the last index in the Collection where a value satisfies the
- * provided predicate function. Otherwise -1 is returned.
- */
- findLastIndex(
- predicate: (value: T, index: number, iter: this) => boolean,
- context?: any
- ): number;
-
- // Sequence algorithms
-
- /**
- * Returns a new Collection with other collections concatenated to this one.
- */
- concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): Collection$1.Indexed<T | C>;
-
- /**
- * Returns a new Collection.Indexed with values passed through a
- * `mapper` function.
- *
- * ```js
- * const { Collection } = require('immutable')
- * Collection.Indexed([1,2]).map(x => 10 * x)
- * // Seq [ 1, 2 ]
- * ```
- *
- * Note: `map()` always returns a new instance, even if it produced the
- * same value at every step.
- */
- map<M>(
- mapper: (value: T, key: number, iter: this) => M,
- context?: any
- ): Collection$1.Indexed<M>;
-
- /**
- * Flat-maps the Collection, returning a Collection of the same type.
- *
- * Similar to `collection.map(...).flatten(true)`.
- */
- flatMap<M>(
- mapper: (value: T, key: number, iter: this) => Iterable<M>,
- context?: any
- ): Collection$1.Indexed<M>;
-
- /**
- * Returns a new Collection with only the values for which the `predicate`
- * function returns true.
- *
- * Note: `filter()` always returns a new instance, even if it results in
- * not filtering out any values.
- */
- filter<F extends T>(
- predicate: (value: T, index: number, iter: this) => value is F,
- context?: any
- ): Collection$1.Indexed<F>;
- filter(
- predicate: (value: T, index: number, iter: this) => any,
- context?: any
- ): this;
-
- [Symbol.iterator](): IterableIterator<T>;
- }
-
-
- /**
- * Set Collections only represent values. They have no associated keys or
- * indices. Duplicate values are possible in the lazy `Seq.Set`s, however
- * the concrete `Set` Collection does not allow duplicate values.
- *
- * Collection methods on Collection.Set such as `map` and `forEach` will provide
- * the value as both the first and second arguments to the provided function.
- *
- * ```js
- * const { Collection } = require('immutable')
- * const seq = Collection.Set([ 'A', 'B', 'C' ])
- * // Seq { "A", "B", "C" }
- * seq.forEach((v, k) =>
- * assert.equal(v, k)
- * )
- * ```
- */
- export module Set {}
-
- /**
- * Similar to `Collection()`, but always returns a Collection.Set.
- *
- * Note: `Collection.Set` is a factory function and not a class, and does
- * not use the `new` keyword during construction.
- */
- export function Set<T>(collection: Iterable<T>): Collection$1.Set<T>;
-
- export interface Set<T> extends Collection$1<T, T> {
- /**
- * Deeply converts this Set collection to equivalent native JavaScript Array.
- */
- toJS(): Array<any>;
-
- /**
- * Shallowly converts this Set collection to equivalent native JavaScript Array.
- */
- toJSON(): Array<T>;
-
- /**
- * Shallowly converts this collection to an Array.
- */
- toArray(): Array<T>;
-
- /**
- * Returns Seq.Set.
- * @override
- */
- toSeq(): Seq.Set<T>;
-
- // Sequence algorithms
-
- /**
- * Returns a new Collection with other collections concatenated to this one.
- */
- concat<U>(...collections: Array<Iterable<U>>): Collection$1.Set<T | U>;
-
- /**
- * Returns a new Collection.Set with values passed through a
- * `mapper` function.
- *
- * ```
- * Collection.Set([ 1, 2 ]).map(x => 10 * x)
- * // Seq { 1, 2 }
- * ```
- *
- * Note: `map()` always returns a new instance, even if it produced the
- * same value at every step.
- */
- map<M>(
- mapper: (value: T, key: T, iter: this) => M,
- context?: any
- ): Collection$1.Set<M>;
-
- /**
- * Flat-maps the Collection, returning a Collection of the same type.
- *
- * Similar to `collection.map(...).flatten(true)`.
- */
- flatMap<M>(
- mapper: (value: T, key: T, iter: this) => Iterable<M>,
- context?: any
- ): Collection$1.Set<M>;
-
- /**
- * Returns a new Collection with only the values for which the `predicate`
- * function returns true.
- *
- * Note: `filter()` always returns a new instance, even if it results in
- * not filtering out any values.
- */
- filter<F extends T>(
- predicate: (value: T, key: T, iter: this) => value is F,
- context?: any
- ): Collection$1.Set<F>;
- filter(
- predicate: (value: T, key: T, iter: this) => any,
- context?: any
- ): this;
-
- [Symbol.iterator](): IterableIterator<T>;
- }
-
- }
-
- /**
- * Creates a Collection.
- *
- * The type of Collection created is based on the input.
- *
- * * If an `Collection`, that same `Collection`.
- * * If an Array-like, an `Collection.Indexed`.
- * * If an Object with an Iterator defined, an `Collection.Indexed`.
- * * If an Object, an `Collection.Keyed`.
- *
- * This methods forces the conversion of Objects and Strings to Collections.
- * If you want to ensure that a Collection of one item is returned, use
- * `Seq.of`.
- *
- * Note: An Iterator itself will be treated as an object, becoming a `Seq.Keyed`,
- * which is usually not what you want. You should turn your Iterator Object into
- * an iterable object by defining a Symbol.iterator (or @@iterator) method which
- * returns `this`.
- *
- * Note: `Collection` is a conversion function and not a class, and does not
- * use the `new` keyword during construction.
- */
- declare function Collection$1<I extends Collection$1<any, any>>(collection: I): I;
- declare function Collection$1<T>(collection: Iterable<T>): Collection$1.Indexed<T>;
- declare function Collection$1<V>(obj: {[key: string]: V}): Collection$1.Keyed<string, V>;
-
- interface Collection$1<K, V> extends ValueObject {
-
- // Value equality
-
- /**
- * True if this and the other Collection have value equality, as defined
- * by `Immutable.is()`.
- *
- * Note: This is equivalent to `Immutable.is(this, other)`, but provided to
- * allow for chained expressions.
- */
- equals(other: any): boolean;
-
- /**
- * Computes and returns the hashed identity for this Collection.
- *
- * The `hashCode` of a Collection is used to determine potential equality,
- * and is used when adding this to a `Set` or as a key in a `Map`, enabling
- * lookup via a different instance.
- *
- * <!-- runkit:activate
- * { "preamble": "const { Set, List } = require('immutable')" }
- * -->
- * ```js
- * const a = List([ 1, 2, 3 ]);
- * const b = List([ 1, 2, 3 ]);
- * assert.notStrictEqual(a, b); // different instances
- * const set = Set([ a ]);
- * assert.equal(set.has(b), true);
- * ```
- *
- * If two values have the same `hashCode`, they are [not guaranteed
- * to be equal][Hash Collision]. If two values have different `hashCode`s,
- * they must not be equal.
- *
- * [Hash Collision]: http://en.wikipedia.org/wiki/Collision_(computer_science)
- */
- hashCode(): number;
-
-
- // Reading values
-
- /**
- * Returns the value associated with the provided key, or notSetValue if
- * the Collection does not contain this key.
- *
- * Note: it is possible a key may be associated with an `undefined` value,
- * so if `notSetValue` is not provided and this method returns `undefined`,
- * that does not guarantee the key was not found.
- */
- get<NSV>(key: K, notSetValue: NSV): V | NSV;
- get(key: K): V | undefined;
-
- /**
- * True if a key exists within this `Collection`, using `Immutable.is`
- * to determine equality
- */
- has(key: K): boolean;
-
- /**
- * True if a value exists within this `Collection`, using `Immutable.is`
- * to determine equality
- * @alias contains
- */
- includes(value: V): boolean;
- contains(value: V): boolean;
-
- /**
- * In case the `Collection` is not empty returns the first element of the
- * `Collection`.
- * In case the `Collection` is empty returns the optional default
- * value if provided, if no default value is provided returns undefined.
- */
- first<NSV>(notSetValue?: NSV): V | NSV;
-
- /**
- * In case the `Collection` is not empty returns the last element of the
- * `Collection`.
- * In case the `Collection` is empty returns the optional default
- * value if provided, if no default value is provided returns undefined.
- */
- last<NSV>(notSetValue?: NSV): V | NSV;
-
- // Reading deep values
-
- /**
- * Returns the value found by following a path of keys or indices through
- * nested Collections.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map, List } = require('immutable')
- * const deepData = Map({ x: List([ Map({ y: 123 }) ]) });
- * deepData.getIn(['x', 0, 'y']) // 123
- * ```
- *
- * Plain JavaScript Object or Arrays may be nested within an Immutable.js
- * Collection, and getIn() can access those values as well:
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map, List } = require('immutable')
- * const deepData = Map({ x: [ { y: 123 } ] });
- * deepData.getIn(['x', 0, 'y']) // 123
- * ```
- */
- getIn(searchKeyPath: Iterable<any>, notSetValue?: any): any;
-
- /**
- * True if the result of following a path of keys or indices through nested
- * Collections results in a set value.
- */
- hasIn(searchKeyPath: Iterable<any>): boolean;
-
- // Persistent changes
-
- /**
- * This can be very useful as a way to "chain" a normal function into a
- * sequence of methods. RxJS calls this "let" and lodash calls it "thru".
- *
- * For example, to sum a Seq after mapping and filtering:
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Seq } = require('immutable')
- *
- * function sum(collection) {
- * return collection.reduce((sum, x) => sum + x, 0)
- * }
- *
- * Seq([ 1, 2, 3 ])
- * .map(x => x + 1)
- * .filter(x => x % 2 === 0)
- * .update(sum)
- * // 6
- * ```
- */
- update<R>(updater: (value: this) => R): R;
-
-
- // Conversion to JavaScript types
-
- /**
- * Deeply converts this Collection to equivalent native JavaScript Array or Object.
- *
- * `Collection.Indexed`, and `Collection.Set` become `Array`, while
- * `Collection.Keyed` become `Object`, converting keys to Strings.
- */
- toJS(): Array<any> | { [key: string]: any };
-
- /**
- * Shallowly converts this Collection to equivalent native JavaScript Array or Object.
- *
- * `Collection.Indexed`, and `Collection.Set` become `Array`, while
- * `Collection.Keyed` become `Object`, converting keys to Strings.
- */
- toJSON(): Array<V> | { [key: string]: V };
-
- /**
- * Shallowly converts this collection to an Array.
- *
- * `Collection.Indexed`, and `Collection.Set` produce an Array of values.
- * `Collection.Keyed` produce an Array of [key, value] tuples.
- */
- toArray(): Array<V> | Array<[K, V]>;
-
- /**
- * Shallowly converts this Collection to an Object.
- *
- * Converts keys to Strings.
- */
- toObject(): { [key: string]: V };
-
-
- // Conversion to Collections
-
- /**
- * Converts this Collection to a Map, Throws if keys are not hashable.
- *
- * Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided
- * for convenience and to allow for chained expressions.
- */
- toMap(): Map$1<K, V>;
-
- /**
- * Converts this Collection to a Map, maintaining the order of iteration.
- *
- * Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but
- * provided for convenience and to allow for chained expressions.
- */
- toOrderedMap(): OrderedMap<K, V>;
-
- /**
- * Converts this Collection to a Set, discarding keys. Throws if values
- * are not hashable.
- *
- * Note: This is equivalent to `Set(this)`, but provided to allow for
- * chained expressions.
- */
- toSet(): Set$1<V>;
-
- /**
- * Converts this Collection to a Set, maintaining the order of iteration and
- * discarding keys.
- *
- * Note: This is equivalent to `OrderedSet(this.valueSeq())`, but provided
- * for convenience and to allow for chained expressions.
- */
- toOrderedSet(): OrderedSet<V>;
-
- /**
- * Converts this Collection to a List, discarding keys.
- *
- * This is similar to `List(collection)`, but provided to allow for chained
- * expressions. However, when called on `Map` or other keyed collections,
- * `collection.toList()` discards the keys and creates a list of only the
- * values, whereas `List(collection)` creates a list of entry tuples.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map, List } = require('immutable')
- * var myMap = Map({ a: 'Apple', b: 'Banana' })
- * List(myMap) // List [ [ "a", "Apple" ], [ "b", "Banana" ] ]
- * myMap.toList() // List [ "Apple", "Banana" ]
- * ```
- */
- toList(): List<V>;
-
- /**
- * Converts this Collection to a Stack, discarding keys. Throws if values
- * are not hashable.
- *
- * Note: This is equivalent to `Stack(this)`, but provided to allow for
- * chained expressions.
- */
- toStack(): Stack<V>;
-
-
- // Conversion to Seq
-
- /**
- * Converts this Collection to a Seq of the same kind (indexed,
- * keyed, or set).
- */
- toSeq(): Seq<K, V>;
-
- /**
- * Returns a Seq.Keyed from this Collection where indices are treated as keys.
- *
- * This is useful if you want to operate on an
- * Collection.Indexed and preserve the [index, value] pairs.
- *
- * The returned Seq will have identical iteration order as
- * this Collection.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Seq } = require('immutable')
- * const indexedSeq = Seq([ 'A', 'B', 'C' ])
- * // Seq [ "A", "B", "C" ]
- * indexedSeq.filter(v => v === 'B')
- * // Seq [ "B" ]
- * const keyedSeq = indexedSeq.toKeyedSeq()
- * // Seq { 0: "A", 1: "B", 2: "C" }
- * keyedSeq.filter(v => v === 'B')
- * // Seq { 1: "B" }
- * ```
- */
- toKeyedSeq(): Seq.Keyed<K, V>;
-
- /**
- * Returns an Seq.Indexed of the values of this Collection, discarding keys.
- */
- toIndexedSeq(): Seq.Indexed<V>;
-
- /**
- * Returns a Seq.Set of the values of this Collection, discarding keys.
- */
- toSetSeq(): Seq.Set<V>;
-
-
- // Iterators
-
- /**
- * An iterator of this `Collection`'s keys.
- *
- * Note: this will return an ES6 iterator which does not support
- * Immutable.js sequence algorithms. Use `keySeq` instead, if this is
- * what you want.
- */
- keys(): IterableIterator<K>;
-
- /**
- * An iterator of this `Collection`'s values.
- *
- * Note: this will return an ES6 iterator which does not support
- * Immutable.js sequence algorithms. Use `valueSeq` instead, if this is
- * what you want.
- */
- values(): IterableIterator<V>;
-
- /**
- * An iterator of this `Collection`'s entries as `[ key, value ]` tuples.
- *
- * Note: this will return an ES6 iterator which does not support
- * Immutable.js sequence algorithms. Use `entrySeq` instead, if this is
- * what you want.
- */
- entries(): IterableIterator<[K, V]>;
-
-
- // Collections (Seq)
-
- /**
- * Returns a new Seq.Indexed of the keys of this Collection,
- * discarding values.
- */
- keySeq(): Seq.Indexed<K>;
-
- /**
- * Returns an Seq.Indexed of the values of this Collection, discarding keys.
- */
- valueSeq(): Seq.Indexed<V>;
-
- /**
- * Returns a new Seq.Indexed of [key, value] tuples.
- */
- entrySeq(): Seq.Indexed<[K, V]>;
-
-
- // Sequence algorithms
-
- /**
- * Returns a new Collection of the same type with values passed through a
- * `mapper` function.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Collection } = require('immutable')
- * Collection({ a: 1, b: 2 }).map(x => 10 * x)
- * // Seq { "a": 10, "b": 20 }
- * ```
- *
- * Note: `map()` always returns a new instance, even if it produced the same
- * value at every step.
- */
- map<M>(
- mapper: (value: V, key: K, iter: this) => M,
- context?: any
- ): Collection$1<K, M>;
-
- /**
- * Note: used only for sets, which return Collection<M, M> but are otherwise
- * identical to normal `map()`.
- *
- * @ignore
- */
- map<M>(...args: never[]): any;
-
- /**
- * Returns a new Collection of the same type with only the entries for which
- * the `predicate` function returns true.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * Map({ a: 1, b: 2, c: 3, d: 4}).filter(x => x % 2 === 0)
- * // Map { "b": 2, "d": 4 }
- * ```
- *
- * Note: `filter()` always returns a new instance, even if it results in
- * not filtering out any values.
- */
- filter<F extends V>(
- predicate: (value: V, key: K, iter: this) => value is F,
- context?: any
- ): Collection$1<K, F>;
- filter(
- predicate: (value: V, key: K, iter: this) => any,
- context?: any
- ): this;
-
- /**
- * Returns a new Collection of the same type with only the entries for which
- * the `predicate` function returns false.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * Map({ a: 1, b: 2, c: 3, d: 4}).filterNot(x => x % 2 === 0)
- * // Map { "a": 1, "c": 3 }
- * ```
- *
- * Note: `filterNot()` always returns a new instance, even if it results in
- * not filtering out any values.
- */
- filterNot(
- predicate: (value: V, key: K, iter: this) => boolean,
- context?: any
- ): this;
-
- /**
- * Returns a new Collection of the same type in reverse order.
- */
- reverse(): this;
-
- /**
- * Returns a new Collection of the same type which includes the same entries,
- * stably sorted by using a `comparator`.
- *
- * If a `comparator` is not provided, a default comparator uses `<` and `>`.
- *
- * `comparator(valueA, valueB)`:
- *
- * * Returns `0` if the elements should not be swapped.
- * * Returns `-1` (or any negative number) if `valueA` comes before `valueB`
- * * Returns `1` (or any positive number) if `valueA` comes after `valueB`
- * * Is pure, i.e. it must always return the same value for the same pair
- * of values.
- *
- * When sorting collections which have no defined order, their ordered
- * equivalents will be returned. e.g. `map.sort()` returns OrderedMap.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { Map } = require('immutable')
- * Map({ "c": 3, "a": 1, "b": 2 }).sort((a, b) => {
- * if (a < b) { return -1; }
- * if (a > b) { return 1; }
- * if (a === b) { return 0; }
- * });
- * // OrderedMap { "a": 1, "b": 2, "c": 3 }
- * ```
- *
- * Note: `sort()` Always returns a new instance, even if the original was
- * already sorted.
- *
- * Note: This is always an eager operation.
- */
- sort(comparator?: (valueA: V, valueB: V) => number): this;
-
- /**
- * Like `sort`, but also accepts a `comparatorValueMapper` which allows for
- * sorting by more sophisticated means:
- *
- * hitters.sortBy(hitter => hitter.avgHits)
- *
- * Note: `sortBy()` Always returns a new instance, even if the original was
- * already sorted.
- *
- * Note: This is always an eager operation.
- */
- sortBy<C>(
- comparatorValueMapper: (value: V, key: K, iter: this) => C,
- comparator?: (valueA: C, valueB: C) => number
- ): this;
-
- /**
- * Returns a `Collection.Keyed` of `Collection.Keyeds`, grouped by the return
- * value of the `grouper` function.
- *
- * Note: This is always an eager operation.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { List, Map } = require('immutable')
- * const listOfMaps = List([
- * Map({ v: 0 }),
- * Map({ v: 1 }),
- * Map({ v: 1 }),
- * Map({ v: 0 }),
- * Map({ v: 2 })
- * ])
- * const groupsOfMaps = listOfMaps.groupBy(x => x.get('v'))
- * // Map {
- * // 0: List [ Map{ "v": 0 }, Map { "v": 0 } ],
- * // 1: List [ Map{ "v": 1 }, Map { "v": 1 } ],
- * // 2: List [ Map{ "v": 2 } ],
- * // }
- * ```
- */
- groupBy<G>(
- grouper: (value: V, key: K, iter: this) => G,
- context?: any
- ): /*Map*/Seq.Keyed<G, /*this*/Collection$1<K, V>>;
-
-
- // Side effects
-
- /**
- * The `sideEffect` is executed for every entry in the Collection.
- *
- * Unlike `Array#forEach`, if any call of `sideEffect` returns
- * `false`, the iteration will stop. Returns the number of entries iterated
- * (including the last iteration which returned false).
- */
- forEach(
- sideEffect: (value: V, key: K, iter: this) => any,
- context?: any
- ): number;
-
-
- // Creating subsets
-
- /**
- * Returns a new Collection of the same type representing a portion of this
- * Collection from start up to but not including end.
- *
- * If begin is negative, it is offset from the end of the Collection. e.g.
- * `slice(-2)` returns a Collection of the last two entries. If it is not
- * provided the new Collection will begin at the beginning of this Collection.
- *
- * If end is negative, it is offset from the end of the Collection. e.g.
- * `slice(0, -1)` returns a Collection of everything but the last entry. If
- * it is not provided, the new Collection will continue through the end of
- * this Collection.
- *
- * If the requested slice is equivalent to the current Collection, then it
- * will return itself.
- */
- slice(begin?: number, end?: number): this;
-
- /**
- * Returns a new Collection of the same type containing all entries except
- * the first.
- */
- rest(): this;
-
- /**
- * Returns a new Collection of the same type containing all entries except
- * the last.
- */
- butLast(): this;
-
- /**
- * Returns a new Collection of the same type which excludes the first `amount`
- * entries from this Collection.
- */
- skip(amount: number): this;
-
- /**
- * Returns a new Collection of the same type which excludes the last `amount`
- * entries from this Collection.
- */
- skipLast(amount: number): this;
-
- /**
- * Returns a new Collection of the same type which includes entries starting
- * from when `predicate` first returns false.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { List } = require('immutable')
- * List([ 'dog', 'frog', 'cat', 'hat', 'god' ])
- * .skipWhile(x => x.match(/g/))
- * // List [ "cat", "hat", "god"" ]
- * ```
- */
- skipWhile(
- predicate: (value: V, key: K, iter: this) => boolean,
- context?: any
- ): this;
-
- /**
- * Returns a new Collection of the same type which includes entries starting
- * from when `predicate` first returns true.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { List } = require('immutable')
- * List([ 'dog', 'frog', 'cat', 'hat', 'god' ])
- * .skipUntil(x => x.match(/hat/))
- * // List [ "hat", "god"" ]
- * ```
- */
- skipUntil(
- predicate: (value: V, key: K, iter: this) => boolean,
- context?: any
- ): this;
-
- /**
- * Returns a new Collection of the same type which includes the first `amount`
- * entries from this Collection.
- */
- take(amount: number): this;
-
- /**
- * Returns a new Collection of the same type which includes the last `amount`
- * entries from this Collection.
- */
- takeLast(amount: number): this;
-
- /**
- * Returns a new Collection of the same type which includes entries from this
- * Collection as long as the `predicate` returns true.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { List } = require('immutable')
- * List([ 'dog', 'frog', 'cat', 'hat', 'god' ])
- * .takeWhile(x => x.match(/o/))
- * // List [ "dog", "frog" ]
- * ```
- */
- takeWhile(
- predicate: (value: V, key: K, iter: this) => boolean,
- context?: any
- ): this;
-
- /**
- * Returns a new Collection of the same type which includes entries from this
- * Collection as long as the `predicate` returns false.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { List } = require('immutable')
- * List([ 'dog', 'frog', 'cat', 'hat', 'god' ])
- * .takeUntil(x => x.match(/at/))
- * // List [ "dog", "frog" ]
- * ```
- */
- takeUntil(
- predicate: (value: V, key: K, iter: this) => boolean,
- context?: any
- ): this;
-
-
- // Combination
-
- /**
- * Returns a new Collection of the same type with other values and
- * collection-like concatenated to this one.
- *
- * For Seqs, all entries will be present in the resulting Seq, even if they
- * have the same key.
- */
- concat(...valuesOrCollections: Array<any>): Collection$1<any, any>;
-
- /**
- * Flattens nested Collections.
- *
- * Will deeply flatten the Collection by default, returning a Collection of the
- * same type, but a `depth` can be provided in the form of a number or
- * boolean (where true means to shallowly flatten one level). A depth of 0
- * (or shallow: false) will deeply flatten.
- *
- * Flattens only others Collection, not Arrays or Objects.
- *
- * Note: `flatten(true)` operates on Collection<any, Collection<K, V>> and
- * returns Collection<K, V>
- */
- flatten(depth?: number): Collection$1<any, any>;
- flatten(shallow?: boolean): Collection$1<any, any>;
-
- /**
- * Flat-maps the Collection, returning a Collection of the same type.
- *
- * Similar to `collection.map(...).flatten(true)`.
- */
- flatMap<M>(
- mapper: (value: V, key: K, iter: this) => Iterable<M>,
- context?: any
- ): Collection$1<K, M>;
-
- /**
- * Flat-maps the Collection, returning a Collection of the same type.
- *
- * Similar to `collection.map(...).flatten(true)`.
- * Used for Dictionaries only.
- */
- flatMap<KM, VM>(
- mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
- context?: any
- ): Collection$1<KM, VM>;
-
- // Reducing a value
-
- /**
- * Reduces the Collection to a value by calling the `reducer` for every entry
- * in the Collection and passing along the reduced value.
- *
- * If `initialReduction` is not provided, the first item in the
- * Collection will be used.
- *
- * @see `Array#reduce`.
- */
- reduce<R>(
- reducer: (reduction: R, value: V, key: K, iter: this) => R,
- initialReduction: R,
- context?: any
- ): R;
- reduce<R>(
- reducer: (reduction: V | R, value: V, key: K, iter: this) => R
- ): R;
-
- /**
- * Reduces the Collection in reverse (from the right side).
- *
- * Note: Similar to this.reverse().reduce(), and provided for parity
- * with `Array#reduceRight`.
- */
- reduceRight<R>(
- reducer: (reduction: R, value: V, key: K, iter: this) => R,
- initialReduction: R,
- context?: any
- ): R;
- reduceRight<R>(
- reducer: (reduction: V | R, value: V, key: K, iter: this) => R
- ): R;
-
- /**
- * True if `predicate` returns true for all entries in the Collection.
- */
- every(
- predicate: (value: V, key: K, iter: this) => boolean,
- context?: any
- ): boolean;
-
- /**
- * True if `predicate` returns true for any entry in the Collection.
- */
- some(
- predicate: (value: V, key: K, iter: this) => boolean,
- context?: any
- ): boolean;
-
- /**
- * Joins values together as a string, inserting a separator between each.
- * The default separator is `","`.
- */
- join(separator?: string): string;
-
- /**
- * Returns true if this Collection includes no values.
- *
- * For some lazy `Seq`, `isEmpty` might need to iterate to determine
- * emptiness. At most one iteration will occur.
- */
- isEmpty(): boolean;
-
- /**
- * Returns the size of this Collection.
- *
- * Regardless of if this Collection can describe its size lazily (some Seqs
- * cannot), this method will always return the correct size. E.g. it
- * evaluates a lazy `Seq` if necessary.
- *
- * If `predicate` is provided, then this returns the count of entries in the
- * Collection for which the `predicate` returns true.
- */
- count(): number;
- count(
- predicate: (value: V, key: K, iter: this) => boolean,
- context?: any
- ): number;
-
- /**
- * Returns a `Seq.Keyed` of counts, grouped by the return value of
- * the `grouper` function.
- *
- * Note: This is not a lazy operation.
- */
- countBy<G>(
- grouper: (value: V, key: K, iter: this) => G,
- context?: any
- ): Map$1<G, number>;
-
-
- // Search for value
-
- /**
- * Returns the first value for which the `predicate` returns true.
- */
- find(
- predicate: (value: V, key: K, iter: this) => boolean,
- context?: any,
- notSetValue?: V
- ): V | undefined;
-
- /**
- * Returns the last value for which the `predicate` returns true.
- *
- * Note: `predicate` will be called for each entry in reverse.
- */
- findLast(
- predicate: (value: V, key: K, iter: this) => boolean,
- context?: any,
- notSetValue?: V
- ): V | undefined;
-
- /**
- * Returns the first [key, value] entry for which the `predicate` returns true.
- */
- findEntry(
- predicate: (value: V, key: K, iter: this) => boolean,
- context?: any,
- notSetValue?: V
- ): [K, V] | undefined;
-
- /**
- * Returns the last [key, value] entry for which the `predicate`
- * returns true.
- *
- * Note: `predicate` will be called for each entry in reverse.
- */
- findLastEntry(
- predicate: (value: V, key: K, iter: this) => boolean,
- context?: any,
- notSetValue?: V
- ): [K, V] | undefined;
-
- /**
- * Returns the key for which the `predicate` returns true.
- */
- findKey(
- predicate: (value: V, key: K, iter: this) => boolean,
- context?: any
- ): K | undefined;
-
- /**
- * Returns the last key for which the `predicate` returns true.
- *
- * Note: `predicate` will be called for each entry in reverse.
- */
- findLastKey(
- predicate: (value: V, key: K, iter: this) => boolean,
- context?: any
- ): K | undefined;
-
- /**
- * Returns the key associated with the search value, or undefined.
- */
- keyOf(searchValue: V): K | undefined;
-
- /**
- * Returns the last key associated with the search value, or undefined.
- */
- lastKeyOf(searchValue: V): K | undefined;
-
- /**
- * Returns the maximum value in this collection. If any values are
- * comparatively equivalent, the first one found will be returned.
- *
- * The `comparator` is used in the same way as `Collection#sort`. If it is not
- * provided, the default comparator is `>`.
- *
- * When two values are considered equivalent, the first encountered will be
- * returned. Otherwise, `max` will operate independent of the order of input
- * as long as the comparator is commutative. The default comparator `>` is
- * commutative *only* when types do not differ.
- *
- * If `comparator` returns 0 and either value is NaN, undefined, or null,
- * that value will be returned.
- */
- max(comparator?: (valueA: V, valueB: V) => number): V | undefined;
-
- /**
- * Like `max`, but also accepts a `comparatorValueMapper` which allows for
- * comparing by more sophisticated means:
- *
- * hitters.maxBy(hitter => hitter.avgHits);
- *
- */
- maxBy<C>(
- comparatorValueMapper: (value: V, key: K, iter: this) => C,
- comparator?: (valueA: C, valueB: C) => number
- ): V | undefined;
-
- /**
- * Returns the minimum value in this collection. If any values are
- * comparatively equivalent, the first one found will be returned.
- *
- * The `comparator` is used in the same way as `Collection#sort`. If it is not
- * provided, the default comparator is `<`.
- *
- * When two values are considered equivalent, the first encountered will be
- * returned. Otherwise, `min` will operate independent of the order of input
- * as long as the comparator is commutative. The default comparator `<` is
- * commutative *only* when types do not differ.
- *
- * If `comparator` returns 0 and either value is NaN, undefined, or null,
- * that value will be returned.
- */
- min(comparator?: (valueA: V, valueB: V) => number): V | undefined;
-
- /**
- * Like `min`, but also accepts a `comparatorValueMapper` which allows for
- * comparing by more sophisticated means:
- *
- * hitters.minBy(hitter => hitter.avgHits);
- *
- */
- minBy<C>(
- comparatorValueMapper: (value: V, key: K, iter: this) => C,
- comparator?: (valueA: C, valueB: C) => number
- ): V | undefined;
-
-
- // Comparison
-
- /**
- * True if `iter` includes every value in this Collection.
- */
- isSubset(iter: Iterable<V>): boolean;
-
- /**
- * True if this Collection includes every value in `iter`.
- */
- isSuperset(iter: Iterable<V>): boolean;
- }
-
- /**
- * The interface to fulfill to qualify as a Value Object.
- */
- interface ValueObject {
- /**
- * True if this and the other Collection have value equality, as defined
- * by `Immutable.is()`.
- *
- * Note: This is equivalent to `Immutable.is(this, other)`, but provided to
- * allow for chained expressions.
- */
- equals(other: any): boolean;
-
- /**
- * Computes and returns the hashed identity for this Collection.
- *
- * The `hashCode` of a Collection is used to determine potential equality,
- * and is used when adding this to a `Set` or as a key in a `Map`, enabling
- * lookup via a different instance.
- *
- * <!-- runkit:activate -->
- * ```js
- * const { List, Set } = require('immutable');
- * const a = List([ 1, 2, 3 ]);
- * const b = List([ 1, 2, 3 ]);
- * assert.notStrictEqual(a, b); // different instances
- * const set = Set([ a ]);
- * assert.equal(set.has(b), true);
- * ```
- *
- * Note: hashCode() MUST return a Uint32 number. The easiest way to
- * guarantee this is to return `myHash | 0` from a custom implementation.
- *
- * If two values have the same `hashCode`, they are [not guaranteed
- * to be equal][Hash Collision]. If two values have different `hashCode`s,
- * they must not be equal.
- *
- * Note: `hashCode()` is not guaranteed to always be called before
- * `equals()`. Most but not all Immutable.js collections use hash codes to
- * organize their internal data structures, while all Immutable.js
- * collections use equality during lookups.
- *
- * [Hash Collision]: http://en.wikipedia.org/wiki/Collision_(computer_science)
- */
- hashCode(): number;
- }
-
- type IFunction<T = void> = (...args: Array<any>) => T;
- type IObject$1 = Record<string, any>;
- type Without<T, U> = {
- [P in Exclude<keyof T, keyof U>]?: never;
- };
- type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
- type Class<T> = new (...args: Array<any>) => T;
-
- declare const TransformationMatrix_base: Record$1.Factory<{
- a: number;
- b: number;
- c: number;
- d: number;
- e: number;
- f: number;
- }>;
- declare class TransformationMatrix extends TransformationMatrix_base {
- a: number;
- b: number;
- c: number;
- d: number;
- e: number;
- f: number;
- static defaultValues: IObject$1;
- static IDENTITY: TransformationMatrix;
- translate({ x: tx, y: ty }: {
- x: number;
- y: number;
- }): TransformationMatrix;
- translateX(tx: number): TransformationMatrix;
- translateY(ty: number): TransformationMatrix;
- scale(sx: number, sy?: number): TransformationMatrix;
- transform(a2: number, b2: number, c2: number, d2: number, e2: number, f2: number): TransformationMatrix;
- rotate(degCW: number): TransformationMatrix;
- rotateRad(a: number): TransformationMatrix;
- inverse(): TransformationMatrix;
- toCssValue(): string;
- applyToPoint([x, y]: [number, number]): [number, number];
- applyToVector([x, y]: [number, number]): [number, number];
- }
-
- interface PointCtorProps {
- x?: number;
- y?: number;
- [k: string]: unknown;
- }
- declare const Point_base: Record$1.Factory<PointCtorProps>;
- declare class Point extends Point_base {
- x: number;
- y: number;
- static defaultValues: IObject$1;
- constructor(options?: PointCtorProps);
- scale(sx: number, sy?: number): this;
- translate({ x: tx, y: ty }: {
- x: number;
- y: number;
- }): this;
- translateX(tx: number): this;
- translateY(ty: number): this;
- distance(other: this): number;
- rotate(deg: number): this;
- apply(matrix: TransformationMatrix): this;
- }
-
- interface IDrawingPoint extends PointCtorProps {
- intensity?: number;
- }
- declare class DrawingPoint extends Point {
- intensity: number;
- static defaultValues: IObject$1;
- constructor(options?: IDrawingPoint);
- }
-
- interface ISize {
- width: number;
- height: number;
- }
- declare const Size_base: Record$1.Factory<ISize>;
- declare class Size extends Size_base {
- scale(factor: number): Size;
- ceil(): Size;
- floor(): Size;
- swapDimensions(): Size;
- apply(matrix: TransformationMatrix): Size;
- }
-
- interface IRect {
- left?: number;
- top?: number;
- width?: number;
- height?: number;
- }
- declare const Rect_base: Record$1.Factory<IRect>;
- declare class Rect extends Rect_base {
- left: number;
- top: number;
- width: number;
- height: number;
- static defaultValues: IObject$1;
- constructor(options?: IRect);
- get right(): number;
- get bottom(): number;
- static fromClientRect({ top, left, width, height }: ClientRect): Rect;
- static union(rects: List<Rect>): Rect;
- static getCenteredRect(inner: Size, outer: Size): Rect;
- static fromInset(inset: Inset): Rect;
- static fromPoints(...points: Point[]): Rect;
- expandToIncludePoints(...points: Point[]): Rect;
- static areRectsCloserThan(a: Rect, b: Rect, distance: number): boolean;
- static areVerticallyAligned(a: Rect, b: Rect, thresholdDistance: number): boolean;
- translate({ x: tx, y: ty }: Point): Rect;
- translateX(tx: number): Rect;
- translateY(ty: number): Rect;
- scale(sx: number, sy?: number): Rect;
- grow(growth: number): Rect;
- getLocation(): Point;
- getSize(): Size;
- getCenter(): Point;
- setLocation(location: Point): Rect;
- roundOverlap(): Rect;
- round(): Rect;
- isPointInside(point: Point): boolean;
- isRectInside(other: Rect): boolean;
- isRectOverlapping(other: Rect): boolean;
- normalize(): Rect;
- apply(matrix: TransformationMatrix): Rect;
- }
-
- interface IInset {
- left: number;
- top: number;
- right: number;
- bottom: number;
- }
- declare const Inset_base: Record$1.Factory<IInset>;
- declare class Inset extends Inset_base {
- static applyToRect(inset: Inset, rect: Rect): Rect;
- static fromRect(rect: Rect): Inset;
- static fromValue(insetValue: number): Inset;
- apply(matrix: TransformationMatrix): Inset;
- setScale(scale: number): Inset;
- }
- type InsetJSON = [left: number, top: number, right: number, bottom: number];
-
- type ActionCtorProps = {
- subActions?: List<Action> | null;
- };
- declare abstract class Action extends InheritableImmutableRecord<ActionCtorProps> {
- subActions?: List<Action> | null | undefined;
- protected constructor(args?: ActionCtorProps);
- }
-
- type ActionTriggerEventType = 'onPointerEnter' | 'onPointerLeave' | 'onPointerDown' | 'onPointerUp' | 'onPageOpen' | 'onPageClose' | 'onPageVisible' | 'onPageHidden';
-
- interface IGoToAction extends ActionCtorProps {
- pageIndex?: number;
- }
- declare class GoToAction extends Action {
- pageIndex: number;
- static defaultValues: IObject$1;
- constructor(args?: IGoToAction);
- }
-
- interface IGoToEmbeddedAction extends ActionCtorProps {
- newWindow?: boolean;
- relativePath?: string;
- targetType?: 'parent' | 'child';
- }
- declare class GoToEmbeddedAction extends Action {
- newWindow: boolean;
- relativePath: string;
- targetType: 'parent' | 'child';
- static defaultValues: IObject$1;
- constructor(args?: IGoToEmbeddedAction);
- }
-
- interface IGoToRemoteAction extends ActionCtorProps {
- relativePath?: string;
- namedDestination?: string;
- }
- declare class GoToRemoteAction extends Action {
- relativePath: string;
- namedDestination: string;
- static defaultValues: IObject$1;
- constructor(args?: IGoToRemoteAction);
- }
-
- type AnnotationReference = {
- fieldName: string;
- } | {
- pdfObjectId: number;
- };
- interface IHideAction extends ActionCtorProps {
- hide?: boolean;
- annotationReferences?: List<AnnotationReference>;
- }
- declare class HideAction extends Action {
- hide: boolean;
- annotationReferences: List<AnnotationReference>;
- static defaultValues: IObject$1;
- constructor(args?: IHideAction);
- }
-
- interface IJavaScriptAction extends ActionCtorProps {
- script?: string;
- }
- declare class JavaScriptAction extends Action {
- script: string;
- static defaultValues: IObject$1;
- constructor(args?: IJavaScriptAction);
- }
-
- interface ILaunchAction extends ActionCtorProps {
- filePath?: string;
- }
- declare class LaunchAction extends Action {
- filePath: string;
- static defaultValues: IObject$1;
- constructor(args?: ILaunchAction);
- }
-
- interface INamedAction extends ActionCtorProps {
- action?: string;
- }
- declare class NamedAction extends Action {
- action: string;
- static defaultValues: IObject$1;
- constructor(args?: INamedAction);
- }
-
- interface IResetFormAction extends ActionCtorProps {
- fields?: List<string> | null | undefined;
- includeExclude?: boolean;
- }
- declare class ResetFormAction extends Action {
- fields: List<string> | null | undefined;
- includeExclude: boolean;
- static defaultValues: IObject$1;
- constructor(args?: IResetFormAction);
- }
-
- interface ISubmitFormAction extends ActionCtorProps {
- uri?: string;
- fields?: List<string>;
- includeExclude?: boolean;
- includeNoValueFields?: boolean;
- exportFormat?: boolean;
- getMethod?: boolean;
- submitCoordinated?: boolean;
- xfdf?: boolean;
- includeAppendSaves?: boolean;
- includeAnnotations?: boolean;
- submitPDF?: boolean;
- canonicalFormat?: boolean;
- excludeNonUserAnnotations?: boolean;
- excludeFKey?: boolean;
- embedForm?: boolean;
- }
- declare class SubmitFormAction extends Action {
- uri: string;
- fields: List<string> | null | undefined;
- includeExclude: boolean;
- includeNoValueFields: boolean;
- exportFormat: boolean;
- getMethod: boolean;
- submitCoordinated: boolean;
- xfdf: boolean;
- includeAppendSaves: boolean;
- includeAnnotations: boolean;
- submitPDF: boolean;
- canonicalFormat: boolean;
- excludeNonUserAnnotations: boolean;
- excludeFKey: boolean;
- embedForm: boolean;
- static defaultValues: IObject$1;
- constructor(args?: ISubmitFormAction);
- }
-
- interface IURIAction extends ActionCtorProps {
- uri?: string;
- }
- declare class URIAction extends Action {
- uri: string;
- static defaultValues: IObject$1;
- constructor(args?: IURIAction);
- }
-
- declare const Color_base: Record$1.Factory<{
- r: number;
- g: number;
- b: number;
- transparent: boolean;
- }>;
- declare class Color$2 extends Color_base {
- static BLACK: Color$2;
- static GREY: Color$2;
- static WHITE: Color$2;
- static DARK_BLUE: Color$2;
- static RED: Color$2;
- static PURPLE: Color$2;
- static PINK: Color$2;
- static GREEN: Color$2;
- static ORANGE: Color$2;
- static YELLOW: Color$2;
- static LIGHT_BLUE: Color$2;
- static LIGHT_RED: Color$2;
- static LIGHT_GREEN: Color$2;
- static LIGHT_YELLOW: Color$2;
- static BLUE: Color$2;
- static LIGHT_ORANGE: Color$2;
- static LIGHT_GREY: Color$2;
- static DARK_GREY: Color$2;
- static MAUVE: Color$2;
- static TRANSPARENT: Color$2;
- static fromHex: (hexColor: string) => Color$2;
- constructor(args: {
- r?: number;
- g?: number;
- b?: number;
- transparent?: boolean;
- });
- lighter(percent: number): Color$2;
- darker(percent: number): Color$2;
- equals(color: Color$2 | {
- r: number;
- g: number;
- b: number;
- transparent: boolean;
- }): boolean;
- saturate(percent: number): Color$2;
- sRGBToRGBComponent(RGBComponent: number): number;
- relativeLuminance(): number;
- contrastRatio(color: Color$2): number;
- toCSSValue(): string;
- toHex(): string;
- }
-
- declare const BlendMode: {
- readonly normal: "normal";
- readonly multiply: "multiply";
- readonly screen: "screen";
- readonly overlay: "overlay";
- readonly darken: "darken";
- readonly lighten: "lighten";
- readonly colorDodge: "colorDodge";
- readonly colorBurn: "colorBurn";
- readonly hardLight: "hardLight";
- readonly softLight: "softLight";
- readonly difference: "difference";
- readonly exclusion: "exclusion";
- };
- type IBlendMode = (typeof BlendMode)[keyof typeof BlendMode];
-
- interface ITextMarkupAnnotation extends AnnotationProperties {
- rects: List<Rect>;
- color: Color$2;
- blendMode: IBlendMode;
- }
- declare class TextMarkupAnnotation<T extends ITextMarkupAnnotation = ITextMarkupAnnotation> extends Annotation<T> {
- rects: List<Rect>;
- color: Color$2;
- blendMode: IBlendMode;
- static defaultValues: IObject$1;
- static readableName: string;
- }
-
- interface IHighlightAnnotation extends ITextMarkupAnnotation {
- color: Color$2;
- blendMode: IBlendMode | 'multiply';
- }
- declare class HighlightAnnotation<T extends IHighlightAnnotation = IHighlightAnnotation> extends TextMarkupAnnotation<T> {
- blendMode: IBlendMode;
- static className: string;
- static readableName: string;
- static defaultValues: IObject$1;
- }
-
- interface IImageAnnotation extends AnnotationProperties {
- description: string | null;
- fileName: string | null;
- contentType: string | null;
- imageAttachmentId: string | null;
- isSignature: boolean;
- xfdfAppearanceStream: string | null;
- xfdfAppearanceStreamOriginalPageRotation: number | null;
- }
- declare class ImageAnnotation<T extends IImageAnnotation = IImageAnnotation> extends Annotation<T> {
- description: null | string;
- fileName: null | string;
- contentType: string;
- imageAttachmentId: string;
- isSignature: boolean;
- xfdfAppearanceStream: null | string;
- xfdfAppearanceStreamOriginalPageRotation: null | number;
- static defaultValues: IObject$1;
- static readableName: string;
- }
-
- interface IInkAnnotation extends AnnotationProperties {
- lines: List<List<DrawingPoint>>;
- lineWidth: number | null;
- strokeColor: Color$2 | null;
- backgroundColor: Color$2 | null;
- isDrawnNaturally: boolean;
- isSignature: boolean;
- }
- declare class InkAnnotation<T extends IInkAnnotation = IInkAnnotation> extends Annotation<T> {
- lines: List<List<DrawingPoint>>;
- lineWidth: number;
- strokeColor: Color$2 | null;
- backgroundColor: Color$2 | null;
- isDrawnNaturally: boolean;
- isSignature: boolean;
- static defaultValues: IObject$1;
- static readableName: string;
- }
-
- declare const MeasurementPrecision: {
- readonly WHOLE: "whole";
- readonly ONE: "oneDp";
- readonly TWO: "twoDp";
- readonly THREE: "threeDp";
- readonly FOUR: "fourDp";
- readonly HALVES: "1/2";
- readonly QUARTERS: "1/4";
- readonly EIGHTHS: "1/8";
- readonly SIXTEENTHS: "1/16";
- };
- type IMeasurementPrecision = (typeof MeasurementPrecision)[keyof typeof MeasurementPrecision];
-
- declare const MeasurementScaleUnitFrom: {
- readonly INCHES: "in";
- readonly MILLIMETERS: "mm";
- readonly CENTIMETERS: "cm";
- readonly POINTS: "pt";
- };
- type IMeasurementScaleUnitFrom = (typeof MeasurementScaleUnitFrom)[keyof typeof MeasurementScaleUnitFrom];
-
- declare const MeasurementScaleUnitTo: {
- readonly INCHES: "in";
- readonly MILLIMETERS: "mm";
- readonly CENTIMETERS: "cm";
- readonly POINTS: "pt";
- readonly FEET: "ft";
- readonly METERS: "m";
- readonly YARDS: "yd";
- readonly KILOMETERS: "km";
- readonly MILES: "mi";
- };
- type IMeasurementScaleUnitTo = (typeof MeasurementScaleUnitTo)[keyof typeof MeasurementScaleUnitTo];
-
- interface IMeasurementScale {
- unitFrom: IMeasurementScaleUnitFrom;
- unitTo: IMeasurementScaleUnitTo;
- fromValue: number;
- toValue: number;
- }
- declare const MeasurementScale_base: Record$1.Factory<IMeasurementScale>;
- declare class MeasurementScale extends MeasurementScale_base {
- }
-
- interface IShapeAnnotation extends AnnotationProperties {
- strokeDashArray: [number, number] | null;
- strokeWidth: number | null;
- strokeColor: Color$2 | null;
- fillColor: Color$2 | null;
- measurementScale: MeasurementScale | null;
- measurementPrecision: IMeasurementPrecision | null;
- }
- declare abstract class ShapeAnnotation<T extends IShapeAnnotation = IShapeAnnotation> extends Annotation<T> {
- strokeDashArray: null | [number, number];
- strokeWidth: number;
- strokeColor: null | Color$2;
- fillColor: null | Color$2;
- measurementPrecision: null | IMeasurementPrecision;
- measurementScale: null | MeasurementScale;
- static readableName: string;
- static defaultValues: IObject$1;
- isMeasurement(): boolean;
- getMeasurementDetails: () => {
- value: number;
- label: string;
- };
- }
-
- declare const LineCap: {
- readonly square: "square";
- readonly circle: "circle";
- readonly diamond: "diamond";
- readonly openArrow: "openArrow";
- readonly closedArrow: "closedArrow";
- readonly butt: "butt";
- readonly reverseOpenArrow: "reverseOpenArrow";
- readonly reverseClosedArrow: "reverseClosedArrow";
- readonly slash: "slash";
- };
- type ILineCap = (typeof LineCap)[keyof typeof LineCap];
- type LineCapsType = {
- start?: ILineCap | null;
- end?: ILineCap | null;
- };
-
- interface ILineAnnotation extends IShapeAnnotation {
- startPoint: Point | null;
- endPoint: Point | null;
- lineCaps: LineCapsType | null;
- points: List<Point> | null;
- }
- declare class LineAnnotation<T extends ILineAnnotation = ILineAnnotation> extends ShapeAnnotation<T> {
- startPoint: Point;
- endPoint: Point;
- lineCaps: LineCapsType | null;
- points: List<Point> | null;
- static defaultValues: IObject$1;
- static readableName: string;
- }
-
- interface IRectangleAnnotation extends IShapeAnnotation {
- cloudyBorderIntensity?: number | null;
- cloudyBorderInset?: Inset | null;
- }
- declare class RectangleAnnotation<T extends IRectangleAnnotation = IRectangleAnnotation> extends ShapeAnnotation<T> {
- cloudyBorderIntensity: null | number;
- cloudyBorderInset: null | Inset;
- measurementBBox: null | Rect;
- static defaultValues: IObject$1;
- static readableName: string;
- constructor(options?: Partial<T>);
- }
-
- interface IEllipseAnnotation extends IShapeAnnotation {
- cloudyBorderIntensity?: number | null;
- cloudyBorderInset?: Inset | null;
- }
- declare class EllipseAnnotation<T extends IEllipseAnnotation = IEllipseAnnotation> extends ShapeAnnotation<T> {
- cloudyBorderIntensity: null | number;
- cloudyBorderInset: null | Inset;
- measurementBBox: null | Rect;
- static defaultValues: IObject$1;
- static readableName: string;
- constructor(options?: Partial<T>);
- }
-
- interface IPolygonAnnotation extends IShapeAnnotation {
- points: List<Point> | null;
- cloudyBorderIntensity: number | null;
- }
- declare class PolygonAnnotation<T extends IPolygonAnnotation = IPolygonAnnotation> extends ShapeAnnotation<T> {
- points: List<Point>;
- cloudyBorderIntensity: null | number;
- static defaultValues: IObject$1;
- static readableName: string;
- }
-
- interface IPolyLineAnnotation extends IShapeAnnotation {
- points: List<Point> | null;
- lineCaps: LineCapsType | null;
- }
- declare class PolylineAnnotation<T extends IPolyLineAnnotation = IPolyLineAnnotation> extends ShapeAnnotation<T> {
- points: List<Point>;
- lineCaps: null | LineCapsType;
- static defaultValues: IObject$1;
- static readableName: string;
- }
-
- declare const BorderStyle: {
- readonly solid: "solid";
- readonly dashed: "dashed";
- readonly beveled: "beveled";
- readonly inset: "inset";
- readonly underline: "underline";
- };
- type IBorderStyle = (typeof BorderStyle)[keyof typeof BorderStyle];
-
- interface ILinkAnnotation extends AnnotationProperties {
- action: Action | null;
- borderColor: Color$2 | null;
- borderStyle: IBorderStyle | null;
- borderWidth: number | null;
- }
- declare class LinkAnnotation<T extends ILinkAnnotation = ILinkAnnotation> extends Annotation<T> {
- action: Action;
- borderColor: null | Color$2;
- borderStyle: null | IBorderStyle;
- borderWidth: null | number;
- static readableName: string;
- static defaultValues: IObject$1;
- }
-
- declare const NoteIcon: {
- readonly COMMENT: "COMMENT";
- readonly RIGHT_POINTER: "RIGHT_POINTER";
- readonly RIGHT_ARROW: "RIGHT_ARROW";
- readonly CHECK: "CHECK";
- readonly CIRCLE: "CIRCLE";
- readonly CROSS: "CROSS";
- readonly INSERT: "INSERT";
- readonly NEW_PARAGRAPH: "NEW_PARAGRAPH";
- readonly NOTE: "NOTE";
- readonly PARAGRAPH: "PARAGRAPH";
- readonly HELP: "HELP";
- readonly STAR: "STAR";
- readonly KEY: "KEY";
- };
- type INoteIcon = (typeof NoteIcon)[keyof typeof NoteIcon];
-
- interface INoteAnnotation extends AnnotationProperties {
- text: {
- format: 'plain';
- value: string;
- };
- icon: string | INoteIcon;
- color: Color$2;
- }
- declare class NoteAnnotation<T extends INoteAnnotation = INoteAnnotation> extends Annotation<T> {
- text: {
- format: 'plain';
- value: string;
- };
- icon: INoteIcon;
- color: Color$2;
- static isEditable: boolean;
- static readableName: string;
- static defaultValues: IObject$1;
- }
-
- interface ISquiggleAnnotation extends ITextMarkupAnnotation {
- color: Color$2;
- }
- declare class SquiggleAnnotation<T extends ISquiggleAnnotation = ISquiggleAnnotation> extends TextMarkupAnnotation<T> {
- static className: string;
- static readableName: string;
- static defaultValues: IObject$1;
- }
-
- interface IStrikeOutAnnotation extends ITextMarkupAnnotation {
- color: Color$2;
- }
- declare class StrikeOutAnnotation<T extends IStrikeOutAnnotation = IStrikeOutAnnotation> extends TextMarkupAnnotation<T> {
- static className: string;
- static readableName: string;
- static defaultValues: IObject$1;
- }
-
- type ICallout = {
- start: Point | null;
- knee: Point | null;
- end: Point | null;
- cap: ILineCap | null;
- innerRectInset: Inset | null;
- };
- declare class Callout extends InheritableImmutableRecord<ICallout> {
- start: Point | null;
- knee: Point | null;
- end: Point | null;
- cap: ILineCap | null;
- innerRectInset: Inset | null;
- static defaultValues: {
- start: null;
- knee: null;
- end: null;
- cap: null;
- innerRectInset: null;
- };
- }
-
- interface ITextAnnotation extends AnnotationProperties {
- text: {
- format: 'plain' | 'xhtml';
- value: string | null;
- };
- fontColor: Color$2 | null;
- backgroundColor: Color$2 | null;
- font: string;
- fontSize: number | null;
- isBold: boolean | null;
- isItalic: boolean | null;
- horizontalAlign: 'left' | 'center' | 'right';
- verticalAlign: 'top' | 'center' | 'bottom';
- callout: Callout | null;
- borderStyle: IBorderStyle | null;
- borderWidth: number | null;
- borderColor: Color$2 | null;
- isFitting: boolean;
- lineHeightFactor: number | null;
- }
- declare class TextAnnotation<T extends ITextAnnotation = ITextAnnotation> extends Annotation<T> {
- text: {
- format: 'plain' | 'xhtml';
- value: string;
- };
- fontColor: null | Color$2;
- backgroundColor: null | Color$2;
- font: string;
- fontSize: number;
- isBold: boolean;
- isItalic: boolean;
- horizontalAlign: 'left' | 'center' | 'right';
- verticalAlign: 'top' | 'center' | 'bottom';
- isFitting: boolean;
- callout: null | Callout;
- borderStyle: null | IBorderStyle;
- borderWidth: null | number;
- borderColor: Color$2 | null;
- lineHeightFactor: null | number;
- static defaultValues: IObject$1;
- static readonly isEditable = true;
- static readonly readableName = "Text";
- static readonly fontSizePresets: readonly number[];
- }
-
- interface IUnderlineAnnotation extends ITextMarkupAnnotation {
- color: Color$2;
- }
- declare class UnderlineAnnotation<T extends IUnderlineAnnotation = IUnderlineAnnotation> extends TextMarkupAnnotation<T> {
- static className: string;
- static readableName: string;
- static defaultValues: IObject$1;
- }
-
- declare class UnknownAnnotation extends Annotation {
- }
-
- type FontSize = 'auto' | number;
- type WidgetActionTriggerEventType = ActionTriggerEventType | 'onFocus' | 'onBlur';
- type WidgetAnnotationAdditionalActionsType = {
- onFocus?: JavaScriptAction;
- onBlur?: JavaScriptAction;
- onChange?: JavaScriptAction;
- onFormat?: JavaScriptAction;
- onInput?: JavaScriptAction;
- onPointerDown?: Action;
- onPointerUp?: Action;
- onPointerEnter?: Action;
- onPointerLeave?: Action;
- };
- interface IWidgetAnnotation extends AnnotationProperties {
- formFieldName: string | null;
- borderColor: Color$2 | null;
- borderStyle: IBorderStyle | null;
- borderDashArray: number[] | null;
- borderWidth: number | null;
- backgroundColor: Color$2 | null;
- fontSize: FontSize | null;
- font: string | null;
- fontColor: Color$2 | null;
- isBold: boolean | null;
- isItalic: boolean | null;
- horizontalAlign: 'left' | 'center' | 'right' | null;
- verticalAlign: 'top' | 'center' | 'bottom' | null;
- additionalActions: WidgetAnnotationAdditionalActionsType | null;
- rotation: number;
- lineHeightFactor: number | null;
- buttonIconUpdatedAt: number | null;
- }
- declare class WidgetAnnotation<T extends IWidgetAnnotation = IWidgetAnnotation> extends Annotation<T> {
- formFieldName: string;
- borderColor: null | Color$2;
- borderStyle: null | IBorderStyle;
- borderDashArray: null | number[];
- borderWidth: null | number;
- backgroundColor: null | Color$2;
- fontSize: null | FontSize;
- font: null | string;
- fontColor: null | Color$2;
- isBold: boolean;
- isItalic: boolean;
- horizontalAlign: 'left' | 'center' | 'right' | null;
- verticalAlign: 'top' | 'center' | 'bottom' | null;
- additionalActions: null | WidgetAnnotationAdditionalActionsType;
- rotation: number;
- lineHeightFactor: null | number;
- action: null | Action;
- buttonIconUpdatedAt: null | number;
- static defaultValues: IObject$1;
- static readableName: string;
- }
-
- declare class CommentMarkerAnnotation extends Annotation {
- static readableName: string;
- }
-
- interface IRedactionAnnotation extends ITextMarkupAnnotation {
- color: Color$2;
- fillColor: null | Color$2;
- overlayText: null | string;
- repeatOverlayText: null | boolean;
- outlineColor: null | Color$2;
- }
- declare class RedactionAnnotation<T extends IRedactionAnnotation = IRedactionAnnotation> extends TextMarkupAnnotation<T> {
- fillColor: null | Color$2;
- overlayText: null | string;
- repeatOverlayText: null | boolean;
- outlineColor: null | Color$2;
- color: Color$2;
- static readableName: string;
- static defaultValues: IObject$1;
- }
-
- interface IMediaAnnotation extends AnnotationProperties {
- description: null | string;
- fileName: null | string;
- contentType: string | null;
- mediaAttachmentId: string | null;
- }
- declare class MediaAnnotation<T extends IMediaAnnotation = IMediaAnnotation> extends Annotation<T> {
- description: null | string;
- fileName: null | string;
- contentType: string | null;
- mediaAttachmentId: string | null;
- static defaultValues: IObject$1;
- static readableName: string;
- }
-
- type SignatureInfo = {
- type: 'pspdfkit/signature-info';
- signatureType?: SignatureTypeType | null | undefined;
- signerName: string | null | undefined;
- creationDate: Date | null | undefined;
- signatureReason: string | null | undefined;
- signatureLocation: string | null | undefined;
- documentIntegrityStatus: DocumentIntegrityStatusType;
- certificateChainValidationStatus: CertificateChainValidationStatusType;
- signatureValidationStatus: SignatureValidationStatusType;
- isTrusted: boolean;
- isSelfSigned: boolean;
- isExpired: boolean;
- documentModifiedSinceSignature: boolean;
- signatureFormFQN: string;
- PAdESSignatureLevel?: PAdESLevelType | null;
- validFrom: string | null | undefined;
- validUntil: string | null | undefined;
- timestampInfo: {
- type: 'pspdfkit/timestamp-info';
- signerName: string | null | undefined;
- };
- ltv: boolean;
- };
- declare const DocumentIntegrityStatus: {
- readonly ok: "ok";
- readonly tampered_document: "tampered_document";
- readonly failed_to_retrieve_signature_contents: "failed_to_retrieve_signature_contents";
- readonly failed_to_retrieve_byterange: "failed_to_retrieve_byterange";
- readonly failed_to_compute_digest: "failed_to_compute_digest";
- readonly failed_retrieve_signing_certificate: "failed_retrieve_signing_certificate";
- readonly failed_retrieve_public_key: "failed_retrieve_public_key";
- readonly failed_encryption_padding: "failed_encryption_padding";
- readonly tampered_or_invalid_timestamp: "tampered_or_invalid_timestamp";
- readonly general_failure: "general_failure";
- };
- type DocumentIntegrityStatusType = (typeof DocumentIntegrityStatus)[keyof typeof DocumentIntegrityStatus];
- declare const CertificateChainValidationStatus: {
- readonly ok: "ok";
- readonly ok_but_self_signed: "ok_but_self_signed";
- readonly ok_but_could_not_check_revocation: "ok_but_could_not_check_revocation";
- readonly untrusted: "untrusted";
- readonly expired: "expired";
- readonly not_yet_valid: "not_yet_valid";
- readonly invalid: "invalid";
- readonly revoked: "revoked";
- readonly failed_to_retrieve_signature_contents: "failed_to_retrieve_signature_contents";
- readonly general_validation_problem: "general_validation_problem";
- };
- type CertificateChainValidationStatusType = (typeof CertificateChainValidationStatus)[keyof typeof CertificateChainValidationStatus];
- declare const SignatureValidationStatus: {
- readonly valid: "valid";
- readonly warning: "warning";
- readonly error: "error";
- };
- type SignatureValidationStatusType = (typeof SignatureValidationStatus)[keyof typeof SignatureValidationStatus];
- declare const SignatureType: {
- CMS: string;
- CAdES: string;
- };
- type SignatureTypeType = (typeof SignatureType)[keyof typeof SignatureType];
- declare const PAdESLevel: {
- readonly b_b: "b-b";
- readonly b_t: "b-t";
- readonly b_lt: "b-lt";
- };
- type PAdESLevelType = (typeof PAdESLevel)[keyof typeof PAdESLevel];
-
- type SignaturesInfo = {
- status: DocumentValidationStatusType;
- checkedAt: Date;
- signatures?: Array<SignatureInfo>;
- documentModifiedSinceSignature?: boolean;
- };
- declare const DocumentValidationStatus: {
- valid: string;
- warning: string;
- error: string;
- not_signed: string;
- };
- type DocumentValidationStatusType = keyof typeof DocumentValidationStatus;
-
- type Glyph = {
- c: string;
- rect: Rect;
- };
-
- type IAnnotationJSON = Omit<BaseAnnotationJSON, 'id' | 'group' | 'permissions'>;
- declare class AnnotationSerializer {
- static VERSION: number;
- annotation: AnnotationsUnion;
- constructor(annotation: AnnotationsUnion);
- toJSON(): Omit<BaseAnnotationJSON, 'type'>;
- static fromJSON(id: ID | null, json: IAnnotationJSON, options?: ICollaboratorPermissionsOptions): {
- group?: string | null | undefined;
- canSetGroup?: boolean | undefined;
- isEditable?: boolean | undefined;
- isDeletable?: boolean | undefined;
- blendMode?: IBlendMode | undefined;
- id: string | null;
- name: string | null;
- subject: string | null;
- pdfObjectId: number | null;
- pageIndex: number;
- opacity: number;
- boundingBox: Rect;
- noPrint: boolean;
- noZoom: boolean;
- noRotate: boolean;
- noView: boolean;
- hidden: boolean;
- locked: boolean;
- lockedContents: boolean;
- readOnly: boolean;
- action: Action | null | undefined;
- note: string | null;
- createdAt: Date;
- updatedAt: Date;
- creatorName: string | null;
- customData: Record<string, unknown> | null;
- isCommentThreadRoot: boolean;
- isAnonymous: boolean;
- };
- static blendModeObjectForAnnotation(json: IAnnotationJSON): {
- blendMode: IBlendMode;
- } | null;
- serializeFlags(): ("noView" | "noPrint" | "locked" | "lockedContents" | "readOnly" | "hidden" | "noZoom" | "noRotate")[] | null;
- }
-
- declare class InkAnnotationSerializer extends AnnotationSerializer {
- annotation: InkAnnotation;
- constructor(annotation: InkAnnotation);
- toJSON(): InkAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<InkAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): InkAnnotation;
- _linesToJSON(): {
- points: [number, number][][];
- intensities: number[][];
- };
- static _JSONToLines(linesJSON: {
- points: Array<Array<[number, number]>>;
- intensities: Array<Array<number>>;
- }): List<List<DrawingPoint>>;
- }
-
- declare abstract class ShapeAnnotationSerializer extends AnnotationSerializer {
- annotation: ShapeAnnotationsUnion;
- toJSON(): ShapeAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<ShapeAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): {
- strokeWidth: number | null;
- strokeColor: Color$2 | null;
- fillColor: Color$2 | null;
- strokeDashArray: [number, number] | null | undefined;
- measurementPrecision: IMeasurementPrecision | null | undefined;
- measurementScale: MeasurementScale | null;
- group?: string | null | undefined;
- canSetGroup?: boolean | undefined;
- isEditable?: boolean | undefined;
- isDeletable?: boolean | undefined;
- blendMode?: IBlendMode | undefined;
- id: string | null;
- name: string | null;
- subject: string | null;
- pdfObjectId: number | null;
- pageIndex: number;
- opacity: number;
- boundingBox: Rect;
- noPrint: boolean;
- noZoom: boolean;
- noRotate: boolean;
- noView: boolean;
- hidden: boolean;
- locked: boolean;
- lockedContents: boolean;
- readOnly: boolean;
- action: Action | null | undefined;
- note: string | null;
- createdAt: Date;
- updatedAt: Date;
- creatorName: string | null;
- customData: Record<string, unknown> | null;
- isCommentThreadRoot: boolean;
- isAnonymous: boolean;
- };
- _pointsToJSON(): Array<[number, number]>;
- static _JSONToPoints(pointsJSON: Array<[number, number]>): List<Point>;
- static _JSONLinesToPoints(linesJSON: {
- points: Array<Array<[number, number]>>;
- intensities: Array<Array<number>>;
- }): List<Point>;
- }
- type MeasurementScaleJSON = {
- unitFrom: IMeasurementScaleUnitFrom;
- unitTo: IMeasurementScaleUnitTo;
- from: number;
- to: number;
- };
-
- declare class LineAnnotationSerializer extends ShapeAnnotationSerializer {
- annotation: LineAnnotation;
- toJSON(): LineAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<LineAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): LineAnnotation;
- }
-
- declare class RectangleAnnotationSerializer extends ShapeAnnotationSerializer {
- annotation: RectangleAnnotation;
- toJSON(): RectangleAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<RectangleAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): RectangleAnnotation;
- }
-
- declare class EllipseAnnotationSerializer extends ShapeAnnotationSerializer {
- annotation: EllipseAnnotation;
- toJSON(): EllipseAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<EllipseAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): EllipseAnnotation;
- }
-
- declare class PolygonAnnotationSerializer extends ShapeAnnotationSerializer {
- annotation: PolygonAnnotation;
- toJSON(): PolygonAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<PolygonAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: IObject$1): PolygonAnnotation;
- }
-
- declare class PolylineAnnotationSerializer extends ShapeAnnotationSerializer {
- annotation: PolylineAnnotation;
- toJSON(): PolylineAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<PolylineAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): PolylineAnnotation;
- }
-
- declare class LinkAnnotationSerializer extends AnnotationSerializer {
- annotation: LinkAnnotation;
- constructor(annotation: LinkAnnotation);
- toJSON(): LinkAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<LinkAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): LinkAnnotation;
- }
-
- declare abstract class BaseTextMarkupSerializer extends AnnotationSerializer {
- annotation: RedactionAnnotation | TextMarkupAnnotation;
- constructor(annotation: RedactionAnnotation | TextMarkupAnnotation);
- toJSON(): BaseTextMarkupAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<BaseTextMarkupAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): {
- rects: List<Rect>;
- group?: string | null | undefined;
- canSetGroup?: boolean | undefined;
- isEditable?: boolean | undefined;
- isDeletable?: boolean | undefined;
- blendMode?: IBlendMode | undefined;
- id: string | null;
- name: string | null;
- subject: string | null;
- pdfObjectId: number | null;
- pageIndex: number;
- opacity: number;
- boundingBox: Rect;
- noPrint: boolean;
- noZoom: boolean;
- noRotate: boolean;
- noView: boolean;
- hidden: boolean;
- locked: boolean;
- lockedContents: boolean;
- readOnly: boolean;
- action: Action | null | undefined;
- note: string | null;
- createdAt: Date;
- updatedAt: Date;
- creatorName: string | null;
- customData: Record<string, unknown> | null;
- isCommentThreadRoot: boolean;
- isAnonymous: boolean;
- };
- }
-
- declare class TextMarkupAnnotationSerializer extends BaseTextMarkupSerializer {
- annotation: TextMarkupAnnotationsUnion;
- constructor(annotation: TextMarkupAnnotationsUnion);
- toJSON(): TextMarkupAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<TextMarkupAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): TextMarkupAnnotationsUnion;
- typeForAnnotation(): "pspdfkit/markup/highlight" | "pspdfkit/markup/squiggly" | "pspdfkit/markup/strikeout" | "pspdfkit/markup/underline" | "pspdfkit/markup/redaction";
- }
-
- declare class RedactionAnnotationSerializer extends BaseTextMarkupSerializer {
- annotation: RedactionAnnotation;
- constructor(annotation: RedactionAnnotation);
- toJSON(): RedactionAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<RedactionAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): RedactionAnnotation;
- }
-
- declare class TextAnnotationSerializer extends AnnotationSerializer {
- annotation: TextAnnotation;
- constructor(annotation: TextAnnotation);
- toJSON(): TextAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<TextAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): TextAnnotation;
- _calloutToJSON(): {
- start: [number, number];
- knee: [number, number] | null;
- end: [number, number];
- cap: ILineCap | null;
- innerRectInset: InsetJSON | null;
- } | null;
- static _JSONToCallout(calloutJSON: TextAnnotationJSON['callout']): Callout | null | undefined;
- }
-
- declare class NoteAnnotationSerializer extends AnnotationSerializer {
- annotation: NoteAnnotation;
- constructor(annotation: NoteAnnotation);
- toJSON(): NoteAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<NoteAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): NoteAnnotation;
- }
-
- declare class ImageAnnotationSerializer extends AnnotationSerializer {
- annotation: ImageAnnotation;
- constructor(annotation: ImageAnnotation);
- toJSON(): ImageAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<ImageAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): ImageAnnotation;
- }
-
- declare class StampAnnotationSerializer extends AnnotationSerializer {
- annotation: StampAnnotation;
- constructor(annotation: StampAnnotation);
- toJSON(): StampAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<StampAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): StampAnnotation;
- }
-
- declare class WidgetAnnotationSerializer extends AnnotationSerializer {
- annotation: WidgetAnnotation;
- constructor(annotation: WidgetAnnotation);
- toJSON(): WidgetAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<WidgetAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): WidgetAnnotation;
- }
-
- type InstantID = string;
- declare function generateInstantId(): InstantID;
-
- declare class CommentMarkerAnnotationSerializer extends AnnotationSerializer {
- annotation: CommentMarkerAnnotation;
- constructor(annotation: CommentMarkerAnnotation);
- toJSON(): CommentMarkerAnnotationJSON;
- static fromJSON(id: InstantID | null, json: Omit<CommentMarkerAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): CommentMarkerAnnotation;
- }
-
- declare class UnknownAnnotationSerializer extends AnnotationSerializer {
- annotation: UnknownAnnotation;
- constructor(annotation: UnknownAnnotation);
- toJSON(): UnknownAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<UnknownAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): UnknownAnnotation;
- }
-
- declare class MediaAnnotationSerializer extends AnnotationSerializer {
- annotation: MediaAnnotation;
- constructor(annotation: MediaAnnotation);
- toJSON(): MediaAnnotationJSON;
- static fromJSON(id: ID | null, json: Omit<MediaAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): MediaAnnotation;
- }
-
- type AnnotationSerializerTypeMap = {
- 'pspdfkit/ink': {
- serializer: InkAnnotationSerializer;
- annotation: InkAnnotation;
- json: InkAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<InkAnnotationJSON>;
- };
- 'pspdfkit/shape/line': {
- serializer: LineAnnotationSerializer;
- annotation: LineAnnotation;
- json: LineAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<LineAnnotationJSON>;
- };
- 'pspdfkit/shape/rectangle': {
- serializer: RectangleAnnotationSerializer;
- annotation: RectangleAnnotation;
- json: RectangleAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<RectangleAnnotationJSON>;
- };
- 'pspdfkit/shape/ellipse': {
- serializer: EllipseAnnotationSerializer;
- annotation: EllipseAnnotation;
- json: EllipseAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<EllipseAnnotationJSON>;
- };
- 'pspdfkit/shape/polygon': {
- serializer: PolygonAnnotationSerializer;
- annotation: PolygonAnnotation;
- json: PolygonAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<PolygonAnnotationJSON>;
- };
- 'pspdfkit/shape/polyline': {
- serializer: PolylineAnnotationSerializer;
- annotation: PolylineAnnotation;
- json: PolylineAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<PolylineAnnotationJSON>;
- };
- 'pspdfkit/link': {
- serializer: LinkAnnotationSerializer;
- annotation: LinkAnnotation;
- json: LinkAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<LinkAnnotationJSON>;
- };
- 'pspdfkit/markup/highlight': {
- serializer: TextMarkupAnnotationSerializer;
- annotation: HighlightAnnotation;
- json: TextMarkupAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<TextMarkupAnnotationJSON>;
- };
- 'pspdfkit/markup/squiggly': {
- serializer: TextMarkupAnnotationSerializer;
- annotation: SquiggleAnnotation;
- json: TextMarkupAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<TextMarkupAnnotationJSON>;
- };
- 'pspdfkit/markup/strikeout': {
- serializer: TextMarkupAnnotationSerializer;
- annotation: StrikeOutAnnotation;
- json: TextMarkupAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<TextMarkupAnnotationJSON>;
- };
- 'pspdfkit/markup/underline': {
- serializer: TextMarkupAnnotationSerializer;
- annotation: UnderlineAnnotation;
- json: TextMarkupAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<TextMarkupAnnotationJSON>;
- };
- 'pspdfkit/markup/redaction': {
- serializer: RedactionAnnotationSerializer;
- annotation: RedactionAnnotation;
- json: RedactionAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<RedactionAnnotationJSON>;
- };
- 'pspdfkit/text': {
- serializer: TextAnnotationSerializer;
- annotation: TextAnnotation;
- json: TextAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<TextAnnotationJSON>;
- };
- 'pspdfkit/note': {
- serializer: NoteAnnotationSerializer;
- annotation: NoteAnnotation;
- json: NoteAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<NoteAnnotationJSON>;
- };
- 'pspdfkit/image': {
- serializer: ImageAnnotationSerializer;
- annotation: ImageAnnotation;
- json: ImageAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<ImageAnnotationJSON>;
- };
- 'pspdfkit/stamp': {
- serializer: StampAnnotationSerializer;
- annotation: StampAnnotation;
- json: StampAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<StampAnnotationJSON, 'color'>;
- };
- 'pspdfkit/widget': {
- serializer: WidgetAnnotationSerializer;
- annotation: WidgetAnnotation;
- json: WidgetAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<WidgetAnnotationJSON>;
- };
- 'pspdfkit/comment-marker': {
- serializer: CommentMarkerAnnotationSerializer;
- annotation: CommentMarkerAnnotation;
- json: CommentMarkerAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<CommentMarkerAnnotationJSON>;
- };
- 'pspdfkit/unknown': {
- serializer: UnknownAnnotationSerializer;
- annotation: UnknownAnnotation;
- json: UnknownAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<UnknownAnnotationJSON>;
- };
- 'pspdfkit/media': {
- serializer: MediaAnnotationSerializer;
- annotation: MediaAnnotation;
- json: MediaAnnotationJSON;
- jsonForBackend: AnnotationBackendJSON<MediaAnnotationJSON>;
- };
- };
- type GetTypeFromAnnotationJSON<T extends {
- type: keyof AnnotationSerializerTypeMap;
- }> = T extends {
- type: infer U;
- } ? U : never;
- type AnnotationJSONToAnnotation<T extends {
- type: keyof AnnotationSerializerTypeMap;
- }> = AnnotationSerializerTypeMap[GetTypeFromAnnotationJSON<T>]['annotation'];
- type Intersection<T, U> = T extends U ? T : never;
- type BackendRequiredKeys = 'id' | 'v' | 'pageIndex' | 'type' | 'bbox';
- type AnnotationBackendJSON<K extends BaseAnnotationJSON = AnnotationJSONUnion, R extends string = never> = {
- [P in keyof K]?: NonNullable<K[P]>;
- } & {
- [P in Intersection<keyof K, BackendRequiredKeys | R>]-?: Exclude<NonNullable<K[P]>, undefined>;
- };
- type AnnotationsUnion = {
- [K in keyof AnnotationSerializerTypeMap]: AnnotationSerializerTypeMap[K]['annotation'];
- }[keyof AnnotationSerializerTypeMap];
- type AnnotationsUnionClass = {
- [K in keyof AnnotationSerializerTypeMap]: Class<AnnotationSerializerTypeMap[K]['annotation']>;
- }[keyof AnnotationSerializerTypeMap];
- type ShapeAnnotationsUnion = PolylineAnnotation | PolygonAnnotation | LineAnnotation | RectangleAnnotation | EllipseAnnotation;
- type AnnotationsBackendJSONUnion = {
- [K in keyof AnnotationSerializerTypeMap]: AnnotationSerializerTypeMap[K]['jsonForBackend'];
- }[keyof AnnotationSerializerTypeMap];
- type TextMarkupAnnotationsUnion = HighlightAnnotation | UnderlineAnnotation | StrikeOutAnnotation | SquiggleAnnotation | RedactionAnnotation;
-
- type CommentJSON = {
- id?: string | null;
- type: 'pspdfkit/comment';
- v: 2;
- rootId: string | number | null;
- pageIndex: number | null;
- pdfObjectId?: number | null;
- creatorName?: string | null;
- name?: string | null;
- createdAt: string | Date;
- updatedAt: string | Date;
- text: {
- value: string | null;
- format: 'xhtml' | 'plain';
- };
- customData?: {
- [key: string]: unknown;
- } | null;
- isAnonymous?: boolean | null;
- } & ICollaboratorPermissionsOptions;
-
- type CommentProps$1 = {
- id: InstantID | null;
- rootId: InstantID | null;
- pageIndex: null | number;
- pdfObjectId: number | null;
- creatorName: string | null;
- createdAt: Date;
- updatedAt: Date;
- text: {
- format: 'plain' | 'xhtml';
- value: string | null;
- };
- customData: Record<string, unknown> | null;
- group?: string | null;
- isEditable?: boolean;
- isDeletable?: boolean;
- canSetGroup?: boolean;
- isAnonymous?: boolean | null;
- };
- declare const Comment_base: Record$1.Factory<CommentProps$1>;
- declare class Comment$1 extends Comment_base {
- static toSerializableObject: (comment: Comment$1) => CommentJSON;
- static fromSerializableObject: (comment: CommentJSON) => Comment$1;
- getMentionedUserIds(): Set$1<string>;
- }
- type MentionableUser$1 = {
- id: string;
- name: string;
- avatarUrl?: string;
- displayName: string;
- description?: string;
- };
-
- type IGroup = string | null | undefined;
- type IPermissions = {
- edit: boolean;
- delete: boolean;
- setGroup: boolean;
- fill?: boolean;
- reply?: boolean;
- };
-
- type ICollaboratorPermissionsOptions = {
- group?: IGroup;
- permissions?: IPermissions;
- };
-
- type SerializedAdditionalActionsType = {
- [key in ActionTriggerEventType | FormFieldEventTriggerType | FormFieldInputEventTriggerType | WidgetActionTriggerEventType]?: {
- type: string;
- [key: string]: unknown;
- };
- };
-
- type FontSubstitution = {
- pattern: string;
- target: string;
- };
-
- declare const ComparisonOperationType: {
- readonly TEXT: "text";
- };
- type IComparisonOperationType = (typeof ComparisonOperationType)[keyof typeof ComparisonOperationType];
-
- declare global {
- interface SymbolConstructor {
- readonly observable: symbol;
- }
- }
-
- type OnCommentCreationStartCallback = (comment: Comment$1) => Comment$1;
-
- interface ITextLine {
- id: number | null;
- pageIndex: number | null;
- boundingBox: Rect;
- contents: string;
- }
- declare const TextLine_base: Record$1.Factory<ITextLine>;
- declare class TextLine extends TextLine_base {
- }
-
- type CustomOverlayItemID = string;
- interface ICustomOverlayItem {
- disableAutoZoom?: boolean;
- id: CustomOverlayItemID | null;
- node: Node | null;
- noRotate?: boolean;
- pageIndex: number;
- position: Point;
- onAppear?: null | ((...args: Array<any>) => any);
- onDisappear?: null | ((...args: Array<any>) => any);
- }
- declare const CustomOverlayItem_base: Record$1.Factory<ICustomOverlayItem>;
- declare class CustomOverlayItem extends CustomOverlayItem_base {
- disableAutoZoom: boolean;
- id: CustomOverlayItemID;
- node: Node;
- noRotate: boolean;
- pageIndex: number;
- position: Point;
- onAppear?: ((...args: Array<any>) => any) | null;
- onDisappear?: ((...args: Array<any>) => any) | null;
- constructor(args: ICustomOverlayItem);
- }
-
- declare class PageInfo {
- index: number;
- label: string;
- height: number;
- width: number;
- rotation: number;
- rawPdfBoxes: RawPdfBoxes;
- }
-
- declare const ViewportPadding_base: Record$1.Factory<{
- horizontal: number;
- vertical: number;
- }>;
- declare class ViewportPadding extends ViewportPadding_base {
- }
-
- declare const LayoutMode: {
- readonly SINGLE: "SINGLE";
- readonly DOUBLE: "DOUBLE";
- readonly AUTO: "AUTO";
- };
- type ILayoutMode = (typeof LayoutMode)[keyof typeof LayoutMode];
-
- declare const ScrollMode: {
- readonly CONTINUOUS: "CONTINUOUS";
- readonly PER_SPREAD: "PER_SPREAD";
- readonly DISABLED: "DISABLED";
- };
- type IScrollMode = (typeof ScrollMode)[keyof typeof ScrollMode];
-
- declare const SidebarPlacement: {
- readonly START: "START";
- readonly END: "END";
- };
- type ISidebarPlacement = (typeof SidebarPlacement)[keyof typeof SidebarPlacement];
-
- declare const ZoomMode: {
- readonly AUTO: "AUTO";
- readonly FIT_TO_WIDTH: "FIT_TO_WIDTH";
- readonly FIT_TO_VIEWPORT: "FIT_TO_VIEWPORT";
- readonly CUSTOM: "CUSTOM";
- };
- type IZoomMode = (typeof ZoomMode)[keyof typeof ZoomMode];
-
- declare const ShowSignatureValidationStatusMode: {
- readonly IF_SIGNED: "IF_SIGNED";
- readonly HAS_WARNINGS: "HAS_WARNINGS";
- readonly HAS_ERRORS: "HAS_ERRORS";
- readonly NEVER: "NEVER";
- };
- type IShowSignatureValidationStatusMode = (typeof ShowSignatureValidationStatusMode)[keyof typeof ShowSignatureValidationStatusMode];
-
- declare const InteractionMode: {
- readonly TEXT_HIGHLIGHTER: "TEXT_HIGHLIGHTER";
- readonly INK: "INK";
- readonly INK_SIGNATURE: "INK_SIGNATURE";
- readonly SIGNATURE: "SIGNATURE";
- readonly STAMP_PICKER: "STAMP_PICKER";
- readonly STAMP_CUSTOM: "STAMP_CUSTOM";
- readonly SHAPE_LINE: "SHAPE_LINE";
- readonly SHAPE_RECTANGLE: "SHAPE_RECTANGLE";
- readonly SHAPE_ELLIPSE: "SHAPE_ELLIPSE";
- readonly SHAPE_POLYGON: "SHAPE_POLYGON";
- readonly SHAPE_POLYLINE: "SHAPE_POLYLINE";
- readonly INK_ERASER: "INK_ERASER";
- readonly NOTE: "NOTE";
- readonly COMMENT_MARKER: "COMMENT_MARKER";
- readonly TEXT: "TEXT";
- readonly CALLOUT: "CALLOUT";
- readonly PAN: "PAN";
- readonly SEARCH: "SEARCH";
- readonly DOCUMENT_EDITOR: "DOCUMENT_EDITOR";
- readonly MARQUEE_ZOOM: "MARQUEE_ZOOM";
- readonly REDACT_TEXT_HIGHLIGHTER: "REDACT_TEXT_HIGHLIGHTER";
- readonly REDACT_SHAPE_RECTANGLE: "REDACT_SHAPE_RECTANGLE";
- readonly DOCUMENT_CROP: "DOCUMENT_CROP";
- readonly BUTTON_WIDGET: "BUTTON_WIDGET";
- readonly TEXT_WIDGET: "TEXT_WIDGET";
- readonly RADIO_BUTTON_WIDGET: "RADIO_BUTTON_WIDGET";
- readonly CHECKBOX_WIDGET: "CHECKBOX_WIDGET";
- readonly COMBO_BOX_WIDGET: "COMBO_BOX_WIDGET";
- readonly LIST_BOX_WIDGET: "LIST_BOX_WIDGET";
- readonly SIGNATURE_WIDGET: "SIGNATURE_WIDGET";
- readonly DATE_WIDGET: "DATE_WIDGET";
- readonly FORM_CREATOR: "FORM_CREATOR";
- readonly LINK: "LINK";
- readonly DISTANCE: "DISTANCE";
- readonly PERIMETER: "PERIMETER";
- readonly RECTANGLE_AREA: "RECTANGLE_AREA";
- readonly ELLIPSE_AREA: "ELLIPSE_AREA";
- readonly POLYGON_AREA: "POLYGON_AREA";
- readonly CONTENT_EDITOR: "CONTENT_EDITOR";
- readonly MULTI_ANNOTATIONS_SELECTION: "MULTI_ANNOTATIONS_SELECTION";
- readonly MEASUREMENT: "MEASUREMENT";
- readonly MEASUREMENT_SETTINGS: "MEASUREMENT_SETTINGS";
- };
- type IInteractionMode = (typeof InteractionMode)[keyof typeof InteractionMode];
-
- declare const SidebarMode: {
- readonly ANNOTATIONS: "ANNOTATIONS";
- readonly BOOKMARKS: "BOOKMARKS";
- readonly DOCUMENT_OUTLINE: "DOCUMENT_OUTLINE";
- readonly THUMBNAILS: "THUMBNAILS";
- readonly SIGNATURES: "SIGNATURES";
- readonly LAYERS: "LAYERS";
- readonly CUSTOM: "CUSTOM";
- };
- type ISidebarMode = (typeof SidebarMode)[keyof typeof SidebarMode];
-
- declare const Alignment: {
- readonly START: "START";
- readonly END: "END";
- };
- type IAlignment = (typeof Alignment)[keyof typeof Alignment];
-
- type SidebarOptions<T extends AnnotationsSidebarOptions | LayersSidebarOptions> = T extends AnnotationsSidebarOptions ? {
- [SidebarMode.ANNOTATIONS]: AnnotationsSidebarOptions;
- } : {
- [SidebarMode.LAYERS]: LayersSidebarOptions;
- };
- type AnnotationsSidebarOptions = {
- includeContent: Array<AnnotationsUnionClass | Class<Comment$1>>;
- };
- type LayersSidebarOptions = {
- lockedLayers: number[];
- iconsAlignment: IAlignment;
- };
-
- type Rotation$1 = 0 | 90 | 180 | 270;
- interface IViewState {
- allowPrinting: boolean;
- allowExport: boolean;
- currentPageIndex: number;
- instance: Instance | null;
- interactionMode: IInteractionMode | null;
- keepFirstSpreadAsSinglePage: boolean;
- layoutMode: ILayoutMode;
- pageSpacing: number;
- pagesRotation: Rotation$1;
- readOnly: boolean;
- scrollMode: IScrollMode;
- showAnnotations: boolean;
- showComments: boolean;
- showAnnotationNotes: boolean;
- showToolbar: boolean;
- enableAnnotationToolbar: boolean;
- sidebarMode: ISidebarMode | null | undefined;
- sidebarOptions: SidebarOptions<AnnotationsSidebarOptions | LayersSidebarOptions>;
- sidebarPlacement: ISidebarPlacement;
- spreadSpacing: number;
- viewportPadding: ViewportPadding;
- zoom: IZoomMode | number;
- zoomStep: number;
- formDesignMode: boolean;
- showSignatureValidationStatus: IShowSignatureValidationStatusMode;
- previewRedactionMode: boolean;
- canScrollWhileDrawing: boolean;
- keepSelectedTool: boolean;
- resolvedLayoutMode: ILayoutMode;
- sidebarWidth: number;
- disablePointSnapping: boolean;
- enableAlwaysScrollToZoom: boolean;
- forceRenderWidgetsInAnnotationsOrder: boolean;
- prerenderedPageSpreads: number | null;
- }
- declare const ViewState_base: Record$1.Factory<IViewState>;
- declare class ViewState extends ViewState_base {
- zoomIn(): ViewState;
- zoomOut(): ViewState;
- rotateLeft(): ViewState;
- rotateRight(): ViewState;
- goToNextPage(): ViewState;
- goToPreviousPage(): ViewState;
- }
-
- declare class InstantClient {
- clientId: string;
- userId: string | null | undefined;
- }
-
- declare const PrintMode: {
- readonly DOM: "DOM";
- readonly EXPORT_PDF: "EXPORT_PDF";
- };
- type IPrintMode = (typeof PrintMode)[keyof typeof PrintMode];
-
- declare function toJSON(bookmark: Bookmark): BookmarkJSON;
-
- type ID$1 = string;
- type BookmarkProps = {
- id: ID$1 | null;
- pdfBookmarkId: ID$1 | null;
- name: string | null;
- sortKey: number | null;
- action: Action | null;
- };
- declare const Bookmark_base: Record$1.Factory<BookmarkProps>;
- declare class Bookmark extends Bookmark_base {
- id: ID$1;
- action: Action;
- static toSerializableObject: typeof toJSON;
- static fromSerializableObject: (bookmark: BookmarkJSON) => Bookmark;
- }
-
- declare const allowedToolbarTypes: ("link" | "ellipse" | "image" | "line" | "polygon" | "polyline" | "text" | "spacer" | "distance" | "note" | "comment" | "zoom-in" | "zoom-out" | "callout" | "search" | "arrow" | "highlighter" | "undo" | "redo" | "custom" | "measure" | "print" | "redact-text-highlighter" | "document-assistant" | "rectangle" | "ink" | "stamp" | "cloudy-rectangle" | "dashed-rectangle" | "cloudy-ellipse" | "dashed-ellipse" | "cloudy-polygon" | "dashed-polygon" | "text-highlighter" | "perimeter" | "ellipse-area" | "rectangle-area" | "polygon-area" | "debug" | "multi-annotations-selection" | "annotate" | "responsive-group" | "layout-config" | "marquee-zoom" | "redact-rectangle" | "document-comparison" | "form-creator" | "content-editor" | "sidebar-thumbnails" | "sidebar-document-outline" | "sidebar-annotations" | "sidebar-bookmarks" | "sidebar-signatures" | "sidebar-layers" | "pager" | "pan" | "zoom-mode" | "ink-eraser" | "signature" | "document-editor" | "document-crop" | "export-pdf")[];
-
- type ToolItemType = 'custom';
- type ToolItem = {
- type: ToolItemType;
- node?: Node;
- id?: string;
- title?: string;
- className?: string;
- icon?: string;
- onPress?: IFunction;
- selected?: boolean;
- disabled?: boolean;
- };
-
- type AnnotationPreset$1 = Record<string, any>;
- type AnnotationPresetID$1 = string;
-
- type ToolbarItemType = ToolItemType | (typeof allowedToolbarTypes)[number];
- type ToolbarItem = Omit<ToolItem, 'type'> & {
- type: ToolbarItemType;
- mediaQueries?: string[];
- responsiveGroup?: string;
- dropdownGroup?: string;
- preset?: AnnotationPresetID$1;
- onKeyPress?: (...args: Array<any>) => any;
- };
-
- type OutlineElementProps = {
- children: List<OutlineElement>;
- title: string;
- color: Color$2 | null;
- isBold: boolean;
- isItalic: boolean;
- isExpanded: boolean;
- action: Action | null;
- };
- declare const OutlineElement_base: Record$1.Factory<OutlineElementProps>;
- declare class OutlineElement extends OutlineElement_base {
- }
-
- type BaseFormFieldJSON = {
- v: 1;
- pdfObjectId?: number | null;
- annotationIds: Array<string>;
- name: string;
- label: string;
- flags?: FormFieldFlags;
- id: string;
- additionalActions?: SerializedAdditionalActionsType;
- group?: IGroup;
- permissions?: IPermissions;
- };
- type ChoiceFormFieldJSON = BaseFormFieldJSON & {
- type: 'pspdfkit/form-field/listbox' | 'pspdfkit/form-field/combobox';
- options: Array<FormOptionJSON>;
- multiSelect: boolean;
- commitOnChange: boolean;
- defaultValues: Array<string>;
- };
- type ListBoxFormFieldJSON = ChoiceFormFieldJSON & {
- type: 'pspdfkit/form-field/listbox';
- };
- type DoNotSpellCheckPropertyPair = XOR<Record<'doNotSpellCheck', boolean>, Record<'doNotSpellcheck', boolean>>;
- type ComboBoxFormFieldJSON = ChoiceFormFieldJSON & {
- type: 'pspdfkit/form-field/combobox';
- edit: boolean;
- } & DoNotSpellCheckPropertyPair;
- type CheckBoxFormFieldJSON = BaseFormFieldJSON & {
- type: 'pspdfkit/form-field/checkbox';
- options: Array<FormOptionJSON>;
- defaultValues: Array<string>;
- };
- type RadioButtonFormFieldJSON = BaseFormFieldJSON & {
- type: 'pspdfkit/form-field/radio';
- options: Array<FormOptionJSON>;
- noToggleToOff: boolean;
- radiosInUnison: boolean;
- defaultValue: string;
- };
- type TextFormFieldJSON = BaseFormFieldJSON & {
- type: 'pspdfkit/form-field/text';
- password: boolean;
- maxLength?: number | null;
- doNotScroll: boolean;
- multiLine: boolean;
- defaultValue: string;
- comb: boolean;
- } & DoNotSpellCheckPropertyPair;
- type ButtonFormFieldJSON = BaseFormFieldJSON & {
- type: 'pspdfkit/form-field/button';
- buttonLabel: string | null;
- };
- type SignatureFormFieldJSON = BaseFormFieldJSON & {
- type: 'pspdfkit/form-field/signature';
- };
- type FormFieldJSON = ListBoxFormFieldJSON | ComboBoxFormFieldJSON | RadioButtonFormFieldJSON | CheckBoxFormFieldJSON | TextFormFieldJSON | ButtonFormFieldJSON | SignatureFormFieldJSON;
-
- type SerializedJSON = {
- skippedPdfObjectIds?: number[];
- annotations?: AnnotationJSONUnion[];
- formFields?: FormFieldJSON[];
- skippedPdfFormFieldIds?: number[];
- formFieldValues?: Record<string, any>[];
- comments?: Record<string, any>[];
- skippedComments?: number[];
- attachments?: Record<string, {
- binary: string;
- contentType: string;
- }>;
- skippedPdfBookmarkIds?: string[];
- bookmarks?: BookmarkJSON[];
- };
- type InstantJSON = SerializedJSON & {
- format: 'https://pspdfkit.com/instant-json/v1';
- pdfId?: {
- permanent: string;
- changing: string;
- };
- };
-
- declare const SearchResult_base: Record$1.Factory<{
- pageIndex: number | null;
- previewText: string;
- locationInPreview: number | null;
- lengthInPreview: number | null;
- rectsOnPage: List<Rect>;
- isAnnotation: boolean | null;
- annotationRect?: Rect | null | undefined;
- }>;
- declare class SearchResult extends SearchResult_base {
- }
-
- declare const SearchState_base: Record$1.Factory<ISearchState>;
- declare class SearchState extends SearchState_base {
- }
- interface ISearchState {
- isFocused: boolean;
- isLoading: boolean;
- term: string;
- focusedResultIndex: number;
- results: List<SearchResult>;
- minSearchQueryLength: number;
- }
-
- type IsEditableAnnotationCallback = (annotation: AnnotationsUnion) => boolean;
-
- type Rotation = 0 | 90 | 180 | 270;
- type AddPageConfiguration = {
- backgroundColor: Color$2;
- pageWidth: number;
- pageHeight: number;
- rotateBy: Rotation;
- insets?: Rect;
- };
- type OperationAttachment = string | File | Blob;
- type min = number;
- type max = number;
- type Range$1 = [min, max];
- type ImportPageIndex = Array<number | Range$1>;
- type DocumentMetadata = {
- title?: string;
- author?: string;
- };
- type NonSerializableDocumentOperationsCommon = {
- type: 'removePages';
- pageIndexes: Array<number>;
- } | {
- type: 'duplicatePages';
- pageIndexes: Array<number>;
- } | {
- type: 'movePages';
- pageIndexes: Array<number>;
- afterPageIndex: number;
- } | {
- type: 'movePages';
- pageIndexes: Array<number>;
- beforePageIndex: number;
- } | {
- type: 'rotatePages';
- pageIndexes: Array<number>;
- rotateBy: Rotation;
- } | {
- type: 'keepPages';
- pageIndexes: Array<number>;
- } | {
- type: 'importDocument';
- afterPageIndex: number;
- treatImportedDocumentAsOnePage?: boolean;
- document: OperationAttachment;
- importedPageIndexes?: ImportPageIndex;
- } | {
- type: 'importDocument';
- beforePageIndex: number;
- treatImportedDocumentAsOnePage?: boolean;
- document: OperationAttachment;
- importedPageIndexes?: ImportPageIndex;
- } | {
- type: 'setPageLabel';
- pageIndexes?: Array<number>;
- pageLabel?: string;
- } | {
- type: 'performOcr';
- pageIndexes?: Array<number> | 'all';
- language: string;
- } | {
- type: 'applyRedactions';
- } | {
- type: 'updateMetadata';
- metadata: DocumentMetadata;
- };
- type NonSerializableDocumentOperations = {
- type: 'applyInstantJson';
- instantJson: Record<string, any>;
- dataFilePath?: OperationAttachment;
- } | {
- type: 'applyXfdf';
- xfdf: string;
- ignorePageRotation?: boolean;
- dataFilePath?: OperationAttachment;
- } | {
- type: 'flattenAnnotations';
- pageIndexes?: Array<number>;
- annotationIds?: string[];
- noteAnnotationBackgroundColor?: Color$2;
- noteAnnotationOpacity?: number;
- };
- type DocumentOperation = (AddPageConfiguration & {
- type: 'addPage';
- afterPageIndex: number;
- }) | (AddPageConfiguration & {
- type: 'addPage';
- beforePageIndex: number;
- }) | {
- type: 'cropPages';
- pageIndexes?: Array<number>;
- cropBox: Rect;
- } | {
- type: 'addPageMargins';
- pageIndexes?: Array<number>;
- margins: Inset;
- } | NonSerializableDocumentOperationsCommon | NonSerializableDocumentOperations;
-
- type RendererConfiguration = {
- node: Node;
- append?: boolean | null;
- noZoom?: boolean | null;
- onDisappear?: ((arg0: Node | null) => void) | null;
- };
-
- type CustomRenderers = {
- Annotation?: (arg0: {
- annotation: AnnotationsUnion;
- }) => RendererConfiguration | null | undefined;
- CommentAvatar?: (arg0: {
- comment: Comment$1;
- }) => RendererConfiguration | null | undefined;
- };
-
- type IsEditableCommentCallback = (comment: Comment$1) => boolean;
-
- type TwoStepSignatureCallback = (arg0: {
- hash: string;
- fileContents: ArrayBuffer | null;
- dataToBeSigned: ArrayBuffer;
- }) => Promise<ArrayBuffer>;
-
- type SignatureMetadata = {
- signerName?: string;
- signatureReason?: string;
- signatureLocation?: string;
- };
-
- type SignaturePosition = {
- pageIndex: number;
- boundingBox: Rect;
- };
-
- declare const SignatureAppearanceMode: {
- readonly signatureOnly: "signatureOnly";
- readonly signatureAndDescription: "signatureAndDescription";
- readonly descriptionOnly: "descriptionOnly";
- };
- type ISignatureAppearanceMode = (typeof SignatureAppearanceMode)[keyof typeof SignatureAppearanceMode];
-
- type SignatureAppearance = {
- mode?: ISignatureAppearanceMode;
- showSigner?: boolean;
- showSignDate?: boolean;
- showReason?: boolean;
- showLocation?: boolean;
- showWatermark?: boolean;
- showDateTimezone?: boolean;
- watermarkImage?: Blob | File;
- graphicImage?: Blob | File;
- };
-
- type SignatureContainerType = 'raw' | 'pkcs7';
- type TimestampType = {
- url: string;
- username?: string;
- password?: string;
- };
- type SigningData = {
- certificates?: ArrayBuffer[] | string[];
- signatureType: SignatureTypeType;
- privateKey?: string;
- signatureContainer?: SignatureContainerType;
- timestamp?: TimestampType;
- ltv?: boolean;
- };
- type SignaturePreparationData = {
- placeholderSize?: number;
- flatten?: boolean;
- formFieldName?: string;
- position?: SignaturePosition;
- appearance?: SignatureAppearance;
- };
- type SignatureCreationData = SignaturePreparationData & {
- signatureMetadata?: SignatureMetadata;
- } & {
- signingData?: SigningData;
- };
-
- type SigningServiceData = {
- signingToken: string;
- };
-
- type RedactionAnnotationPreset = {
- fillColor?: Color$2;
- overlayText?: string;
- repeatOverlayText?: boolean;
- color?: Color$2;
- outlineColor?: Color$2;
- creatorName?: string;
- };
-
- type Change = AnnotationsUnion | Bookmark | FormField | FormFieldValue | Comment$1;
-
- type DocumentEditorUIHandler = {
- setOperations: (callback: (stagedDocumentOperations: List<DocumentOperation | List<DocumentOperation>>) => List<DocumentOperation | List<DocumentOperation>>, clearPagesSelection?: boolean) => void | Promise<void>;
- getSelectedPageIndexes: () => number[];
- };
-
- type BuiltInDocumentEditorFooterItem = 'cancel' | 'spacer' | 'save-as' | 'save' | 'selected-pages' | 'loading-indicator';
- type BasicDocumentEditorFooterItem = {
- type: BuiltInDocumentEditorFooterItem | 'custom';
- node?: Node;
- className?: string;
- id?: string;
- onPress?: (e: MouseEvent, documentEditorUIHandler?: DocumentEditorUIHandler, id?: string) => void;
- };
- type DocumentEditorFooterItem = Omit<BasicDocumentEditorFooterItem, 'type' | 'onPress'> & ({
- type: BuiltInDocumentEditorFooterItem;
- onPress?: (e: Event) => void;
- } | {
- type: 'custom';
- onPress?: (e: Event, documentEditorUIHandler: DocumentEditorUIHandler, id?: string) => void;
- });
-
- type BuiltInDocumentEditorToolbarItem = 'add' | 'remove' | 'duplicate' | 'rotate-left' | 'rotate-right' | 'move' | 'move-left' | 'move-right' | 'import-document' | 'spacer' | 'undo' | 'redo' | 'select-all' | 'select-none';
- type DocumentEditorBuiltinToolbarItem = Omit<ToolItem, 'type' | 'onPress'> & {
- type: BuiltInDocumentEditorToolbarItem;
- onPress?: (e: Event) => void;
- };
- type DocumentEditorToolbarItem = Omit<ToolItem, 'type' | 'onPress'> & (DocumentEditorBuiltinToolbarItem | {
- type: 'custom';
- onPress?: (e: Event, documentEditorUIHandler: DocumentEditorUIHandler, id?: string) => void;
- });
-
- type AnnotationsResizeEvent = {
- annotation: AnnotationsUnion;
- isShiftPressed: boolean;
- resizeAnchor: ResizeAnchor;
- };
- type ResizeAnchor = 'TOP' | 'BOTTOM' | 'LEFT' | 'RIGHT' | 'TOP_LEFT' | 'TOP_RIGHT' | 'BOTTOM_RIGHT' | 'BOTTOM_LEFT';
-
- type AnnotationResizeStartCallbackConfiguration = {
- maintainAspectRatio?: boolean;
- minWidth?: number | undefined;
- minHeight?: number | undefined;
- maxWidth?: number | undefined;
- maxHeight?: number | undefined;
- };
- type AnnotationResizeStartCallback = (event: AnnotationsResizeEvent) => AnnotationResizeStartCallbackConfiguration;
-
- declare const UIElement: {
- readonly Sidebar: "Sidebar";
- };
- type IUIElement = (typeof UIElement)[keyof typeof UIElement];
-
- type RendererProps = {
- containerNode: Node;
- items?: List<any> | null;
- };
- type ItemRendererProps = {
- itemContainerNode: Node;
- item: any;
- };
- type ItemCustomRenderer = (itemRendererProps: ItemRendererProps) => void;
- type UIRendererConfiguration = {
- node: Node;
- onRenderItem?: ItemCustomRenderer;
- };
- type Renderer$1 = (rendererProps: RendererProps) => UIRendererConfiguration;
- type CustomUISidebarConfiguration = Partial<{
- [K in ISidebarMode]: Renderer$1;
- }>;
- type CustomUIElementConfiguration = CustomUISidebarConfiguration;
- type CustomUI = Partial<Record<IUIElement, CustomUIElementConfiguration>>;
-
- declare const SearchType: {
- readonly TEXT: "text";
- readonly PRESET: "preset";
- readonly REGEX: "regex";
- };
- type ISearchType = (typeof SearchType)[keyof typeof SearchType];
-
- declare const SearchPattern: {
- readonly CREDIT_CARD_NUMBER: "credit_card_number";
- readonly DATE: "date";
- readonly TIME: "time";
- readonly EMAIL_ADDRESS: "email_address";
- readonly INTERNATIONAL_PHONE_NUMBER: "international_phone_number";
- readonly IP_V4: "ipv4";
- readonly IP_V6: "ipv6";
- readonly MAC_ADDRESS: "mac_address";
- readonly NORTH_AMERICAN_PHONE_NUMBER: "north_american_phone_number";
- readonly SOCIAL_SECURITY_NUMBER: "social_security_number";
- readonly URL: "url";
- readonly US_ZIP_CODE: "us_zip_code";
- readonly VIN: "vin";
- };
- type ISearchPattern = (typeof SearchPattern)[keyof typeof SearchPattern];
-
- type AnnotationsPressEvent = {
- annotation: AnnotationsUnion;
- nativeEvent: Event;
- preventDefault?: () => void;
- selected: boolean;
- };
-
- declare enum AnnotationsWillChangeReason {
- DRAW_START = "DRAW_START",
- DRAW_END = "DRAW_END",
- TEXT_EDIT_START = "TEXT_EDIT_START",
- TEXT_EDIT_END = "TEXT_EDIT_END",
- SELECT_START = "SELECT_START",
- SELECT_END = "SELECT_END",
- MOVE_START = "MOVE_START",
- MOVE_END = "MOVE_END",
- RESIZE_START = "RESIZE_START",
- RESIZE_END = "RESIZE_END",
- ROTATE_START = "ROTATE_START",
- ROTATE_END = "ROTATE_END",
- DELETE_START = "DELETE_START",
- DELETE_END = "DELETE_END",
- PROPERTY_CHANGE = "PROPERTY_CHANGE"
- }
-
- type PagePressEvent = {
- pageIndex: number;
- point: Point;
- nativeEvent: Event;
- };
-
- type AnnotationPresetsUpdateEvent = {
- preventDefault: () => boolean;
- currentPreset: AnnotationPresetID;
- currentPresetProperties: AnnotationPreset;
- newPresetProperties: AnnotationPreset;
- };
-
- type AnnotationsFocusEvent = {
- annotation: AnnotationsUnion;
- nativeEvent: FocusEvent;
- };
- type AnnotationsBlurEvent = {
- annotation: AnnotationsUnion;
- nativeEvent: FocusEvent;
- };
-
- type SaveStateChangeEvent = {
- hasUnsavedChanges: boolean;
- };
-
- type SearchTermChangeEvent = {
- term: string;
- preventDefault: () => void;
- };
-
- type TextLinePressEvent = {
- textLine: TextLine;
- point: Point;
- nativeEvent: Event;
- };
-
- type CropAreaChangeStartEvent = {
- cropBox: Rect;
- pageIndex: number;
- };
- type CropAreaChangeStopEvent = {
- cropBox: Rect;
- pageIndex: number;
- };
-
- type AnnotationsTransformEvent = {
- annotation: AnnotationsUnion;
- };
-
- type AnnotationsCopyEvent = {
- annotation: AnnotationsUnion;
- };
-
- type AnnotationsCutEvent = {
- annotation: AnnotationsUnion;
- };
-
- type AnnotationsDuplicateEvent = {
- annotations: AnnotationsUnion[];
- formFields?: FormField[];
- originalAnnotations: AnnotationsUnion[];
- originalFormFields?: Map$1<string, FormField>;
- };
-
- type AnnotationsPasteEvent = AnnotationsDuplicateEvent & {
- previousAction: 'COPY' | 'CUT';
- };
-
- interface ITextSelection$1 {
- startNestedContentBlockId: string | null;
- startTextLineId: number | null;
- startPageIndex: number | null;
- startNode: Text | null;
- startOffset: number | null;
- endNestedContentBlockId: string | null;
- endTextLineId: number | null;
- endPageIndex: number | null;
- endNode: Text | null;
- endOffset: number | null;
- getText: (() => Promise<string>) | null;
- getSelectedTextLines: (() => Promise<List<TextLine>>) | null;
- getBoundingClientRect: (() => Promise<Rect | null>) | null;
- getSelectedRectsPerPage: (() => Promise<List<{
- pageIndex: number;
- rects: List<Rect>;
- }>>) | null;
- }
- declare const PublicTextSelection_base: Record$1.Factory<ITextSelection$1>;
- declare class PublicTextSelection extends PublicTextSelection_base {
- startTextLineId: number;
- startNestedContentBlockId: string;
- startPageIndex: number;
- startNode: Text;
- startOffset: number;
- endTextLineId: number;
- endNestedContentBlockId: string;
- endPageIndex: number;
- endNode: Text;
- endOffset: number;
- getText: () => Promise<string>;
- getSelectedTextLines: () => Promise<List<TextLine>>;
- getBoundingClientRect: () => Promise<Rect | null>;
- getSelectedRectsPerPage: () => Promise<List<{
- pageIndex: number;
- rects: List<Rect>;
- }>>;
- }
-
- interface AnnotationNoteProps extends INoteAnnotation {
- parentAnnotation: AnnotationsUnion | null;
- position: Point;
- notePosition?: Point;
- }
- declare class AnnotationNote<T extends AnnotationNoteProps = AnnotationNoteProps> extends NoteAnnotation<T> {
- parentAnnotation?: AnnotationsUnion;
- position: Point;
- notePosition?: Point;
- static defaultValues: IObject$1;
- }
-
- type AnnotationNotePressEvent = {
- preventDefault: () => boolean;
- annotationNote?: AnnotationNote | null;
- };
-
- type AnnotationNoteHoverEvent = {
- preventDefault: () => boolean;
- annotationNote?: AnnotationNote | null;
- };
-
- declare const DocumentComparisonSourceType: {
- readonly USE_OPEN_DOCUMENT: "USE_OPEN_DOCUMENT";
- readonly USE_FILE_DIALOG: "USE_FILE_DIALOG";
- };
- type IDocumentComparisonSourceType = (typeof DocumentComparisonSourceType)[keyof typeof DocumentComparisonSourceType];
-
- type DocumentComparisonSource = {
- source: IDocumentComparisonSourceType | string | ArrayBuffer | Promise<string | ArrayBuffer>;
- pageIndex?: number;
- };
-
- type DocumentComparisonStrokeColors = {
- documentA?: Color$2;
- documentB?: Color$2;
- };
-
- type DocumentComparisonConfiguration = {
- documentA: DocumentComparisonSource;
- documentB: DocumentComparisonSource;
- strokeColors?: DocumentComparisonStrokeColors;
- blendMode?: IBlendMode;
- autoCompare: boolean;
- };
-
- type DocumentComparisonUIStartEvent = DocumentComparisonConfiguration;
-
- type CommentsMentionEvent = {
- comment: Comment$1;
- modifications: List<{
- userId: string;
- action: 'ADDED' | 'REMOVED';
- }>;
- };
-
- type Signature = InkAnnotation | ImageAnnotation;
- interface HistoryEvent<T> {
- action: T;
- before: AnnotationsUnion;
- after: AnnotationsUnion;
- }
- interface EventMap {
- 'viewState.change': (viewState: ViewState, previousViewState: ViewState) => void;
- 'viewState.currentPageIndex.change': (pageIndex: number) => void;
- 'viewState.zoom.change': (zoom: number) => void;
- 'annotationPresets.update': (event: AnnotationPresetsUpdateEvent) => void;
- 'annotations.blur': (event: AnnotationsBlurEvent) => void;
- 'annotations.change': () => void;
- 'annotations.create': (annotations: List<AnnotationsUnion>) => void;
- 'annotations.delete': (annotations: List<AnnotationsUnion>) => void;
- 'annotations.didSave': () => void;
- 'annotations.focus': (event: AnnotationsFocusEvent) => void;
- 'annotations.load': (annotations: List<AnnotationsUnion>) => void;
- 'annotations.press': (event: AnnotationsPressEvent) => void;
- 'annotations.update': (annotations: List<AnnotationsUnion>) => void;
- 'annotations.willChange': (event: {
- reason: AnnotationsWillChangeReason;
- annotations: List<AnnotationsUnion>;
- }) => void;
- 'annotations.willSave': () => void;
- 'annotationSelection.change': (annotation?: AnnotationsUnion) => void;
- 'annotations.transform': (event: AnnotationsTransformEvent) => void;
- 'annotations.copy': (event: AnnotationsCopyEvent) => void;
- 'annotations.cut': (event: AnnotationsCutEvent) => void;
- 'annotations.paste': (event: AnnotationsPasteEvent) => void;
- 'annotations.duplicate': (event: AnnotationsDuplicateEvent) => void;
- 'bookmarks.change': () => void;
- 'bookmarks.create': (bookmarks: List<Bookmark>) => void;
- 'bookmarks.update': (bookmarks: List<Bookmark>) => void;
- 'bookmarks.delete': (bookmarks: List<Bookmark>) => void;
- 'bookmarks.load': (bookmarks: List<Bookmark>) => void;
- 'bookmarks.didSave': () => void;
- 'bookmarks.willSave': () => void;
- 'comments.change': () => void;
- 'comments.create': (comments: List<Comment$1>) => void;
- 'comments.delete': (comments: List<Comment$1>) => void;
- 'comments.update': (comments: List<Comment$1>) => void;
- 'comments.load': () => void;
- 'comments.willSave': () => void;
- 'comments.didSave': () => void;
- 'instant.connectedClients.change': (clients: Map$1<string, InstantClient>) => void;
- 'document.change': (operations: DocumentOperation[]) => void;
- 'document.saveStateChange': (event: SaveStateChangeEvent) => void;
- 'formFieldValues.update': (formFields: List<FormField>) => void;
- 'formFieldValues.willSave': () => void;
- 'formFieldValues.didSave': (res: {
- response: Response;
- error: Error;
- }) => void;
- 'forms.willSubmit': (event: {
- preventDefault: () => void;
- }) => void;
- 'forms.didSubmit': (event: {
- preventDefault: () => void;
- }) => void;
- 'formFields.change': () => void;
- 'formFields.create': (formFields: List<FormField>) => void;
- 'formFields.delete': (formFields: List<FormField>) => void;
- 'formFields.didSave': () => void;
- 'formFields.load': (formFields: List<FormField>) => void;
- 'formFields.update': (formFields: List<FormField>) => void;
- 'formFields.willSave': () => void;
- 'search.stateChange': (searchState: SearchState) => void;
- 'search.termChange': (event: SearchTermChangeEvent) => void;
- 'storedSignatures.change': () => void;
- 'storedSignatures.create': (signature: Signature) => void;
- 'storedSignatures.delete': (signature: Signature) => void;
- 'storedSignatures.update': (signatures: List<Signature>) => void;
- 'textLine.press': (event: TextLinePressEvent) => void;
- 'textSelection.change': (selection: PublicTextSelection | null) => void;
- 'history.change': (event: HistoryEvent<'undo' | 'redo'>) => void;
- 'history.willChange': (event: {
- type: 'create' | 'update' | 'delete';
- annotation: Annotation;
- preventDefault: () => void;
- }) => void;
- 'history.clear': () => void;
- 'history.redo': (event: HistoryEvent<'redo'>) => void;
- 'history.undo': (event: HistoryEvent<'undo'>) => void;
- 'page.press': (event: PagePressEvent) => void;
- 'inkSignatures.create': (signature: Signature) => void;
- 'inkSignatures.delete': (signature: Signature) => void;
- 'inkSignatures.update': (signatures: Signature[]) => void;
- 'inkSignatures.change': () => void;
- 'cropArea.changeStart': (opts: CropAreaChangeStartEvent) => void;
- 'cropArea.changeStop': (opts: CropAreaChangeStopEvent) => void;
- 'documentComparisonUI.start': (opts: DocumentComparisonUIStartEvent) => void;
- 'documentComparisonUI.end': () => void;
- 'annotationNote.press': (event: AnnotationNotePressEvent) => void;
- 'annotationNote.hover': (event: AnnotationNoteHoverEvent) => void;
- 'comments.mention': (event: CommentsMentionEvent) => void;
- }
-
- interface IEmbeddedFile {
- id: ID;
- attachmentId: string;
- description: null | string;
- fileName: null | string;
- fileSize: null | number;
- updatedAt: null | Date;
- }
- declare const EmbeddedFile_base: Record$1.Factory<IEmbeddedFile>;
- declare class EmbeddedFile extends EmbeddedFile_base {
- }
-
- type IAnnotationToolbarType = 'stroke-color' | 'fill-color' | 'background-color' | 'opacity' | 'line-width' | 'blend-mode' | 'spacer' | 'delete' | 'annotation-note' | 'border-color' | 'border-width' | 'border-style' | 'color' | 'linecaps-dasharray' | 'line-style' | 'font' | 'overlay-text' | 'outline-color' | 'apply-redactions' | 'measurementType' | 'measurementScale' | 'back';
- type BuiltInAnnotationToolbarItem = {
- type: IAnnotationToolbarType;
- };
- type Shared = Omit<ToolItem, 'selected' | 'type'> & {
- onPress?: (nativeEvent: MouseEvent, id?: string) => void;
- iconClassName?: string;
- onIconPress?: (nativeEvent: MouseEvent, id?: string) => void;
- };
- type AnnotationToolbarItem = (Omit<Shared, 'node'> & {
- type: IAnnotationToolbarType;
- }) | (Omit<Shared, 'icon'> & {
- id: string;
- type: 'custom';
- icon?: string | Node;
- node?: Node;
- });
-
- type AnnotationToolbarItemsCallback = (annotation: AnnotationsUnion, options: {
- defaultAnnotationToolbarItems: BuiltInAnnotationToolbarItem[];
- hasDesktopLayout: boolean;
- }) => AnnotationToolbarItem[];
-
- type OnWidgetAnnotationCreationStartCallback = (annotation: WidgetAnnotation, formField: FormField) => {
- annotation?: WidgetAnnotation;
- formField?: FormField;
- };
-
- interface ITextRange {
- startNode: Text | null;
- startOffset: number | null;
- endNode: Text | null;
- endOffset: number | null;
- }
- declare const TextRange_base: Record$1.Factory<ITextRange>;
- declare class TextRange extends TextRange_base {
- startNode: Text;
- startOffset: number;
- endNode: Text;
- endOffset: number;
- startAndEndIds(): {
- startTextLineId: number;
- endTextLineId: number;
- startNestedContentBlockId: string;
- endNestedContentBlockId: string;
- startPageIndex: number;
- endPageIndex: number;
- } | null;
- }
-
- interface ITextSelection {
- textRange: TextRange | null;
- startTextLineId: number | null;
- endTextLineId: number | null;
- startNestedContentBlockId: string | null;
- endNestedContentBlockId: string | null;
- startPageIndex: number | null;
- endPageIndex: number | null;
- }
- declare const TextSelection_base: Record$1.Factory<ITextSelection>;
- declare class TextSelection extends TextSelection_base {
- }
-
- declare const builtInItems: readonly ["highlight", "strikeout", "underline", "squiggle", "redact-text-highlighter", "comment", "document-assistant"];
- type InlineToolbarType = (typeof builtInItems)[number];
- type InlineTextSelectionToolbarItem = Omit<ToolItem, 'type'> & {
- type: InlineToolbarType | 'custom';
- };
- type InlineTextSelectionToolbarItemsCallback = (options: {
- defaultItems: InlineTextSelectionToolbarItem[];
- hasDesktopLayout: boolean;
- }, selection: TextSelection) => InlineTextSelectionToolbarItem[];
-
- type MeasurementValueConfiguration = {
- name?: string;
- scale: IMeasurementScale;
- precision: IMeasurementPrecision;
- selected?: boolean;
- };
- type MeasurementValueConfigurationCallback = (configuration: MeasurementValueConfiguration[]) => MeasurementValueConfiguration[];
-
- declare const DocumentPermissionsEnum: {
- readonly annotationsAndForms: "annotationsAndForms";
- readonly assemble: "assemble";
- readonly extract: "extract";
- readonly extractAccessibility: "extractAccessibility";
- readonly fillForms: "fillForms";
- readonly modification: "modification";
- readonly printHighQuality: "printHighQuality";
- readonly printing: "printing";
- };
- type IDocumentPermissions = (typeof DocumentPermissionsEnum)[keyof typeof DocumentPermissionsEnum];
-
- type OCGLayer = {
- name: string;
- ocgId: number;
- radioGroup?: number;
- };
- type OCGCollection = {
- name?: string;
- ocgId?: number;
- layers: OCGLayer[];
- };
- type OCG = OCGLayer | OCGCollection;
- type OCGLayers = OCG[];
- type OCGLayersVisibilityState = {
- visibleLayerIds: number[];
- };
-
- type ViewStateSetter = (currentState: ViewState) => ViewState;
- type ToolbarItemsSetter = (currentState: ToolbarItem[]) => ToolbarItem[];
- type StoredSignaturesSetter = (annotations: List<InkAnnotation | ImageAnnotation>) => List<InkAnnotation | ImageAnnotation>;
- type SearchStateSetter = (currentState: SearchState) => SearchState;
- type AnnotationPresetsSetter = (currentState: Record<string, AnnotationPreset$1>) => Record<string, AnnotationPreset$1>;
- type StampAnnotationTemplatesSetter = (currentState: Array<StampAnnotation | ImageAnnotation>) => Array<StampAnnotation | ImageAnnotation>;
- type SetDocumentEditorFooterFunction = (currentState: DocumentEditorFooterItem[]) => DocumentEditorFooterItem[];
- type SetDocumentEditorToolbarFunction = (currentState: DocumentEditorToolbarItem[]) => DocumentEditorToolbarItem[];
- declare class Instance {
- totalPageCount: number;
- pageInfoForIndex: (pageIndex: number) => PageInfo | null | undefined;
- textLinesForPageIndex: (pageIndex: number) => Promise<List<TextLine>>;
- getMarkupAnnotationText: (annotation: TextMarkupAnnotationsUnion) => Promise<string>;
- getTextFromRects: (pageIndex: number, rects: List<Rect>) => Promise<string>;
- getDocumentPermissions: () => Promise<Record<IDocumentPermissions, boolean>>;
- currentZoomLevel: number;
- maximumZoomLevel: number;
- minimumZoomLevel: number;
- zoomStep: number;
- disablePointSnapping: boolean;
- connectedClients: Map$1<string, InstantClient>;
- addEventListener: <K extends keyof EventMap>(action: K, listener: EventMap[K]) => void;
- removeEventListener: <K extends keyof EventMap>(action: K, listener: EventMap[K]) => void;
- jumpToRect: (pageIndex: number, rect: Rect) => void;
- jumpAndZoomToRect: (pageIndex: number, rect: Rect) => void;
- transformContentClientToPageSpace: <T extends Rect | Point>(rectOrPoint: T, pageIndex: number) => T;
- transformContentPageToClientSpace: <T extends Rect | Point>(rectOrPoint: T, pageIndex: number) => T;
- transformClientToPageSpace: <T extends Rect | Point>(rectOrPoint: T, pageIndex: number) => T;
- transformPageToClientSpace: <T extends Rect | Point>(rectOrPoint: T, pageIndex: number) => T;
- transformRawToPageSpace: (rawInset: InsetJSON | Inset, pageIndex: number) => Rect;
- transformPageToRawSpace: (rect: Rect, pageIndex: number) => Inset;
- exportOffice: (options: ExportOfficeFlags) => Promise<ArrayBuffer>;
- exportPDF: (flags?: ExportPDFFlags) => Promise<ArrayBuffer>;
- exportXFDF: () => Promise<string>;
- exportInstantJSON: (version?: number) => Promise<InstantJSON>;
- renderPageAsArrayBuffer: (options: {
- width: number;
- } | {
- height: number;
- }, pageIndex: number) => Promise<ArrayBuffer>;
- renderPageAsImageURL: (options: {
- width: number;
- } | {
- height: number;
- }, pageIndex: number) => Promise<string>;
- print: (printMode?: IPrintMode | {
- mode?: IPrintMode;
- excludeAnnotations?: boolean;
- }) => void;
- abortPrint: () => void;
- setCustomRenderers: (customRenderers: CustomRenderers) => void;
- setCustomUIConfiguration: (customUIConfigurationOrConfigurationSetter: CustomUI | ((customUI: CustomUI | null) => CustomUI)) => void;
- getDocumentOutline: () => Promise<List<OutlineElement>>;
- setDocumentOutline: (outline: List<OutlineElement>) => void;
- getPageGlyphs: (pageIndex: number) => Promise<List<Glyph>>;
- setAnnotationCreatorName: (annotationCreatorName?: string | null) => void;
- setOnWidgetAnnotationCreationStart: (callback: OnWidgetAnnotationCreationStartCallback) => void;
- setOnCommentCreationStart: (callback: OnCommentCreationStartCallback) => void;
- getLayers: () => Promise<OCGLayers>;
- getLayersVisibilityState: () => Promise<OCGLayersVisibilityState>;
- setLayersVisibilityState: (visibilityState: OCGLayersVisibilityState) => Promise<void>;
- contentWindow: Window;
- contentDocument: Document | ShadowRoot;
- readonly viewState: ViewState;
- setViewState: (stateOrFunction: ViewStateSetter | ViewState) => void;
- readonly toolbarItems: ToolbarItem[];
- setToolbarItems: (stateOrFunction: ToolbarItemsSetter | ToolbarItem[]) => void;
- setAnnotationToolbarItems: (annotationToolbarItemsCallback: AnnotationToolbarItemsCallback) => void;
- setInlineTextSelectionToolbarItems: (InlineTextSelectionToolbarItemsCallback: InlineTextSelectionToolbarItemsCallback) => void;
- annotationPresets: Record<AnnotationPresetID$1, AnnotationPreset$1>;
- setAnnotationPresets: (stateOrFunction: AnnotationPresetsSetter | Record<AnnotationPresetID$1, AnnotationPreset$1>) => void;
- setCurrentAnnotationPreset: (annotationPresetID?: string | null) => void;
- readonly currentAnnotationPreset: string | null | undefined;
- readonly stampAnnotationTemplates: Array<StampAnnotation | ImageAnnotation>;
- setStampAnnotationTemplates: (stateOrFunction: StampAnnotationTemplatesSetter | Array<StampAnnotation | ImageAnnotation>) => void;
- getAnnotations: (pageIndex: number) => Promise<List<AnnotationsUnion>>;
- createAttachment: (file: Blob) => Promise<string>;
- getAttachment: (attachmentId: string) => Promise<Blob>;
- calculateFittingTextAnnotationBoundingBox: (annotation: TextAnnotation) => TextAnnotation;
- setOnAnnotationResizeStart: (callback: AnnotationResizeStartCallback) => void;
- getOverlappingAnnotations: (annotationOrFormField: AnnotationsUnion | FormField) => Promise<List<AnnotationsUnion>>;
- getBookmarks: () => Promise<List<Bookmark>>;
- getFormFields: () => Promise<List<FormField>>;
- getFormFieldValues: () => Record<string, null | string | Array<string>>;
- setFormFieldValues: (formFieldValues: Record<string, null | string | Array<string>>) => void;
- getTextSelection: () => Record<string, any> | null | undefined;
- getSelectedAnnotation: () => AnnotationsUnion | null | undefined;
- getSelectedAnnotations: () => List<AnnotationsUnion> | null | undefined;
- getAnnotationsGroups: () => Map$1<string, {
- groupKey: string;
- annotationsIds: Set$1<ID>;
- }> | null | undefined;
- setSelectedAnnotation: (annotationOrAnnotationId?: (AnnotationsUnion | ID) | null) => void;
- setSelectedAnnotations: (annotationsOrAnnotationsId?: List<AnnotationsUnion | ID> | null) => void;
- groupAnnotations: (annotationsOrAnnotationsId?: List<AnnotationsUnion | ID>) => void;
- deleteAnnotationsGroup: (annotationGroupId?: string) => void;
- setEditingAnnotation: (annotationOrAnnotationId?: (AnnotationsUnion | ID) | null, autoSelectText?: boolean | null) => void;
- setCustomOverlayItem: (item: CustomOverlayItem) => void;
- removeCustomOverlayItem: (id: CustomOverlayItemID) => void;
- readonly locale: string;
- setLocale: (arg0: string) => Promise<void>;
- getInkSignatures: () => Promise<List<InkAnnotation | ImageAnnotation>>;
- getStoredSignatures: () => Promise<List<InkAnnotation | ImageAnnotation>>;
- setInkSignatures: (stateOrFunction: StoredSignaturesSetter | List<InkAnnotation | ImageAnnotation>) => Promise<void>;
- setStoredSignatures: (stateOrFunction: StoredSignaturesSetter | List<InkAnnotation | ImageAnnotation>) => Promise<void>;
- search: (term: string, options?: {
- startPageIndex?: number;
- endPageIndex?: number;
- searchType?: ISearchType;
- searchInAnnotations?: boolean;
- caseSensitive?: boolean;
- }) => Promise<List<SearchResult>>;
- startUISearch: (term: string) => void;
- readonly searchState: SearchState;
- setSearchState: (stateOrFunction: SearchStateSetter | SearchState) => void;
- readonly editableAnnotationTypes: Array<Class<AnnotationsUnion>>;
- setEditableAnnotationTypes: (arg0: Array<Class<AnnotationsUnion>>) => void;
- setIsEditableAnnotation: (arg0: IsEditableAnnotationCallback) => void;
- setIsEditableComment: (arg0: IsEditableCommentCallback) => void;
- setGroup: (group: string) => void;
- resetGroup: () => void;
- setMentionableUsers: (users: MentionableUser$1[]) => void;
- setMaxMentionSuggestions: (maxSuggestions: number) => void;
- getComments: () => Promise<List<Comment$1>>;
- setDocumentEditorFooterItems: (stateOrFunction: DocumentEditorFooterItem[] | SetDocumentEditorFooterFunction) => void;
- setDocumentEditorToolbarItems: (stateOrFunction: DocumentEditorToolbarItem[] | SetDocumentEditorToolbarFunction) => void;
- getSignaturesInfo: () => Promise<SignaturesInfo>;
- signDocument: (arg0: SignatureCreationData | null, arg1?: TwoStepSignatureCallback | SigningServiceData) => Promise<void>;
- setSignaturesLTV: (certificates?: ArrayBuffer[] | string[]) => Promise<SignaturesInfo>;
- applyOperations: (operations: Array<DocumentOperation>) => Promise<void>;
- exportPDFWithOperations: (arg0: Array<DocumentOperation>) => Promise<ArrayBuffer>;
- applyRedactions: () => Promise<void>;
- save: () => Promise<void>;
- hasUnsavedChanges: () => boolean;
- ensureChangesSaved: (changes: Change | Array<Change>) => Promise<Array<Change>>;
- create: (changes: Change | Array<Change> | List<Change>) => Promise<Array<Change>>;
- update: (changes: Change | Array<Change> | List<Change>) => Promise<Array<Change>>;
- delete: (ids: InstantID | Change | Array<InstantID | Change> | List<InstantID | Change>) => Promise<Array<Change>>;
- toggleClipboardActions: (enable: boolean) => void;
- setMeasurementSnapping: (enable: boolean) => void;
- setMeasurementPrecision: (precision: IMeasurementPrecision) => void;
- setMeasurementScale: (scale: MeasurementScale) => void;
- setMeasurementValueConfiguration: (configurationCallback: MeasurementValueConfigurationCallback) => void;
- createRedactionsBySearch: (term: string | ISearchPattern, options?: {
- searchType?: ISearchType;
- searchInAnnotations?: boolean;
- caseSensitive?: boolean;
- annotationPreset?: RedactionAnnotationPreset;
- }) => Promise<List<string>>;
- history: {
- undo: () => Promise<boolean>;
- redo: () => Promise<boolean>;
- clear: () => void;
- enable: () => void;
- disable: () => void;
- canUndo: () => boolean;
- canRedo: () => boolean;
- };
- setDocumentComparisonMode: (documentComparisonConfiguration: DocumentComparisonConfiguration | null) => void;
- compareDocuments: (comparisonDocuments: ComparisonDocuments, operations: ComparisonOperation) => Promise<DocumentComparisonResult>;
- getEmbeddedFiles: () => Promise<List<EmbeddedFile>>;
- getPageTabOrder: (pageIndex: number) => Promise<ID[]>;
- setPageTabOrder: (pageIndex: number, annotationIdsSortCallback: (tabOrderedAnnotations: AnnotationsUnion[]) => ID[]) => Promise<void>;
- enableAlwaysScrollToZoom: boolean;
- }
-
- type ComparisonDocuments = {
- originalDocument: DocumentDescriptor;
- changedDocument: DocumentDescriptor;
- };
- type Range = {
- position: number;
- length: number;
- };
- type TextBlock = {
- range: Range;
- rects: number[][];
- };
- type Operation = {
- type: 'insert' | 'delete' | 'equal';
- text: string;
- originalTextBlocks: TextBlock;
- changedTextBlocks: TextBlock;
- };
- type Hunk = {
- originalRange: Range;
- changedRange: Range;
- operations: Operation[];
- };
- type ComparisonResult = {
- type: 'text';
- hunks: Hunk[];
- };
- type PageComparisonResult = {
- originalPageIndex: number;
- changedPageIndex: number;
- comparisonResults: ComparisonResult[];
- };
- type DocumentComparisonResult = {
- documentComparisonResults: PageComparisonResult[];
- } | null;
-
- declare const ProductId: {
- SharePoint: string;
- Salesforce: string;
- Maui_Android: string;
- Maui_iOS: string;
- Maui_MacCatalyst: string;
- Maui_Windows: string;
- FlutterForWeb: string;
- Electron: string;
- };
- type IProductId = (typeof ProductId)[keyof typeof ProductId];
-
- type ActionFlags = 'includeExclude' | 'includeNoValueFields' | 'exportFormat' | 'getMethod' | 'submitCoordinated' | 'xfdf' | 'includeAppendSaves' | 'includeAnnotations' | 'submitPDF' | 'canonicalFormat' | 'excludeNonUserAnnotations' | 'excludeFKey' | 'embedForm';
- type ActionJSON = {
- type: 'uri';
- uri: string;
- subactions?: Array<ActionJSON>;
- } | {
- type: 'goTo';
- pageIndex: number;
- subactions?: Array<ActionJSON>;
- } | {
- type: 'goToEmbedded';
- newWindow: boolean;
- relativePath: string;
- targetType: 'parent' | 'child';
- subactions?: Array<ActionJSON>;
- } | {
- type: 'goToRemote';
- relativePath: string;
- namedDestination: string;
- subactions?: Array<ActionJSON>;
- } | {
- type: 'hide';
- hide: boolean;
- annotationReferences: Array<AnnotationReference>;
- subactions?: Array<ActionJSON>;
- } | {
- type: 'resetForm';
- fields: Array<string> | null;
- flags: string | null;
- subactions?: Array<ActionJSON>;
- } | {
- type: 'submitForm';
- uri: string;
- fields: Array<string> | null;
- flags: Array<ActionFlags> | null;
- subactions?: Array<ActionJSON>;
- } | {
- type: 'launch';
- filePath: string;
- subactions?: Array<ActionJSON>;
- } | {
- type: 'named';
- action: string;
- subactions?: Array<ActionJSON>;
- } | {
- type: 'javaScript';
- script: string;
- subactions?: Array<ActionJSON>;
- };
- type BookmarkJSON = {
- v: 1;
- type: 'pspdfkit/bookmark';
- id: string;
- name: string | null;
- sortKey: number | null;
- action: ActionJSON;
- pdfBookmarkId: string | null;
- };
- type RawPdfBoxes = {
- bleedBox: null | IRectJSON;
- cropBox: null | IRectJSON;
- mediaBox: null | IRectJSON;
- trimBox: null | IRectJSON;
- };
-
- type IRectJSON = [left: number, top: number, width: number, height: number];
-
- type BaseAnnotationJSON = {
- v: number;
- type?: 'pspdfkit/ink' | 'pspdfkit/shape/line' | 'pspdfkit/shape/rectangle' | 'pspdfkit/shape/ellipse' | 'pspdfkit/shape/polygon' | 'pspdfkit/shape/polyline' | 'pspdfkit/link' | 'pspdfkit/markup/highlight' | 'pspdfkit/markup/squiggly' | 'pspdfkit/markup/strikeout' | 'pspdfkit/markup/underline' | 'pspdfkit/markup/redaction' | 'pspdfkit/stamp' | 'pspdfkit/text' | 'pspdfkit/note' | 'pspdfkit/image' | 'pspdfkit/media' | 'pspdfkit/widget' | 'pspdfkit/comment-marker' | 'pspdfkit/unknown';
- name?: string | null;
- id: string;
- subject?: string | null;
- pdfObjectId?: number | null;
- pageIndex: number;
- bbox: IRectJSON;
- opacity?: number;
- flags?: ('noPrint' | 'noZoom' | 'noRotate' | 'noView' | 'hidden' | 'locked' | 'lockedContents' | 'readOnly')[] | null;
- action?: ActionJSON | null;
- note?: string | null;
- createdAt?: string | Date;
- updatedAt?: string | Date;
- creatorName?: string | null;
- customData?: Record<string, unknown> | null;
- isCommentThreadRoot?: boolean;
- isAnonymous?: boolean;
- APStreamCache?: {
- cache: string;
- } | {
- attach: string;
- };
- blendMode?: IBlendMode | null;
- } & ICollaboratorPermissionsOptions;
- type ImageAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
- type: 'pspdfkit/image';
- description?: string | null;
- fileName?: string | null;
- contentType: string;
- imageAttachmentId: string;
- rotation: number;
- isSignature?: boolean;
- xfdfAppearanceStream?: string;
- xfdfAppearanceStreamOriginalPageRotation?: number;
- };
- type ShapeAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
- strokeWidth: number;
- strokeColor: string | null;
- fillColor: string | null;
- strokeDashArray?: [number, number] | null;
- measurementPrecision?: IMeasurementPrecision | null;
- measurementScale?: MeasurementScaleJSON | null;
- lineWidth?: number | null;
- };
- type EllipseAnnotationJSON = ShapeAnnotationJSON & {
- type: 'pspdfkit/shape/ellipse';
- cloudyBorderIntensity: number | null;
- cloudyBorderInset: InsetJSON | null;
- measurementBBox: IRectJSON | null;
- };
- type LineAnnotationJSON = ShapeAnnotationJSON & {
- type: 'pspdfkit/shape/line';
- startPoint: [number, number];
- endPoint: [number, number];
- lineCaps?: LineCapsType | null;
- lines?: {
- points: [number, number][][];
- intensities: number[][];
- };
- };
- type PolygonAnnotationJSON = ShapeAnnotationJSON & {
- type: 'pspdfkit/shape/polygon';
- points: [number, number][];
- cloudyBorderIntensity: number | null;
- lines?: {
- points: [number, number][][];
- intensities: number[][];
- };
- };
- type PolylineAnnotationJSON = ShapeAnnotationJSON & {
- type: 'pspdfkit/shape/polyline';
- points: [number, number][];
- lineCaps?: LineCapsType | null;
- lines?: {
- points: [number, number][][];
- intensities: number[][];
- };
- };
- type RectangleAnnotationJSON = ShapeAnnotationJSON & {
- type: 'pspdfkit/shape/rectangle';
- cloudyBorderIntensity: number | null;
- cloudyBorderInset?: InsetJSON | null;
- measurementBBox: IRectJSON | null;
- };
- type InkAnnotationJSON = BaseAnnotationJSON & {
- type: 'pspdfkit/ink';
- lines: {
- points: [number, number][][];
- intensities: number[][];
- };
- lineWidth: number;
- strokeColor: string | null;
- backgroundColor: string | null;
- isDrawnNaturally: boolean;
- isSignature: boolean;
- };
- type LinkAnnotationJSON = BaseAnnotationJSON & {
- type: 'pspdfkit/link';
- borderColor?: string | null;
- borderWidth?: number | null;
- borderStyle?: IBorderStyle | null;
- };
- type NoteAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
- type: 'pspdfkit/note';
- text?: {
- format: 'plain';
- value: string;
- };
- icon?: string;
- color?: string;
- };
- type MediaAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
- type: 'pspdfkit/media';
- description: string | null;
- fileName: string | null;
- contentType: string | null;
- mediaAttachmentId: string | null;
- };
- type BaseTextMarkupAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
- rects: [number, number, number, number][];
- };
- type TextMarkupAnnotationJSON = BaseTextMarkupAnnotationJSON & {
- type: 'pspdfkit/markup/highlight' | 'pspdfkit/markup/squiggly' | 'pspdfkit/markup/strikeout' | 'pspdfkit/markup/underline' | 'pspdfkit/markup/redaction';
- color: string | null;
- };
- type RedactionAnnotationJSON = BaseTextMarkupAnnotationJSON & {
- type: 'pspdfkit/markup/redaction';
- fillColor?: string | null;
- outlineColor?: string | null;
- overlayText?: string | null;
- repeatOverlayText?: boolean | null;
- rotation?: number;
- color?: string | null;
- };
- type StampAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
- type: 'pspdfkit/stamp';
- stampType: StampKind;
- title: string | null;
- color?: string | null;
- subTitle?: string | null;
- subtitle: string | null;
- rotation: number | null;
- xfdfAppearanceStream?: string;
- xfdfAppearanceStreamOriginalPageRotation?: number;
- kind?: StampKind;
- };
- type TextAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
- type: 'pspdfkit/text';
- text: {
- format: 'xhtml' | 'plain';
- value: string;
- };
- fontColor?: string | null;
- backgroundColor?: string | null;
- font?: string | null;
- rotation?: number | null;
- fontSize?: number | null;
- fontStyle?: string[] | null;
- horizontalAlign?: 'left' | 'center' | 'right';
- verticalAlign?: 'top' | 'center' | 'bottom';
- callout?: {
- start: [number, number];
- knee?: [number, number] | null;
- end: [number, number];
- cap?: ILineCap | null;
- innerRectInset?: InsetJSON | null;
- } | null;
- borderStyle?: IBorderStyle | null;
- borderWidth?: number | null;
- borderColor?: string | null;
- isFitting?: boolean;
- lineHeightFactor?: number | null;
- };
- type UnknownAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
- type: 'pspdfkit/unknown';
- };
- type WidgetAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
- type: 'pspdfkit/widget';
- formFieldName: string;
- borderColor?: string | null;
- borderStyle?: IBorderStyle | null;
- borderDashArray?: number[] | null;
- borderWidth?: number | null;
- font?: string | null;
- fontSize?: 'auto' | number | null;
- fontColor?: string | null;
- backgroundColor?: string | null;
- horizontalAlign?: 'left' | 'center' | 'right' | null;
- verticalAlign?: 'top' | 'center' | 'bottom' | null;
- fontStyle?: string[] | null | undefined;
- rotation?: number;
- additionalActions?: SerializedAdditionalActionsType | null;
- lineHeightFactor?: number | null;
- };
- type CommentMarkerAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
- type: 'pspdfkit/comment-marker';
- };
- type AnnotationJSONUnion = TextMarkupAnnotationJSON | TextAnnotationJSON | WidgetAnnotationJSON | RedactionAnnotationJSON | StampAnnotationJSON | NoteAnnotationJSON | LinkAnnotationJSON | InkAnnotationJSON | RectangleAnnotationJSON | PolylineAnnotationJSON | PolygonAnnotationJSON | LineAnnotationJSON | EllipseAnnotationJSON | ImageAnnotationJSON | UnknownAnnotationJSON | MediaAnnotationJSON | CommentMarkerAnnotationJSON;
-
- declare const Theme$1: {
- readonly LIGHT: "LIGHT";
- readonly DARK: "DARK";
- readonly AUTO: "AUTO";
- };
- type ITheme = (typeof Theme$1)[keyof typeof Theme$1];
-
- interface ResolvedDateTimeFormatOptions extends Intl.ResolvedDateTimeFormatOptions {
- hourCycle?: Intl.DateTimeFormatOptions['hourCycle'];
- }
- interface DateRangeFormatPart extends Intl.DateTimeFormatPart {
- source: 'startRange' | 'endRange' | 'shared';
- }
- /** A wrapper around Intl.DateTimeFormat that fixes various browser bugs, and polyfills new features. */
- declare class DateFormatter implements Intl.DateTimeFormat {
- constructor(locale: string, options?: Intl.DateTimeFormatOptions);
- /** Formats a date as a string according to the locale and format options passed to the constructor. */
- format(value: Date): string;
- /** Formats a date to an array of parts such as separators, numbers, punctuation, and more. */
- formatToParts(value: Date): Intl.DateTimeFormatPart[];
- /** Formats a date range as a string. */
- formatRange(start: Date, end: Date): string;
- /** Formats a date range as an array of parts. */
- formatRangeToParts(start: Date, end: Date): DateRangeFormatPart[];
- /** Returns the resolved formatting options based on the values passed to the constructor. */
- resolvedOptions(): ResolvedDateTimeFormatOptions;
- }
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface AriaLabelingProps$1 {
- /**
- * Defines a string value that labels the current element.
- */
- 'aria-label'?: string,
-
- /**
- * Identifies the element (or elements) that labels the current element.
- */
- 'aria-labelledby'?: string,
-
- /**
- * Identifies the element (or elements) that describes the object.
- */
- 'aria-describedby'?: string,
-
- /**
- * Identifies the element (or elements) that provide a detailed, extended description for the object.
- */
- 'aria-details'?: string
- }
-
- interface AriaValidationProps {
- // https://www.w3.org/TR/wai-aria-1.2/#aria-errormessage
- /**
- * Identifies the element that provides an error message for the object.
- */
- 'aria-errormessage'?: string
- }
-
- // A set of common DOM props that are allowed on any component
- // Ensure this is synced with DOMPropNames in filterDOMProps
- interface DOMProps {
- /**
- * The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
- */
- id?: string
- }
-
- interface FocusableDOMProps extends DOMProps {
- /**
- * Whether to exclude the element from the sequential tab order. If true,
- * the element will not be focusable via the keyboard by tabbing. This should
- * be avoided except in rare scenarios where an alternative means of accessing
- * the element or its functionality via the keyboard is available.
- */
- excludeFromTabOrder?: boolean
- }
-
-
- interface TextInputDOMEvents {
- // Clipboard events
- /**
- * Handler that is called when the user copies text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncopy).
- */
- onCopy?: ClipboardEventHandler<HTMLInputElement>,
-
- /**
- * Handler that is called when the user cuts text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncut).
- */
- onCut?: ClipboardEventHandler<HTMLInputElement>,
-
- /**
- * Handler that is called when the user pastes text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/onpaste).
- */
- onPaste?: ClipboardEventHandler<HTMLInputElement>,
-
- // Composition events
- /**
- * Handler that is called when a text composition system starts a new text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionstart_event).
- */
- onCompositionStart?: CompositionEventHandler<HTMLInputElement>,
-
- /**
- * Handler that is called when a text composition system completes or cancels the current text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionend_event).
- */
- onCompositionEnd?: CompositionEventHandler<HTMLInputElement>,
-
- /**
- * Handler that is called when a new character is received in the current text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionupdate_event).
- */
- onCompositionUpdate?: CompositionEventHandler<HTMLInputElement>,
-
- // Selection events
- /**
- * Handler that is called when text in the input is selected. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/select_event).
- */
- onSelect?: ReactEventHandler<HTMLInputElement>,
-
- // Input events
- /**
- * Handler that is called when the input value is about to be modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/beforeinput_event).
- */
- onBeforeInput?: FormEventHandler<HTMLInputElement>,
- /**
- * Handler that is called when the input value is modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event).
- */
- onInput?: FormEventHandler<HTMLInputElement>
- }
-
- interface InputDOMProps {
- /**
- * The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
- */
- name?: string
- }
-
- // DOM props that apply to all text inputs
- // Ensure this is synced with useTextField
- interface TextInputDOMProps extends DOMProps, InputDOMProps, TextInputDOMEvents {
- /**
- * Describes the type of autocomplete functionality the input should provide if any. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete).
- */
- autoComplete?: string,
-
- /**
- * The maximum number of characters supported by the input. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefmaxlength).
- */
- maxLength?: number,
-
- /**
- * The minimum number of characters required by the input. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefminlength).
- */
- minLength?: number,
-
- /**
- * Regex pattern that the value of the input must match to be valid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefpattern).
- */
- pattern?: string,
-
- /**
- * Content that appears in the input when it is empty. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefplaceholder).
- */
- placeholder?: string,
-
- /**
- * The type of input to render. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdeftype).
- */
- type?: 'text' | 'search' | 'url' | 'tel' | 'email' | 'password' | (string & {}),
-
- /**
- * Hints at the type of data that might be entered by the user while editing the element or its contents. See [MDN](https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute).
- */
- inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'
- }
-
- // Make sure to update filterDOMProps.ts when updating this.
- interface LinkDOMProps {
- /** A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href). */
- href?: string,
- /** The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target). */
- target?: HTMLAttributeAnchorTarget,
- /** The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel). */
- rel?: string,
- /** Causes the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download). */
- download?: boolean | string,
- /** A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping). */
- ping?: string,
- /** How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy). */
- referrerPolicy?: HTMLAttributeReferrerPolicy
- }
-
- /** Any focusable element, including both HTML and SVG elements. */
- interface FocusableElement extends Element, HTMLOrSVGElement {}
-
- /** All DOM attributes supported across both HTML and SVG elements. */
- interface DOMAttributes<T = FocusableElement> extends AriaAttributes, DOMAttributes$1<T> {
- id?: string | undefined,
- role?: AriaRole | undefined,
- tabIndex?: number | undefined,
- style?: CSSProperties | undefined,
- className?: string | undefined
- }
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- type ValidationState = 'valid' | 'invalid';
-
- type ValidationError = string | string[];
-
- interface Validation<T> {
- /** Whether user input is required on the input before form submission. */
- isRequired?: boolean,
- /** Whether the input value is invalid. */
- isInvalid?: boolean,
- /** @deprecated Use `isInvalid` instead. */
- validationState?: ValidationState,
- /**
- * Whether to use native HTML form validation to prevent form submission
- * when the value is missing or invalid, or mark the field as required
- * or invalid via ARIA.
- * @default 'aria'
- */
- validationBehavior?: 'aria' | 'native',
- /**
- * A function that returns an error message if a given value is invalid.
- * Validation errors are displayed to the user when the form is submitted
- * if `validationBehavior="native"`. For realtime validation, use the `isInvalid`
- * prop instead.
- */
- validate?: (value: T) => ValidationError | true | null | undefined
- }
-
- interface ValidationResult {
- /** Whether the input value is invalid. */
- isInvalid: boolean,
- /** The current error messages for the input if it is invalid, otherwise an empty array. */
- validationErrors: string[],
- /** The native validation details for the input. */
- validationDetails: ValidityState
- }
-
- interface InputBase {
- /** Whether the input is disabled. */
- isDisabled?: boolean,
- /** Whether the input can be selected but not changed by the user. */
- isReadOnly?: boolean
- }
-
- interface ValueBase<T, C = T> {
- /** The current value (controlled). */
- value?: T,
- /** The default value (uncontrolled). */
- defaultValue?: T,
- /** Handler that is called when the value changes. */
- onChange?: (value: C) => void
- }
-
- interface TextInputBase {
- /** Temporary text that occupies the text input when it is empty. */
- placeholder?: string
- }
-
- interface RangeInputBase<T> {
- /** The smallest value allowed for the input. */
- minValue?: T,
- /** The largest value allowed for the input. */
- maxValue?: T,
- /** The amount that the input value changes with each increment or decrement "tick". */
- step?: T // ??
- }
-
- interface HelpTextProps {
- /** A description for the field. Provides a hint such as specific requirements for what to choose. */
- description?: ReactNode,
- /** An error message for the field. */
- errorMessage?: ReactNode | ((v: ValidationResult) => ReactNode)
- }
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface SingleSelection {
- /** Whether the collection allows empty selection. */
- disallowEmptySelection?: boolean,
- /** The currently selected key in the collection (controlled). */
- selectedKey?: Key$1 | null,
- /** The initial selected key in the collection (uncontrolled). */
- defaultSelectedKey?: Key$1,
- /** Handler that is called when the selection changes. */
- onSelectionChange?: (key: Key$1) => any
- }
-
- type SelectionMode = 'none' | 'single' | 'multiple';
- type SelectionBehavior = 'toggle' | 'replace';
- type Selection$1 = 'all' | Set<Key$1>;
- interface MultipleSelection {
- /** The type of selection that is allowed in the collection. */
- selectionMode?: SelectionMode,
- /** Whether the collection allows empty selection. */
- disallowEmptySelection?: boolean,
- /** The currently selected keys in the collection (controlled). */
- selectedKeys?: 'all' | Iterable<Key$1>,
- /** The initial selected keys in the collection (uncontrolled). */
- defaultSelectedKeys?: 'all' | Iterable<Key$1>,
- /** Handler that is called when the selection changes. */
- onSelectionChange?: (keys: Selection$1) => any,
- /** The currently disabled keys in the collection (controlled). */
- disabledKeys?: Iterable<Key$1>
- }
-
- type FocusStrategy = 'first' | 'last';
- type DisabledBehavior = 'selection' | 'all';
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface DragDropEvent {
- /** The x coordinate of the event, relative to the target element. */
- x: number,
- /** The y coordinate of the event, relative to the target element. */
- y: number
- }
-
- type DropOperation = 'copy' | 'link' | 'move' | 'cancel';
-
- interface DragItem {
- [type: string]: string
- }
-
- interface DragStartEvent extends DragDropEvent {
- /** The event type. */
- type: 'dragstart'
- }
-
- interface DragMoveEvent extends DragDropEvent {
- /** The event type. */
- type: 'dragmove'
- }
-
- interface DragEndEvent extends DragDropEvent {
- /** The event type. */
- type: 'dragend',
- /** The drop operation that occurred. */
- dropOperation: DropOperation
- }
-
- interface DropEnterEvent extends DragDropEvent {
- /** The event type. */
- type: 'dropenter'
- }
-
- interface DropMoveEvent extends DragDropEvent {
- /** The event type. */
- type: 'dropmove'
- }
-
- interface DropActivateEvent extends DragDropEvent {
- /** The event type. */
- type: 'dropactivate'
- }
-
- interface DropExitEvent extends DragDropEvent {
- /** The event type. */
- type: 'dropexit'
- }
-
- interface TextDropItem {
- /** The item kind. */
- kind: 'text',
- /**
- * The drag types available for this item.
- * These are often mime types, but may be custom app-specific types.
- */
- types: Set<string>,
- /** Returns the data for the given type as a string. */
- getText(type: string): Promise<string>
- }
-
- interface FileDropItem {
- /** The item kind. */
- kind: 'file',
- /** The file type (usually a mime type). */
- type: string,
- /** The file name. */
- name: string,
- /** Returns the contents of the file as a blob. */
- getFile(): Promise<File>,
- /** Returns the contents of the file as a string. */
- getText(): Promise<string>
- }
-
- interface DirectoryDropItem {
- /** The item kind. */
- kind: 'directory',
- /** The directory name. */
- name: string,
- /** Returns the entries contained within the directory. */
- getEntries(): AsyncIterable<FileDropItem | DirectoryDropItem>
- }
-
- type DropItem = TextDropItem | FileDropItem | DirectoryDropItem;
-
- interface DropEvent extends DragDropEvent {
- /** The event type. */
- type: 'drop',
- /** The drop operation that should occur. */
- dropOperation: DropOperation,
- /** The dropped items. */
- items: DropItem[]
- }
-
- type DropPosition = 'on' | 'before' | 'after';
- interface RootDropTarget {
- /** The event type. */
- type: 'root'
- }
-
- interface ItemDropTarget {
- /** The drop target type. */
- type: 'item',
- /** The item key. */
- key: Key$1,
- /** The drop position relative to the item. */
- dropPosition: DropPosition
- }
-
- type DropTarget = RootDropTarget | ItemDropTarget;
-
- interface DroppableCollectionEnterEvent extends DropEnterEvent {
- /** The drop target. */
- target: DropTarget
- }
-
- interface DroppableCollectionActivateEvent extends DropActivateEvent {
- /** The drop target. */
- target: DropTarget
- }
-
- interface DroppableCollectionExitEvent extends DropExitEvent {
- /** The drop target. */
- target: DropTarget
- }
-
- interface DroppableCollectionDropEvent extends DropEvent {
- /** The drop target. */
- target: DropTarget
- }
-
- interface DroppableCollectionInsertDropEvent {
- /** The dropped items. */
- items: DropItem[],
- /** The drop operation that should occur. */
- dropOperation: DropOperation,
- /** The drop target. */
- target: ItemDropTarget
- }
-
- interface DroppableCollectionRootDropEvent {
- /** The dropped items. */
- items: DropItem[],
- /** The drop operation that should occur. */
- dropOperation: DropOperation
- }
-
- interface DroppableCollectionOnItemDropEvent {
- /** The dropped items. */
- items: DropItem[],
- /** The drop operation that should occur. */
- dropOperation: DropOperation,
- /** Whether the drag originated within the same collection as the drop. */
- isInternal: boolean,
- /** The drop target. */
- target: ItemDropTarget
- }
-
- interface DroppableCollectionReorderEvent {
- /** The keys of the items that were reordered. */
- keys: Set<Key$1>,
- /** The drop operation that should occur. */
- dropOperation: DropOperation,
- /** The drop target. */
- target: ItemDropTarget
- }
-
- interface DragTypes {
- /** Returns whether the drag contains data of the given type. */
- has(type: string | symbol): boolean
- }
-
- interface DropTargetDelegate {
- /**
- * Returns a drop target within a collection for the given x and y coordinates.
- * The point is provided relative to the top left corner of the collection container.
- * A drop target can be checked to see if it is valid using the provided `isValidDropTarget` function.
- */
- getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget | null
- }
-
- interface DroppableCollectionUtilityOptions {
- /**
- * The drag types that the droppable collection accepts. If the collection accepts directories, include `DIRECTORY_DRAG_TYPE` in your array of allowed types.
- * @default 'all'
- */
- acceptedDragTypes?: 'all' | Array<string | symbol>,
- /**
- * Handler that is called when external items are dropped "between" items.
- */
- onInsert?: (e: DroppableCollectionInsertDropEvent) => void,
- /**
- * Handler that is called when external items are dropped on the droppable collection's root.
- */
- onRootDrop?: (e: DroppableCollectionRootDropEvent) => void,
- /**
- * Handler that is called when items are dropped "on" an item.
- */
- onItemDrop?: (e: DroppableCollectionOnItemDropEvent) => void,
- /**
- * Handler that is called when items are reordered via drag in the source collection.
- */
- onReorder?: (e: DroppableCollectionReorderEvent) => void,
- /**
- * A function returning whether a given target in the droppable collection is a valid "on" drop target for the current drag types.
- */
- shouldAcceptItemDrop?: (target: ItemDropTarget, types: DragTypes) => boolean
- }
-
- interface DroppableCollectionBaseProps {
- /** Handler that is called when a valid drag enters a drop target. */
- onDropEnter?: (e: DroppableCollectionEnterEvent) => void,
- /**
- * Handler that is called after a valid drag is held over a drop target for a period of time.
- * @private
- */
- onDropActivate?: (e: DroppableCollectionActivateEvent) => void,
- /** Handler that is called when a valid drag exits a drop target. */
- onDropExit?: (e: DroppableCollectionExitEvent) => void,
- /**
- * Handler that is called when a valid drag is dropped on a drop target. When defined, this overrides other
- * drop handlers such as `onInsert`, and `onItemDrop`.
- */
- onDrop?: (e: DroppableCollectionDropEvent) => void,
- /**
- * A function returning the drop operation to be performed when items matching the given types are dropped
- * on the drop target.
- */
- getDropOperation?: (target: DropTarget, types: DragTypes, allowedOperations: DropOperation[]) => DropOperation
- }
-
- interface DroppableCollectionProps extends DroppableCollectionUtilityOptions, DroppableCollectionBaseProps {}
-
- interface DraggableCollectionStartEvent extends DragStartEvent {
- /** The keys of the items that were dragged. */
- keys: Set<Key$1>
- }
-
- interface DraggableCollectionMoveEvent extends DragMoveEvent {
- /** The keys of the items that were dragged. */
- keys: Set<Key$1>
- }
-
- interface DraggableCollectionEndEvent extends DragEndEvent {
- /** The keys of the items that were dragged. */
- keys: Set<Key$1>,
- /** Whether the drop ended within the same collection as it originated. */
- isInternal: boolean
- }
-
- type DragPreviewRenderer = (items: DragItem[], callback: (node: HTMLElement) => void) => void;
-
- interface DraggableCollectionProps {
- /** Handler that is called when a drag operation is started. */
- onDragStart?: (e: DraggableCollectionStartEvent) => void,
- /** Handler that is called when the drag is moved. */
- onDragMove?: (e: DraggableCollectionMoveEvent) => void,
- /** Handler that is called when the drag operation is ended, either as a result of a drop or a cancellation. */
- onDragEnd?: (e: DraggableCollectionEndEvent) => void,
- /** A function that returns the items being dragged. */
- getItems: (keys: Set<Key$1>) => DragItem[],
- /** The ref of the element that will be rendered as the drag preview while dragging. */
- preview?: RefObject<DragPreviewRenderer>,
- /** Function that returns the drop operations that are allowed for the dragged items. If not provided, all drop operations are allowed. */
- getAllowedDropOperations?: () => DropOperation[]
- }
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface ItemProps$1<T> extends LinkDOMProps {
- /** Rendered contents of the item or child items. */
- children: ReactNode,
- /** Rendered contents of the item if `children` contains child items. */
- title?: ReactNode, // label?? contents?
- /** A string representation of the item's contents, used for features like typeahead. */
- textValue?: string,
- /** An accessibility label for this item. */
- 'aria-label'?: string,
- /** A list of child item objects. Used for dynamic collections. */
- childItems?: Iterable<T>,
- /** Whether this item has children, even if not loaded yet. */
- hasChildItems?: boolean
- }
-
- type ItemElement<T> = ReactElement<ItemProps$1<T>>;
- type ItemRenderer<T> = (item: T) => ItemElement<T>;
-
- interface SectionProps<T> {
- /** Rendered contents of the section, e.g. a header. */
- title?: ReactNode,
- /** An accessibility label for the section. */
- 'aria-label'?: string,
- /** Static child items or a function to render children. */
- children: ItemElement<T> | ItemElement<T>[] | ItemRenderer<T>,
- /** Item objects in the section. */
- items?: Iterable<T>
- }
-
- type SectionElement<T> = ReactElement<SectionProps<T>>;
-
- type CollectionElement<T> = SectionElement<T> | ItemElement<T>;
- type CollectionChildren<T> = CollectionElement<T> | CollectionElement<T>[] | ((item: T) => CollectionElement<T>);
- interface CollectionBase<T> {
- /** The contents of the collection. */
- children: CollectionChildren<T>,
- /** Item objects in the collection. */
- items?: Iterable<T>,
- /** The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with. */
- disabledKeys?: Iterable<Key$1>
- }
-
- interface CollectionStateBase<T, C extends Collection<Node$1<T>> = Collection<Node$1<T>>> extends Partial<CollectionBase<T>> {
- /** A pre-constructed collection to use instead of building one from items and children. */
- collection?: C
- }
-
- interface KeyboardDelegate {
- /** Returns the key visually below the given one, or `null` for none. */
- getKeyBelow?(key: Key$1): Key$1 | null,
-
- /** Returns the key visually above the given one, or `null` for none. */
- getKeyAbove?(key: Key$1): Key$1 | null,
-
- /** Returns the key visually to the left of the given one, or `null` for none. */
- getKeyLeftOf?(key: Key$1): Key$1 | null,
-
- /** Returns the key visually to the right of the given one, or `null` for none. */
- getKeyRightOf?(key: Key$1): Key$1 | null,
-
- /** Returns the key visually one page below the given one, or `null` for none. */
- getKeyPageBelow?(key: Key$1): Key$1 | null,
-
- /** Returns the key visually one page above the given one, or `null` for none. */
- getKeyPageAbove?(key: Key$1): Key$1 | null,
-
- /** Returns the first key, or `null` for none. */
- getFirstKey?(key?: Key$1, global?: boolean): Key$1 | null,
-
- /** Returns the last key, or `null` for none. */
- getLastKey?(key?: Key$1, global?: boolean): Key$1 | null,
-
- /** Returns the next key after `fromKey` that matches the given search string, or `null` for none. */
- getKeyForSearch?(search: string, fromKey?: Key$1): Key$1 | null
- }
-
- /**
- * A generic interface to access a readonly sequential
- * collection of unique keyed items.
- */
- interface Collection<T> extends Iterable<T> {
- /** The number of items in the collection. */
- readonly size: number,
-
- /** Iterate over all keys in the collection. */
- getKeys(): Iterable<Key$1>,
-
- /** Get an item by its key. */
- getItem(key: Key$1): T | null,
-
- /** Get an item by the index of its key. */
- at(idx: number): T | null,
-
- /** Get the key that comes before the given key in the collection. */
- getKeyBefore(key: Key$1): Key$1 | null,
-
- /** Get the key that comes after the given key in the collection. */
- getKeyAfter(key: Key$1): Key$1 | null,
-
- /** Get the first key in the collection. */
- getFirstKey(): Key$1 | null,
-
- /** Get the last key in the collection. */
- getLastKey(): Key$1 | null,
-
- /** Iterate over the child items of the given key. */
- getChildren?(key: Key$1): Iterable<T>,
-
- /** Returns a string representation of the item's contents. */
- getTextValue?(key: Key$1): string
- }
-
- interface Node$1<T> {
- /** The type of item this node represents. */
- type: string,
- /** A unique key for the node. */
- key: Key$1,
- /** The object value the node was created from. */
- value: T | null,
- /** The level of depth this node is at in the hierarchy. */
- level: number,
- /** Whether this item has children, even if not loaded yet. */
- hasChildNodes: boolean,
- /**
- * The loaded children of this node.
- * @deprecated Use `collection.getChildren(node.key)` instead.
- */
- childNodes: Iterable<Node$1<T>>,
- /** The rendered contents of this node (e.g. JSX). */
- rendered: ReactNode,
- /** A string value for this node, used for features like typeahead. */
- textValue: string,
- /** An accessibility label for this node. */
- 'aria-label'?: string,
- /** The index of this node within its parent. */
- index?: number,
- /** A function that should be called to wrap the rendered node. */
- wrapper?: (element: ReactElement) => ReactElement,
- /** The key of the parent node. */
- parentKey?: Key$1 | null,
- /** The key of the node before this node. */
- prevKey?: Key$1 | null,
- /** The key of the node after this node. */
- nextKey?: Key$1 | null,
- /** Additional properties specific to a particular node type. */
- props?: any,
- /** @private */
- shouldInvalidate?: (context: unknown) => boolean
- }
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- // Event bubbling can be problematic in real-world applications, so the default for React Spectrum components
- // is not to propagate. This can be overridden by calling continuePropagation() on the event.
- type BaseEvent<T extends SyntheticEvent> = T & {
- /**
- * Use continuePropagation.
- * @deprecated */
- stopPropagation(): void,
- continuePropagation(): void
- }
-
- type KeyboardEvent = BaseEvent<KeyboardEvent$1<any>>;
-
- type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard' | 'virtual';
-
- interface PressEvent {
- /** The type of press event being fired. */
- type: 'pressstart' | 'pressend' | 'pressup' | 'press',
- /** The pointer type that triggered the press event. */
- pointerType: PointerType,
- /** The target element of the press event. */
- target: Element,
- /** Whether the shift keyboard modifier was held during the press event. */
- shiftKey: boolean,
- /** Whether the ctrl keyboard modifier was held during the press event. */
- ctrlKey: boolean,
- /** Whether the meta keyboard modifier was held during the press event. */
- metaKey: boolean,
- /** Whether the alt keyboard modifier was held during the press event. */
- altKey: boolean,
- /**
- * By default, press events stop propagation to parent elements.
- * In cases where a handler decides not to handle a specific event,
- * it can call `continuePropagation()` to allow a parent to handle it.
- */
- continuePropagation(): void
- }
-
- interface LongPressEvent extends Omit<PressEvent, 'type' | 'continuePropagation'> {
- /** The type of long press event being fired. */
- type: 'longpressstart' | 'longpressend' | 'longpress'
- }
-
- interface KeyboardEvents {
- /** Handler that is called when a key is pressed. */
- onKeyDown?: (e: KeyboardEvent) => void,
- /** Handler that is called when a key is released. */
- onKeyUp?: (e: KeyboardEvent) => void
- }
-
- interface FocusEvents<Target = Element> {
- /** Handler that is called when the element receives focus. */
- onFocus?: (e: FocusEvent$1<Target>) => void,
- /** Handler that is called when the element loses focus. */
- onBlur?: (e: FocusEvent$1<Target>) => void,
- /** Handler that is called when the element's focus status changes. */
- onFocusChange?: (isFocused: boolean) => void
- }
-
- interface PressEvents {
- /** Handler that is called when the press is released over the target. */
- onPress?: (e: PressEvent) => void,
- /** Handler that is called when a press interaction starts. */
- onPressStart?: (e: PressEvent) => void,
- /**
- * Handler that is called when a press interaction ends, either
- * over the target or when the pointer leaves the target.
- */
- onPressEnd?: (e: PressEvent) => void,
- /** Handler that is called when the press state changes. */
- onPressChange?: (isPressed: boolean) => void,
- /**
- * Handler that is called when a press is released over the target, regardless of
- * whether it started on the target or not.
- */
- onPressUp?: (e: PressEvent) => void
- }
-
- interface FocusableProps<Target = Element> extends FocusEvents<Target>, KeyboardEvents {
- /** Whether the element should receive focus on render. */
- autoFocus?: boolean
- }
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface LabelableProps {
- /** The content to display as the label. */
- label?: ReactNode
- }
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
- type Orientation = 'horizontal' | 'vertical';
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
- type Direction = 'ltr' | 'rtl';
-
- /*
- * Copyright 2023 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
- type Key$1 = string | number;
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface ToggleProps extends InputBase, Validation<boolean>, FocusableProps {
- /**
- * The label for the element.
- */
- children?: ReactNode,
- /**
- * Whether the element should be selected (uncontrolled).
- */
- defaultSelected?: boolean,
- /**
- * Whether the element should be selected (controlled).
- */
- isSelected?: boolean,
- /**
- * Handler that is called when the element's selection state changes.
- */
- onChange?: (isSelected: boolean) => void,
- /**
- * The value of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefvalue).
- */
- value?: string
- }
-
- interface AriaToggleProps extends ToggleProps, FocusableDOMProps, AriaLabelingProps$1, AriaValidationProps, InputDOMProps {
- /**
- * Identifies the element (or elements) whose contents or presence are controlled by the current element.
- */
- 'aria-controls'?: string
- }
-
- interface CheckboxProps$1 extends ToggleProps {
- /**
- * Indeterminism is presentational only.
- * The indeterminate visual representation remains regardless of user interaction.
- */
- isIndeterminate?: boolean
- }
-
- interface AriaCheckboxProps extends CheckboxProps$1, AriaToggleProps {}
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- type Placement = 'bottom' | 'bottom left' | 'bottom right' | 'bottom start' | 'bottom end' |
- 'top' | 'top left' | 'top right' | 'top start' | 'top end' |
- 'left' | 'left top' | 'left bottom' | 'start' | 'start top' | 'start bottom' |
- 'right' | 'right top' | 'right bottom' | 'end' | 'end top' | 'end bottom';
-
- interface PositionProps {
- /**
- * The placement of the element with respect to its anchor element.
- * @default 'bottom'
- */
- placement?: Placement,
- /**
- * The placement padding that should be applied between the element and its
- * surrounding container.
- * @default 12
- */
- containerPadding?: number,
- /**
- * The additional offset applied along the main axis between the element and its
- * anchor element.
- * @default 0
- */
- offset?: number,
- /**
- * The additional offset applied along the cross axis between the element and its
- * anchor element.
- * @default 0
- */
- crossOffset?: number,
- /**
- * Whether the element should flip its orientation (e.g. top to bottom or left to right) when
- * there is insufficient room for it to render completely.
- * @default true
- */
- shouldFlip?: boolean,
- // /**
- // * The element that should be used as the bounding container when calculating container offset
- // * or whether it should flip.
- // */
- // boundaryElement?: Element,
- /** Whether the element is rendered. */
- isOpen?: boolean
- }
-
- interface OverlayTriggerProps$1 {
- /** Whether the overlay is open by default (controlled). */
- isOpen?: boolean,
- /** Whether the overlay is open by default (uncontrolled). */
- defaultOpen?: boolean,
- /** Handler that is called when the overlay's open state changes. */
- onOpenChange?: (isOpen: boolean) => void
- }
-
- interface OverlayTriggerState {
- /** Whether the overlay is currently open. */
- readonly isOpen: boolean;
- /** Sets whether the overlay is open. */
- setOpen(isOpen: boolean): void;
- /** Opens the overlay. */
- open(): void;
- /** Closes the overlay. */
- close(): void;
- /** Toggles the overlay's visibility. */
- toggle(): void;
- }
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface SelectProps$1<T> extends CollectionBase<T>, Omit<InputBase, 'isReadOnly'>, Validation<Key$1>, HelpTextProps, LabelableProps, TextInputBase, Omit<SingleSelection, 'disallowEmptySelection'>, FocusableProps {
- /** Sets the open state of the menu. */
- isOpen?: boolean,
- /** Sets the default open state of the menu. */
- defaultOpen?: boolean,
- /** Method that is called when the open state of the menu changes. */
- onOpenChange?: (isOpen: boolean) => void
- }
-
- interface AriaSelectProps<T> extends SelectProps$1<T>, DOMProps, AriaLabelingProps$1, FocusableDOMProps {
- /**
- * Describes the type of autocomplete functionality the input should provide if any. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete).
- */
- autoComplete?: string,
- /**
- * The name of the input, used when submitting an HTML form.
- */
- name?: string
- }
-
- interface FocusState {
- /** Whether the collection is currently focused. */
- readonly isFocused: boolean;
- /** Sets whether the collection is focused. */
- setFocused(isFocused: boolean): void;
- /** The current focused key in the collection. */
- readonly focusedKey: Key$1;
- /** Whether the first or last child of the focused key should receive focus. */
- readonly childFocusStrategy: FocusStrategy;
- /** Sets the focused key, and optionally, whether the first or last child of that key should receive focus. */
- setFocusedKey(key: Key$1, child?: FocusStrategy): void;
- }
- interface MultipleSelectionState extends FocusState {
- /** The type of selection that is allowed in the collection. */
- readonly selectionMode: SelectionMode;
- /** The selection behavior for the collection. */
- readonly selectionBehavior: SelectionBehavior;
- /** Sets the selection behavior for the collection. */
- setSelectionBehavior(selectionBehavior: SelectionBehavior): void;
- /** Whether the collection allows empty selection. */
- readonly disallowEmptySelection: boolean;
- /** The currently selected keys in the collection. */
- readonly selectedKeys: Selection$1;
- /** Sets the selected keys in the collection. */
- setSelectedKeys(keys: Selection$1): void;
- /** The currently disabled keys in the collection. */
- readonly disabledKeys: Set<Key$1>;
- /** Whether `disabledKeys` applies to selection, actions, or both. */
- readonly disabledBehavior: DisabledBehavior;
- }
- interface MultipleSelectionManager extends FocusState {
- /** The type of selection that is allowed in the collection. */
- readonly selectionMode: SelectionMode;
- /** The selection behavior for the collection. */
- readonly selectionBehavior: SelectionBehavior;
- /** Whether the collection allows empty selection. */
- readonly disallowEmptySelection?: boolean;
- /** The currently selected keys in the collection. */
- readonly selectedKeys: Set<Key$1>;
- /** Whether the selection is empty. */
- readonly isEmpty: boolean;
- /** Whether all items in the collection are selected. */
- readonly isSelectAll: boolean;
- /** The first selected key in the collection. */
- readonly firstSelectedKey: Key$1 | null;
- /** The last selected key in the collection. */
- readonly lastSelectedKey: Key$1 | null;
- /** The currently disabled keys in the collection. */
- readonly disabledKeys: Set<Key$1>;
- /** Whether `disabledKeys` applies to selection, actions, or both. */
- readonly disabledBehavior: DisabledBehavior;
- /** Returns whether a key is selected. */
- isSelected(key: Key$1): boolean;
- /** Returns whether the current selection is equal to the given selection. */
- isSelectionEqual(selection: Set<Key$1>): boolean;
- /** Extends the selection to the given key. */
- extendSelection(toKey: Key$1): void;
- /** Toggles whether the given key is selected. */
- toggleSelection(key: Key$1): void;
- /** Replaces the selection with only the given key. */
- replaceSelection(key: Key$1): void;
- /** Replaces the selection with the given keys. */
- setSelectedKeys(keys: Iterable<Key$1>): void;
- /** Selects all items in the collection. */
- selectAll(): void;
- /** Removes all keys from the selection. */
- clearSelection(): void;
- /** Toggles between select all and an empty selection. */
- toggleSelectAll(): void;
- /**
- * Toggles, replaces, or extends selection to the given key depending
- * on the pointer event and collection's selection mode.
- */
- select(key: Key$1, e?: PressEvent | LongPressEvent | PointerEvent): void;
- /** Returns whether the given key can be selected. */
- canSelectItem(key: Key$1): boolean;
- /** Returns whether the given key is non-interactive, i.e. both selection and actions are disabled. */
- isDisabled(key: Key$1): boolean;
- /** Sets the selection behavior for the collection. */
- setSelectionBehavior(selectionBehavior: SelectionBehavior): void;
- /** Returns whether the given key is a hyperlink. */
- isLink(key: Key$1): boolean;
- }
- interface MultipleSelectionStateProps extends MultipleSelection {
- /** How multiple selection should behave in the collection. */
- selectionBehavior?: SelectionBehavior;
- /** Whether onSelectionChange should fire even if the new set of keys is the same as the last. */
- allowDuplicateSelectionEvents?: boolean;
- /** Whether `disabledKeys` applies to all interactions, or only selection. */
- disabledBehavior?: DisabledBehavior;
- }
- interface SelectionManagerOptions {
- allowsCellSelection?: boolean;
- }
- /**
- * An interface for reading and updating multiple selection state.
- */
- declare class SelectionManager implements MultipleSelectionManager {
- constructor(collection: Collection<Node$1<unknown>>, state: MultipleSelectionState, options?: SelectionManagerOptions);
- /**
- * The type of selection that is allowed in the collection.
- */
- get selectionMode(): SelectionMode;
- /**
- * Whether the collection allows empty selection.
- */
- get disallowEmptySelection(): boolean;
- /**
- * The selection behavior for the collection.
- */
- get selectionBehavior(): SelectionBehavior;
- /**
- * Sets the selection behavior for the collection.
- */
- setSelectionBehavior(selectionBehavior: SelectionBehavior): void;
- /**
- * Whether the collection is currently focused.
- */
- get isFocused(): boolean;
- /**
- * Sets whether the collection is focused.
- */
- setFocused(isFocused: boolean): void;
- /**
- * The current focused key in the collection.
- */
- get focusedKey(): Key$1;
- /** Whether the first or last child of the focused key should receive focus. */
- get childFocusStrategy(): FocusStrategy;
- /**
- * Sets the focused key.
- */
- setFocusedKey(key: Key$1 | null, childFocusStrategy?: FocusStrategy): void;
- /**
- * The currently selected keys in the collection.
- */
- get selectedKeys(): Set<Key$1>;
- /**
- * The raw selection value for the collection.
- * Either 'all' for select all, or a set of keys.
- */
- get rawSelection(): Selection$1;
- /**
- * Returns whether a key is selected.
- */
- isSelected(key: Key$1): boolean;
- /**
- * Whether the selection is empty.
- */
- get isEmpty(): boolean;
- /**
- * Whether all items in the collection are selected.
- */
- get isSelectAll(): boolean;
- get firstSelectedKey(): Key$1 | null;
- get lastSelectedKey(): Key$1 | null;
- get disabledKeys(): Set<Key$1>;
- get disabledBehavior(): DisabledBehavior;
- /**
- * Extends the selection to the given key.
- */
- extendSelection(toKey: Key$1): void;
- /**
- * Toggles whether the given key is selected.
- */
- toggleSelection(key: Key$1): void;
- /**
- * Replaces the selection with only the given key.
- */
- replaceSelection(key: Key$1): void;
- /**
- * Replaces the selection with the given keys.
- */
- setSelectedKeys(keys: Iterable<Key$1>): void;
- /**
- * Selects all items in the collection.
- */
- selectAll(): void;
- /**
- * Removes all keys from the selection.
- */
- clearSelection(): void;
- /**
- * Toggles between select all and an empty selection.
- */
- toggleSelectAll(): void;
- select(key: Key$1, e?: PressEvent | LongPressEvent | PointerEvent): void;
- /**
- * Returns whether the current selection is equal to the given selection.
- */
- isSelectionEqual(selection: Set<Key$1>): boolean;
- canSelectItem(key: Key$1): boolean;
- isDisabled(key: Key$1): boolean;
- isLink(key: Key$1): boolean;
- }
-
- interface ListProps<T> extends CollectionStateBase<T>, MultipleSelectionStateProps {
- /** Filter function to generate a filtered list of nodes. */
- filter?: (nodes: Iterable<Node$1<T>>) => Iterable<Node$1<T>>;
- /** @private */
- suppressTextValueWarning?: boolean;
- }
- interface ListState<T> {
- /** A collection of items in the list. */
- collection: Collection<Node$1<T>>;
- /** A set of items that are disabled. */
- disabledKeys: Set<Key$1>;
- /** A selection manager to read and update multiple selection state. */
- selectionManager: SelectionManager;
- }
-
- interface SelectStateOptions<T> extends Omit<SelectProps$1<T>, 'children'>, CollectionStateBase<T> {
- }
-
- interface DraggableCollectionStateOptions extends DraggableCollectionProps {
- /** A collection of items. */
- collection: Collection<Node$1<unknown>>;
- /** An interface for reading and updating multiple selection state. */
- selectionManager: MultipleSelectionManager;
- }
- interface DroppableCollectionStateOptions extends Omit<DroppableCollectionProps, 'onDropMove' | 'onDropActivate'> {
- /** A collection of items. */
- collection: Collection<Node$1<unknown>>;
- /** An interface for reading and updating multiple selection state. */
- selectionManager: MultipleSelectionManager;
- }
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- type MenuTriggerType = 'press' | 'longPress';
-
- interface MenuTriggerProps extends OverlayTriggerProps$1 {
- /**
- * How the menu is triggered.
- * @default 'press'
- */
- trigger?: MenuTriggerType
- }
-
- interface MenuProps$1<T> extends CollectionBase<T>, MultipleSelection {
- /** Where the focus should be set. */
- autoFocus?: boolean | FocusStrategy,
- /** Whether keyboard navigation is circular. */
- shouldFocusWrap?: boolean,
- /** Handler that is called when an item is selected. */
- onAction?: (key: Key$1) => void,
- /** Handler that is called when the menu should close after selecting an item. */
- onClose?: () => void
- }
-
- interface AriaMenuProps<T> extends MenuProps$1<T>, DOMProps, AriaLabelingProps$1 {}
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface RadioGroupProps$1 extends ValueBase<string>, InputBase, InputDOMProps, Validation<string | null>, LabelableProps, HelpTextProps, FocusEvents {
- /**
- * The axis the Radio Button(s) should align with.
- * @default 'vertical'
- */
- orientation?: Orientation
- }
-
- interface AriaRadioGroupProps extends RadioGroupProps$1, DOMProps, AriaLabelingProps$1, AriaValidationProps {}
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface TextFieldProps extends InputBase, Validation<string>, HelpTextProps, FocusableProps, TextInputBase, ValueBase<string>, LabelableProps {}
-
- interface AriaTextFieldProps extends TextFieldProps, AriaLabelingProps$1, FocusableDOMProps, TextInputDOMProps, AriaValidationProps {
- // https://www.w3.org/TR/wai-aria-1.2/#textbox
- /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
- 'aria-activedescendant'?: string,
- /**
- * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be
- * presented if they are made.
- */
- 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both',
- /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
- 'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'
- }
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface SearchFieldProps extends TextFieldProps {
- /** Handler that is called when the SearchField is submitted. */
- onSubmit?: (value: string) => void,
-
- /** Handler that is called when the clear button is pressed. */
- onClear?: () => void
- }
-
- interface AriaSearchFieldProps extends SearchFieldProps, AriaTextFieldProps {}
-
- interface SliderProps$1<T = number | number[]> extends RangeInputBase<number>, ValueBase<T>, LabelableProps {
- /**
- * The orientation of the Slider.
- * @default 'horizontal'
- */
- orientation?: Orientation,
- /** Whether the whole Slider is disabled. */
- isDisabled?: boolean,
- /** Fired when the slider stops moving, due to being let go. */
- onChangeEnd?: (value: T) => void,
- // These are duplicated from ValueBase to define defaults for the docs.
- /**
- * The slider's minimum value.
- * @default 0
- */
- minValue?: number,
- /**
- * The slider's maximum value.
- * @default 100
- */
- maxValue?: number,
- /**
- * The slider's step value.
- * @default 1
- */
- step?: number
- }
-
- interface AriaSliderProps<T = number | number[]> extends SliderProps$1<T>, DOMProps, AriaLabelingProps$1 {}
-
- interface SliderStateOptions<T> extends SliderProps$1<T> {
- numberFormatter: Intl.NumberFormat;
- }
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface NumberFieldProps extends InputBase, Validation<number>, FocusableProps, TextInputBase, ValueBase<number>, RangeInputBase<number>, LabelableProps, HelpTextProps {
- /**
- * Formatting options for the value displayed in the number field.
- * This also affects what characters are allowed to be typed by the user.
- */
- formatOptions?: Intl.NumberFormatOptions
- }
-
- interface AriaNumberFieldProps extends NumberFieldProps, DOMProps, AriaLabelingProps$1, TextInputDOMEvents {
- /** A custom aria-label for the decrement button. If not provided, the localized string "Decrement" is used. */
- decrementAriaLabel?: string,
- /** A custom aria-label for the increment button. If not provided, the localized string "Increment" is used. */
- incrementAriaLabel?: string,
- /**
- * Enables or disables changing the value with scroll.
- */
- isWheelDisabled?: boolean
- }
-
- interface NumberFieldStateOptions extends NumberFieldProps {
- /**
- * The locale that should be used for parsing.
- * @default 'en-US'
- */
- locale: string;
- }
-
- declare let Item$1: <T>(props: ItemProps$1<T>) => JSX.Element;
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface TabListProps<T> extends CollectionBase<T>, Omit<SingleSelection, 'disallowEmptySelection'> {
- /**
- * Whether the TabList is disabled.
- * Shows that a selection exists, but is not available in that circumstance.
- */
- isDisabled?: boolean
- }
-
- interface AriaTabListBase extends AriaLabelingProps$1 {
- /**
- * Whether tabs are activated automatically on focus or manually.
- * @default 'automatic'
- */
- keyboardActivation?: 'automatic' | 'manual',
- /**
- * The orientation of the tabs.
- * @default 'horizontal'
- */
- orientation?: Orientation
- }
-
- interface AriaTabListProps<T> extends TabListProps<T>, AriaTabListBase, DOMProps, AriaLabelingProps$1 {}
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface TooltipTriggerProps extends OverlayTriggerProps$1 {
- /**
- * Whether the tooltip should be disabled, independent from the trigger.
- */
- isDisabled?: boolean,
-
- /**
- * The delay time for the tooltip to show up. [See guidelines](https://spectrum.adobe.com/page/tooltip/#Immediate-or-delayed-appearance).
- * @default 1500
- */
- delay?: number,
-
- /**
- * The delay time for the tooltip to close. [See guidelines](https://spectrum.adobe.com/page/tooltip/#Warmup-and-cooldown).
- * @default 500
- */
- closeDelay?: number,
-
- /**
- * By default, opens for both focus and hover. Can be made to open only for focus.
- */
- trigger?: 'focus'
- }
-
- interface TooltipProps$1 {
- isOpen?: boolean
- }
-
- interface AriaTooltipProps extends TooltipProps$1, DOMProps, AriaLabelingProps$1 {}
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface LinkProps$1 extends PressEvents, FocusableProps {}
-
- interface AriaLinkProps extends LinkProps$1, LinkDOMProps, AriaLabelingProps$1 { }
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface ButtonProps extends PressEvents, FocusableProps {
- /** Whether the button is disabled. */
- isDisabled?: boolean,
- /** The content to display in the button. */
- children?: ReactNode
- }
-
- interface ToggleButtonProps$1 extends ButtonProps {
- /** Whether the element should be selected (controlled). */
- isSelected?: boolean,
- /** Whether the element should be selected (uncontrolled). */
- defaultSelected?: boolean,
- /** Handler that is called when the element's selection state changes. */
- onChange?: (isSelected: boolean) => void
- }
-
- interface AriaButtonElementTypeProps<T extends ElementType = 'button'> {
- /**
- * The HTML element or React element used to render the button, e.g. 'div', 'a', or `RouterLink`.
- * @default 'button'
- */
- elementType?: T | JSXElementConstructor<any>
- }
-
- interface LinkButtonProps<T extends ElementType = 'button'> extends AriaButtonElementTypeProps<T> {
- /** A URL to link to if elementType="a". */
- href?: string,
- /** The target window for the link. */
- target?: string,
- /** The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel). */
- rel?: string
- }
-
- interface AriaBaseButtonProps extends FocusableDOMProps, AriaLabelingProps$1 {
- /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
- 'aria-expanded'?: boolean | 'true' | 'false',
- /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
- 'aria-haspopup'?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | 'true' | 'false',
- /** Identifies the element (or elements) whose contents or presence are controlled by the current element. */
- 'aria-controls'?: string,
- /** Indicates the current "pressed" state of toggle buttons. */
- 'aria-pressed'?: boolean | 'true' | 'false' | 'mixed',
- /**
- * The behavior of the button when used in an HTML form.
- * @default 'button'
- */
- type?: 'button' | 'submit' | 'reset'
- }
-
- interface AriaButtonProps<T extends ElementType = 'button'> extends ButtonProps, LinkButtonProps<T>, AriaBaseButtonProps {}
- interface AriaToggleButtonProps<T extends ElementType = 'button'> extends ToggleButtonProps$1, AriaBaseButtonProps, AriaButtonElementTypeProps<T> {}
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface ListBoxProps$1<T> extends CollectionBase<T>, MultipleSelection, FocusEvents {
- /** Whether to auto focus the listbox or an option. */
- autoFocus?: boolean | FocusStrategy,
- /** Whether focus should wrap around when the end/start is reached. */
- shouldFocusWrap?: boolean
- }
-
- interface AriaListBoxPropsBase<T> extends ListBoxProps$1<T>, DOMProps, AriaLabelingProps$1 {}
- interface AriaListBoxProps<T> extends AriaListBoxPropsBase<T> {
- /**
- * An optional visual label for the listbox.
- */
- label?: ReactNode,
- /** How multiple selection should behave in the collection. */
- selectionBehavior?: SelectionBehavior,
- /**
- * Handler that is called when a user performs an action on an item. The exact user event depends on
- * the collection's `selectionBehavior` prop and the interaction modality.
- */
- onAction?: (key: Key$1) => void
- }
-
- interface SelectableItemStates {
- /** Whether the item is currently in a pressed state. */
- isPressed: boolean;
- /** Whether the item is currently selected. */
- isSelected: boolean;
- /** Whether the item is currently focused. */
- isFocused: boolean;
- /**
- * Whether the item is non-interactive, i.e. both selection and actions are disabled and the item may
- * not be focused. Dependent on `disabledKeys` and `disabledBehavior`.
- */
- isDisabled: boolean;
- /**
- * Whether the item may be selected, dependent on `selectionMode`, `disabledKeys`, and `disabledBehavior`.
- */
- allowsSelection: boolean;
- /**
- * Whether the item has an action, dependent on `onAction`, `disabledKeys`,
- * and `disabledBehavior`. It may also change depending on the current selection state
- * of the list (e.g. when selection is primary). This can be used to enable or disable hover
- * styles or other visual indications of interactivity.
- */
- hasAction: boolean;
- }
-
- interface AriaListBoxOptions<T> extends Omit<AriaListBoxProps<T>, 'children'> {
- /** Whether the listbox uses virtual scrolling. */
- isVirtualized?: boolean;
- /**
- * An optional keyboard delegate implementation for type to select,
- * to override the default.
- */
- keyboardDelegate?: KeyboardDelegate;
- /**
- * Whether the listbox items should use virtual focus instead of being focused directly.
- */
- shouldUseVirtualFocus?: boolean;
- /** Whether selection should occur on press up instead of press down. */
- shouldSelectOnPressUp?: boolean;
- /** Whether options should be focused when the user hovers over them. */
- shouldFocusOnHover?: boolean;
- /**
- * The behavior of links in the collection.
- * - 'action': link behaves like onAction.
- * - 'selection': link follows selection interactions (e.g. if URL drives selection).
- * - 'override': links override all other interactions (link items are not selectable).
- * @default 'override'
- */
- linkBehavior?: 'action' | 'selection' | 'override';
- }
- interface OptionAria extends SelectableItemStates {
- /** Props for the option element. */
- optionProps: DOMAttributes;
- /** Props for the main text element inside the option. */
- labelProps: DOMAttributes;
- /** Props for the description text element inside the option, if any. */
- descriptionProps: DOMAttributes;
- /** Whether the option is currently focused. */
- isFocused: boolean;
- /** Whether the option is keyboard focused. */
- isFocusVisible: boolean;
- }
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface AriaDialogProps extends DOMProps, AriaLabelingProps$1 {
- /**
- * The accessibility role for the dialog.
- * @default 'dialog'
- */
- role?: 'dialog' | 'alertdialog'
- }
-
- interface DropOptions {
- /** A ref for the droppable element. */
- ref: RefObject<HTMLElement>;
- /**
- * A function returning the drop operation to be performed when items matching the given types are dropped
- * on the drop target.
- */
- getDropOperation?: (types: DragTypes, allowedOperations: DropOperation[]) => DropOperation;
- /** A function that returns the drop operation for a specific point within the target. */
- getDropOperationForPoint?: (types: DragTypes, allowedOperations: DropOperation[], x: number, y: number) => DropOperation;
- /** Handler that is called when a valid drag enters the drop target. */
- onDropEnter?: (e: DropEnterEvent) => void;
- /** Handler that is called when a valid drag is moved within the drop target. */
- onDropMove?: (e: DropMoveEvent) => void;
- /**
- * Handler that is called after a valid drag is held over the drop target for a period of time.
- * This typically opens the item so that the user can drop within it.
- * @private
- */
- onDropActivate?: (e: DropActivateEvent) => void;
- /** Handler that is called when a valid drag exits the drop target. */
- onDropExit?: (e: DropExitEvent) => void;
- /** Handler that is called when a valid drag is dropped on the drop target. */
- onDrop?: (e: DropEvent) => void;
- /**
- * Whether the item has an explicit focusable drop affordance to initiate accessible drag and drop mode.
- * If true, the dropProps will omit these event handlers, and they will be applied to dropButtonProps instead.
- */
- hasDropButton?: boolean;
- }
- interface DroppableCollectionOptions extends DroppableCollectionProps {
- /** A delegate object that implements behavior for keyboard focus movement. */
- keyboardDelegate: KeyboardDelegate;
- /** A delegate object that provides drop targets for pointer coordinates within the collection. */
- dropTargetDelegate: DropTargetDelegate;
- }
- interface DraggableCollectionOptions {
- }
- interface ClipboardProps {
- /** A function that returns the items to copy. */
- getItems?: () => DragItem[];
- /** Handler that is called when the user triggers a copy interaction. */
- onCopy?: () => void;
- /** Handler that is called when the user triggers a cut interaction. */
- onCut?: () => void;
- /** Handler that is called when the user triggers a paste interaction. */
- onPaste?: (items: DropItem[]) => void;
- }
-
- declare global {
- namespace FormatjsIntl {
- interface Message {
- }
- interface IntlConfig {
- }
- interface Formats {
- }
- }
- }
-
- type LocalizedStrings = {
- [lang: string]: {
- [key: string]: string;
- };
- };
-
- interface NumberFormatOptions extends Intl.NumberFormatOptions {
- /** Overrides default numbering system for the current locale. */
- numberingSystem?: string;
- }
-
- interface Locale {
- /** The [BCP47](https://www.ietf.org/rfc/bcp/bcp47.txt) language code for the locale. */
- locale: string;
- /** The writing direction for the locale. */
- direction: Direction;
- }
- interface I18nProviderProps$1 {
- /** Contents that should have the locale applied. */
- children: ReactNode;
- /** The locale to apply to the children. */
- locale?: string;
- }
- interface DateFormatterOptions extends Intl.DateTimeFormatOptions {
- calendar?: string;
- }
- /**
- * Provides localized date formatting for the current locale. Automatically updates when the locale changes,
- * and handles caching of the date formatter for performance.
- * @param options - Formatting options.
- */
- declare function useDateFormatter(options?: DateFormatterOptions): DateFormatter;
- /**
- * Provides localized number formatting for the current locale. Automatically updates when the locale changes,
- * and handles caching of the number formatter for performance.
- * @param options - Formatting options.
- */
- declare function useNumberFormatter(options?: NumberFormatOptions): Intl.NumberFormat;
- /**
- * Provides localized string collation for the current locale. Automatically updates when the locale changes,
- * and handles caching of the collator for performance.
- * @param options - Collator options.
- */
- declare function useCollator(options?: Intl.CollatorOptions): Intl.Collator;
-
- interface PressProps extends PressEvents {
- /** Whether the target is in a controlled press state (e.g. an overlay it triggers is open). */
- isPressed?: boolean;
- /** Whether the press events should be disabled. */
- isDisabled?: boolean;
- /** Whether the target should not receive focus on press. */
- preventFocusOnPress?: boolean;
- /**
- * Whether press events should be canceled when the pointer leaves the target while pressed.
- * By default, this is `false`, which means if the pointer returns back over the target while
- * still pressed, onPressStart will be fired again. If set to `true`, the press is canceled
- * when the pointer leaves the target and onPressStart will not be fired if the pointer returns.
- */
- shouldCancelOnPointerExit?: boolean;
- /** Whether text selection should be enabled on the pressable element. */
- allowTextSelectionOnPress?: boolean;
- }
-
- interface AriaLinkOptions extends AriaLinkProps {
- /** Whether the link is disabled. */
- isDisabled?: boolean;
- /**
- * The HTML element used to render the link, e.g. 'a', or 'span'.
- * @default 'a'
- */
- elementType?: string;
- }
-
- interface AriaPositionProps extends PositionProps {
- /**
- * Cross size of the overlay arrow in pixels.
- * @default 0
- */
- arrowSize?: number;
- /**
- * Element that that serves as the positioning boundary.
- * @default document.body
- */
- boundaryElement?: Element;
- /**
- * The ref for the element which the overlay positions itself with respect to.
- */
- targetRef: RefObject<Element>;
- /**
- * The ref for the overlay element.
- */
- overlayRef: RefObject<Element>;
- /**
- * A ref for the scrollable region within the overlay.
- * @default overlayRef
- */
- scrollRef?: RefObject<Element>;
- /**
- * Whether the overlay should update its position automatically.
- * @default true
- */
- shouldUpdatePosition?: boolean;
- /** Handler that is called when the overlay should close. */
- onClose?: () => void;
- /**
- * The maxHeight specified for the overlay element.
- * By default, it will take all space up to the current viewport height.
- */
- maxHeight?: number;
- /**
- * The minimum distance the arrow's edge should be from the edge of the overlay element.
- * @default 0
- */
- arrowBoundaryOffset?: number;
- }
- interface AriaOverlayProps {
- /** Whether the overlay is currently open. */
- isOpen?: boolean;
- /** Handler that is called when the overlay should close. */
- onClose?: () => void;
- /**
- * Whether to close the overlay when the user interacts outside it.
- * @default false
- */
- isDismissable?: boolean;
- /** Whether the overlay should close when focus is lost or moves outside it. */
- shouldCloseOnBlur?: boolean;
- /**
- * Whether pressing the escape key to close the overlay should be disabled.
- * @default false
- */
- isKeyboardDismissDisabled?: boolean;
- /**
- * When user interacts with the argument element outside of the overlay ref,
- * return true if onClose should be called. This gives you a chance to filter
- * out interaction with elements that should not dismiss the overlay.
- * By default, onClose will always be called on interaction outside the overlay ref.
- */
- shouldCloseOnInteractOutside?: (element: Element) => boolean;
- }
- interface OverlayTriggerProps {
- /** Type of overlay that is opened by the trigger. */
- type: 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid';
- }
- interface OverlayTriggerAria {
- /** Props for the trigger element. */
- triggerProps: AriaButtonProps;
- /** Props for the overlay container element. */
- overlayProps: DOMProps;
- }
- /**
- * Handles the behavior and accessibility for an overlay trigger, e.g. a button
- * that opens a popover, menu, or other overlay that is positioned relative to the trigger.
- */
- declare function useOverlayTrigger(props: OverlayTriggerProps, state: OverlayTriggerState, ref?: RefObject<Element>): OverlayTriggerAria;
- interface AriaPopoverProps extends Omit<AriaPositionProps, 'isOpen' | 'onClose' | 'targetRef' | 'overlayRef'> {
- /**
- * The ref for the element which the popover positions itself with respect to.
- */
- triggerRef: RefObject<Element>;
- /**
- * The ref for the popover element.
- */
- popoverRef: RefObject<Element>;
- /**
- * Whether the popover is non-modal, i.e. elements outside the popover may be
- * interacted with by assistive technologies.
- *
- * Most popovers should not use this option as it may negatively impact the screen
- * reader experience. Only use with components such as combobox, which are designed
- * to handle this situation carefully.
- */
- isNonModal?: boolean;
- /**
- * Whether pressing the escape key to close the popover should be disabled.
- *
- * Most popovers should not use this option. When set to true, an alternative
- * way to close the popover with a keyboard must be provided.
- *
- * @default false
- */
- isKeyboardDismissDisabled?: boolean;
- /**
- * When user interacts with the argument element outside of the popover ref,
- * return true if onClose should be called. This gives you a chance to filter
- * out interaction with elements that should not dismiss the popover.
- * By default, onClose will always be called on interaction outside the popover ref.
- */
- shouldCloseOnInteractOutside?: (element: Element) => boolean;
- }
- interface OverlayProps {
- /**
- * The container element in which the overlay portal will be placed.
- * @default document.body
- */
- portalContainer?: Element;
- /** The overlay to render in the portal. */
- children: ReactNode;
- /**
- * Disables default focus management for the overlay, including containment and restoration.
- * This option should be used very carefully. When focus management is disabled, you must
- * implement focus containment and restoration to ensure the overlay is keyboard accessible.
- */
- disableFocusManagement?: boolean;
- /**
- * Whether the overlay is currently performing an exit animation. When true,
- * focus is allowed to move outside.
- */
- isExiting?: boolean;
- }
- interface AriaModalOverlayProps extends Pick<AriaOverlayProps, 'shouldCloseOnInteractOutside'> {
- /**
- * Whether to close the modal when the user interacts outside it.
- * @default false
- */
- isDismissable?: boolean;
- /**
- * Whether pressing the escape key to close the modal should be disabled.
- * @default false
- */
- isKeyboardDismissDisabled?: boolean;
- }
-
- interface AriaMenuTriggerProps {
- /** The type of menu that the menu trigger opens. */
- type?: 'menu' | 'listbox';
- /** Whether menu trigger is disabled. */
- isDisabled?: boolean;
- /** How menu is triggered. */
- trigger?: MenuTriggerType;
- }
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface ProgressBaseProps {
- /**
- * The current value (controlled).
- * @default 0
- */
- value?: number,
- /**
- * The smallest value allowed for the input.
- * @default 0
- */
- minValue?: number,
- /**
- * The largest value allowed for the input.
- * @default 100
- */
- maxValue?: number
- }
-
- interface ProgressBarBaseProps extends ProgressBaseProps {
- /** The content to display as the label. */
- label?: ReactNode,
- /**
- * The display format of the value label.
- * @default {style: 'percent'}
- */
- formatOptions?: Intl.NumberFormatOptions,
- /** The content to display as the value's label (e.g. 1 of 4). */
- valueLabel?: ReactNode
- }
-
- interface ProgressBarProps$1 extends ProgressBarBaseProps {
- /**
- * Whether presentation is indeterminate when progress isn't known.
- */
- isIndeterminate?: boolean
- }
-
- interface AriaProgressBarProps extends ProgressBarProps$1, DOMProps, AriaLabelingProps$1 {}
-
- interface AriaSelectOptions<T> extends Omit<AriaSelectProps<T>, 'children'> {
- /**
- * An optional keyboard delegate implementation for type to select,
- * to override the default.
- */
- keyboardDelegate?: KeyboardDelegate;
- }
-
- interface SeparatorProps$1 extends DOMProps, AriaLabelingProps$1 {
- /**
- * The orientation of the separator.
- * @default 'horizontal'
- */
- orientation?: Orientation;
- /** The HTML element type that will be used to render the separator. */
- elementType?: string;
- }
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface SwitchBase extends InputBase, FocusableProps {
- /**
- * The content to render as the Switch's label.
- */
- children?: ReactNode,
- /**
- * Whether the Switch should be selected (uncontrolled).
- */
- defaultSelected?: boolean,
- /**
- * Whether the Switch should be selected (controlled).
- */
- isSelected?: boolean,
- /**
- * Handler that is called when the Switch's selection state changes.
- */
- onChange?: (isSelected: boolean) => void,
- /**
- * The value of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefvalue).
- */
- value?: string
- }
- interface SwitchProps$1 extends SwitchBase {}
- interface AriaSwitchBase extends SwitchBase, FocusableDOMProps, InputDOMProps, AriaLabelingProps$1 {
- /**
- * Identifies the element (or elements) whose contents or presence are controlled by the current element.
- */
- 'aria-controls'?: string
- }
- interface AriaSwitchProps extends SwitchProps$1, AriaSwitchBase {}
-
- interface AriaTagGroupProps<T> extends CollectionBase<T>, MultipleSelection, DOMProps, LabelableProps, AriaLabelingProps$1, Omit<HelpTextProps, 'errorMessage'> {
- /** How multiple selection should behave in the collection. */
- selectionBehavior?: SelectionBehavior;
- /** Handler that is called when a user deletes a tag. */
- onRemove?: (keys: Set<Key$1>) => void;
- /** An error message for the field. */
- errorMessage?: ReactNode;
- }
-
- /**
- * A map of HTML element names and their interface types.
- * For example `'a'` -> `HTMLAnchorElement`.
- */
- type IntrinsicHTMLElements = {
- [K in keyof IntrinsicHTMLAttributes]: IntrinsicHTMLAttributes[K] extends HTMLAttributes<infer T> ? T : never;
- };
- /**
- * A map of HTML element names and their attribute interface types.
- * For example `'a'` -> `AnchorHTMLAttributes<HTMLAnchorElement>`.
- */
- type IntrinsicHTMLAttributes = {
- [K in keyof ReactDOM]: ReactDOM[K] extends DOMFactory<infer T, any> ? T : never;
- };
- /**
- * The intrinsic HTML element names that `useTextField` supports; e.g. `input`,
- * `textarea`.
- */
- type TextFieldIntrinsicElements = keyof Pick<IntrinsicHTMLElements, 'input' | 'textarea'>;
- interface AriaTextFieldOptions<T extends TextFieldIntrinsicElements> extends AriaTextFieldProps {
- /**
- * The HTML element used to render the input, e.g. 'input', or 'textarea'.
- * It determines whether certain HTML attributes will be included in `inputProps`.
- * For example, [`type`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-type).
- * @default 'input'
- */
- inputElementType?: T;
- /**
- * Controls whether inputted text is automatically capitalized and, if so, in what manner.
- * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize).
- */
- autoCapitalize?: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';
- }
-
- interface SVGRProps {
- title?: string;
- titleId?: string;
- size?: CSSProperties["width"];
- }
- declare type IconProps = SVGRProps & SVGProps<SVGSVGElement>;
-
- interface ResponsiveArray<Length extends number, Value> extends ReadonlyArray<Value> {
- 0: Value;
- length: Length;
- }
-
- declare const createLayerSprinkles: (layer: string) => ((props: {
- paddingBlockStart?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- paddingInlineEnd?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- paddingBlockEnd?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- paddingInlineStart?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- marginBlockStart?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- marginInlineEnd?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- marginBlockEnd?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- marginInlineStart?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- gap?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- paddingLeft?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- paddingRight?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- paddingTop?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- paddingBottom?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- padding?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- paddingX?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- paddingY?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- marginLeft?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- marginRight?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- marginTop?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- marginBottom?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- margin?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- marginX?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- marginY?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
- } & {
- borderStartStartRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
- borderStartEndRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
- borderEndStartRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
- borderEndEndRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
- borderRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
- borderTopRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
- borderBottomRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
- borderLeftRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
- borderRightRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
- mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
- } & {
- boxShadow?: "medium" | "low" | undefined;
- } & {
- opacity?: "none" | "medium" | "low" | "high" | undefined;
- } & {
- typography?: "heading.h6.regular" | "heading.h6.medium" | "heading.h6.semibold" | "heading.h5.regular" | "heading.h5.medium" | "heading.h5.semibold" | "heading.h4.regular" | "heading.h4.medium" | "heading.h4.semibold" | "heading.h3.regular" | "heading.h3.medium" | "heading.h3.semibold" | "heading.h2.regular" | "heading.h2.medium" | "heading.h2.semibold" | "heading.h1.regular" | "heading.h1.medium" | "heading.h1.semibold" | "label.sm.regular" | "label.sm.medium" | "label.sm.semibold" | "label.md.regular" | "label.md.medium" | "label.md.semibold" | "label.lg.regular" | "label.lg.medium" | "label.lg.semibold" | "body.sm.regular" | "body.sm.medium" | "body.sm.semibold" | "body.md.regular" | "body.md.medium" | "body.md.semibold" | "body.lg.regular" | "body.lg.medium" | "body.lg.semibold" | undefined;
- } & {
- color?: "text.primary" | "text.secondary" | "text.helper" | "text.placeholder" | "text.disabled" | "text.inverse" | "icon.primary" | "icon.secondary" | "icon.disabled" | "icon.inverse" | "icon.interactive" | "interactive.primary" | "interactive.hovered" | "interactive.active" | "interactive.visited" | "interactive.disabled" | "support.error.subtler" | "support.error.subtle" | "support.error.medium" | "support.error.strong" | "support.success.subtler" | "support.success.subtle" | "support.success.medium" | "support.success.strong" | "support.warning.subtler" | "support.warning.subtle" | "support.warning.medium" | "support.warning.strong" | "support.info.subtler" | "support.info.subtle" | "support.info.medium" | "support.info.strong" | "focused.primary" | "focused.inset" | undefined;
- backgroundColor?: "background.primary.subtle" | "background.primary.medium" | "background.primary.strong" | "background.secondary.subtle" | "background.secondary.medium" | "background.secondary.strong" | "background.inverse.subtle" | "background.inverse.medium" | "background.inverse.strong" | "background.overlay.subtle" | "background.overlay.medium" | "positive.subtle" | "positive.medium" | "positive.strong" | "positive.interactive" | "support.error.subtler" | "support.error.subtle" | "support.error.medium" | "support.error.strong" | "support.success.subtler" | "support.success.subtle" | "support.success.medium" | "support.success.strong" | "support.warning.subtler" | "support.warning.subtle" | "support.warning.medium" | "support.warning.strong" | "support.info.subtler" | "support.info.subtle" | "support.info.medium" | "support.info.strong" | "focused.primary" | "focused.inset" | undefined;
- borderColor?: "transparent" | "support.error.subtler" | "support.error.subtle" | "support.error.medium" | "support.error.strong" | "support.success.subtler" | "support.success.subtle" | "support.success.medium" | "support.success.strong" | "support.warning.subtler" | "support.warning.subtle" | "support.warning.medium" | "support.warning.strong" | "support.info.subtler" | "support.info.subtle" | "support.info.medium" | "support.info.strong" | "focused.primary" | "focused.inset" | "border.subtle" | "border.medium" | "border.strong" | "border.inverse" | "border.interactive" | "border.disabled" | undefined;
- outlineColor?: "transparent" | "support.error.subtler" | "support.error.subtle" | "support.error.medium" | "support.error.strong" | "support.success.subtler" | "support.success.subtle" | "support.success.medium" | "support.success.strong" | "support.warning.subtler" | "support.warning.subtle" | "support.warning.medium" | "support.warning.strong" | "support.info.subtler" | "support.info.subtle" | "support.info.medium" | "support.info.strong" | "focused.primary" | "focused.inset" | "border.subtle" | "border.medium" | "border.strong" | "border.inverse" | "border.interactive" | "border.disabled" | undefined;
- } & {
- position?: ("fixed" | "absolute" | "relative" | {
- mobile?: "fixed" | "absolute" | "relative" | undefined;
- tablet?: "fixed" | "absolute" | "relative" | undefined;
- desktop?: "fixed" | "absolute" | "relative" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "fixed" | "absolute" | "relative" | null>;
- display?: ("none" | "block" | "flex" | "grid" | "inline-flex" | {
- mobile?: "none" | "block" | "flex" | "grid" | "inline-flex" | undefined;
- tablet?: "none" | "block" | "flex" | "grid" | "inline-flex" | undefined;
- desktop?: "none" | "block" | "flex" | "grid" | "inline-flex" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "block" | "flex" | "grid" | "inline-flex" | null>;
- flexDirection?: ("column" | "column-reverse" | "row" | "row-reverse" | {
- mobile?: "column" | "column-reverse" | "row" | "row-reverse" | undefined;
- tablet?: "column" | "column-reverse" | "row" | "row-reverse" | undefined;
- desktop?: "column" | "column-reverse" | "row" | "row-reverse" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "column" | "column-reverse" | "row" | "row-reverse" | null>;
- alignItems?: ("stretch" | "center" | "flex-end" | "flex-start" | {
- mobile?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
- tablet?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
- desktop?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "stretch" | "center" | "flex-end" | "flex-start" | null>;
- alignSelf?: ("stretch" | "center" | "flex-end" | "flex-start" | {
- mobile?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
- tablet?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
- desktop?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "stretch" | "center" | "flex-end" | "flex-start" | null>;
- flex?: (number | {
- mobile?: number | undefined;
- tablet?: number | undefined;
- desktop?: number | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, number | null>;
- justifyContent?: ("space-between" | "stretch" | "center" | "flex-end" | "flex-start" | {
- mobile?: "space-between" | "stretch" | "center" | "flex-end" | "flex-start" | undefined;
- tablet?: "space-between" | "stretch" | "center" | "flex-end" | "flex-start" | undefined;
- desktop?: "space-between" | "stretch" | "center" | "flex-end" | "flex-start" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "space-between" | "stretch" | "center" | "flex-end" | "flex-start" | null>;
- justifySelf?: ("stretch" | "center" | "flex-end" | "flex-start" | {
- mobile?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
- tablet?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
- desktop?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "stretch" | "center" | "flex-end" | "flex-start" | null>;
- placeItems?: ("stretch" | "center" | "flex-end" | "flex-start" | {
- mobile?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
- tablet?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
- desktop?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
- } | undefined) | ResponsiveArray<1 | 2 | 3, "stretch" | "center" | "flex-end" | "flex-start" | null>;
- } & {
- transition?: "transition.medium" | undefined;
- transitionProperty?: "opacity" | "transform" | "background-color" | undefined;
- } & {
- readonly flexWrap?: "nowrap" | "wrap" | undefined;
- readonly insetBlockStart?: 0 | undefined;
- readonly insetBlockEnd?: 0 | undefined;
- readonly insetInlineStart?: 0 | undefined;
- readonly insetInlineEnd?: 0 | undefined;
- readonly flexShrink?: 0 | undefined;
- readonly flexGrow?: 0 | 1 | undefined;
- readonly width?: "full" | undefined;
- readonly height?: "full" | undefined;
- readonly cursor?: "pointer" | undefined;
- inset?: 0 | undefined;
- } & {
- outline?: "none" | undefined;
- outlineStyle?: "solid" | undefined;
- outlineWidth?: number | undefined;
- outlineOffset?: number | undefined;
- border?: "none" | undefined;
- borderStyle?: "dashed" | "solid" | undefined;
- borderWidth?: number | undefined;
- }) => string) & {
- properties: Set<"alignItems" | "alignSelf" | "backgroundColor" | "borderEndEndRadius" | "borderEndStartRadius" | "borderStartEndRadius" | "borderStartStartRadius" | "boxShadow" | "color" | "cursor" | "display" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "height" | "insetBlockEnd" | "insetBlockStart" | "insetInlineEnd" | "insetInlineStart" | "justifyContent" | "justifySelf" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "opacity" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "transitionProperty" | "width" | "border" | "borderColor" | "borderRadius" | "borderStyle" | "borderWidth" | "flex" | "gap" | "inset" | "margin" | "outline" | "padding" | "placeItems" | "transition" | "typography" | "paddingX" | "paddingY" | "marginX" | "marginY" | "borderTopRadius" | "borderBottomRadius" | "borderLeftRadius" | "borderRightRadius">;
- };
- declare type BaseSprinkles = ReturnType<typeof createLayerSprinkles>;
-
- interface Theme {
- elevation: Elevation;
- opacity: Opacity;
- rounded: Rounded;
- spacing: Spacing;
- color: Color$1;
- typography: Typography;
- }
- interface Typography {
- heading: Heading;
- label: Label;
- body: Label;
- }
- interface Label {
- sm: H6;
- md: H6;
- lg: H6;
- }
- interface Heading {
- h6: H6;
- h5: H6;
- h4: H6;
- h3: H6;
- h2: H6;
- h1: H6;
- }
- interface H6 {
- regular: Regular;
- medium: Regular;
- semibold: Regular;
- }
- interface Regular {
- font: string;
- letterSpacing: string;
- }
- interface Color$1 {
- support: Support;
- focused: Focused;
- background: Background;
- text: Text$2;
- icon: Icon;
- border: Border;
- interactive: Interactive;
- positive: Positive;
- }
- interface Positive {
- subtle: string;
- medium: string;
- strong: string;
- interactive: string;
- }
- interface Interactive {
- primary: string;
- hovered: string;
- active: string;
- visited: string;
- disabled: string;
- }
- interface Border {
- subtle: string;
- medium: string;
- strong: string;
- inverse: string;
- interactive: string;
- disabled: string;
- }
- interface Icon {
- primary: string;
- secondary: string;
- inverse: string;
- interactive: string;
- disabled: string;
- }
- interface Text$2 {
- primary: string;
- secondary: string;
- helper: string;
- placeholder: string;
- inverse: string;
- disabled: string;
- }
- interface Background {
- primary: Primary;
- inverse: Primary;
- secondary: Primary;
- overlay: Overlay;
- }
- interface Overlay {
- subtle: string;
- medium: string;
- interactive: string;
- }
- interface Primary {
- subtle: string;
- medium: string;
- strong: string;
- }
- interface Focused {
- primary: string;
- inset: string;
- }
- interface Support {
- error: Error$1;
- success: Error$1;
- warning: Error$1;
- info: Error$1;
- }
- interface Error$1 {
- subtler: string;
- subtle: string;
- medium: string;
- strong: string;
- }
- interface Spacing {
- xs: string;
- sm: string;
- md: string;
- lg: string;
- xl: string;
- '2xl': string;
- '3xl': string;
- '4xl': string;
- '5xl': string;
- '6xl': string;
- '7xl': string;
- '8xl': string;
- '9xl': string;
- }
- interface Rounded {
- xs: string;
- sm: string;
- md: string;
- lg: string;
- xl: string;
- '2xl': string;
- full: string;
- }
- interface Opacity {
- none: string;
- low: string;
- medium: string;
- high: string;
- }
- interface Elevation {
- low: string;
- medium: string;
- }
-
- interface Sprinkles extends BaseSprinkles {
- base: BaseSprinkles;
- variants: BaseSprinkles;
- compoundVariants: BaseSprinkles;
- overrides: BaseSprinkles;
- }
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- /** A list of supported color formats. */
- type ColorFormat = 'hex' | 'hexa' | 'rgb' | 'rgba' | 'hsl' | 'hsla' | 'hsb' | 'hsba';
-
- /** A list of color channels. */
- type ColorChannel = 'hue' | 'saturation' | 'brightness' | 'lightness' | 'red' | 'green' | 'blue' | 'alpha';
-
- type ColorAxes = {xChannel: ColorChannel, yChannel: ColorChannel, zChannel: ColorChannel};
-
- interface ColorChannelRange {
- /** The minimum value of the color channel. */
- minValue: number,
- /** The maximum value of the color channel. */
- maxValue: number,
- /** The step value of the color channel, used when incrementing and decrementing. */
- step: number,
- /** The page step value of the color channel, used when incrementing and decrementing. */
- pageSize: number
- }
-
- /** Represents a color value. */
- interface Color {
- /** Converts the color to the given color format, and returns a new Color object. */
- toFormat(format: ColorFormat): Color,
- /** Converts the color to a string in the given format. */
- toString(format: ColorFormat | 'css'): string,
- /** Converts the color to hex, and returns an integer representation. */
- toHexInt(): number,
- /**
- * Returns the numeric value for a given channel.
- * Throws an error if the channel is unsupported in the current color format.
- */
- getChannelValue(channel: ColorChannel): number,
- /**
- * Sets the numeric value for a given channel, and returns a new Color object.
- * Throws an error if the channel is unsupported in the current color format.
- */
- withChannelValue(channel: ColorChannel, value: number): Color,
- /**
- * Returns the minimum, maximum, and step values for a given channel.
- */
- getChannelRange(channel: ColorChannel): ColorChannelRange,
- /**
- * Returns a localized color channel name for a given channel and locale,
- * for use in visual or accessibility labels.
- */
- getChannelName(channel: ColorChannel, locale: string): string,
- /**
- * Formats the numeric value for a given channel for display according to the provided locale.
- */
- formatChannelValue(channel: ColorChannel, locale: string): string,
- /**
- * Returns the color space, 'rgb', 'hsb' or 'hsl', for the current color.
- */
- getColorSpace(): ColorFormat,
- /**
- * Returns the color space axes, xChannel, yChannel, zChannel.
- */
- getColorSpaceAxes(xyChannels: {xChannel?: ColorChannel, yChannel?: ColorChannel}): ColorAxes,
- /**
- * Returns an array of the color channels within the current color space space.
- */
- getColorChannels(): [ColorChannel, ColorChannel, ColorChannel]
- }
-
- interface ColorFieldProps extends Omit<ValueBase<string | Color | null>, 'onChange'>, InputBase, Validation<Color | null>, FocusableProps, TextInputBase, LabelableProps, HelpTextProps {
- /** Handler that is called when the value changes. */
- onChange?: (color: Color | null) => void
- }
-
- interface IObject<T> {
- [name: string]: T;
- }
-
- declare type TargetParam<Param> = Pick<Param, Exclude<keyof Param, keyof EmitterParam>> & Partial<EmitterParam>;
- interface EmitterParam<Target = any> {
- type: string;
- currentTarget: Target;
- stop(): void;
- }
- declare type OnEvent$1<Param, Target = any> = EmitterParam<Target> & Param;
- declare type EventHash<Events, Target> = Partial<{
- [Key in keyof Events]: EventListener<Events[Key], Target>;
- }>;
- declare type EventListener<Param, Target> = (e: OnEvent$1<Param, Target>) => any;
-
- declare class EventEmitter<Events extends {} = {
- [key: string]: {
- [key: string]: any;
- };
- }> {
- private _events;
- on<Name extends keyof Events, Param = Events[Name]>(eventName: Name, listener: EventListener<Param, this>): this;
- on(events: EventHash<Events, this>): this;
- off<Name extends keyof Events, Param = Events[Name]>(eventName?: Name, listener?: EventListener<Param, this>): this;
- off(events: EventHash<Events, this>): this;
- once<Name extends keyof Events & string, Param = Events[Name]>(eventName: Name, listener?: EventListener<Param, this>): Promise<OnEvent$1<Param, this>>;
- emit<Name extends keyof Events, Param = Events[Name]>(eventName: {} extends Param ? Name : never): boolean;
- emit<Name extends keyof Events, Param = Events[Name]>(eventName: Name, param: TargetParam<Param>): boolean;
- trigger<Name extends keyof Events, Param = Events[Name]>(eventName: {} extends TargetParam<Param> ? Name : never): boolean;
- trigger<Name extends keyof Events, Param = Events[Name]>(eventName: Name, param: TargetParam<Param>): boolean;
- private _addEvent;
- }
-
- /**
- * @typedef
- * @memberof Gesto
- */
- interface Client {
- clientX: number;
- clientY: number;
- originalClientX?: number;
- originalClientY?: number;
- }
- /**
- * @typedef
- * @memberof Gesto
- */
- interface Dist {
- distX: number;
- distY: number;
- }
- /**
- * @typedef
- * @memberof Gesto
- */
- interface Delta {
- deltaX: number;
- deltaY: number;
- }
- /**
- * @typedef
- * @memberof Gesto
- * @extends Gesto.Client
- * @extends Gesto.Dist
- * @extends Gesto.Delta
- */
- interface Position extends Client, Dist, Delta {
- }
- /**
- * @typedef
- * @memberof Gesto
- * @extends Gesto.Position
- * @extends EventEmitter.EmitterParam
- */
- interface OnDragStart$1<T = Gesto> extends Position, EmitterParam<T> {
- datas: IObject<any>;
- data: IObject<any>;
- inputEvent: any;
- isTrusted: boolean;
- isMouseEvent: boolean;
- isSecondaryButton: boolean;
- isDouble: boolean;
- preventDefault: () => void;
- preventDrag: () => void;
- }
- /**
- * @typedef
- * @memberof Gesto
- * @extends Gesto.Position
- * @extends EventEmitter.EmitterParam
- */
- interface OnDrag$1<T = Gesto> extends Position, EmitterParam<T> {
- isDrag: boolean;
- isMouseEvent: boolean;
- isSecondaryButton: boolean;
- isPinch: boolean;
- movement: number;
- datas: IObject<any>;
- data: IObject<any>;
- isScroll: boolean;
- isFirstDrag: boolean;
- inputEvent: any;
- isTrusted: boolean;
- }
- /**
- * @typedef
- * @memberof Gesto
- * @extends Gesto.Position
- * @extends EventEmitter.EmitterParam
- */
- interface OnDragEnd$1<T = Gesto> extends Position, EmitterParam<T> {
- isDrag: boolean;
- isClick: boolean;
- isMouseEvent: boolean;
- isSecondaryButton: boolean;
- isDouble: boolean;
- datas: IObject<any>;
- data: IObject<any>;
- inputEvent: any;
- isTrusted: boolean;
- }
- /**
- * @typedef
- * @memberof Gesto
- * @extends Gesto.Position
- * @extends EventEmitter.EmitterParam
- */
- interface OnPinchStart<T = Gesto> extends Position, EmitterParam<T> {
- datas: IObject<any>;
- data: IObject<any>;
- touches: Position[];
- angle: number;
- inputEvent: any;
- isTrusted: boolean;
- preventDefault: () => void;
- preventDrag: () => void;
- }
- /**
- * @typedef
- * @memberof Gesto
- * @extends Gesto.Position
- * @extends EventEmitter.EmitterParam
- */
- interface OnPinch<T = Gesto> extends Position, EmitterParam<T> {
- datas: IObject<any>;
- data: IObject<any>;
- touches: Position[];
- rotation: number;
- angle: number;
- scale: number;
- distance: number;
- movement: number;
- inputEvent: any;
- isTrusted: boolean;
- }
- /**
- * @typedef
- * @memberof Gesto
- * @extends Gesto.Position
- * @extends EventEmitter.EmitterParam
- */
- interface OnPinchEnd<T = Gesto> extends Position, EmitterParam<T> {
- isPinch: boolean;
- datas: IObject<any>;
- data: IObject<any>;
- touches: Position[];
- inputEvent: any;
- }
- /**
- * @typedef
- * @memberof Gesto
- */
- interface GestoOptions {
- container?: Window | Node | Element;
- /**
- * @default ["mouse", "touch"]
- */
- events?: Array<"drag" | "mouse" | "touch">;
- /**
- * Whether to prevent dragging of the right mouse button
- * @default true
- */
- preventRightClick?: boolean;
- /**
- * @default true
- */
- preventWheelClick?: boolean;
- preventDefault?: boolean;
- /**
- * Prevents pinching when the drag is moved more than a certain distance. That distance allowance is pinchThreshold.
- * @default 0
- */
- pinchThreshold?: number;
- /**
- * Whether to keep dragging even when pinch ends
- * @default false
- */
- keepDragging?: boolean;
- /**
- * Prevent click event on drag. (mousemove, touchmove)
- * @default false
- */
- preventClickEventOnDrag?: boolean;
- /**
- * Prevent click event on dragStart. (mousedown, touchstart)
- * @default false
- */
- preventClickEventOnDragStart?: boolean;
- /**
- * Prevent click event according to specific conditions.
- * Returning true allows the click event, returning false prevents it.
- * @default null
- */
- preventClickEventByCondition?: ((e: MouseEvent) => boolean) | null;
- pinchOutside?: boolean;
- /**
- * Prevent dragging of `input`, `textarea`, and contenteditable.
- * @default false
- */
- checkInput?: boolean;
- /**
- * Whether to drag the focused input
- * If `checkInput` is true, this option is not applied.
- * @default false
- */
- dragFocusedInput?: boolean;
- checkWindowBlur?: boolean;
- }
- /**
- * @typedef
- * @memberof Gesto
- */
- type GestoEvents = {
- "dragStart": OnDragStart$1;
- "drag": OnDrag$1;
- "dragEnd": OnDragEnd$1;
- "pinchStart": OnPinchStart;
- "pinch": OnPinch;
- "pinchEnd": OnPinchEnd;
- };
-
- /**
- * You can set up drag, pinch events in any browser.
- */
- declare class Gesto extends EventEmitter<GestoEvents> {
- options: GestoOptions;
- private flag;
- private pinchFlag;
- private data;
- private isDrag;
- private isPinch;
- private clientStores;
- private targets;
- private prevTime;
- private doubleFlag;
- private _useMouse;
- private _useTouch;
- private _useDrag;
- private _dragFlag;
- private _isTrusted;
- private _isMouseEvent;
- private _isSecondaryButton;
- private _preventMouseEvent;
- private _prevInputEvent;
- private _isDragAPI;
- private _isIdle;
- private _preventMouseEventId;
- private _window;
- /**
- *
- */
- constructor(targets: Array<Element | Window> | Element | Window, options?: GestoOptions);
- /**
- * Stop Gesto's drag events.
- */
- stop(): void;
- /**
- * The total moved distance
- */
- getMovement(clients?: Client[]): number;
- /**
- * Whether to drag
- */
- isDragging(): boolean;
- /**
- * Whether the operation of gesto is finished and is in idle state
- */
- isIdle(): boolean;
- /**
- * Whether to start drag
- */
- isFlag(): boolean;
- /**
- * Whether to start pinch
- */
- isPinchFlag(): boolean;
- /**
- * Whether to start double click
- */
- isDoubleFlag(): boolean;
- /**
- * Whether to pinch
- */
- isPinching(): boolean;
- /**
- * If a scroll event occurs, it is corrected by the scroll distance.
- */
- scrollBy(deltaX: number, deltaY: number, e: any, isCallDrag?: boolean): void;
- /**
- * Create a virtual drag event.
- */
- move([deltaX, deltaY]: number[], inputEvent: any): TargetParam<OnDrag$1>;
- /**
- * The dragStart event is triggered by an external event.
- */
- triggerDragStart(e: any): void;
- /**
- * Set the event data while dragging.
- */
- setEventData(data: IObject<any>): this;
- /**
- * Set the event data while dragging.
- * Use `setEventData`
- * @deprecated
- */
- setEventDatas(data: IObject<any>): this;
- /**
- * Get the current event state while dragging.
- */
- getCurrentEvent(inputEvent?: any): {
- movement: number;
- isDrag: boolean;
- isPinch: boolean;
- isScroll: boolean;
- inputEvent: any;
- distX: number;
- distY: number;
- clientX: number;
- clientY: number;
- originalClientX?: number | undefined;
- originalClientY?: number | undefined;
- deltaX: number;
- deltaY: number;
- data: IObject<any>;
- datas: IObject<any>;
- };
- /**
- * Get & Set the event data while dragging.
- */
- getEventData(): IObject<any>;
- /**
- * Get & Set the event data while dragging.
- * Use getEventData method
- * @depreacated
- */
- getEventDatas(): IObject<any>;
- /**
- * Unset Gesto
- */
- unset(): void;
- onDragStart: (e: any, isTrusted?: boolean) => false | undefined;
- onDrag: (e: any, isScroll?: boolean) => void;
- onDragEnd: (e?: any) => void;
- onPinchStart(e: TouchEvent): void;
- onPinch(e: TouchEvent, clients: Client[]): void;
- onPinchEnd(e: TouchEvent): void;
- private getCurrentStore;
- private moveClients;
- private onBlur;
- private _addStore;
- private _getPosition;
- private _allowClickEvent;
- private _attchDragEvent;
- private _dettachDragEvent;
- private _onClick;
- private _onContextMenu;
- private _allowMouseEvent;
- private _passCallback;
- }
-
- declare class CustomGesto {
- private ableName;
- private prevX;
- private prevY;
- private startX;
- private startY;
- private isDrag;
- private isFlag;
- private datas;
- constructor(ableName?: string);
- dragStart(client: number[], e: any): {
- type: string;
- inputEvent: any;
- isDrag: boolean;
- isFirstDrag: boolean;
- datas: IObject<any>;
- originalDatas: IObject<any>;
- parentEvent: boolean;
- parentGesto: CustomGesto;
- clientX: number;
- clientY: number;
- originalClientX?: number | undefined;
- originalClientY?: number | undefined;
- distX: number;
- distY: number;
- deltaX: number;
- deltaY: number;
- };
- drag(client: number[], inputEvent: any): OnCustomDrag;
- move(delta: number[], inputEvent: any): OnCustomDrag;
- }
-
- interface MoveableElementMatrixInfo {
- hasZoom: boolean;
- hasFixed: boolean;
- originalRootMatrix: number[];
- rootMatrix: number[];
- beforeMatrix: number[];
- offsetMatrix: number[];
- allMatrix: number[];
- targetMatrix: number[];
- transformOrigin: number[];
- targetOrigin: number[];
- is3d: boolean;
- targetTransform: string;
- inlineTransform: string;
- offsetContainer: HTMLElement | null;
- offsetRootContainer: HTMLElement | null;
- matrixes: MatrixInfo[];
- }
-
- interface MoveableElementInfo extends MoveableElementMatrixInfo, MoveablePosition, ElementSizes {
- width: number;
- height: number;
- rotation: number;
- }
-
- interface MoveableTargetInfo extends MoveableElementInfo {
- targetClientRect: MoveableClientRect;
- containerClientRect: MoveableClientRect;
- moveableClientRect: MoveableClientRect;
- rootContainerClientRect: MoveableClientRect;
- beforeDirection: 1 | -1;
- beforeOrigin: number[];
- offsetDelta: number[];
- originalBeforeOrigin: number[];
- target: HTMLElement | SVGElement | null | undefined;
- style: Partial<Writable<CSSStyleDeclaration>>;
- }
-
- interface MoveableClientRect {
- left: number;
- top: number;
- right: number;
- bottom: number;
- width: number;
- height: number;
- clientLeft?: number;
- clientTop?: number;
- clientWidth?: number;
- clientHeight?: number;
- scrollWidth?: number;
- scrollHeight?: number;
- overflow?: boolean;
- }
- declare type MoveableManagerProps<T = {}> = {
- cssStyled: any;
- customStyledMap: Record<string, any>;
- wrapperMoveable?: MoveableManagerInterface | null;
- isWrapperMounted?: boolean;
- parentMoveable?: MoveableManagerInterface | null;
- parentPosition?: number[] | null;
- groupable?: boolean;
- } & MoveableDefaultOptions & (unknown extends T ? IObject<any> : T);
- /**
- * @typedef
- * @memberof Moveable
- */
- interface MoveablePosition {
- left: number;
- top: number;
- right: number;
- bottom: number;
- origin: number[];
- pos1: number[];
- pos2: number[];
- pos3: number[];
- pos4: number[];
- direction: 1 | -1;
- }
- /**
- * @typedef
- * @memberof Moveable
- * @options
- */
- interface DefaultOptions {
- /**
- * The target(s) to indicate Moveable Control Box.
- * @default null
- */
- target?: SVGElement | HTMLElement | null;
- /**
- * The external target(s) to drag Moveable target(s)
- * @default target
- */
- dragTarget?: MoveableRefType | null;
- /**
- * If dragTarget is set directly, taget itself cannot be dragged.
- * Whether to drag the target as well.
- * @default false
- */
- dragTargetSelf?: boolean;
- /**
- * Container area where drag works
- * @default window
- */
- dragContainer?: null | Window | MoveableRefType<HTMLElement>;
- /**
- * A container into which Moveables are inserted.
- * Set it only when used within the slot of Web Components or when the container is different.
- * @default parentElement
- */
- container?: SVGElement | HTMLElement | null;
- /**
- * Whether to warp itself to the container itself. Don't set it.
- * @private
- * @default false
- */
- warpSelf?: boolean;
- /**
- * Moveable Root Container (No Transformed Container)
- * @default parentElement
- * @story options--options-root-container
- */
- rootContainer?: MoveableRefType<HTMLElement>;
- /**
- * If you want to set the dragging information to the viewer, refer to the following.
- * @default null
- * @story options--options-view-container
- */
- viewContainer?: MoveableRefType<HTMLElement>;
- /**
- * Whether the target size is detected and updated whenever it changes.
- * It is more effective when used together with `useMutationObserver`.
- * @default false
- * @story options--options-resize-observer
- */
- useResizeObserver?: boolean;
- /**
- * Whether the target size, pos in inline style is detected and updated whenever it changes.
- * It is more effective when used together with `useResizeObserver`.
- * @default false
- * @story options--options-mutation-observer
- */
- useMutationObserver?: boolean;
- /**
- * Zooms in the elements of a moveable.
- * @default 1
- */
- zoom?: number;
- /**
- * The default transformOrigin of the target can be set in advance.
- * @default ""
- */
- transformOrigin?: Array<string | number> | string | "";
- /**
- * You can add your custom able.
- * @default []
- */
- ables?: Able[];
- /**
- * You can specify the className of the moveable controlbox.
- * @default ""
- */
- className?: string;
- /**
- * Minimum distance to pinch.
- * @default 20
- */
- pinchThreshold?: number;
- /**
- * Whether the container containing the target becomes a pinch.
- * @default true
- */
- pinchOutside?: boolean;
- /**
- * Lets generate events of ables at the same time. (like Resizable, Scalable)
- * @default false
- */
- triggerAblesSimultaneously?: boolean;
- /**
- * Checks whether this is an element to input text or contentEditable, and prevents dragging.
- * @default false
- */
- checkInput?: boolean;
- /**
- * add nonce property to style for CSP.
- * @deprecated
- * @default ""
- */
- cspNonce?: string;
- /**
- * You can set the translateZ value of moveable.
- * @default 50
- */
- translateZ?: number | string;
- /**
- * Whether to hide the line corresponding to the rect of the target.
- * @default false
- */
- hideDefaultLines?: boolean;
- /**
- * Whether to prevent bubbling of events like mousedown, touchstart, etc.
- * @default false
- */
- stopPropagation?: boolean;
- /**
- * Whether to call preventDefault on touchstart or mousedown
- * @since 0.44.0
- * @default true
- */
- preventDefault?: boolean;
- /**
- * Whether to prevent dragging using the right mouse button
- * @default true
- */
- preventRightClick?: boolean;
- /**
- * Whether to prevent dragging using the wheel (middle) mouse button
- * @default true
- */
- preventWheelClick?: boolean;
- /**
- * Prevent click event on drag. (mousemove, touchmove)
- * @default true
- */
- preventClickEventOnDrag?: boolean;
- /**
- * Whether to drag the focused input
- * If `checkInput` is true, this option is not applied.
- * @since 0.47.0
- * @story options--options-drag-focused-input
- * @default false
- */
- dragFocusedInput?: boolean;
- /**
- * Prevent click event on dragStart. (mousedown, touchstart)
- * @default false
- */
- preventClickDefault?: boolean;
- /**
- * You can use props in object format or custom props.
- * @default empty object
- */
- props?: Record<string, any>;
- /**
- * Data for first render
- * @default null
- */
- persistData?: PersistRectData | null;
- /**
- * Whether to accurately show the position of a movable control box
- * Because getBoundingClientRect is used, css zoom, transform: rotate between container and rootContainer cannot be used.
- * group is not supported.
- * @default false
- */
- useAccuratePosition?: boolean;
- /**
- * By adding padding to the line, you can increase the area of the line that can be clicked and dragged.
- * @since 0.43.0
- * @story options--options-line-padding
- * @default 0
- */
- linePadding?: number;
- /**
- * By adding padding to the control, you can increase the area of the control that can be clicked and dragged.
- * Either `rotateAroundControls` or `displayAroundControls` can be used.
- * @since 0.44.0
- * @story options--options-control-padding
- * @default 0
- */
- controlPadding?: number;
- /**
- * @private
- * single => group로 변환과정에 도형 유지를 위한 첫 렌더링 state
- */
- firstRenderState?: MoveableManagerState | null;
- /**
- * @private
- */
- requestStyles?: string[];
- /**
- * If you are using React 18's concurrent mode, use `flushSync` for UI sync.
- * @default empty function
- * @example
- * ```jsx
- * import { flushSync } from "react-dom";
- *
- * <Moveable flushSync={flushSync} />
- * ```
- */
- flushSync?: (callback: () => void) => void;
- }
- /**
- * @typedef
- * @extends Moveable.DefaultOptions
- * @extends Moveable.DragAreaOptions
- * @extends Moveable.OriginOptions
- * @extends Moveable.PaddingOptions
- */
- interface MoveableDefaultOptions extends DefaultOptions, DragAreaOptions, OriginOptions, PaddingOptions {
- }
- interface MatrixInfo {
- type: "offset" | "target" | "zoom";
- target: SVGElement | HTMLElement;
- matrix?: number[];
- origin?: number[];
- zoom?: number;
- }
- declare type MoveableManagerState<T = {}> = {
- container: SVGElement | HTMLElement | null | undefined;
- disableNativeEvent: boolean;
- gestos: Record<string, Gesto | CustomGesto | null>;
- renderLines: number[][][];
- renderPoses: number[][];
- posDelta: number[];
- style: Partial<Writable<CSSStyleDeclaration>>;
- isPersisted?: boolean;
- } & MoveableTargetInfo & T;
- /**
- * @typedef
- * @memberof Moveable
- */
- interface ElementSizes {
- svg: boolean;
- offsetWidth: number;
- offsetHeight: number;
- clientWidth: number;
- clientHeight: number;
- inlineCSSWidth: number;
- inlineCSSHeight: number;
- cssWidth: number;
- cssHeight: number;
- contentWidth: number;
- contentHeight: number;
- minWidth: number;
- minHeight: number;
- maxWidth: number;
- maxHeight: number;
- minOffsetWidth: number;
- minOffsetHeight: number;
- maxOffsetWidth: number;
- maxOffsetHeight: number;
- }
- /**
- * @typedef
- * @memberof Moveable
- * @property - left padding
- * @property - top padding
- * @property - right padding
- * @property - bottom padding
- */
- interface PaddingBox {
- left?: number;
- top?: number;
- right?: number;
- bottom?: number;
- }
- interface Renderer {
- createElement(type: any, props?: any, ...children: any[]): any;
- }
- /**
- * @typedef
- * @memberof Moveable.Snappable
- */
- interface SnapGuideline {
- type: "horizontal" | "vertical";
- direction: string;
- hide?: boolean;
- element?: Element | null;
- isStart?: boolean;
- isEnd?: boolean;
- isCenter?: boolean;
- isInner?: boolean;
- grid?: boolean;
- pos: number[];
- size: number;
- className?: string;
- sizes?: number[];
- gap?: number;
- elementDirection?: string;
- elementRect?: SnapElementRect;
- gapRects?: SnapElementRect[];
- }
- /**
- * @memberof Moveable
- * @typedef
- */
- declare type MoveableRefType<T extends Element = HTMLElement | SVGElement> = string | (() => T) | MoveableRefObject<T> | T | null | undefined;
- /**
- * @memberof Moveable
- * @typedef
- */
- interface MoveableRefObject<T extends Element = HTMLElement | SVGElement> {
- current: T | undefined | null;
- }
- /**
- * You can make Able that can work in Moveable.
- * @typedef
- * In Able, you can manage drag events, props, state, fire event props, and render elements.
- * @memberof Moveable
- */
- interface Able<Props extends IObject<any> = IObject<any>, Events extends IObject<any> = IObject<any>> {
- name: string;
- props?: readonly (keyof Props)[];
- events?: readonly (keyof Events)[];
- always?: boolean;
- ableGroup?: string;
- updateRect?: boolean;
- canPinch?: boolean;
- css?: string[];
- /**
- * You can request style. Specify the name of the style in camel case.
- * You can check it with `moveable.state.style`
- * @exmaple
- * ["borderRadius", "top", "left"]
- */
- requestStyle?(): string[];
- /**
- * If you use group, you can request child style. Specify the name of the style in camel case.
- * You can check it with `moveable.state.style`
- * @exmaple
- * ["borderRadius", "top", "left"]
- */
- requestChildStyle?(): string[];
- /**
- * You can specify the class name to be added to the Moveable control box.
- */
- className?(moveable: any): string;
- /**
- * You can specify the class name to be added to the Moveable View Container
- */
- viewClassName?(moveable: any): string;
- /**
- * Check how related to drag
- */
- dragRelation?: "strong" | "weak" | undefined | null | false;
- /**
- * Fired when the event is cleared
- */
- unset?(moveable: any): any;
- /**
- * Renders the React DOM structure for the able.
- */
- render?(moveable: any, renderer: Renderer): any;
- dragStart?(moveable: any, e: any): any;
- drag?(moveable: any, e: any): any;
- dragEnd?(moveable: any, e: any): any;
- dragAfter?(moveable: any, e: any): any;
- pinchStart?(moveable: any, e: OnPinchStart): any;
- pinch?(moveable: any, e: OnPinch): any;
- pinchEnd?(moveable: any, e: OnPinchEnd): any;
- dragControlCondition?(moveable: any, e: any): boolean;
- dragControlStart?(moveable: any, e: any): any;
- dragControl?(moveable: any, e: any): any;
- dragControlEnd?(moveable: any, e: any): any;
- dragControlAfter?(moveable: any, e: any): any;
- dragGroupCondition?(moveable: any, e: any): boolean;
- dragGroupStart?(moveable: any, e: any): any;
- dragGroup?(moveable: any, e: any): any;
- dragGroupEnd?(moveable: any, e: any): any;
- pinchGroupStart?(moveable: any, e: OnPinchStart): any;
- pinchGroup?(moveable: any, e: OnPinch): any;
- pinchGroupEnd?(moveable: any, e: OnPinchEnd): any;
- dragGroupControlCondition?(moveable: any, e: any): boolean;
- dragGroupControlStart?(moveable: any, e: any): any;
- dragGroupControl?(moveable: any, e: any): any;
- dragGroupControlEnd?(moveable: any, e: any): any;
- mouseEnter?(moveable: any, e: any): any;
- mouseLeave?(moveable: any, e: any): any;
- mouseGroupEnter?(moveable: any, e: any): any;
- mouseGroupLeave?(moveable: any, e: any): any;
- request?(moveable: any): AbleRequester;
- }
- /**
- * @typedef
- * @memberof Moveable
- */
- interface OnEvent {
- /**
- * The Moveable instance
- */
- currentTarget: MoveableManagerInterface<Record<string, any>, Record<string, any>>;
- /**
- * The Moveable instance
- */
- moveable: MoveableManagerInterface<Record<string, any>, Record<string, any>>;
- /**
- * The Moveable's target
- */
- target: HTMLElement | SVGElement;
- /**
- * The horizontal coordinate within the application's client area at which the event occurred.
- */
- clientX: number;
- /**
- * The vertical coordinate within the application's client area at which the event occurred.
- */
- clientY: number;
- /**
- * Whether this is the first drag in the drag event
- */
- isFirstDrag: number;
- /**
- * Objects that can send information to the following events.
- */
- datas: IObject<any>;
- /**
- * The mouse or touch input event that is invoking the moveable event
- */
- inputEvent: any;
- /**
- * Stop the currently working able.
- */
- stopAble(): void;
- /**
- * Calling `stopDrag` in a drag-related event ends the drag.
- */
- stopDrag(): void;
- /**
- * Whether the event did not occur externally
- */
- isTrusted: boolean;
- }
- /**
- * @typedef
- * @memberof Moveable
- * @extends Moveable.OnEvent
- * @property - This is the last dragged event. No, if you haven't dragged.
- * @property - Whether this moved
- * @property - Whether it is double-click
- */
- interface OnEndEvent extends OnEvent {
- lastEvent: any | undefined;
- isDrag: boolean;
- isDouble: boolean;
- }
- /**
- * @typedef
- * @memberof Moveable
- */
- interface OnTransformStartEvent {
- /**
- * Set your original transform.
- * `transformIndex` is the sequence of functions used in the event.
- * If you use `setTransform`, you don't need to use `set` function.
- * @default transform of target's inline style
- */
- setTransform(transform: string | string[], transformIndex?: number): void;
- /**
- * `transformIndex` is the sequence of functions used in the event.
- * @default index with that property in transform or last
- */
- setTransformIndex(transformIndex: number): void;
- }
- /**
- * @typedef
- * @memberof Moveable
- * @extends Moveable.CSSObject
- */
- interface TransformObject extends CSSObject {
- /**
- * a target's next transform string value.
- */
- transform: string;
- /**
- * A transform obtained by the simultaneous occurrence of other events in the current event
- */
- afterTransform: string;
- }
- /**
- * @typedef
- * @memberof Moveable
- * @extends Moveable.TransformObject
- */
- interface OnTransformEvent extends TransformObject {
- /**
- * transform events causes a `drag` event. In some events, there may be no value.
- */
- drag: OnDrag;
- }
- /**
- * @typedef
- * @memberof Moveable
- */
- interface AbleRequestParam {
- /**
- * Run the request instantly. (requestStart, request, requestEnd happen at the same time)
- */
- isInstant?: boolean;
- [key: string]: any;
- }
- /**
- * @typedef
- * @memberof Moveable
- * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.html#request|Request Method}
- * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Draggable.html#request|Draggable Requester}
- * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Resizable.html#request|Resizable Requester}
- * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Scalable.html#request|Scalable Requester}
- * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Rotatable.html#request|Rotatable Requester}
- * @property - Continue executing the request.
- * @property - End the request.
- */
- interface Requester<RequestParam extends {} = AbleRequestParam> {
- request(param: RequestParam): this;
- requestEnd(): this;
- }
- interface AbleRequester {
- isControl: boolean;
- requestStart(param: IObject<any>): IObject<any>;
- request(param: IObject<any>): IObject<any>;
- requestEnd(): IObject<any>;
- }
- /**
- * When the drag starts, the dragStart event is called.
- * @typedef
- * @memberof Moveable.Draggable
- * @extends Moveable.OnEvent
- * @extends Moveable.OnTransformStartEvent
- */
- interface OnDragStart extends OnEvent, OnTransformStartEvent {
- /**
- * You can set the start translate value.
- */
- set: (translate: number[]) => void;
- }
- /**
- * @typedef
- * @memberof Moveable.Draggable
- * @extends Moveable.OnEvent
- * @extends Moveable.CSSObject
- * @property - The delta of [left, top]
- * @property - The distance of [left, top]
- * @property - The position of [left, top]
- * @property - The delta of [translateX, translateY]
- * @property - The distance of [translateX, translateY]
- * @property - The position of [translateX, translateY]
- * @property - a target's transform
- * @property - a target's left
- * @property - a target's top
- * @property - a target's bottom
- * @property - a target's offset width
- * @property - a target's offset height
- * @property - a target's right
- * @property - Whether or not it is being pinched.
- */
- interface OnDrag extends OnEvent, CSSObject {
- beforeDelta: number[];
- beforeDist: number[];
- beforeTranslate: number[];
- delta: number[];
- dist: number[];
- translate: number[];
- transform: string;
- left: number;
- top: number;
- bottom: number;
- width: number;
- height: number;
- right: number;
- isPinch: boolean;
- }
- /**
- * @typedef
- * @memberof Moveable.Draggable
- * @extends Moveable.OnEndEvent
- */
- interface OnDragEnd extends OnEndEvent {
- }
- /**
- * @typedef
- * @memberof Moveable.Resizable
- * @extends Moveable.OnEvent
- * @property - The direction of resize.
- * @property - resize causes a `dragStart` event.
- * @property - You can set the css width, height value.
- * @property - You can set the css min width, min height value. (default: min-width)
- * @property - You can set the css max width, max height value. (default: max-width)
- * @property - You can set the css origin (default: % %)
- * @property - Set a fixed direction to resize. (default: Opposite direction)
- * @property - Set the ratio of width and height. (default: offsetWidth / offsetHeight)
- */
- interface OnResizeStart extends OnEvent {
- /**
- * The direction of resize.
- */
- direction: number[];
- /**
- * First set (boundingWidth / boundingHeight) value
- */
- startRatio: number;
- /**
- * resize causes a `dragStart` event.
- */
- dragStart: OnDragStart | false;
- /**
- * You can set the css width, height value.
- */
- set: (size: number[]) => any;
- /**
- * You can set the css min offset width, min offset height value.
- * @default [minOffsetWidth, minOffsetHeight])
- */
- setMin: (minSize: Array<string | number>) => any;
- /**
- * You can set the css max offset width, max offset height value.
- * @default [maxOffsetWidth, maxOffsetHeight])
- */
- setMax: (maxSize: Array<string | number>) => any;
- /**
- * You can set the css origin
- * @default transformOrigin
- */
- setOrigin: (origin: Array<string | number>) => any;
- /**
- * Set a fixed direction to resize.
- * @default Opposite direction
- */
- setFixedDirection: (startDirecition: number[]) => any;
- /**
- * Set a fixed direction to resize.
- * @default Opposite position
- * @private
- */
- setFixedPosition: (startPosition: number[]) => any;
- /**
- * Set the ratio of width and height.
- * @default offsetWidth / offsetHeight
- */
- setRatio: (ratio: number) => any;
- }
- /**
- * @typedef
- * @memberof Moveable
- */
- interface CSSObject {
- /**
- * You can get the style you can get from the event.
- */
- style: Record<string, string>;
- /**
- * You can get it as a cssText that you can get from that event.
- */
- cssText: string;
- }
- /**
- * @typedef
- * @memberof Moveable.Resizable
- * @extends Moveable.OnEvent
- * @extends Moveable.OnTransformEvent
- */
- interface OnResize extends OnEvent, OnTransformEvent {
- /**
- * The direction of resize.
- */
- direction: number[];
- /**
- * a target's cssWidth
- */
- width: number;
- /**
- * a target's cssHeight
- */
- height: number;
- /**
- * a target's offset width as an integer with bounding width
- */
- offsetWidth: number;
- /**
- * a target's offset height as an integer with bounding height
- */
- offsetHeight: number;
- /**
- * a target's bounding width
- */
- boundingWidth: number;
- /**
- * a target's bounding height
- */
- boundingHeight: number;
- /**
- * The distance of [boundingWidth, boundingHeight]
- */
- dist: number[];
- /**
- * The delta of [boundingWidth, boundingHeight]
- */
- delta: number[];
- /**
- * First set (boundingWidth / boundingHeight) value
- */
- startRatio: number;
- /**
- * Whether or not it is being pinched.
- */
- isPinch: boolean;
- }
- /**
- * @typedef
- * @memberof Moveable.Resizable
- * @extends Moveable.OnEndEvent
- */
- interface OnResizeEnd extends OnEndEvent {
- }
- /**
- * @typedef
- * @memberof Moveable.Rotatable
- * @extends Moveable.OnEvent
- * @extends Moveable.OnTransformStartEvent
- */
- interface OnRotateStart extends OnEvent, OnTransformStartEvent {
- /**
- * You can set the start rotate value.
- */
- set: (rotate: number) => void;
- /**
- * Set a fixed direction to rotate.
- * @default target's transformOrigin
- */
- setFixedDirection: (fixedDirection: number[]) => void;
- /**
- * Set a fixed position to rotate.
- * @default target's transformOrigin
- */
- setFixedPosition: (fixedPosition: number[]) => void;
- /**
- * rotate causes a `dragStart` event.
- */
- dragStart: OnDragStart | false;
- /**
- * rotate causes a `resizeStart` event.
- */
- resizeStart: OnResizeStart | false;
- }
- /**
- * @typedef
- * @description Parameters for the `rotate` event
- * @memberof Moveable.Rotatable
- * @extends Moveable.OnEvent
- * @extends Moveable.OnTransformEvent
- */
- interface OnRotate extends OnEvent, OnTransformEvent {
- /**
- * The distance of rotation degree before transform is applied
- */
- beforeDist: number;
- /**
- * The delta of rotation degree before transform is applied
- */
- beforeDelta: number;
- /**
- * The now rotation degree before transform is applied
- * @deprecated
- */
- beforeRotate: number;
- /**
- * The now rotation degree before transform is applied
- */
- beforeRotation: number;
- /**
- * The distance of rotation degree
- */
- dist: number;
- /**
- * The delta of rotation degree
- */
- delta: number;
- /**
- * The now rotation degree
- * @deprecated
- */
- rotate: number;
- /**
- * The now rotation degree
- */
- rotation: number;
- /**
- * The distance of client rotation degree
- */
- absoluteDist: number;
- /**
- * The delta of client rotation degree
- */
- absoluteDelta: number;
- /**
- * The now client rotation degree
- * @deprecated
- */
- absoluteRotate: number;
- /**
- * The now client rotation degree
- */
- absoluteRotation: number;
- /**
- * Whether or not it is being pinched.
- */
- isPinch: boolean;
- /**
- * rotate causes a `resize` event.
- */
- resize?: OnResize;
- }
- /**
- * @typedef
- * @memberof Moveable.Rotatable
- * @extends Moveable.OnEndEvent
- */
- interface OnRotateEnd extends OnEndEvent {
- }
- /**
- * `renderStart` event occurs at the first start of all events.
- * @typedef
- * @memberof Moveable
- * @extends Moveable.OnEvent
- * @property - Whether or not it is being pinched.
- */
- interface OnRenderStart extends OnEvent {
- isPinch: boolean;
- }
- /**
- * `render` event occurs before the target is drawn on the screen.
- * @typedef
- * @memberof Moveable
- * @extends Moveable.OnEvent
- * @extends Moveable.CSSObject
- */
- interface OnRender extends OnEvent, CSSObject {
- /**
- * a target's next transform string value.
- */
- transform: string;
- /**
- * Whether or not it is being pinched.
- */
- isPinch: boolean;
- /**
- * Return transform as a transform object.
- * `rotate` is a number and everything else is an array of numbers.
- */
- transformObject: Record<string, any>;
- }
- /**
- * @typedef
- * @memberof Moveable
- */
- interface PaddingOptions {
- /**
- * Add padding around the target to increase the drag area.
- * @default null
- */
- padding?: PaddingBox | number;
- }
- /**
- * @typedef
- * @memberof Moveable
- */
- interface OriginOptions {
- /**
- * Whether or not the origin control box will be visible or not.
- * @default true
- */
- origin?: boolean;
- /**
- * Sets the transform origin based on the svg target. If not set, it is set as the transform origin based on the owner of svg.
- * @since 0.47.0
- * @default ""
- */
- svgOrigin?: string;
- }
- /**
- * @typedef
- * @memberof Moveable
- * @extends Moveable.AbleRequestParam
- * @description the Resizable's request parameter
- */
- interface AbleRequesters {
- draggable: DraggableRequestParam;
- resizable: ResizableRequestParam;
- scalable: ScalableRequestParam;
- rotatable: RotatableRequestParam;
- [key: string]: AbleRequestParam;
- }
- /**
- * @typedef
- * @memberof Moveable.Draggable
- * @extends Moveable.AbleRequestParam
- * @description the Draggable's request parameter
- */
- interface DraggableRequestParam extends AbleRequestParam {
- /**
- * x position
- */
- x?: number;
- /**
- * y position
- */
- y?: number;
- /**
- * X number to move
- */
- deltaX?: number;
- /**
- * Y number to move
- */
- deltaY?: number;
- /**
- * whether to use with `snappable`
- */
- useSnap?: boolean;
- }
- /**
- * @typedef
- * @memberof Moveable.Resizable
- * @extends Moveable.AbleRequestParam
- * @description the Resizable's request parameter
- */
- interface ResizableRequestParam extends AbleRequestParam {
- /**
- * Direction to resize
- * @default [1, 1]
- */
- direction?: number[];
- /**
- * Whether to force keepRatio to resize
- */
- keepRatio?: boolean;
- /**
- * delta number of width
- */
- deltaWidth?: number;
- /**
- * delta number of height
- */
- deltaHeight?: number;
- /**
- * offset number of width
- */
- offsetWidth?: number;
- /**
- * offset number of height
- */
- offsetHeight?: number;
- /**
- *
- */
- horizontal?: boolean;
- /**
- * whether to use with `snappable`
- */
- useSnap?: boolean;
- }
- /**
- * @typedef
- * @memberof Moveable.Scalable
- * @extends Moveable.AbleRequestParam
- * @description the Scalable's request parameter
- */
- interface ScalableRequestParam extends AbleRequestParam {
- /**
- * Direction to scale
- * @default [1, 1]
- */
- direction?: number[];
- /**
- * Whether to force keepRatio to resize
- */
- keepRatio?: boolean;
- /**
- * delta number of width
- */
- deltaWidth?: number;
- /**
- * delta number of height
- */
- deltaHeight?: number;
- /**
- * whether to use with `snappable`
- */
- useSnap?: boolean;
- }
- /**
- * @typedef
- * @memberof Moveable.Rotatable
- * @extends Moveable.AbleRequestParam
- * @description the Rotatable's request parameter
- */
- interface RotatableRequestParam extends AbleRequestParam {
- /**
- * delta number of rotation
- */
- deltaRotate?: number;
- /**
- * absolute number of moveable's rotation
- */
- rotate?: number;
- }
- declare type RotationPosition = "top" | "bottom" | "left" | "right" | "top-right" | "top-left" | "bottom-right" | "bottom-left" | "left-top" | "left-bottom" | "right-top" | "right-bottom" | "none";
- /**
- * @typedef
- * @memberof Moveable.Snappable
- */
- interface SnapDirections {
- /**
- * Whether to snap the top of the element
- * @default true
- */
- left?: boolean;
- /**
- * Whether to snap the left of the element
- * @default true
- */
- top?: boolean;
- /**
- * Whether to snap the right of the element
- * @default true
- */
- right?: boolean;
- /**
- * Whether to snap the bottom of the element
- * @default true
- */
- bottom?: boolean;
- /**
- * Whether to snap the center((left + right) / 2) of the element
- * @default false
- */
- center?: boolean;
- /**
- * Whether to snap the middle((top + bottom) / 2) of the element
- * @default false
- */
- middle?: boolean;
- }
- /**
- * @typedef
- * @memberof Moveable.Snappable
- * @extends Moveable.Snappable.SnapDirections
- */
- interface ElementGuidelineValue extends SnapDirections {
- /**
- * guideline element
- */
- element: Element;
- /**
- * class names to add to guideline
- * @default ""
- * @example
- *
- * ```css
- * .moveable-gap.red {
- * background: red!important;
- * }
- * ```
- * ```css
- * .moveable-bold.red {
- * background: red!important;
- * }
- * ```
- * ```css
- * .moveable-dashed.red {
- * border-top-color: red!important;
- * }
- * ```
- */
- className?: string;
- /**
- * Whether to update the element size at every render
- * @default false
- */
- refresh?: boolean;
- }
- /**
- * @typedef
- * @memberof Moveable.Snappable
- * @extends Moveable.Snappable.SnapDirections
- */
- interface ElementGuidelineValue extends SnapDirections {
- /**
- * guideline element
- */
- element: Element;
- /**
- * class names to add to guideline
- * @default ""
- */
- className?: string;
- /**
- * Whether to update the element size at every render
- * @default false
- */
- refresh?: boolean;
- }
- /**
- * @typedef
- * @memberof Moveable.Snappable
- */
- interface OnSnap {
- /**
- * snapped verticalGuidelines, horizontalGuidelines,
- */
- guidelines: SnapGuideline[];
- /**
- * snapped elements (group by element)
- */
- elements: SnapGuideline[];
- /**
- * gaps is snapped guidelines that became gap snap between elements.
- */
- gaps: SnapGuideline[];
- }
- interface SnapDirectionPoses {
- left?: number;
- top?: number;
- right?: number;
- bottom?: number;
- center?: number;
- middle?: number;
- }
- interface SnapElementRect extends ElementGuidelineValue {
- rect: SnapDirectionPoses;
- }
- /**
- * @typedef
- * @memberof Moveable
- */
- interface DragAreaOptions {
- /**
- * Instead of firing an event on the target, we add it to the moveable control element. You can use click and clickGroup events.
- * @default if group, true, else fals
- */
- dragArea?: boolean;
- /**
- * Set `pointerEvents: none;` css to pass events in dragArea.
- * @default false
- */
- passDragArea?: boolean;
- }
- interface OnCustomDrag extends Position {
- type: string;
- inputEvent: any;
- isDrag: boolean;
- isFirstDrag: boolean;
- datas: IObject<any>;
- originalDatas: IObject<any>;
- parentEvent: boolean;
- parentGesto: CustomGesto;
- }
- /**
- * @typedef
- * @memberof Moveable
- */
- declare type PersistRectData = Omit<Partial<RectInfo>, "children"> & {
- children?: Array<Partial<RectInfo>>;
- };
- /**
- * @typedef
- * @memberof Moveable
- */
- interface RectInfo {
- /**
- * The coordinates of the vertex 1
- */
- pos1: number[];
- /**
- * The coordinates of the vertex 2
- */
- pos2: number[];
- /**
- * The coordinates of the vertex 3
- */
- pos3: number[];
- /**
- * The coordinates of the vertex 4
- */
- pos4: number[];
- /**
- * left position of the target relative to the container
- */
- left: number;
- /**
- * top position of the target relative to the container
- */
- top: number;
- /**
- * The width of moveable element
- */
- width: number;
- /**
- * The height of moveable element
- */
- height: number;
- /**
- * The offset width of the target
- */
- offsetWidth: number;
- /**
- * The offset height of the target
- */
- offsetHeight: number;
- /**
- * The absolute transform origin
- */
- origin: number[];
- /**
- * The absolute transform origin before transformation
- */
- beforeOrigin: number[];
- /**
- * The target transform origin
- */
- transformOrigin: number[];
- /**
- * you can get the absolute rotation value
- */
- rotation: number;
- /**
- * If you use a group, you can get child moveables' rect info
- */
- children?: RectInfo[];
- }
- /**
- * @typedef
- * @memberof Moveable
- * @property - top position
- * @property - left position
- * @property - target's width
- * @property - target's height
- */
- interface HitRect {
- top: number;
- left: number;
- width?: number;
- height?: number;
- }
- /**
- * @typedef
- * @memberof Moveable
- * @extends Moveable.MoveableInterface
- */
- interface MoveableManagerInterface<T = {}, U = {}> extends MoveableInterface {
- moveables?: MoveableManagerInterface[];
- props: MoveableManagerProps<T>;
- state: MoveableManagerState<U>;
- renderState: Record<string, any>;
- rotation: number;
- scale: number[];
- controlGesto: Gesto;
- targetGesto: Gesto;
- enabledAbles: Able[];
- controlAbles: Able[];
- targetAbles: Able[];
- areaElement: HTMLElement;
- controlBox: HTMLElement;
- isUnmounted: boolean;
- useCSS(tag: string, css: string): any;
- getContainer(): HTMLElement | SVGElement;
- getRotation(): number;
- getState(): MoveableManagerState<U>;
- triggerEvent(name: string, params: IObject<any>, isManager?: boolean): any;
- }
- /**
- * @typedef
- * @memberof Moveable
- */
- interface MoveableInterface {
- getManager(): MoveableManagerInterface<any, any>;
- getRect(): RectInfo;
- getAble<T extends Able>(ableName: string): T | undefined;
- isMoveableElement(target: Element): boolean;
- /**
- * If the location or size of the target is changed, call the `.updateRect()` method.
- * Use the `useResizeObserver` and `useMutationObserver` props to update automatically.
- */
- updateRect(type?: "Start" | "" | "End", isTarget?: boolean, isSetState?: boolean): void;
- /**
- * @deprecated
- * Use `.updateRect()` method
- */
- updateTarget(): void;
- /**
- * Request able through a method rather than an event.
- * At the moment of execution, requestStart is executed,
- * and then request and requestEnd can be executed through Requester.
- * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Draggable.html#request Draggable Requester}
- * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Resizable.html#request Resizable Requester}
- * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Scalable.html#request Scalable Requester}
- * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Rotatable.html#request Rotatable Requester}
- * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.OriginDraggable.html#request OriginDraggable Requester}
- * @param - ableName
- * @param - request to be able params.
- * @param - If isInstant is true, request and requestEnd are executed immediately.
- * @return - Able Requester. If there is no request in able, nothing will work.
- * @example
- * import Moveable from "moveable";
- *
- * const moveable = new Moveable(document.body);
- *
- * // Instantly Request (requestStart - request - requestEnd)
- * moveable.request("draggable", { deltaX: 10, deltaY: 10 }, true);
- *
- * // Start move
- * const requester = moveable.request("draggable");
- * requester.request({ deltaX: 10, deltaY: 10 });
- * requester.request({ deltaX: 10, deltaY: 10 });
- * requester.request({ deltaX: 10, deltaY: 10 });
- * requester.requestEnd();
- */
- request<RequestParam extends AbleRequesters[Name], Name extends string = string>(ableName: Name, params?: RequestParam, isInstant?: boolean): Requester<RequestParam>;
- /**
- * moveable is the top level that manages targets
- * `Single`: MoveableManager instance
- * `Group`: MoveableGroup instance
- * `IndividualGroup`: MoveableIndividaulGroup instance
- * Returns leaf target MoveableManagers.
- */
- getMoveables(): MoveableManagerInterface[];
- /**
- * Returns the element of the control box.
- */
- getControlBoxElement(): HTMLElement;
- /**
- * Target element to be dragged in moveable
- */
- getDragElement(): HTMLElement | SVGElement | null | undefined;
- destroy(): void;
- dragStart(e: MouseEvent | TouchEvent, target?: EventTarget | null): void;
- isInside(clientX: number, clientY: number): boolean;
- isDragging(ableName?: string): boolean;
- hitTest(el: Element | HitRect): number;
- setState(state: any, callback?: () => any): any;
- waitToChangeTarget(): Promise<void>;
- forceUpdate(callback?: () => any): any;
- updateSelectors(): void;
- getTargets(): Array<HTMLElement | SVGElement>;
- stopDrag(type?: "target" | "control"): void;
- }
- declare type Writable<T> = {
- -readonly [key in keyof T]: T[key];
- };
-
- interface AriaToolbarProps extends AriaLabelingProps$1 {
- /**
- * The orientation of the entire toolbar.
- * @default 'horizontal'
- */
- orientation?: Orientation;
- }
-
- /** These types can be animated */
- type Animatable<T = any> = T extends number ? number : T extends string ? string : T extends ReadonlyArray<number | string> ? Array<number | string> extends T ? ReadonlyArray<number | string> : {
- [P in keyof T]: Animatable<T[P]>;
- } : never;
-
- /**
- * MIT License
- * Copyright (c) Alec Larson
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
- /** Ensure each type of `T` is an array */
- type Arrify<T> = [T, T] extends [infer T, infer DT] ? DT extends ReadonlyArray<any> ? Array<DT[number]> extends DT ? ReadonlyArray<T extends ReadonlyArray<infer U> ? U : T> : DT : ReadonlyArray<T extends ReadonlyArray<infer U> ? U : T> : never;
- /** Override the property types of `A` with `B` and merge any new properties */
- type Merge<A, B> = Remap<{
- [P in keyof A]: P extends keyof B ? B[P] : A[P];
- } & Omit$1<B, keyof A>>;
- /** Better type errors for overloads with generic types */
- type Constrain<T, U> = [T] extends [Any$2] ? U : [T] extends [U] ? T : U;
- /** Try to simplify `&` out of an object type */
- type Remap<T> = {} & {
- [P in keyof T]: T[P];
- };
- type Pick$1<T, K extends keyof T> = {} & {
- [P in K]: T[P];
- };
- type Omit$1<T, K> = Pick$1<T, Exclude<keyof T, K>>;
- type OneOrMore<T> = T | readonly T[];
- type Falsy = false | null | undefined;
- interface Lookup<T = any> {
- [key: string]: T;
- }
- /** Intersected with other object types to allow for unknown properties */
- interface UnknownProps extends Lookup<unknown> {
- }
- /** Use `[T] extends [Any]` to know if a type parameter is `any` */
- declare class Any$2 {
- private _;
- }
-
- type EasingFunction = (t: number) => number;
- type ExtrapolateType = 'identity' | 'clamp' | 'extend';
- type InterpolatorArgs<Input = any, Output = any> = [InterpolatorFn<Arrify<Input>, Output>] | [InterpolatorConfig<Output>] | [
- readonly number[],
- readonly Constrain<Output, Animatable>[],
- (ExtrapolateType | undefined)?
- ];
- type InterpolatorFn<Input, Output> = (...inputs: Arrify<Input>) => Output;
- type InterpolatorConfig<Output = Animatable> = {
- /**
- * What happens when the spring goes below its target value.
- *
- * - `extend` continues the interpolation past the target value
- * - `clamp` limits the interpolation at the max value
- * - `identity` sets the value to the interpolation input as soon as it hits the boundary
- *
- * @default 'extend'
- */
- extrapolateLeft?: ExtrapolateType;
- /**
- * What happens when the spring exceeds its target value.
- *
- * - `extend` continues the interpolation past the target value
- * - `clamp` limits the interpolation at the max value
- * - `identity` sets the value to the interpolation input as soon as it hits the boundary
- *
- * @default 'extend'
- */
- extrapolateRight?: ExtrapolateType;
- /**
- * What happens when the spring exceeds its target value.
- * Shortcut to set `extrapolateLeft` and `extrapolateRight`.
- *
- * - `extend` continues the interpolation past the target value
- * - `clamp` limits the interpolation at the max value
- * - `identity` sets the value to the interpolation input as soon as it hits the boundary
- *
- * @default 'extend'
- */
- extrapolate?: ExtrapolateType;
- /**
- * Input ranges mapping the interpolation to the output values.
- *
- * @example
- *
- * range: [0, 0.5, 1], output: ['yellow', 'orange', 'red']
- *
- * @default [0,1]
- */
- range?: readonly number[];
- /**
- * Output values from the interpolation function. Should match the length of the `range` array.
- */
- output: readonly Constrain<Output, Animatable>[];
- /**
- * Transformation to apply to the value before interpolation.
- */
- map?: (value: number) => number;
- /**
- * Custom easing to apply in interpolator.
- */
- easing?: EasingFunction;
- };
-
- interface Timeout {
- time: number;
- handler: () => void;
- cancel: () => void;
- }
-
- /**
- * MIT License
- * Copyright (c) Alec Larson
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
- declare const $get: unique symbol;
- declare const $observers: unique symbol;
- /** An event sent to `FluidObserver` objects. */
- interface FluidEvent<T = any> {
- type: string;
- parent: FluidValue<T>;
- }
- /**
- * Extend this class for automatic TypeScript support when passing this
- * value to `fluids`-compatible libraries.
- */
- declare abstract class FluidValue<T = any, E extends FluidEvent<T> = any> {
- private [$get];
- private [$observers]?;
- constructor(get?: () => T);
- /** Get the current value. */
- protected get?(): T;
- /** Called after an observer is added. */
- protected observerAdded?(count: number, observer: FluidObserver<E>): void;
- /** Called after an observer is removed. */
- protected observerRemoved?(count: number, observer: FluidObserver<E>): void;
- }
- /** An observer of `FluidValue` objects. */
- type FluidObserver<E extends FluidEvent = any> = {
- eventObserved(event: E): void;
- } | {
- (event: E): void;
- };
- /** Add the `FluidValue` type to every property. */
- type FluidProps<T> = T extends object ? {
- [P in keyof T]: T[P] | FluidValue<Exclude<T[P], void>>;
- } : unknown;
-
- /** An animated number or a native attribute value */
- declare class AnimatedValue<T = any> extends Animated {
- protected _value: T;
- done: boolean;
- elapsedTime: number;
- lastPosition: number;
- lastVelocity?: number | null;
- v0?: number | null;
- durationProgress: number;
- constructor(_value: T);
- /** @internal */
- static create(value: any): AnimatedValue<any>;
- getPayload(): Payload;
- getValue(): T;
- setValue(value: T, step?: number): boolean;
- reset(): void;
- }
- declare abstract class Animated<T = any> {
- /** The cache of animated values */
- protected payload?: Payload;
- constructor();
- /** Get the current value. Pass `true` for only animated values. */
- abstract getValue(animated?: boolean): T;
- /** Set the current value. Returns `true` if the value changed. */
- abstract setValue(value: T): boolean | void;
- /** Reset any animation state. */
- abstract reset(goal?: T): void;
- /** Get every `AnimatedValue` used by this node. */
- getPayload(): Payload;
- }
- type Payload = readonly AnimatedValue[];
-
- /**
- * An `Interpolation` is a memoized value that's computed whenever one of its
- * `FluidValue` dependencies has its value changed.
- *
- * Other `FrameValue` objects can depend on this. For example, passing an
- * `Interpolation` as the `to` prop of a `useSpring` call will trigger an
- * animation toward the memoized value.
- */
- declare class Interpolation<Input = any, Output = any> extends FrameValue<Output> {
- /** The source of input values */
- readonly source: unknown;
- /** Useful for debugging. */
- key?: string;
- /** Equals false when in the frameloop */
- idle: boolean;
- /** The function that maps inputs values to output */
- readonly calc: InterpolatorFn<Input, Output>;
- /** The inputs which are currently animating */
- protected _active: Set<FluidValue<any, any>>;
- constructor(
- /** The source of input values */
- source: unknown, args: InterpolatorArgs<Input, Output>);
- advance(_dt?: number): void;
- protected _get(): Output;
- protected _start(): void;
- protected _attach(): void;
- protected _detach(): void;
- /** @internal */
- eventObserved(event: FrameValue.Event): void;
- }
-
- /**
- * A kind of `FluidValue` that manages an `AnimatedValue` node.
- *
- * Its underlying value can be accessed and even observed.
- */
- declare abstract class FrameValue<T = any> extends FluidValue<T, FrameValue.Event<T>> {
- readonly id: number;
- abstract key?: string;
- abstract get idle(): boolean;
- protected _priority: number;
- get priority(): number;
- set priority(priority: number);
- /** Get the current value */
- get(): T;
- /** Create a spring that maps our value to another value */
- to<Out>(...args: InterpolatorArgs<T, Out>): Interpolation<T, Out>;
- /** @deprecated Use the `to` method instead. */
- interpolate<Out>(...args: InterpolatorArgs<T, Out>): Interpolation<T, Out>;
- toJSON(): T;
- protected observerAdded(count: number): void;
- protected observerRemoved(count: number): void;
- /** @internal */
- abstract advance(dt: number): void;
- /** @internal */
- abstract eventObserved(_event: FrameValue.Event): void;
- /** Called when the first child is added. */
- protected _attach(): void;
- /** Called when the last child is removed. */
- protected _detach(): void;
- /** Tell our children about our new value */
- protected _onChange(value: T, idle?: boolean): void;
- /** Tell our children about our new priority */
- protected _onPriorityChange(priority: number): void;
- }
- declare namespace FrameValue {
- /** A parent changed its value */
- interface ChangeEvent<T = any> {
- parent: FrameValue<T>;
- type: 'change';
- value: T;
- idle: boolean;
- }
- /** A parent changed its priority */
- interface PriorityEvent<T = any> {
- parent: FrameValue<T>;
- type: 'priority';
- priority: number;
- }
- /** A parent is done animating */
- interface IdleEvent<T = any> {
- parent: FrameValue<T>;
- type: 'idle';
- }
- /** Events sent to children of `FrameValue` objects */
- type Event<T = any> = ChangeEvent<T> | PriorityEvent<T> | IdleEvent<T>;
- }
-
- declare class AnimationConfig {
- /**
- * With higher tension, the spring will resist bouncing and try harder to stop at its end value.
- *
- * When tension is zero, no animation occurs.
- *
- * @default 170
- */
- tension: number;
- /**
- * The damping ratio coefficient, or just the damping ratio when `speed` is defined.
- *
- * When `speed` is defined, this value should be between 0 and 1.
- *
- * Higher friction means the spring will slow down faster.
- *
- * @default 26
- */
- friction: number;
- /**
- * The natural frequency (in seconds), which dictates the number of bounces
- * per second when no damping exists.
- *
- * When defined, `tension` is derived from this, and `friction` is derived
- * from `tension` and `damping`.
- */
- frequency?: number;
- /**
- * The damping ratio, which dictates how the spring slows down.
- *
- * Set to `0` to never slow down. Set to `1` to slow down without bouncing.
- * Between `0` and `1` is for you to explore.
- *
- * Only works when `frequency` is defined.
- *
- * @default 1
- */
- damping: number;
- /**
- * Higher mass means more friction is required to slow down.
- *
- * Defaults to 1, which works fine most of the time.
- *
- * @default 1
- */
- mass: number;
- /**
- * The initial velocity of one or more values.
- *
- * @default 0
- */
- velocity: number | number[];
- /**
- * The smallest velocity before the animation is considered "not moving".
- *
- * When undefined, `precision` is used instead.
- */
- restVelocity?: number;
- /**
- * The smallest distance from a value before that distance is essentially zero.
- *
- * This helps in deciding when a spring is "at rest". The spring must be within
- * this distance from its final value, and its velocity must be lower than this
- * value too (unless `restVelocity` is defined).
- *
- * @default 0.01
- */
- precision?: number;
- /**
- * For `duration` animations only. Note: The `duration` is not affected
- * by this property.
- *
- * Defaults to `0`, which means "start from the beginning".
- *
- * Setting to `1+` makes an immediate animation.
- *
- * Setting to `0.5` means "start from the middle of the easing function".
- *
- * Any number `>= 0` and `<= 1` makes sense here.
- */
- progress?: number;
- /**
- * Animation length in number of milliseconds.
- */
- duration?: number;
- /**
- * The animation curve. Only used when `duration` is defined.
- *
- * Defaults to quadratic ease-in-out.
- */
- easing: EasingFunction;
- /**
- * Avoid overshooting by ending abruptly at the goal value.
- *
- * @default false
- */
- clamp: boolean;
- /**
- * When above zero, the spring will bounce instead of overshooting when
- * exceeding its goal value. Its velocity is multiplied by `-1 + bounce`
- * whenever its current value equals or exceeds its goal. For example,
- * setting `bounce` to `0.5` chops the velocity in half on each bounce,
- * in addition to any friction.
- */
- bounce?: number;
- /**
- * "Decay animations" decelerate without an explicit goal value.
- * Useful for scrolling animations.
- *
- * Use `true` for the default exponential decay factor (`0.998`).
- *
- * When a `number` between `0` and `1` is given, a lower number makes the
- * animation slow down faster. And setting to `1` would make an unending
- * animation.
- *
- * @default false
- */
- decay?: boolean | number;
- /**
- * While animating, round to the nearest multiple of this number.
- * The `from` and `to` values are never rounded, as well as any value
- * passed to the `set` method of an animated value.
- */
- round?: number;
- constructor();
- }
-
- /** The object type of the `config` prop. */
- type SpringConfig = Partial<AnimationConfig>;
- /** The object given to the `onRest` prop and `start` promise. */
- interface AnimationResult<T extends Readable = any> {
- value: T extends Readable<infer U> ? U : never;
- /** When true, no animation ever started. */
- noop?: boolean;
- /** When true, the animation was neither cancelled nor stopped prematurely. */
- finished?: boolean;
- /** When true, the animation was cancelled before it could finish. */
- cancelled?: boolean;
- }
- /** The promised result of an animation. */
- type AsyncResult<T extends Readable = any> = Promise<AnimationResult<T>>;
- /**
- * The set of `SpringValue` objects returned by a `useSpring` call (or similar).
- */
- type SpringValues<T extends Lookup = any> = [T] extends [Any$2] ? Lookup<SpringValue<unknown> | undefined> : {
- [P in keyof T]: SpringWrap<T[P]>;
- };
- type SpringWrap<T> = [
- Exclude<T, FluidValue>,
- Extract<T, readonly any[]>
- ] extends [object | void, never] ? never : SpringValue<Exclude<T, FluidValue | void>> | Extract<T, void>;
-
- /** @internal */
- interface Readable<T = any> {
- get(): T;
- }
- /** @internal */
- type InferState<T extends Readable> = T extends Controller<infer State> ? State : T extends SpringValue<infer U> ? U : unknown;
- /** @internal */
- type InferProps<T extends Readable> = T extends Controller<infer State> ? ControllerUpdate<State> : T extends SpringValue<infer U> ? SpringUpdate<U> : Lookup;
- /** @internal */
- type InferTarget<T> = T extends object ? T extends ReadonlyArray<number | string> ? SpringValue<T> : Controller<T> : SpringValue<T>;
- /** @internal */
- interface AnimationTarget<T = any> extends Readable<T> {
- start(props: any): AsyncResult<this>;
- stop: Function;
- item?: unknown;
- }
- /** @internal */
- interface AnimationRange<T> {
- to: T | FluidValue<T> | undefined;
- from: T | FluidValue<T> | undefined;
- }
- /** @internal */
- type AnimationResolver<T extends Readable> = (result: AnimationResult<T> | AsyncResult<T>) => void;
- /** @internal */
- type EventKey = Exclude<keyof ReservedEventProps, 'onResolve' | 'onDestroyed'>;
- /** @internal */
- type PickEventFns<T> = {
- [P in Extract<keyof T, EventKey>]?: Extract<T[P], Function>;
- };
-
- /** An animation being executed by the frameloop */
- declare class Animation<T = any> {
- changed: boolean;
- values: readonly AnimatedValue[];
- toValues: readonly number[] | null;
- fromValues: readonly number[];
- to: T | FluidValue<T>;
- from: T | FluidValue<T>;
- config: AnimationConfig;
- immediate: boolean;
- }
- interface Animation<T> extends PickEventFns<SpringProps<T>> {
- }
-
- type AsyncTo<T> = SpringChain<T> | SpringToFn<T>;
- /** @internal */
- type RunAsyncProps<T extends AnimationTarget = any> = InferProps<T> & {
- callId: number;
- parentId?: number;
- cancel: boolean;
- to?: any;
- };
- /** @internal */
- interface RunAsyncState<T extends AnimationTarget = any> {
- paused: boolean;
- pauseQueue: Set<() => void>;
- resumeQueue: Set<() => void>;
- timeouts: Set<Timeout>;
- delayed?: boolean;
- asyncId?: number;
- asyncTo?: AsyncTo<InferState<T>>;
- promise?: AsyncResult<T>;
- cancelId?: number;
- }
-
- interface DefaultSpringProps<T> extends Pick<SpringProps<T>, 'pause' | 'cancel' | 'immediate' | 'config'>, PickEventFns<SpringProps<T>> {
- }
- /**
- * Only numbers, strings, and arrays of numbers/strings are supported.
- * Non-animatable strings are also supported.
- */
- declare class SpringValue<T = any> extends FrameValue<T> {
- /** The property name used when `to` or `from` is an object. Useful when debugging too. */
- key?: string;
- /** The animation state */
- animation: Animation<T>;
- /** The queue of pending props */
- queue?: SpringUpdate<T>[];
- /** Some props have customizable default values */
- defaultProps: DefaultSpringProps<T>;
- /** The state for `runAsync` calls */
- protected _state: RunAsyncState<SpringValue<T>>;
- /** The promise resolvers of pending `start` calls */
- protected _pendingCalls: Set<AnimationResolver<this>>;
- /** The counter for tracking `scheduleProps` calls */
- protected _lastCallId: number;
- /** The last `scheduleProps` call that changed the `to` prop */
- protected _lastToId: number;
- protected _memoizedDuration: number;
- constructor(from: Exclude<T, object>, props?: SpringUpdate<T>);
- constructor(props?: SpringUpdate<T>);
- /** Equals true when not advancing on each frame. */
- get idle(): boolean;
- get goal(): T;
- get velocity(): VelocityProp<T>;
- /**
- * When true, this value has been animated at least once.
- */
- get hasAnimated(): boolean;
- /**
- * When true, this value has an unfinished animation,
- * which is either active or paused.
- */
- get isAnimating(): boolean;
- /**
- * When true, all current and future animations are paused.
- */
- get isPaused(): boolean;
- /**
- *
- *
- */
- get isDelayed(): boolean | undefined;
- /** Advance the current animation by a number of milliseconds */
- advance(dt: number): void;
- /** Set the current value, while stopping the current animation */
- set(value: T | FluidValue<T>): this;
- /**
- * Freeze the active animation in time, as well as any updates merged
- * before `resume` is called.
- */
- pause(): void;
- /** Resume the animation if paused. */
- resume(): void;
- /** Skip to the end of the current animation. */
- finish(): this;
- /** Push props into the pending queue. */
- update(props: SpringUpdate<T>): this;
- /**
- * Update this value's animation using the queue of pending props,
- * and unpause the current animation (if one is frozen).
- *
- * When arguments are passed, a new animation is created, and the
- * queued animations are left alone.
- */
- start(): AsyncResult<this>;
- start(props: SpringUpdate<T>): AsyncResult<this>;
- start(to: T, props?: SpringProps<T>): AsyncResult<this>;
- /**
- * Stop the current animation, and cancel any delayed updates.
- *
- * Pass `true` to call `onRest` with `cancelled: true`.
- */
- stop(cancel?: boolean): this;
- /** Restart the animation. */
- reset(): void;
- /** @internal */
- eventObserved(event: FrameValue.Event): void;
- /**
- * Parse the `to` and `from` range from the given `props` object.
- *
- * This also ensures the initial value is available to animated components
- * during the render phase.
- */
- protected _prepareNode(props: {
- to?: any;
- from?: any;
- reverse?: boolean;
- default?: any;
- }): {
- to: any;
- from: any;
- };
- /** Every update is processed by this method before merging. */
- protected _update({ ...props }: SpringProps<T>, isLoop?: boolean): AsyncResult<SpringValue<T>>;
- /** Merge props into the current animation */
- protected _merge(range: AnimationRange<T>, props: RunAsyncProps<SpringValue<T>>, resolve: AnimationResolver<SpringValue<T>>): void;
- /** Update the `animation.to` value, which might be a `FluidValue` */
- protected _focus(value: T | FluidValue<T>): void;
- protected _attach(): void;
- protected _detach(): void;
- /**
- * Update the current value from outside the frameloop,
- * and return the `Animated` node.
- */
- protected _set(arg: T | FluidValue<T>, idle?: boolean): Animated | undefined;
- protected _onStart(): void;
- protected _onChange(value: T, idle?: boolean): void;
- protected _start(): void;
- protected _resume(): void;
- /**
- * Exit the frameloop and notify `onRest` listeners.
- *
- * Always wrap `_stop` calls with `batchedUpdates`.
- */
- protected _stop(goal?: any, cancel?: boolean): void;
- }
-
- /** Queue of pending updates for a `Controller` instance. */
- interface ControllerQueue<State extends Lookup = Lookup> extends Array<ControllerUpdate<State, any> & {
- /** The keys affected by this update. When null, all keys are affected. */
- keys: string[] | null;
- }> {
- }
- declare class Controller<State extends Lookup = Lookup> {
- readonly id: number;
- /** The animated values */
- springs: SpringValues<State>;
- /** The queue of props passed to the `update` method. */
- queue: ControllerQueue<State>;
- /**
- * The injected ref. When defined, render-based updates are pushed
- * onto the `queue` instead of being auto-started.
- */
- ref?: SpringRef<State>;
- /** Custom handler for flushing update queues */
- protected _flush?: ControllerFlushFn<this>;
- /** These props are used by all future spring values */
- protected _initialProps?: Lookup;
- /** The counter for tracking `scheduleProps` calls */
- protected _lastAsyncId: number;
- /** The values currently being animated */
- protected _active: Set<FrameValue<any>>;
- /** The values that changed recently */
- protected _changed: Set<FrameValue<any>>;
- /** Equals false when `onStart` listeners can be called */
- protected _started: boolean;
- private _item?;
- /** State used by the `runAsync` function */
- protected _state: RunAsyncState<this>;
- /** The event queues that are flushed once per frame maximum */
- protected _events: {
- onStart: Map<((result: AnimationResult<SpringValue<State>>, ctrl: Controller<State>, item?: any) => void) | ((result: AnimationResult<SpringValue<State>>, ctrl: Controller<State>, item: any) => void), AnimationResult<any>>;
- onChange: Map<((result: AnimationResult<SpringValue<State>>, ctrl: Controller<State>, item?: any) => void) | ((result: AnimationResult<SpringValue<State>>, ctrl: Controller<State>, item: any) => void), AnimationResult<any>>;
- onRest: Map<((result: AnimationResult<SpringValue<State>>, ctrl: Controller<State>, item?: any) => void) | ((result: AnimationResult<SpringValue<State>>, ctrl: Controller<State>, item: any) => void), AnimationResult<any>>;
- };
- constructor(props?: ControllerUpdate<State> | null, flush?: ControllerFlushFn<any>);
- /**
- * Equals `true` when no spring values are in the frameloop, and
- * no async animation is currently active.
- */
- get idle(): boolean;
- get item(): any;
- set item(item: any);
- /** Get the current values of our springs */
- get(): State & UnknownProps;
- /** Set the current values without animating. */
- set(values: Partial<State>): void;
- /** Push an update onto the queue of each value. */
- update(props: ControllerUpdate<State> | Falsy): this;
- /**
- * Start the queued animations for every spring, and resolve the returned
- * promise once all queued animations have finished or been cancelled.
- *
- * When you pass a queue (instead of nothing), that queue is used instead of
- * the queued animations added with the `update` method, which are left alone.
- */
- start(props?: OneOrMore<ControllerUpdate<State>> | null): AsyncResult<this>;
- /** Stop all animations. */
- stop(): this;
- /** Stop animations for the given keys. */
- stop(keys: OneOrMore<string>): this;
- /** Cancel all animations. */
- stop(cancel: boolean): this;
- /** Cancel animations for the given keys. */
- stop(cancel: boolean, keys: OneOrMore<string>): this;
- /** Stop some or all animations. */
- stop(keys?: OneOrMore<string>): this;
- /** Cancel some or all animations. */
- stop(cancel: boolean, keys?: OneOrMore<string>): this;
- /** Freeze the active animation in time */
- pause(keys?: OneOrMore<string>): this;
- /** Resume the animation if paused. */
- resume(keys?: OneOrMore<string>): this;
- /** Call a function once per spring value */
- each(iterator: (spring: SpringValue, key: string) => void): void;
- /** @internal Called at the end of every animation frame */
- protected _onFrame(): void;
- /** @internal */
- eventObserved(event: FrameValue.Event): void;
- }
- /**
- * For testing whether a type is an object but not an array.
- *
- * T extends IsPlainObject<T> ? true : false
- *
- * When `any` is passed, the resolved type is `true | false`.
- */
- type IsPlainObject<T> = T extends ReadonlyArray<any> ? Any$2 : T extends object ? object : Any$2;
- type StringKeys<T> = T extends IsPlainObject<T> ? string & keyof T : string;
-
- /** The flush function that handles `start` calls */
- type ControllerFlushFn<T extends Controller<any> = Controller> = (ctrl: T, queue: ControllerQueue<InferState<T>>) => AsyncResult<T>;
- /**
- * An async function that can update or stop the animations of a spring.
- * Typically defined as the `to` prop.
- *
- * The `T` parameter can be a set of animated values (as an object type)
- * or a primitive type for a single animated value.
- */
- interface SpringToFn<T = any> {
- (start: StartFn<T>, stop: StopFn<T>): Promise<any> | void;
- }
- type StartFn<T> = InferTarget<T> extends {
- start: infer T;
- } ? T : never;
- type StopFn<T> = InferTarget<T> extends {
- stop: infer T;
- } ? T : never;
- type EventHandler<TResult extends Readable = any, TSource = unknown, Item = undefined> = Item extends undefined ? (result: AnimationResult<TResult>, ctrl: TSource, item?: Item) => void : (result: AnimationResult<TResult>, ctrl: TSource, item: Item) => void;
- /**
- * Called before the first frame of every animation.
- * From inside the `requestAnimationFrame` callback.
- */
- type OnStart<TResult extends Readable, TSource, Item = undefined> = EventHandler<TResult, TSource, Item>;
- /** Called when a `SpringValue` changes */
- type OnChange<TResult extends Readable, TSource, Item = undefined> = EventHandler<TResult, TSource, Item>;
- type OnPause<TResult extends Readable, TSource, Item = undefined> = EventHandler<TResult, TSource, Item>;
- type OnResume<TResult extends Readable, TSource, Item = undefined> = EventHandler<TResult, TSource, Item>;
- /** Called once the animation comes to a halt */
- type OnRest<TResult extends Readable, TSource, Item = undefined> = EventHandler<TResult, TSource, Item>;
- type OnResolve<TResult extends Readable, TSource, Item = undefined> = EventHandler<TResult, TSource, Item>;
- /**
- * Called after an animation is updated by new props,
- * even if the animation remains idle.
- */
- type OnProps<T = unknown> = (props: Readonly<SpringProps<T>>, spring: SpringValue<T>) => void;
-
- declare enum TransitionPhase {
- /** This transition is being mounted */
- MOUNT = "mount",
- /** This transition is entering or has entered */
- ENTER = "enter",
- /** This transition had its animations updated */
- UPDATE = "update",
- /** This transition will expire after animating */
- LEAVE = "leave"
- }
- type UseTransitionProps<Item = any> = Merge<Omit<ControllerProps<UnknownProps, Item>, 'onResolve'>, {
- from?: TransitionFrom<Item>;
- initial?: TransitionFrom<Item>;
- enter?: TransitionTo<Item>;
- update?: TransitionTo<Item>;
- leave?: TransitionTo<Item>;
- keys?: ItemKeys<Item>;
- sort?: (a: Item, b: Item) => number;
- trail?: number;
- exitBeforeEnter?: boolean;
- /**
- * When `true` or `<= 0`, each item is unmounted immediately after its
- * `leave` animation is finished.
- *
- * When `false`, items are never unmounted.
- *
- * When `> 0`, this prop is used in a `setTimeout` call that forces a
- * rerender if the component that called `useTransition` doesn't rerender
- * on its own after an item's `leave` animation is finished.
- */
- expires?: boolean | number | ((item: Item) => boolean | number);
- config?: SpringConfig | ((item: Item, index: number, state: TransitionPhase) => AnimationProps['config']);
- /**
- * Called after a transition item is unmounted.
- */
- onDestroyed?: (item: Item, key: Key) => void;
- /**
- * Used to access the imperative API.
- *
- * Animations never auto-start when `ref` is defined.
- */
- ref?: SpringRef;
- }>;
- type Key = string | number;
- type ItemKeys<T = any> = OneOrMore<Key> | ((item: T) => Key) | null;
- type TransitionFrom<Item> = Falsy | GoalProp<UnknownProps> | ((item: Item, index: number) => GoalProp<UnknownProps> | Falsy);
- type TransitionTo<Item, State extends Lookup = Lookup> = Falsy | OneOrMore<ControllerUpdate<State, Item>> | Function | ((item: Item, index: number) => ControllerUpdate<State, Item> | SpringChain<State> | SpringToFn<State> | Falsy);
- /**
- * The props of a `useSpring` call or its async `update` function.
- *
- * The `T` parameter can be a set of animated values (as an object type)
- * or a primitive type for a single animated value.
- */
- type SpringUpdate<T = any> = ToProps<T> & SpringProps<T>;
- /**
- * Use the `SpringUpdate` type if you need the `to` prop to exist.
- * For function types, prefer one overload per possible `to` prop
- * type (for better type inference).
- *
- * The `T` parameter can be a set of animated values (as an object type)
- * or a primitive type for a single animated value.
- */
- interface SpringProps<T = any> extends AnimationProps<T> {
- from?: GoalValue<T>;
- loop?: LoopProp<SpringUpdate>;
- /**
- * Called after an animation is updated by new props,
- * even if the animation remains idle.
- */
- onProps?: EventProp<OnProps<T>>;
- /**
- * Called when an animation moves for the first time.
- */
- onStart?: EventProp<OnStart<SpringValue<T>, SpringValue<T>>>;
- /**
- * Called when a spring has its value changed.
- */
- onChange?: EventProp<OnChange<SpringValue<T>, SpringValue<T>>>;
- onPause?: EventProp<OnPause<SpringValue<T>, SpringValue<T>>>;
- onResume?: EventProp<OnResume<SpringValue<T>, SpringValue<T>>>;
- /**
- * Called when all animations come to a stand-still.
- */
- onRest?: EventProp<OnRest<SpringValue<T>, SpringValue<T>>>;
- }
- /**
- * A union type of all possible `to` prop values.
- *
- * This is not recommended for function types. Instead, you should declare
- * an overload for each `to` type. See `SpringUpdateFn` for an example.
- *
- * The `T` parameter can be a set of animated values (as an object type)
- * or a primitive type for a single animated value.
- */
- type ToProps<T = any> = {
- to?: GoalProp<T> | SpringToFn<T> | SpringChain<T>;
- } | ([T] extends [IsPlainObject<T>] ? InlineToProps<T> : never);
- /**
- * A value or set of values that can be animated from/to.
- *
- * The `T` parameter can be a set of animated values (as an object type)
- * or a primitive type for a single animated value.
- */
- type GoalProp<T> = [T] extends [IsPlainObject<T>] ? GoalValues<T> | Falsy : GoalValue<T>;
- /** A set of values for a `Controller` to animate from/to. */
- type GoalValues<T> = FluidProps<T> extends infer Props ? {
- [P in keyof Props]?: Props[P] | null;
- } : never;
- /**
- * A value that `SpringValue` objects can animate from/to.
- *
- * The `UnknownProps` type lets you pass in { a: 1 } if the `key`
- * property of `SpringValue` equals "a".
- */
- type GoalValue<T> = T | FluidValue<T> | UnknownProps | null | undefined;
- /**
- * Where `to` is inferred from non-reserved props
- *
- * The `T` parameter can be a set of animated values (as an object type)
- * or a primitive type for a single animated value.
- */
- type InlineToProps<T = any> = Remap<GoalValues<T> & {
- to?: undefined;
- }>;
- /** A serial queue of spring updates. */
- interface SpringChain<T = any> extends Array<[
- T
- ] extends [IsPlainObject<T>] ? ControllerUpdate<T> : SpringTo<T> | SpringUpdate<T>> {
- }
- /** A value that any `SpringValue` or `Controller` can animate to. */
- type SpringTo<T = any> = ([T] extends [IsPlainObject<T>] ? never : T | FluidValue<T>) | SpringChain<T> | SpringToFn<T> | Falsy;
- type ControllerUpdate<State extends Lookup = Lookup, Item = undefined> = unknown & ToProps<State> & ControllerProps<State, Item>;
- /**
- * Props for `Controller` methods and constructor.
- */
- interface ControllerProps<State extends Lookup = Lookup, Item = undefined> extends AnimationProps<State> {
- ref?: SpringRef<State>;
- from?: GoalValues<State> | Falsy;
- loop?: LoopProp<ControllerUpdate>;
- /**
- * Called when the # of animating values exceeds 0
- *
- * Also accepts an object for per-key events
- */
- onStart?: OnStart<SpringValue<State>, Controller<State>, Item> | {
- [P in keyof State]?: OnStart<SpringValue<State[P]>, Controller<State>, Item>;
- };
- /**
- * Called when the # of animating values hits 0
- *
- * Also accepts an object for per-key events
- */
- onRest?: OnRest<SpringValue<State>, Controller<State>, Item> | {
- [P in keyof State]?: OnRest<SpringValue<State[P]>, Controller<State>, Item>;
- };
- /**
- * Called once per frame when animations are active
- *
- * Also accepts an object for per-key events
- */
- onChange?: OnChange<SpringValue<State>, Controller<State>, Item> | {
- [P in keyof State]?: OnChange<SpringValue<State[P]>, Controller<State>, Item>;
- };
- onPause?: OnPause<SpringValue<State>, Controller<State>, Item> | {
- [P in keyof State]?: OnPause<SpringValue<State[P]>, Controller<State>, Item>;
- };
- onResume?: OnResume<SpringValue<State>, Controller<State>, Item> | {
- [P in keyof State]?: OnResume<SpringValue<State[P]>, Controller<State>, Item>;
- };
- /**
- * Called after an animation is updated by new props.
- * Useful for manipulation
- *
- * Also accepts an object for per-key events
- */
- onProps?: OnProps<State> | {
- [P in keyof State]?: OnProps<State[P]>;
- };
- /**
- * Called when the promise for this update is resolved.
- */
- onResolve?: OnResolve<SpringValue<State>, Controller<State>, Item>;
- }
- type LoopProp<T extends object> = boolean | T | (() => boolean | T);
- type VelocityProp<T = any> = T extends ReadonlyArray<number | string> ? number[] : number;
- /** For props that can be set on a per-key basis. */
- type MatchProp<T> = boolean | OneOrMore<StringKeys<T>> | ((key: StringKeys<T>) => boolean);
- /** Event props can be customized per-key. */
- type EventProp<T> = T | Lookup<T | undefined>;
- /**
- * Most of the reserved animation props, except `to`, `from`, `loop`,
- * and the event props.
- */
- interface AnimationProps<T = any> {
- /**
- * Configure the spring behavior for each key.
- */
- config?: SpringConfig | ((key: StringKeys<T>) => SpringConfig);
- /**
- * Milliseconds to wait before applying the other props.
- */
- delay?: number | ((key: StringKeys<T>) => number);
- /**
- * When true, props jump to their goal values instead of animating.
- */
- immediate?: MatchProp<T>;
- /**
- * Cancel all animations by using `true`, or some animations by using a key
- * or an array of keys.
- */
- cancel?: MatchProp<T>;
- /**
- * Pause all animations by using `true`, or some animations by using a key
- * or an array of keys.
- */
- pause?: MatchProp<T>;
- /**
- * Start the next animations at their values in the `from` prop.
- */
- reset?: MatchProp<T>;
- /**
- * Swap the `to` and `from` props.
- */
- reverse?: boolean;
- /**
- * Override the default props with this update.
- */
- default?: boolean | SpringProps<T>;
- }
- interface ReservedEventProps {
- onProps?: any;
- onStart?: any;
- onChange?: any;
- onPause?: any;
- onResume?: any;
- onRest?: any;
- onResolve?: any;
- onDestroyed?: any;
- }
-
- interface ControllerUpdateFn<State extends Lookup = Lookup> {
- (i: number, ctrl: Controller<State>): ControllerUpdate<State> | Falsy;
- }
- interface SpringRef<State extends Lookup = Lookup> {
- (props?: ControllerUpdate<State> | ControllerUpdateFn<State>): AsyncResult<Controller<State>>[];
- current: Controller<State>[];
- /** Add a controller to this ref */
- add(ctrl: Controller<State>): void;
- /** Remove a controller from this ref */
- delete(ctrl: Controller<State>): void;
- /** Pause all animations. */
- pause(): this;
- /** Pause animations for the given keys. */
- pause(keys: OneOrMore<string>): this;
- /** Pause some or all animations. */
- pause(keys?: OneOrMore<string>): this;
- /** Resume all animations. */
- resume(): this;
- /** Resume animations for the given keys. */
- resume(keys: OneOrMore<string>): this;
- /** Resume some or all animations. */
- resume(keys?: OneOrMore<string>): this;
- /** Update the state of each controller without animating. */
- set(values: Partial<State>): void;
- /** Update the state of each controller without animating based on their passed state. */
- set(values: (index: number, ctrl: Controller<State>) => Partial<State>): void;
- /** Start the queued animations of each controller. */
- start(): AsyncResult<Controller<State>>[];
- /** Update every controller with the same props. */
- start(props: ControllerUpdate<State>): AsyncResult<Controller<State>>[];
- /** Update controllers based on their state. */
- start(props: ControllerUpdateFn<State>): AsyncResult<Controller<State>>[];
- /** Start animating each controller. */
- start(props?: ControllerUpdate<State> | ControllerUpdateFn<State>): AsyncResult<Controller<State>>[];
- /** Stop all animations. */
- stop(): this;
- /** Stop animations for the given keys. */
- stop(keys: OneOrMore<string>): this;
- /** Cancel all animations. */
- stop(cancel: boolean): this;
- /** Cancel animations for the given keys. */
- stop(cancel: boolean, keys: OneOrMore<string>): this;
- /** Stop some or all animations. */
- stop(keys?: OneOrMore<string>): this;
- /** Cancel some or all animations. */
- stop(cancel: boolean, keys?: OneOrMore<string>): this;
- /** Add the same props to each controller's update queue. */
- update(props: ControllerUpdate<State>): this;
- /** Generate separate props for each controller's update queue. */
- update(props: ControllerUpdateFn<State>): this;
- /** Add props to each controller's update queue. */
- update(props: ControllerUpdate<State> | ControllerUpdateFn<State>): this;
- _getProps(arg: ControllerUpdate<State> | ControllerUpdateFn<State>, ctrl: Controller<State>, index: number): ControllerUpdate<State> | Falsy;
- }
- declare const SpringRef: <State extends Lookup<any> = Lookup<any>>() => SpringRef<State>;
-
- declare type DragAndDropProps = Omit<DraggableCollectionStateOptions & DraggableCollectionOptions & DroppableCollectionOptions & DroppableCollectionStateOptions, "keyboardDelegate" | "dropTargetDelegate" | "shouldAcceptItemDrop" | "onDropEnter" | "onDropActivate" | "onDropExit" | "getDropOperation" | "collection" | "selectionManager" | "onRootDrop" | "onInsert" | "getAllowedDropOperations" | "getItems" | "onItemDrop"> & Partial<Pick<DraggableCollectionStateOptions, "getItems">> & {
- /**
- * Indicates whether reordering is enabled.
- *
- * @default false
- */
- enableReorder: boolean;
- /**
- * Whether the items are arranged in a stack or grid.
- *
- * @default stack
- */
- layout: "grid" | "stack";
- /**
- * The primary orientation of the items. Usually this is the direction that
- * the collection scrolls.
- *
- * @default vertical
- */
- orientation: Orientation;
- };
-
- interface BlockProps {
- /**
- * The unique identifier for the block. This is used to identify the block in
- * the DOM and in the block map. It is added as a data attribute
- * `data-block-id` to the root element of the block if a DOM node is
- * rendered.
- */
- "data-block-id"?: Key$2;
- }
- interface StylingProps extends BlockProps {
- /** The className applied to the root element of the component. */
- className?: string;
- /** The style applied to the root element of the component. */
- style?: React__default.CSSProperties;
- }
-
- /**
- * Check if the selector is inside an overlay content
- *
- * @param selector
- */
- declare function isInsideOverlayContent(selector: HTMLElement): Element | null;
-
- interface ListOption {
- id: string;
- label: string;
- description?: string;
- icon?: React__default.FC<IconProps>;
- data?: Record<string, any>;
- /**
- * The type of item.
- *
- * @default item
- */
- type?: "option";
- }
- interface ListSection {
- id: string;
- title?: string;
- type: "section";
- children: ListOption[];
- }
- declare type ListItem = ListOption | ListSection;
- interface ListBoxProps extends StylingProps, Omit<AriaListBoxProps<ListItem> & AriaListBoxOptions<ListItem>, "children" | "linkBehavior" | "isVirtualized" | "keyboardDelegate">, Omit<DragAndDropProps, "preview" | "enableReorder" | "orientation" | "layout">, Partial<Pick<DragAndDropProps, "enableReorder" | "orientation" | "layout">> {
- /**
- * The items to render in the listbox. Items have the following shape:
- *
- * ```ts
- * export type ListOption = {
- * id: string;
- * label: string;
- * description?: string;
- * icon?: React.FC<IconProps>;
- * };
- *
- * export type ListSection = {
- * id: string;
- * title?: string;
- * type: "section";
- * children: ListOption[];
- * };
- *
- * type ListItem = ListOption | ListSection;
- * ```
- */
- items: ListItem[];
- /**
- * The custom render function for the listbox options.
- *
- * @param item Node<ListItem>
- * @param options [OptionAria]()
- * @param ref React.RefObject<HTMLLIElement>
- */
- renderOption?: (item: Node$1<ListItem>, options: OptionAria & {
- showSelectedIcon?: boolean;
- _state: ListState<ListItem>;
- }, ref: React__default.Ref<HTMLLIElement>) => React__default.ReactNode;
- /** Renders the drop indicator component. */
- renderDropIndicator?: (options: {
- dropIndicatorProps: React__default.HTMLAttributes<HTMLLIElement>;
- isDropTarget: boolean;
- isHidden: boolean;
- orientation: Orientation;
- }, ref: React__default.RefObject<HTMLLIElement>) => React__default.ReactNode;
- /**
- * The custom render function for the drag preview. This can be used to render
- * a custom drag preview when dragging items.
- */
- renderDragPreview?: (items: DragItem[]) => React__default.ReactNode;
- /** Whether to show the selected checkmark icon. */
- showSelectedIcon?: boolean;
- /** The label for the listbox. */
- label?: React__default.ReactNode;
- /** The CSS class name for the drop indicator. */
- dropIndicatorClassName?: string;
- /** The style of the drop indicator used in a component. */
- dropIndicatorStyle?: React__default.CSSProperties;
- /** The CSS class name for the option. */
- optionClassName?: string | ((item: ListOption) => string);
- /** The CSS class name for the section. */
- sectionClassName?: string | ((item: ListSection) => string);
- /** The style of the option. */
- optionStyle?: React__default.CSSProperties | ((item: ListOption) => React__default.CSSProperties);
- /** The style of the section. */
- sectionStyle?: React__default.CSSProperties | ((item: ListSection) => React__default.CSSProperties);
- }
-
- declare const ListBox: React__default.ForwardRefExoticComponent<ListBoxProps & React__default.RefAttributes<HTMLUListElement>>;
-
- interface ActionButtonSharedProps extends Omit<AriaButtonProps<"button" | "div">, "rel" | "href" | "target" | "children">, StylingProps {
- }
- interface ActionButtonProps extends ActionButtonSharedProps {
- /**
- * The button's variant.
- *
- * @default primary
- */
- variant?: "primary" | "secondary" | "tertiary" | "ghost" | "popover";
- /** The button's label. */
- label: React__default.ReactNode;
- /** The button's icon before the label. */
- iconStart?: React__default.FC<IconProps>;
- /** The button's icon after the label. */
- iconEnd?: React__default.FC<IconProps>;
- /**
- * The button's size.
- *
- * @default sm
- */
- size?: "sm" | "md";
- /** Indicates whether focusing should be prevented on press. */
- preventFocusOnPress?: boolean;
- }
-
- declare const ActionButton: React__default.ForwardRefExoticComponent<ActionButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
-
- interface DomNodeRendererProps {
- /** The class name applied to the wrapper `div` component. */
- className?: string;
- /**
- * The DOM node to render inside the component. If this is not provided, the
- * component will render nothing. If this is provided, the component will
- * render the DOM node inside a `div` component with `display` set to
- * `contents`.
- */
- node: Node;
- }
-
- declare const DomNodeRenderer: React__default.ForwardRefExoticComponent<DomNodeRendererProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface SliderProps extends Omit<AriaSliderProps<number> & SliderStateOptions<number>, "orientation" | "numberFormatter">, StylingProps {
- /**
- * Whether the slider is read only.
- *
- * @default false
- */
- isReadOnly?: boolean;
- /** The format options passed to `Intl.NumberFormat`. */
- numberFormatOptions?: Intl.NumberFormatOptions & {
- numberingSystem?: string;
- };
- /** The label for the slider. */
- label?: React__default.ReactNode;
- /**
- * Whether to include a number input for the slider.
- *
- * @default false
- */
- includeNumberInput?: boolean;
- }
-
- declare const Slider: React__default.ForwardRefExoticComponent<SliderProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface SwitchProps extends Omit<AriaSwitchProps, "children">, Omit<ToggleProps, "children" | "isRequired" | "validate" | "validationBehavior" | "validationState" | "isInvalid">, StylingProps {
- /** The label to display next to the switch. */
- label?: React__default.ReactNode;
- /** The position of the label. */
- labelPosition?: "top" | "left";
- /** The status label to display next to the switch. */
- statusLabel?: {
- on: string;
- off: string;
- };
- }
-
- declare const Switch: React__default.ForwardRefExoticComponent<SwitchProps & React__default.RefAttributes<HTMLLabelElement>>;
-
- interface SearchInputProps extends Omit<AriaSearchFieldProps, "validationState" | "label" | "aria-autocomplete" | "autoComplete" | "isRequired" | "aria-haspopup" | "isReadOnly" | "aria-activedescendant" | "type" | "validationBehavior" | "validate" | "isInvalid">, StylingProps {
- /**
- * The size of the search input.
- *
- * @default "md"
- */
- size?: "sm" | "md" | "lg";
- /**
- * The variant of the search input.
- *
- * @default "primary"
- */
- variant?: "primary" | "ghost";
- /** Defines a string value that labels the current element. */
- "aria-label": string;
- }
-
- declare const SearchInput: React__default.ForwardRefExoticComponent<SearchInputProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface ThemeProviderProps extends StylingProps {
- /**
- * The theme to use. If not provided, the theme will be inherited from the
- * parent ThemeProvider. If there is no parent ThemeProvider, the default
- * theme will be used.
- *
- * @default "system"
- */
- theme?: Theme | "light" | "dark" | "system";
- /** The children to render. */
- children: React__default.ReactNode;
- /**
- * A function that will be called when the theme changes from any of the child
- * components.
- */
- setTheme?: (theme: Theme | "light" | "dark" | "system") => void;
- }
-
- declare const ThemeProvider: React__default.ForwardRefExoticComponent<ThemeProviderProps & React__default.RefAttributes<HTMLDivElement>>;
-
- /**
- * A hook that returns the user preferences for color scheme, contrast, reduced
- * motion, transparency and reduced data. The values are updated when the user
- * changes their preferences.
- *
- * @example
- * const { colorScheme, highContrast, reducedMotion, transparency } =
- * useUserPreferences();
- *
- * @param ownerWindow - The window object to use. Defaults to the global window
- * object.
- * @returns The user preferences.
- */
- declare function useUserPreferences(ownerWindow?: Window & typeof globalThis): {
- colorScheme: "dark" | "light";
- highContrast: boolean;
- reducedMotion: boolean;
- transparency: boolean;
- };
-
- interface PortalContainerProviderProps {
- /**
- * The container element for the popover. By default, the modal is rendered as
- * a child of the body element.
- *
- * @default undefined
- */
- portalContainer: HTMLElement | undefined;
- /** The children to render. */
- children: React__default.ReactNode;
- }
-
- declare const PortalContainerProvider: React__default.FC<PortalContainerProviderProps>;
-
- declare type OverlayTriggerProps_ = Parameters<typeof useOverlayTrigger>[0];
- interface PopoverProps extends OverlayTriggerProps$1, OverlayTriggerProps_ {
- /** The children of the popover. */
- children: React__default.ReactNode | ((state: OverlayTriggerState) => React__default.ReactNode);
- }
- interface PopoverContentProps extends Omit<AriaPopoverProps, "popoverRef" | "triggerRef" | "arrowSize" | "arrowBoundaryOffset">, StylingProps {
- /**
- * The reference element for the popover position. By default, the popover is
- * positioned relative to the trigger element.
- */
- triggerRef?: React__default.RefObject<HTMLElement>;
- /** The class name for the underlay element. */
- underlayClassName?: string;
- /** The contents of the popover. */
- children: React__default.ReactNode;
- /**
- * The container element for the popover. By default, the modal is rendered as
- * a child of the body element.
- *
- * @default document.body
- */
- portalContainer?: HTMLElement;
- /**
- * Whether to include an arrow on the popover.
- *
- * @default false
- */
- includeArrow?: boolean;
- /** The class name for the content container element. */
- contentContainerClassName?: string;
- /** The style for the content container element. */
- contentContainerStyle?: React__default.CSSProperties;
- }
- interface PopoverTriggerProps {
- /** The contents of the popover trigger. */
- children: React__default.ReactNode | (({ isOpen, triggerProps, triggerRef, }: {
- isOpen: boolean;
- triggerProps: AriaButtonProps<"button">;
- triggerRef: React__default.RefObject<HTMLElement>;
- }) => React__default.ReactNode);
- }
-
- declare const PopoverContent: React__default.ForwardRefExoticComponent<PopoverContentProps & React__default.RefAttributes<HTMLDivElement>>;
-
- declare const PopoverTrigger: React__default.FC;
-
- declare const Popover: React__default.FC<PopoverProps>;
-
- declare type MenuOption = Omit<ListOption, "description"> & {
- keyboardShortcut?: string;
- };
- declare type MenuSection = Omit<ListSection, "children"> & {
- children: MenuOption[];
- };
- declare type MenuItem = MenuOption | MenuSection;
- declare type MenuPopoverProps = Pick<PopoverContentProps, "isNonModal" | "placement" | "shouldUpdatePosition" | "shouldFlip" | "boundaryElement" | "crossOffset" | "offset" | "portalContainer">;
- interface MenuProps extends MenuPopoverProps, MenuTriggerProps, Omit<AriaMenuProps<MenuItem>, "children">, Omit<AriaMenuTriggerProps, "type"> {
- /** The `className` property assigned to the root element of the component. */
- className?: string;
- /** The `className` property assigned to the content element of the component. */
- contentClassName?: string;
- /** The `className` property assigned to the item element of the component. */
- itemClassName?: string;
- /**
- * A list of items to render in the menu. Items have the following shape:
- *
- * ```ts
- * export type MenuOption = {
- * id: string;
- * label: string;
- * keyboardShortcut?: string;
- * icon?: React.FC<IconProps>;
- * };
- *
- * export type MenuSection = {
- * id: string;
- * title?: string;
- * type: "section";
- * children: MenuOption[];
- * };
- *
- * export type MenuItem = MenuOption | MenuSection;
- * ```
- */
- items: MenuItem[];
- /**
- * The `children` property is used to render the trigger element of the
- * component.
- *
- * ```tsx
- * <Menu>
- * <ActionButton label="Label">
- * </Menu>
- * ```
- */
- children?: React__default.ReactNode;
- }
-
- declare const Menu: React__default.ForwardRefExoticComponent<MenuProps & React__default.RefAttributes<HTMLUListElement>>;
-
- interface LinkProps extends AriaLinkOptions, StylingProps {
- /** The link's style variant. */
- variant?: "default" | "inline";
- /** The children to render. */
- children: React__default.ReactNode;
- /** The size of the link. */
- size?: "sm" | "md" | "lg";
- /**
- * The type of the link.
- *
- * @default "body"
- */
- type?: "body" | "label";
- /** The title of the link, for providing additional information. */
- title?: string;
- }
-
- declare const Link: React__default.ForwardRefExoticComponent<LinkProps & React__default.RefAttributes<HTMLElement>>;
-
- interface SharedFileUploadProps extends StylingProps {
- /** Whether the component is inlined. */
- variant?: "default" | "inline";
- /** Whether the component is disabled. */
- isDisabled?: boolean;
- /** The label to display. */
- label: string;
- /** The description to display. */
- description?: string;
- /**
- * The pattern to match the file name against. This is a regular expression,
- * and will be matched against the entire file name.
- */
- accept?: string;
- /** The name of the input. */
- name?: string;
- /** The callback function that is fired when the value changes. */
- onChange?: (event: React__default.ChangeEvent<HTMLInputElement>) => void;
- /**
- * The callback function that is fired when the value changes and the value is
- * valid.
- */
- onValueChange?: (files: File[]) => void;
- /**
- * Identifies the element (or elements) that provide a detailed, extended
- * description for the object.
- */
- "aria-describedby"?: string;
- }
- interface FileUploadProps extends SharedFileUploadProps {
- /** The Icon to display. */
- icon?: React__default.FC<IconProps>;
- /** Whether to allow multiple files to be uploaded. */
- multiple?: boolean;
- }
-
- declare const FileUpload: React__default.ForwardRefExoticComponent<FileUploadProps & React__default.RefAttributes<HTMLLabelElement>>;
-
- interface SeparatorProps extends SeparatorProps$1, StylingProps {
- /**
- * The variant of the separator.
- *
- * @default "primary"
- */
- variant?: "primary" | "secondary";
- }
-
- declare const Separator: React__default.ForwardRefExoticComponent<SeparatorProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface ProgressBarProps extends Omit<AriaProgressBarProps, "isIndeterminate"> {
- /** The `className` property assigned to the root element of the component. */
- className?: string;
- /**
- * The variant of the progress bar.
- *
- * @default active
- */
- variant?: "active" | "success" | "error";
- /** The description of the progress bar. */
- description?: string;
- /**
- * Whether the progress bar value should be displayed.
- *
- * @default false
- */
- showValue?: boolean;
- /** The error message of the progress bar. */
- errorMessage?: string;
- }
-
- declare const ProgressBar: React__default.ForwardRefExoticComponent<ProgressBarProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface InputMessage {
- /** The description to display below the input. */
- description?: string;
- /** The error message to display when the input is in an error state. */
- errorMessage?: string;
- /** The warning message to display when the input is in a warning state. */
- warningMessage?: string;
- }
- interface TextInputProps extends Omit<AriaTextFieldProps, "validationState" | "isInvalid" | "description" | "errorMessage">, StylingProps, InputMessage {
- /** The state of the input. */
- validationState?: "valid" | "error" | "warning";
- /**
- * The variant of the text input.
- *
- * @default primary
- */
- variant?: "primary" | "ghost";
- /**
- * The position of the label relative to the input.
- *
- * @default top
- */
- labelPosition?: "top" | "start";
- /** Whether the input is read only. */
- readOnly?: boolean;
- /** The style object to apply to the input element */
- inputStyle?: React__default.CSSProperties;
- /** The class name to apply to the input element */
- inputClassName?: string;
- }
-
- declare const TextInput: React__default.ForwardRefExoticComponent<TextInputProps & React__default.RefAttributes<HTMLInputElement>>;
-
- interface ReactionProps extends Omit<AriaSwitchProps & ToggleProps, "validationState" | "isRequired" | "children" | "isInvalid" | "validationBehavior" | "validate">, StylingProps {
- /** The size of the reaction. */
- size?: "sm" | "md";
- /** The number of reactions. */
- count: number;
- /** The icon to render. */
- icon?: React__default.FC<IconProps>;
- }
-
- declare const Reaction: React__default.ForwardRefExoticComponent<ReactionProps & React__default.RefAttributes<HTMLLabelElement>>;
-
- interface TooltipProps extends TooltipTriggerProps, AriaTooltipProps, Omit<AriaPositionProps, "overlayRef" | "targetRef" | "maxHeight" | "isOpen" | "arrowSize"> {
- /** The content of the tooltip. */
- text?: string;
- /** The tooltip trigger element. */
- children: React__default.ReactNode;
- /**
- * The delay time for the tooltip to show up.
- *
- * @default 1000
- */
- delay?: number;
- /**
- * The delay time for the tooltip to hide.
- *
- * @default 500
- */
- closeDelay?: number;
- /**
- * Represents the size of an element.
- *
- * @default md
- */
- size?: "sm" | "md";
- /**
- * The variant that can be applied to an element.
- *
- * @default default
- */
- variant?: "default" | "inverse";
- /**
- * Indicates whether to include an arrow in the output.
- *
- * @default true
- */
- includeArrow?: boolean;
- /**
- * The container element for the modal. By default, the modal is rendered as a
- * child of the body element.
- *
- * @default document.body
- */
- portalContainer?: HTMLElement;
- }
-
- declare const Tooltip: React__default.ForwardRefExoticComponent<TooltipProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface PortalProps extends OverlayProps {
- /** The `className` property assigned to the root element of the component. */
- className?: string;
- /** The `style` property assigned to the root element of the component. */
- style?: React__default.CSSProperties;
- }
-
- declare const Portal: React__default.ForwardRefExoticComponent<PortalProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface ProgressSpinnerProps extends Omit<AriaProgressBarProps, "value" | "isIndeterminate" | "formatOptions" | "maxValue" | "minValue" | "valueLabel">, StylingProps {
- /**
- * The size of the progress circle.
- *
- * @default md
- */
- size?: "sm" | "md";
- /**
- * The progress circle's variant.
- *
- * @default active
- */
- variant?: "active" | "inactive" | "success" | "error";
- }
-
- declare const ProgressSpinner: React__default.ForwardRefExoticComponent<ProgressSpinnerProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface ActionIconButtonProps extends ActionButtonSharedProps {
- /** The icon to display */
- icon: React__default.FC<IconProps>;
- /**
- * The size of the icon button.
- *
- * @default "md"
- */
- size?: "xxs" | "xs" | "sm" | "md" | "lg";
- /**
- * The variant of the icon button.
- *
- * @default "primary"
- */
- variant?: "primary" | "secondary" | "tertiary" | "ghost" | "toolbar" | "popover";
- /** Indicates whether focusing should be prevented on press. */
- preventFocusOnPress?: boolean;
- }
-
- declare const ActionIconButton: React__default.ForwardRefExoticComponent<ActionIconButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
-
- interface ToggleButtonProps extends StylingProps, Omit<AriaToggleButtonProps, "children"> {
- /** The text content of the button. */
- label: React__default.ReactNode;
- /** The icon to display before the label. */
- iconStart?: React__default.FC<SVGRProps>;
- /**
- * The size of the button.
- *
- * @default "md"
- */
- size?: "md" | "lg";
- /** Indicates whether focusing should be prevented on press. */
- preventFocusOnPress?: boolean;
- }
-
- declare const ToggleButton: React__default.ForwardRefExoticComponent<ToggleButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
-
- interface CheckboxProps extends Omit<AriaCheckboxProps, "children" | "validationBehavior" | "validationState" | "validate">, StylingProps {
- /** The checkbox's label. */
- label?: string;
- /**
- * The position of the label
- *
- * @default end
- */
- labelPosition?: "start" | "end";
- }
-
- declare const Checkbox: React__default.ForwardRefExoticComponent<CheckboxProps & React__default.RefAttributes<HTMLLabelElement>>;
-
- declare type Excluded = "isDisabled" | "isReadOnly" | "isRequired" | "locale" | "validationState" | "label" | "formatOptions" | "isInvalid" | "validationBehaviour" | "validate" | "description" | "errorMessage";
- interface PaginationProps extends Omit<AriaNumberFieldProps, Excluded>, Omit<NumberFieldStateOptions, Excluded>, StylingProps {
- /** The largest value allowed for the input. */
- maxValue: number;
- /** The label for the pagination component. */
- "aria-label": string;
- /**
- * The variant of the pagination component.
- *
- * @default floating
- */
- variant?: "floating" | "pinned";
- /**
- * The size of the pagination component.
- *
- * @default md
- */
- size?: "xs" | "sm" | "md" | "lg";
- }
-
- declare const Pagination: React__default.ForwardRefExoticComponent<PaginationProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface I18nProviderProps extends I18nProviderProps$1 {
- /** The messages to use for internationalization. */
- messages?: LocalizedStrings;
- }
-
- declare const I18nProvider: React__default.FC<I18nProviderProps>;
-
- declare type NumberFormatProps = Parameters<typeof useNumberFormatter>[0] & {
- /** The number to format. */
- value: number;
- };
-
- declare const NumberFormat: React__default.FC<NumberFormatProps>;
-
- declare type DateFormatProps = Parameters<typeof useDateFormatter>[0] & {
- /** The date to format. */
- date: Date;
- };
-
- declare const DateFormat: React__default.FC<DateFormatProps>;
-
- interface Item {
- id: string;
- label: string;
- variant?: "neutral" | "red" | "green" | "blue" | "high-contrast";
- icon?: React__default.FC<SVGRProps>;
- }
- interface TagGroupProps extends StylingProps, Omit<AriaTagGroupProps<Item>, "children" | "errorMessage" | "description">, Omit<ListProps<Item>, "children" | "collection" | "filter"> {
- /**
- * The items to display in the tag group.
- *
- * Type Item = { id: string; label: string; variant?: "neutral" | "red" |
- * "green" | "blue" | "high-contrast"; icon?: React.FC<SVGRProps>; }
- */
- items: Item[];
- /**
- * The variant of the tag group.
- *
- * @default "neutral"
- */
- variant?: Item["variant"];
- /** The label for the tag group. */
- "aria-label": string;
- }
-
- declare const TagGroup: React__default.ForwardRefExoticComponent<TagGroupProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface AccordionProps extends StylingProps {
- /**
- * This prop controls the expansion mode of the accordion. If set to `single`,
- * only one item can be expanded at a time. If set to `multiple`, multiple
- * items can be expanded at the same time.
- *
- * @default single
- */
- expansionMode?: "single" | "multiple";
- /** This callback is called when the expanded state of the accordion changes. */
- onChange?: (value: Set<Key$2>) => void;
- /** The children of the accordion. Each child should be an `AccordionItem`. */
- children: React__default.ReactNode;
- /** The keys of the items that should be expanded by default. */
- defaultExpandedKeys?: Set<Key$2>;
- /**
- * The keys of the items that should be expanded. If this prop is provided,
- * the accordion will be a controlled component. This means that the expanded
- * state of the accordion will not change unless you update this prop.
- */
- expandedKeys?: Set<Key$2>;
- /**
- * The keys of the items that should be disabled. Disabled items cannot be
- * expanded or collapsed.
- */
- disabledKeys?: Set<Key$2>;
- }
- interface AccordionItemProps extends StylingProps {
- /** The title of the accordion item. */
- title: string;
- /**
- * The buttons that should be rendered in the accordion item. These buttons
- * will be rendered in the top right corner of the accordion item. They will
- * be rendered in the order they are provided. The buttons will be rendered as
- * `ActionIconButton`s, so you can pass any props that you would pass to an
- * `ActionIconButton`.
- *
- * @example
- * ```jsx
- * <AccordionItem
- * title="Accordion Item"
- * actions={[{
- * icon: EditIcon,
- * label: "Edit",
- * onPress: () => alert("Edit"),
- * }]}>Content</AccordionItem>
- * ```;
- */
- actions?: Omit<ActionIconButtonProps, "size" | "variant" | "excludeFromTabOrder">[];
- /**
- * The action buttons should only be shown when the user hovers over or
- * focuses the accordion item.
- *
- * @default false
- */
- showActionsOnTriggerOnly?: boolean;
- /** The content of the accordion item. */
- children: React__default.ReactNode;
- /** The key of the accordion item. */
- value: Key$2;
- /**
- * The description of the accordion item. This will be rendered at the end of
- * the accordion header.
- */
- subLabel?: string;
- }
-
- declare const Accordion: React__default.ForwardRefExoticComponent<AccordionProps & React__default.RefAttributes<HTMLDivElement>>;
-
- declare const AccordionItem: React__default.ForwardRefExoticComponent<AccordionItemProps & React__default.RefAttributes<HTMLHeadingElement>>;
-
- interface SelectProps extends Omit<AriaSelectOptions<ListItem> & SelectStateOptions<ListItem> & PopoverContentProps, "validationState" | "items" | "children" | "isRequired" | "className" | "style" | "triggerRef" | "validate" | "validationBehavior" | "keyboardDelegate">, Pick<ListBoxProps, "items" | "showSelectedIcon" | "optionStyle" | "optionClassName">, StylingProps {
- /**
- * The position of the label.
- *
- * @default "top"
- */
- labelPosition?: "top" | "start";
- /** The description of the select component. */
- description?: string;
- /** The error message of the select component. */
- errorMessage?: string;
- /** The warning message of the select component. */
- warningMessage?: string;
- /** The label of the select component. */
- label?: React__default.ReactNode;
- /** The variant of the select component. */
- variant?: "primary" | "ghost";
- /** The state of the select component. */
- validationState?: "valid" | "error" | "warning";
- /** Whether the select component is read only. */
- isReadOnly?: boolean;
- }
-
- declare const Select: React__default.ForwardRefExoticComponent<SelectProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface AvatarProps extends StylingProps {
- /**
- * The size of the component.
- *
- * @default "md"
- */
- size?: "md" | "sm";
- /**
- * The icon to display. This icon has to be imported from the
- * `@baseline-ui/icons` package.
- */
- icon?: React__default.FC<SVGRProps>;
- /** The name of the user. */
- name: string;
- /** The URL of the image to display. */
- imgSrc?: string;
- /**
- * The image loading strategy to use. See
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes:~:text=a%20fallback%20destination.-,loading,-Indicates%20how%20the)
- */
- imgLoading?: "lazy" | "eager";
- /** Whether to show the initials of the user if no image is provided. */
- showInitials?: boolean;
- /** Whether the component is disabled. */
- isDisabled?: boolean;
- /** Whether the user has a notification. */
- hasNotifications?: boolean;
- }
-
- declare const Avatar: React__default.ForwardRefExoticComponent<AvatarProps & React__default.RefAttributes<HTMLSpanElement>>;
-
- declare type ItemProps = React__default.ComponentProps<typeof Item$1> & StylingProps & {
- key?: Key$2;
- icon?: React__default.FC<SVGRProps>;
- value?: string;
- title?: string;
- titleClassName?: string;
- titleStyle?: React__default.CSSProperties;
- };
- declare type TabsProps = Omit<StylingProps & AriaTabListProps<ItemProps>, "orientation" | "children" | "items" | "selectedKey" | "defaultSelectedKey" | "disabledKeys"> & {
- /**
- * The `TabItem` components to render inside the `Tabs` component.
- *
- * ```jsx
- * <Tabs>
- * <TabItem key="tab1" title="Tab 1">
- * <div>Tab 1 content</div>
- * </TabItem>
- * <TabItem key="tab2" title="Tab 2">
- * <div>Tab 2 content</div>
- * </TabItem>
- * </Tabs>;
- * ```
- */
- children: React__default.ReactNode;
- /**
- * The key of the tab that needs to be removed.
- *
- * @param key
- */
- onRemove?: (key: Key$2) => void;
- /** The value of the tab that needs to be selected. */
- selectedValue?: string;
- /** The default value of the tab that needs to be selected. */
- defaultSelectedValue?: string;
- /** The values of the tabs that need to be disabled. */
- disabledValues?: Set<Key$2>;
- /** A list of action buttons to render beside the tab items. */
- actions?: Omit<ActionIconButtonProps, "variant" | "size">[];
- /** The variant of the tabs */
- variant?: "primary" | "ghost";
- /** The className to apply to the tab header container. */
- tabHeaderClassName?: string;
- /** The style to apply to the tab header container. */
- tabHeaderStyle?: React__default.CSSProperties;
- };
- declare type TabItemProps = StylingProps & {
- /** The title of the tab. This will be displayed in the tab button. */
- title: string;
- /** The icon to display in front of the title. */
- icon?: React__default.FC<SVGRProps>;
- /** The value of the tab. This will be used to identify the tab. */
- value: string;
- /** The className to apply to the tab item. */
- titleClassName?: string;
- /** The style to apply to the tab item. */
- titleStyle?: React__default.CSSProperties;
- };
-
- declare const Tabs: React__default.ForwardRefExoticComponent<Omit<StylingProps & AriaTabListProps<ItemProps>, "children" | "items" | "disabledKeys" | "orientation" | "selectedKey" | "defaultSelectedKey"> & {
- children: React__default.ReactNode;
- onRemove?: ((key: React__default.Key) => void) | undefined;
- selectedValue?: string | undefined;
- defaultSelectedValue?: string | undefined;
- disabledValues?: Set<React__default.Key> | undefined;
- actions?: Omit<ActionIconButtonProps, "size" | "variant">[] | undefined;
- variant?: "primary" | "ghost" | undefined;
- tabHeaderClassName?: string | undefined;
- tabHeaderStyle?: React__default.CSSProperties | undefined;
- } & React__default.RefAttributes<HTMLDivElement>>;
-
- declare const TabItem: React__default.FC<TabItemProps>;
-
- interface InlineAlertProps extends StylingProps {
- /**
- * The variant of the alert.
- *
- * @default "info"
- */
- variant?: "info" | "warning" | "error" | "success";
- /** The title of the alert. */
- title: string;
- /** The description of the alert. */
- description: string;
- /**
- * The label of the action button. When provided, the action button will be
- * rendered.
- */
- actionLabel?: string;
- /** The callback fired when the action button is clicked. */
- onAction?: () => void;
- /**
- * The callback fired when the close button is clicked. When provided, the
- * close button will be rendered.
- */
- onClose?: () => void;
- /**
- * The arrangement of the variable.
- *
- * @default "single"
- * @typedef {"single" | "multi" | "compact"} Arrangement
- */
- arrangement?: "single" | "multi" | "compact";
- /**
- * The size of the alert.
- *
- * @default "md"
- */
- size?: "sm" | "md";
- }
-
- declare const InlineAlert: React__default.ForwardRefExoticComponent<InlineAlertProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface NumberInputProps extends StylingProps, Omit<AriaNumberFieldProps, "validationState" | "isRequired" | "validate" | "validationBehavior"> {
- /**
- * The position of the label relative to the input.
- *
- * @default top
- */
- labelPosition?: "top" | "start";
- /**
- * The variant of the number input.
- *
- * @default primary
- */
- variant?: "primary" | "ghost";
- /**
- * Whether to show the stepper buttons.
- *
- * @default true
- */
- showStepper?: boolean;
- /** The description to display below the input. */
- description?: string;
- /** The error message to display when the input is in an error state. */
- errorMessage?: string;
- }
-
- declare const NumberInput: React__default.ForwardRefExoticComponent<NumberInputProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface DrawerProps extends StylingProps, AriaDialogProps {
- /** The children to render. */
- children: React__default.ReactNode;
- /**
- * The valid values for the background type are "medium" and "subtle".
- *
- * @default "medium"
- */
- background?: "medium" | "subtle";
- /** The title to display in the drawer. */
- title: string;
- /** The props of additional `ActionIconButton` to display in the drawer header. */
- action?: ActionIconButtonProps;
- /** The callback to call when the drawer is requested to be closed. */
- onCloseRequest?: () => void;
- }
-
- declare const Drawer: React__default.ForwardRefExoticComponent<DrawerProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface DialogProps extends AriaDialogProps, StylingProps {
- /** The children to render. */
- children: React__default.ReactNode;
- /**
- * The size of the dialog. This defines the max width of the dialog.
- *
- * @default "sm"
- */
- size?: "sm" | "md" | "lg" | "content";
- /**
- * The variant of the dialog.
- *
- * @default "primary"
- */
- variant?: "primary" | "ghost";
- /**
- * The background color of the drawer.
- *
- * @default "medium"
- */
- drawerBackground?: DrawerProps["background"];
- /**
- * When used inside a modal, this prop will decide whether the dialog should
- * inherit the drawer styles.
- *
- * @default false
- */
- inheritDrawer?: boolean;
- }
- interface DialogTitleProps extends StylingProps {
- /** The children to render. */
- children: React__default.ReactNode;
- }
-
- declare const Dialog: React__default.ForwardRefExoticComponent<DialogProps & React__default.RefAttributes<HTMLDivElement>>;
-
- declare const DialogTitle: React__default.ForwardRefExoticComponent<DialogTitleProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface ColorPreset$1 {
- label: string;
- color: string;
- }
- interface ColorInputProps extends OverlayTriggerProps$1, StylingProps, Pick<ColorFieldProps, "onChange" | "defaultValue" | "value" | "label" | "isDisabled">, Pick<AriaLabelingProps$1, "aria-label">, Pick<PopoverContentProps, "isNonModal" | "placement" | "shouldUpdatePosition" | "shouldFlip" | "boundaryElement" | "crossOffset" | "offset" | "portalContainer"> {
- /**
- * The list of color presets to show in the color picker. The signature of the
- * color presets is:
- *
- * ```ts
- * export interface ColorPreset {
- * label: string;
- * color: string;
- * }
- * ```
- *
- * The color can be a hex or hexa value.
- */
- presets?: ColorPreset$1[];
- /**
- * Whether to include the custom color picker. If `false`, the color picker
- * will only show the color presets. The custom color picker allows the user
- * to pick any color. You can set the `allowAlpha` prop to `false` to disable
- * the alpha channel.
- *
- * @default true
- */
- includePicker?: boolean;
- /**
- * Whether to show the color label. The color label is the name of the color
- * that is currently selected. If boolean, the label will be shown only when
- * the color is not `null`. If a function, the function will be called with
- * the current color and should return a string. If `false`, the label will
- * not be shown.
- *
- * @default true
- */
- colorLabel?: boolean | ((color: Color | null) => string);
- /**
- * Whether to allow alpha values in the custom color picker.
- *
- * @default true
- */
- allowAlpha?: boolean;
- /**
- * Whether to allow the removal of the color.
- *
- * @default false
- */
- allowRemoval?: boolean;
- /** The label position of the color input. */
- labelPosition?: "top" | "start";
- /**
- * Whether to show the color picker in active or lazy mode. In active mode,
- * the color picker will be rendered when the color input popover is open and
- * the value of the color input will be updated when the user picks a color.
- * In lazy mode, the color picker will be rendered only when the user clicks
- * on the "Add color" button and the selected color will be added to custom
- * colors when the user clicks on the "Add color" button.
- *
- * @default active
- */
- pickerMode?: "active" | "lazy";
- /**
- * The key to use to store the picked color in the local storage.
- *
- * @default baselinePickedColor
- */
- storePickedColorKey?: string;
- /**
- * The label to show on the add color button.
- *
- * @default Add color
- */
- addColorButtonLabel?: string;
- /**
- * The label to show on the remove color button.
- *
- * @default Remove color
- */
- removeColorButtonLabel?: string;
- /**
- * The label to show on the custom colors section.
- *
- * @default Custom colors
- */
- customColorsLabel?: string;
- /**
- * An optional function to render the custom trigger button.
- *
- * @param options
- */
- renderTriggerButton?: (options: {
- isOpen: boolean;
- color: Color | null;
- ref: React__default.RefObject<HTMLButtonElement>;
- colorName?: string | boolean;
- triggerProps: AriaButtonProps<"button">;
- }) => React__default.ReactElement;
- }
-
- declare const ColorInput: React__default.ForwardRefExoticComponent<ColorInputProps & React__default.RefAttributes<HTMLDivElement>>;
-
- declare const ColorSwatch: React__default.FC<ColorSwatchProps>;
- interface ColorSwatchProps {
- color?: string;
- isFocusVisible?: boolean;
- isDisabled?: boolean;
- isSelected?: boolean;
- isPresentational?: boolean;
- }
-
- declare const IconColorInputButton: React__default.ForwardRefExoticComponent<Omit<ColorInputButtonProps, "children" | "labelPosition"> & {
- icon: React__default.FC<IconProps>;
- color?: string | undefined;
- } & React__default.RefAttributes<HTMLButtonElement>>;
- interface ColorInputButtonProps extends Omit<ActionButtonProps, "label"> {
- isOpen: boolean;
- "aria-label"?: string;
- labelPosition: "top" | "start";
- children: React__default.ReactNode;
- }
-
- interface FreehandCanvasProps extends StylingProps, AriaLabelingProps$1 {
- /** The className applicable to the SVG canvas. */
- canvasClassName?: string;
- /** The style applicable to the SVG canvas. */
- canvasStyle?: React__default.CSSProperties;
- /** The ref for the canvas. */
- canvasRef?: React__default.RefObject<HTMLDivElement>;
- /** The className applicable to the footer. */
- footerClassName?: string;
- /** The style applicable to the footer. */
- footerStyle?: React__default.CSSProperties;
- /**
- * How much to soften the stroke's edges.
- *
- * @default 0
- */
- smoothing?: number;
- /**
- * How much to streamline the stroke.
- *
- * @default 0
- */
- streamline?: number;
- /** An easing function to apply to each point's pressure. */
- easing?: (pressure: number) => number;
- /**
- * Whether to simulate pressure based on velocity.
- *
- * @default false
- */
- simulatePressure?: boolean;
- /** Cap, taper and easing for the start of the line. */
- start?: {
- cap?: boolean;
- taper?: number | boolean;
- easing?: (distance: number) => number;
- };
- /** Cap, taper and easing for the end of the line. */
- end?: {
- cap?: boolean;
- taper?: number | boolean;
- easing?: (distance: number) => number;
- };
- /**
- * The width of the stroke.
- *
- * @default 2
- */
- strokeWidth?: number;
- /**
- * The color of the stroke.
- *
- * @default #3A87FD
- */
- strokeColor?: string;
- /**
- * Whether to keep the points within the canvas.
- *
- * @default true
- */
- isBound?: boolean;
- /**
- * Callback for when the points change. This is called on every point change.
- *
- * @param points
- */
- onChange?: (points: number[][][]) => void;
- /**
- * Callback for when the points change has ended. This is called once after
- * the pointerup event. It is recommended to use this callback for performance
- * reasons.
- *
- * @param points
- */
- onChangeEnd?: (points: number[][][]) => void;
- /** The default points to render. */
- defaultValue?: number[][][];
- /**
- * The value of the canvas. This can be used to make the canvas a controlled
- * component.
- */
- value?: number[][][];
- /** The label for the canvas. */
- label?: string;
- /**
- * Whether to enable history for undo/redo.
- *
- * @default false
- */
- enableHistory?: boolean;
- /**
- * Whether the canvas is inline.
- *
- * @default true
- */
- isInline?: boolean;
- /** Whether the canvas is disabled. */
- isDisabled?: boolean;
- /** The placeholder for the canvas. */
- placeholder?: string;
- /** The label for the clear button. */
- clearLabel?: string;
- /** The label for the undo button. */
- undoLabel?: string;
- /** The label for the redo button. */
- redoLabel?: string;
- /** Description for the canvas. */
- description?: string;
- }
-
- declare const FreehandCanvas: React__default.ForwardRefExoticComponent<FreehandCanvasProps & React__default.RefAttributes<HTMLDivElement>>;
-
- declare type TextProps<T extends keyof React__default.JSX.IntrinsicElements = "span"> = StylingProps & React__default.ComponentProps<T> & {
- /**
- * The type of text to render.
- *
- * @default "title"
- */
- type?: "subtitle" | "title" | "label" | "value" | "helper" | "body";
- /**
- * The size of the text.
- *
- * @default "md"
- */
- size?: "sm" | "md" | "lg";
- /** The text to render. Can be a string or a number. */
- children: React__default.ReactNode;
- /**
- * The HTML element to render.
- *
- * @default "span"
- */
- elementType?: React__default.ElementType;
- };
-
- declare const Text$1: React__default.ForwardRefExoticComponent<Pick<TextProps<"span">, "className" | "style" | "dir" | "slot" | "title" | "children" | "autoFocus" | "onFocus" | "onBlur" | "id" | "aria-label" | "aria-labelledby" | "aria-describedby" | "aria-details" | "onDrop" | "onDragStart" | "onDragEnd" | "data-block-id" | "type" | "color" | "size" | "content" | "translate" | "hidden" | "elementType" | "role" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStartCapture" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React__default.RefAttributes<HTMLDivElement>>;
-
- interface TransformProps {
- /** The `className` property assigned to the root element of the component. */
- className?: string;
- /** The `style` property assigned to the root element of the component. */
- style?: React__default.CSSProperties;
- /** The children to render. */
- children: (options: {
- style: React__default.CSSProperties;
- }) => React__default.ReactNode;
- /** Whether the transform is draggable. */
- isDraggable?: boolean;
- /** Whether the transform is resizable. */
- isResizable?: boolean;
- /** Whether the transform is rotatable. */
- isRotatable?: boolean;
- /** Whether the transform is snappable. */
- isSnappable?: boolean;
- /** A callback that will be called when the transform changes. */
- onTransform?: (transform: OnRender) => void;
- /** A callback that will be called when the transform starts. */
- onTransformStart?: (transform: OnRenderStart) => void;
- /** A callback that will be called when the transform ends. */
- onTransformEnd?: (transform: OnRender) => void;
- /** A callback that will be called when the target drag starts. */
- onDragStart?: (e: OnDragStart) => void;
- /** A callback that will be called when the target is dragged. */
- onDrag?: (e: OnDrag) => void;
- /** A callback that will be called when the target drag ends. */
- onDragEnd?: (e: OnDragEnd) => void;
- /** A callback that will be called when the target resize starts. */
- onResizeStart?: (e: OnResizeStart) => void;
- /** A callback that will be called when the target is resized. */
- onResize?: (e: OnResize) => void;
- /** A callback that will be called when the target resize ends. */
- onResizeEnd?: (e: OnResizeEnd) => void;
- /** A callback that will be called when the target rotation starts. */
- onRotateStart?: (e: OnRotateStart) => void;
- /** A callback that will be called when the target is rotated. */
- onRotate?: (e: OnRotate) => void;
- /** A callback that will be called when the target rotation ends. */
- onRotateEnd?: (e: OnRotateEnd) => void;
- /** A callback that will be called when the target is snapped. */
- onSnap?: (e: OnSnap) => void;
- /** A callback that will be called when the child is double clicked. */
- onDoubleClick?: (e: React__default.MouseEvent<HTMLDivElement, MouseEvent>) => void;
- /** A list of selectors relative to which the guidelines will be rendered. */
- elementGuidelines?: string[];
- /**
- * Set directions to show the control box.
- *
- * @default false if rotatable, ["n", "nw", "ne", "s", "se", "sw", "e", "w"] otherwise
- */
- renderDirections?: boolean | ("n" | "nw" | "ne" | "s" | "se" | "sw" | "e" | "w")[];
- /**
- * Whether the anchor should be hidden when dragging.
- *
- * @default true
- */
- hideAnchorOnDrag?: boolean;
- /** The `title` property assigned to the root element of the component. */
- title: string;
- /** The position of the rotation anchor. */
- rotationPosition?: RotationPosition;
- /**
- * Degree angles to snap to rotation
- *
- * @default [ ]
- */
- snapRotationDegrees?: number[];
- /**
- * Snap works if `abs(current rotation - snapRotationDegrees) <
- * snapRotationThreshold`.
- *
- * @default 5
- */
- snapRotationThreshold?: number;
- /** Whether the transform should be updated automatically. */
- autoUpdate?: boolean;
- /** The element ref, selector or element to which the transform will be bound. */
- bound?: React__default.RefObject<HTMLElement> | string | HTMLElement;
- /** The element ref, selector or element that is it's scrollable ancestor. */
- scrollableAncestor?: React__default.RefObject<HTMLElement> | string | HTMLElement;
- /**
- * Whether to prevent bubbling of events like mousedown, touchstart, etc.
- *
- * @default false
- */
- stopPropagation?: boolean;
- /**
- * Whether to call preventDefault on touchstart or mousedown
- *
- * @default true
- */
- preventDefault?: boolean;
- /**
- * The default transformOrigin of the target can be set in advance.
- *
- * @default ""
- */
- transformOrigin?: (string | number)[] | string;
- }
-
- declare const Transform: React__default.ForwardRefExoticComponent<TransformProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface ImageDropZoneProps extends Omit<SharedFileUploadProps, "label" | "variant">, Omit<DropOptions, "ref" | "getDropOperation" | "hasDropButton" | "getDropOperationForPoint">, Omit<ClipboardProps, "getItems" | "onCut" | "onCopy">, Pick<FreehandCanvasProps, "footerClassName" | "footerStyle" | "placeholder" | "clearLabel">, AriaLabelingProps$1 {
- /**
- * The initial image to display. This will be used as the `src` attribute of
- * the `<img>` element. You will be able to choose a new image.
- */
- defaultImageSrc?: string | File;
- /**
- * The image to display. This will be used as the `src` attribute of the
- * `<img>` element and will not be able to be changed from within the
- * component. Basically, this makes the component controlled.
- */
- imageSrc?: string | File;
- /**
- * The alt text to display for the image. This will be used as the `alt`
- * attribute of the `<img>`. element. If no `imageAlt` is provided, the
- * `label` will be used.
- */
- imageAlt?: string;
- /** The label to display for the picker button. */
- pickerButtonLabel?: string;
- /**
- * Whether to show the checkered background behind the image. This is useful
- * when the image has transparency.
- *
- * @default true
- */
- includeCheckeredBackground?: boolean;
- /** Whether the component is inlined. */
- isInline?: boolean;
- /** The class name to apply to the picker button. */
- pickerButtonClassName?: string;
- /** The style to apply to the picker button. */
- pickerButtonStyle?: React__default.CSSProperties;
- /** The class name to apply to the label. */
- labelClassName?: string;
- /** The style to apply to the label. */
- labelStyle?: React__default.CSSProperties;
- }
-
- declare const ImageDropZone: React__default.ForwardRefExoticComponent<ImageDropZoneProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface PreviewProps extends StylingProps, AriaLabelingProps$1 {
- /**
- * Whether the preview should be displayed inline or not. This is just a
- * visual change, the component will still behave the same.
- *
- * @default true
- */
- isInline?: boolean;
- /**
- * The image to display in the preview. This can be a URL or a base64 encoded
- * string.
- */
- imageSrc?: string;
- /** The alt text for the image. */
- imageAlt?: string;
- /** The SVG to display in the preview. This can be a React element or a string. */
- svgSrc?: string | React__default.ReactElement;
- /** Whether the preview should be disabled or not. */
- isDisabled?: boolean;
- /** The text to display in the preview. */
- textValue?: string;
- /** The style of the text. */
- textStyle?: React__default.CSSProperties;
- /**
- * This is fired when the `actionButtons` are not passed and you trigger a
- * `click` event on the preview. In case you have passed `actionButtons`, this
- * is not fired as focus shifts to the action buttons.
- */
- onPress?: PressProps["onPress"];
- /**
- * The callback to be called when the delete button is clicked. When passed,
- * the delete button is displayed.
- */
- onDelete?: ActionButtonProps["onPress"];
- /**
- * The label to be used for the delete button. This is used for accessibility
- * purposes.
- */
- deleteAriaLabel?: string;
- /** The callback to be called when the preview is clicked. */
- addAriaLabel?: string;
- /**
- * The accent variable represents the type of accent color used in the
- * application. It can have one of the following values:
- *
- * - "theme": Represents the accent color defined by the current application
- * theme.
- * - "positive": Represents a positive accent color that doesn't change with
- * theme.
- *
- * @default "theme"
- */
- accent?: "theme" | "positive";
- }
-
- declare const Preview: React__default.ForwardRefExoticComponent<PreviewProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface RadioGroupProps extends StylingProps, Omit<AriaRadioGroupProps, "description" | "errorMessage" | "isRequired" | "isInvalid" | "validate" | "validationBehavior" | "validationState"> {
- /**
- * The position of the label relative to the input.
- *
- * @default top
- */
- labelPosition?: "top" | "start";
- /**
- * The list of items to render in the radio group. Items have the following
- * shape:
- *
- * ```ts
- * export type ListOption = {
- * id: string;
- * label: string;
- * description?: string;
- * icon?: React.FC<IconProps>;
- * };
- * ```
- */
- items: ListOption[];
- /**
- * Render item option
- *
- * @typedef {Object} RenderItemOptions
- * @property {boolean} isFocusVisible - Whether the focus ring is visible.
- * @property {boolean} isFocused - Whether the option is focused.
- * @property {boolean} isSelected - Whether the option is selected.
- * @property {boolean} isHovered - Whether the option is hovered.
- * @property {boolean} isDisabled - Whether the option is disabled.
- */
- /**
- * The custom render function for the radio group options.
- *
- * @param {ListOption} item The item to render.
- * @param {RenderItemOptions} options The options for rendering the item.
- */
- renderOption?: (item: ListOption, options: {
- isFocusVisible: boolean;
- isFocused: boolean;
- isSelected: boolean;
- isHovered: boolean;
- isDisabled: boolean;
- optionLabelPosition: "start" | "end";
- isReadOnly?: boolean;
- }) => React__default.ReactNode;
- /** The class name for the group container. */
- optionsContainerClassName?: string;
- /** The style for the group container. */
- optionsContainerStyle?: React__default.CSSProperties;
- /** The ids of the items that are disabled. */
- disabledValues?: string[];
- /**
- * The position of the label of individual radio buttons.
- *
- * @default end
- */
- optionLabelPosition?: "start" | "end";
- /** The className applicable to the label. */
- optionClassName?: string;
- /** The style applicable to the label. */
- optionStyle?: React__default.CSSProperties;
- }
-
- declare const RadioGroup: React__default.ForwardRefExoticComponent<RadioGroupProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface ModalProps extends OverlayTriggerProps$1 {
- }
- interface ModalContentProps extends Omit<AriaModalOverlayProps, "isDismissable" | "isKeyboardDismissDisabled">, StylingProps {
- /**
- * The contents of the modal. Can be a React node or a function that returns a
- * React node.
- */
- children: React__default.ReactNode | ((props: {
- close: () => void;
- }) => React__default.ReactNode);
- /**
- * The container element for the modal. By default, the modal is rendered as a
- * child of the body element.
- *
- * @default document.body
- */
- portalContainer?: HTMLElement;
- /**
- * Whether to disable the animation for the modal. This is useful when you
- * want to render one modal after another without the animation.
- *
- * @default false
- */
- disableAnimation?: boolean;
- /**
- * Whether the modal should be rendered as a drawer. This will render the
- * modal with a transparent background and no border at the bottom. The `auto`
- * value will render the modal as a drawer on mobile and as a dialog on
- * desktop and tablet.
- *
- * @default false
- */
- enableDrawer?: boolean | "auto";
- /**
- * Specifies if the component is dismissable or not. If the value is a
- * function, it will be called with a boolean indicating if the modal is
- * rendered as a drawer or not.
- *
- * @default true
- */
- isDismissable?: boolean | ((isDrawer: boolean) => boolean);
- /**
- * Determines if keyboard dismissal is disabled. If the value is a function,
- * it will be called with a boolean indicating if the modal is rendered as a
- * drawer or not.
- *
- * @default false
- */
- isKeyboardDismissDisabled?: boolean | ((isDrawer: boolean) => boolean);
- }
-
- declare const Modal: React__default.FC<ModalProps>;
-
- declare const ModalContent: React__default.FC<ModalContentProps>;
-
- declare const ModalTrigger: React__default.FC;
-
- declare const ModalClose: React__default.FC;
-
- interface MessageFormatProps {
- /**
- * By default `<MessageFormat>` will render the formatted string into a
- * `<React.Fragment>`. If you need to customize rendering, you can either wrap
- * it with another React element (recommended), specify a different tagName
- * (e.g., 'div')
- */
- elementType?: React__default.ElementType | "div" | "span";
- /** The id of the message to format. */
- id: string;
- /** The default message to use if the message id is not found. */
- defaultMessage?: string;
- }
-
- declare const MessageFormat: React__default.FC<MessageFormatProps>;
-
- interface GroupProps extends StylingProps, AriaLabelingProps$1 {
- /**
- * The `role` property specifies the accessibility `role` for the group. By
- * default, it is set to 'group'. If the contents of the group are important
- * enough to be included in the page table of contents, use 'region'. If the
- * group is visual only and does not represent a semantic grouping of
- * controls, use 'presentation'.
- *
- * @default group
- */
- role?: "group" | "region" | "presentation";
- /** Whether the group is disabled. */
- isDisabled?: boolean;
- /** The children to render. */
- children: React__default.ReactNode;
- }
-
- declare const Group: React__default.ForwardRefExoticComponent<GroupProps & React__default.RefAttributes<HTMLDivElement>>;
-
- declare type SprinkleProps = Parameters<Sprinkles>[0];
- interface BoxProps extends Pick<StylingProps, "data-block-id">, Omit<React__default.ComponentPropsWithoutRef<"div">, "color">, SprinkleProps {
- /**
- * The HTML element to use for the box.
- *
- * @default "div"
- */
- elementType?: string;
- }
-
- declare const Box: React__default.ForwardRefExoticComponent<BoxProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface ColorPresetInlineInputProps extends Omit<RadioGroupProps, "items" | "disabledValues"> {
- items: ColorPreset$1[];
- }
-
- declare const ColorPresetInlineInput: React__default.ForwardRefExoticComponent<ColorPresetInlineInputProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface ToolbarProps extends StylingProps, AriaToolbarProps {
- children: React__default.ReactNode;
- /**
- * Identifies the element (or elements) whose contents or presence are
- * controlled by the current element.
- */
- "aria-controls"?: string;
- }
-
- declare const Toolbar: React__default.ForwardRefExoticComponent<ToolbarProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface ToggleIconButtonProps extends StylingProps, Omit<ToggleProps, "children">, Omit<ToggleButtonProps, "size" | "iconStart" | "label"> {
- /**
- * The available sizes for a variable.
- *
- * @default "md"
- */
- size?: "xxs" | "xs" | "sm" | "md" | "lg";
- /** Represents the variant of a component. */
- variant?: "primary" | "secondary" | "tertiary" | "toolbar";
- /**
- * The icon to be displayed on the button. You can pass an object with
- * `selected` and `unselected` keys to display different icons based on the
- * state of the button.
- */
- icon: React__default.FC<IconProps> | {
- selected: React__default.FC<IconProps>;
- unselected: React__default.FC<IconProps>;
- };
- /** Indicates whether focusing should be prevented on press. */
- preventFocusOnPress?: boolean;
- }
-
- declare const ToggleIconButton: React__default.ForwardRefExoticComponent<ToggleIconButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
-
- interface MentionableUser {
- id: string;
- name: string;
- displayName: string;
- avatar?: AvatarProps;
- description?: string;
- }
- interface EditorHandle {
- setCaretPosition: (index: number) => void;
- }
- interface EditorProps extends StylingProps, AriaLabelingProps$1 {
- /**
- * The function to be called when `Enter` key is pressed or Save button is
- * clicked.
- */
- onSave?: (value: string) => void;
- /**
- * The function to be called when Cancel button is clicked. If not provided,
- * the Cancel button will not be rendered.
- */
- onCancel?: () => void;
- /** The default value of the editor. */
- defaultValue?: string;
- /** The value of the editor. */
- value?: string;
- /**
- * The function to be called when the value of the editor changes.
- *
- * @param value
- */
- onChange?: (value: string) => void;
- /** Whether the editor is disabled. This includes both input and save button. */
- isDisabled?: boolean;
- /** Whether saving it disabled. Ths disables only save button. */
- isSaveDisabled?: boolean;
- /**
- * Indicates whether rich text is enabled or not.
- *
- * @default true
- */
- enableRichText?: boolean;
- /** The placeholder text to be displayed when the editor is empty. */
- placeholder?: string;
- /**
- * The variant of the editor.
- *
- * @default default
- */
- variant?: "default" | "minimal";
- /** Whether the editor is inline or not. */
- isInline?: boolean;
- /** Specifies whether spell checking is enabled or disabled. */
- spellCheck?: boolean;
- /**
- * Optional property that represents the ARIA label for the submit button.
- * This property is used to provide an accessible label for the button, which
- * is read by screen readers to assist visually impaired users.
- *
- * @default Save
- */
- submitButtonAriaLabel?: string;
- /**
- * The React node representing the icon to be displayed on the submit button.
- *
- * @default ArrowUpCircleFilledIcon
- */
- submitButtonIcon?: React__default.FC<IconProps>;
- /**
- * Optional property that represents the ARIA label for the cancel button.
- *
- * @default Cancel
- */
- cancelButtonAriaLabel?: string;
- /**
- * The name of the avatar. The avatar is visible when `variant` is set to
- * `minimal` and `enableRichText` is set to `false`.
- */
- avatarName?: string;
- /**
- * The ARIA label for the editable content. In case of rich text, this label
- * is used to provide an accessible label for the contenteditable element,
- * which is read by screen readers to assist visually impaired users. In case
- * of plain text, this label is used to provide an accessible label for the
- * textarea element.
- *
- * @default Editing Area
- */
- editableContentAriaLabel?: string;
- /**
- * An optional array of mentionable users. Mention feature is only available
- * when `enableRichText` is set to `true` and this prop is provided.
- *
- * ```tsx
- * type MentionableUser = {
- * id: string;
- * name: string;
- * displayName: string;
- * avatar?: AvatarProps;
- * description?: string;
- * };
- * ```
- */
- mentionableUsers?: MentionableUser[];
- /**
- * The maximum number of mentionable users to be displayed in the suggestions.
- * This prop is only used when `mentionableUsers` is provided.
- *
- * @default 10
- */
- maxMentionableUsersSuggestions?: number;
- /** Footer button represents the buttons that are displayed in the footer. */
- footerButtons?: ({
- type: "action";
- props: Omit<ActionIconButtonProps, "size" | "variant">;
- } | {
- type: "toggle";
- props: Omit<ToggleIconButtonProps, "size" | "variant">;
- })[];
- /** The imperative handle for manipulating editor. */
- editorHandle?: React__default.RefObject<EditorHandle>;
- /**
- * Whether to clear the editor value when the editor is saved.
- *
- * @default false
- */
- clearOnSave?: boolean;
- /**
- * Whether to clear the editor value when the cancel button is clicked.
- *
- * @default false
- */
- clearOnCancel?: boolean;
- /**
- * Whether to autofocus the editor when it is mounted.
- *
- * @default false
- */
- autoFocus?: boolean;
- }
-
- declare const Editor: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<EditorProps & React__default.RefAttributes<HTMLDivElement>>>;
-
- interface ScrollControlButtonProps extends StylingProps, Pick<ActionButtonProps, "label"> {
- /**
- * The ref to the scrollable element.
- *
- * @default document.body
- */
- scrollRef?: React__default.RefObject<HTMLElement>;
- /**
- * Indicates whether the button should be hidden when the keyboard is being
- * used.
- *
- * @default false
- */
- hideForKeyboard?: boolean;
- /**
- * The delay in milliseconds before the button is hidden when the scrolling
- * stops.
- *
- * @default 1500
- */
- delay?: number;
- /**
- * Indicates whether the scroll should be smooth.
- *
- * @default true
- */
- smoothScroll?: boolean;
- }
-
- declare const ScrollControlButton: React__default.ForwardRefExoticComponent<ScrollControlButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
-
- interface TransitionProps extends StylingProps {
- isMounted: boolean;
- transitions: UseTransitionProps;
- elementType?: keyof React__default.ReactHTML;
- children: React__default.ReactNode;
- }
-
- declare const Transition: React__default.ForwardRefExoticComponent<TransitionProps & React__default.RefAttributes<HTMLElement>>;
-
- interface AlertDialogProps extends StylingProps {
- /**
- * The title of the dialog. This is the main heading of the dialog and is
- * displayed at the top of the dialog.
- */
- title: string;
- /**
- * The message of the dialog. This is the main content of the dialog and is
- * displayed below the title.
- */
- message?: React__default.ReactNode;
- /**
- * The label for the cancel button. This is the text that is displayed on the
- * button that allows the user to cancel the dialog.
- */
- cancelLabel?: string;
- /**
- * The label for the confirm button. This is the text that is displayed on the
- * button that allows the user to confirm the dialog.
- */
- primaryActionLabel?: string;
- /**
- * The function that is called when the user confirms the dialog. This is
- * called when the user clicks the primary action button.
- */
- onPrimaryAction?: () => void;
- /**
- * The function that is called when the user cancels the dialog. This is
- * called when the user clicks the cancel button or the close button.
- */
- onCancel?: () => void;
- /** The button that should be focused when the dialog is opened. */
- autoFocusButton?: "primary" | "cancel";
- /** Whether the primary action button should be disabled. */
- isPrimaryActionDisabled?: boolean;
- /**
- * The props that are passed to the text input. If this is provided, a text
- * input will be displayed at the bottom of the dialog.
- */
- textInputProps?: TextInputProps;
- /**
- * The icon that is displayed at the top of the dialog. This is typically used
- * to display an icon that represents the type of alert that is being shown.
- */
- icon?: React__default.FC<IconProps>;
- /** The color of the icon. This is the color that is used to fill the icon. */
- iconColor?: string;
- /**
- * Whether the close button should be displayed in the top end corner of the
- * dialog. If this is `true`, a close button will be displayed. If this is
- * `false`, no close button will be displayed.
- *
- * @default true
- */
- showCloseButton?: boolean;
- }
-
- declare const AlertDialog: React__default.ForwardRefExoticComponent<AlertDialogProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface MarkdownProps extends StylingProps {
- /** The markdown to render. */
- children: string;
- /** The flag to show the caret at the end */
- showCaret?: boolean;
- }
-
- declare const Markdown: React__default.ForwardRefExoticComponent<MarkdownProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface AudioPlayerProps extends StylingProps, AriaLabelingProps$1 {
- /**
- * The sources of the audio file. The `url` is the URL of the audio file, and
- * the `type` is the MIME type of the audio file.
- *
- * ```tsx
- * <AudioPlayer
- * sources={[
- * { url: "/sound.mp3", type: "audio/mpeg" },
- * { url: "/sound.ogg", type: "audio/ogg" },
- * ]}
- * />
- * ```
- */
- sources: {
- url: string;
- type: string;
- }[];
- /**
- * The size of the audio player.
- *
- * @default "lg"
- */
- size?: "sm" | "lg";
- }
-
- declare const AudioPlayer: React__default.ForwardRefExoticComponent<AudioPlayerProps & React__default.RefAttributes<HTMLDivElement>>;
-
- /**
- * A hook that creates an IntersectionObserver and observes a target element.
- *
- * @example
- * ```tsx
- * import { useIntersectionObserver } from "@baseline-ui/core";
- *
- * const MyComponent = () => {
- * const ref = useRef(null);
- *
- * const onIntersect = (entry) => {
- * console.log(entry);
- * };
- *
- * useIntersectionObserver({ ref, onIntersect });
- *
- * return <div ref={ref}>Hello world</div>;
- * };
- * ```;
- *
- * @param {IntersectionObserverOptions} options - The options for the
- * IntersectionObserver.
- * @param {React.RefObject<HTMLElement>} options.ref - The ref of the target
- * element to observe.
- * @param {(entry: IntersectionObserverEntry) => void} options.onIntersect - The
- * function to call when the target element intersects the root element.
- * @param {boolean} options.isDisabled - Whether the IntersectionObserver should
- * be disabled.
- * @param {number | number[]} options.threshold - The threshold(s) at which to
- * trigger the onIntersect function.
- * @param {string} options.rootMargin - The margin around the root element.
- * @param {React.RefObject<HTMLElement>} options.root - The ref of the root
- * element to observe.
- */
- declare function useIntersectionObserver({ ref, onIntersect, isDisabled, threshold, rootMargin, root, }: IntersectionObserverOptions): void;
- interface IntersectionObserverOptions {
- ref: React__default.RefObject<HTMLElement>;
- onIntersect: (entry: IntersectionObserverEntry) => void;
- root?: React__default.RefObject<HTMLElement>;
- rootMargin?: string;
- threshold?: number;
- isDisabled?: boolean;
- }
-
- /**
- * A hook that observes the size changes of a DOM element using the
- * ResizeObserver API.
- *
- * @example
- * ```tsx
- * const ref = useRef<HTMLDivElement>(null);
- *
- * const { size } = useResizeObserver({
- * ref,
- * onResize: (entry) => {
- * // do something
- * },
- * isDisabled: false,
- * });
- * ```;
- *
- * @param {Object} options - The options object.
- * @param {React.RefObject<HTMLElement>} options.ref - The ref object that
- * points to the observed element.
- * @param {Function} options.onResize - The callback function that is called
- * when the element is resized.
- * @param {boolean} options.isDisabled - A flag that indicates whether the
- * observer is disabled.
- * @returns {Object} An object that contains the size of the observed element.
- */
- declare function useResizeObserver({ ref, onResize, isDisabled, }: ResizeObserverOptions): {
- size: {
- width: number;
- height: number;
- } | undefined;
- };
- interface ResizeObserverOptions {
- ref: React__default.RefObject<HTMLElement>;
- onResize?: (entry: ResizeObserverEntry) => void;
- isDisabled?: boolean;
- }
-
- /**
- * A custom hook that loads an image and returns its loading state and props.
- *
- * @example
- * ```tsx
- * const { isLoaded, hasError, isLoading, imgProps } = useImage({
- * src: "https://via.placeholder.com/150",
- * alt: "Placeholder image",
- * });
- * ```;
- *
- * @param {Object} options - The options object.
- * @param {string} options.src - The image source URL.
- * @param {string} options.alt - The image alt text.
- * @returns {Object} An object containing the image loading state and props.
- * @returns {boolean} IsLoaded - Whether the image has loaded.
- * @returns {boolean} HasError - Whether there was an error loading the image.
- * @returns {boolean} IsLoading - Whether the image is currently loading.
- * @returns {Object} ImgProps - The image props to be passed to the `img`
- * element.
- * @returns {string} ImgProps.src - The image source URL, or `undefined` if the
- * image hasn't loaded yet.
- * @returns {string} ImgProps.alt - The image alt text.
- */
- declare function useImage({ src, alt }: {
- src?: string;
- alt: string;
- }): {
- isLoaded: boolean;
- hasError: boolean;
- isLoading: boolean;
- imgProps: {
- src?: string;
- alt: string;
- };
- };
-
- /**
- * A hook that provides undo and redo functionality for a given state.
- *
- * @example
- * ```tsx
- * const { state, push, undo, redo, pastStates, futureStates, canUndo, canRedo } = useUndoRedo({
- * onAction: (state, action) => {
- * // do something
- * },
- * });
- *
- * // push a new state
- * push({ foo: "bar" });
- *
- * // undo the last state
- * undo();
- *
- * // redo the last state
- * redo();
- * ```;
- *
- * @template T The type of the state object.
- * @param initialState The initial state object.
- * @param options Additional options for the hook.
- * @param options.isDisabled Whether the undo/redo functionality should be
- * disabled.
- * @param options.onAction A callback function that is called whenever an undo
- * or redo action is performed.
- * @returns An object containing the current state, undo and redo functions, and
- * other related properties.
- */
- declare const useUndoRedo: <T>(initialState: T | undefined, { isDisabled, onAction, }: {
- isDisabled?: boolean | undefined;
- onAction?: ((state: T, action: "UNDO" | "REDO") => void) | undefined;
- }) => {
- state: T;
- push: (newState: T) => void;
- undo: () => void;
- redo: () => void;
- pastStates: T[];
- futureStates: T[];
- canUndo: boolean;
- canRedo: boolean;
- };
-
- /**
- * This hook returns true if the component is being rendered for the first time.
- * This is useful for avoiding side effects on the first render inside of
- * useEffect.
- *
- * @example
- * ```tsx
- * const isFirstRender = useIsFirstRender();
- *
- * useEffect(() => {
- * if (isFirstRender) return;
- * // do something
- * return () => {
- * // do something on unmount
- * };
- * }, [isFirstRender]);
- * ```;
- *
- * @returns Whether or not the component is being rendered for the first time
- */
- declare function useIsFirstRender(): boolean;
-
- /**
- * A hook that provides internationalization functionality. It returns a
- * function to format messages and the current locale. The hook can be used with
- * or without a messages object. If no messages object is provided, the hook
- * will use the messages provided by the `I18nProvider`. If a messages object is
- * provided, the hook will use those messages instead of the ones provided by
- * the `I18nProvider`.
- *
- * @example
- * ```tsx
- * import { useI18n } from "@baseline-ui/core";
- *
- * const messages = {
- * en: { hello: "Hello" },
- * fr: { hello: "Bonjour" },
- * };
- *
- * const MyComponent = () => {
- * const { formatMessage, locale } = useI18n(messages);
- *
- * return (
- * <div>
- * <p>{formatMessage("hello")}</p>
- * <p>{locale}</p>
- * </div>
- * )};
- * ```;
- *
- * @template T - A type that represents the shape of the translation messages.
- * @param {Object<string, T>} [messages] - An optional object containing
- * translation messages for different languages.
- * @returns {I18nResult<T>} An object containing a function to format messages
- * and the current locale.
- */
- declare function useI18n<T extends Record<string, string>>(messages?: Record<string, T>): I18nResult<T>;
- interface I18nResult<T extends LocalizedStrings[keyof LocalizedStrings]> {
- formatMessage: (id: keyof T | MessageDescriptor, values?: Record<string, any>) => string;
- locale: Locale;
- }
- interface MessageDescriptor {
- id: string;
- defaultMessage?: string;
- }
- /**
- * Defines a set of messages for use with the `useI18n` hook.
- *
- * @param messages An object containing message descriptors.
- * @returns An object containing the message descriptors with their keys as
- * property names.
- */
- declare const defineMessages: <T extends Record<string, {
- id: string;
- }>>(messages: T) => T;
-
- /**
- * A hook that uses a MutationObserver to watch for changes to the DOM.
- *
- * @example
- * ```tsx
- * const targetRef = React.useRef<HTMLDivElement>(null);
- *
- * useMutationObserver(targetRef.current, { attributes: true }, (mutations) => {
- * console.log(mutations);
- * // do something with the mutations
- * // ...
- * });
- * ```;
- *
- * @param target The element to observe for changes.
- * @param options The options to pass to the MutationObserver.
- * @param callback The callback to call when a mutation occurs.
- * @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
- */
- declare function useMutationObserver(target: Element | null, options: MutationObserverInit, callback: MutationCallback): MutationObserver | null;
-
- declare type SetValue<T> = Dispatch<SetStateAction<T>>;
- /**
- * A hook to persist a value to localStorage.
- *
- * @example
- * ```tsx
- * function MyComponent() {
- * const [value, setValue] = useLocalStorage("my-value", "default-value");
- * return (
- * <input value={value} onChange={e => setValue(e.target.value)} />
- * );
- * }
- * ```;
- *
- * @param key The localStorage key to use
- * @param initialValue The initial value to use if the key is not found in
- * localStorage
- */
- declare function useLocalStorage<T>(key: string, initialValue: T): [T, SetValue<T>];
-
- /**
- * A hook that provides text selection functionality for a given HTML element.
- *
- * ```jsx
- * function MyComponent() {
- * const ref = useRef();
- * const [selection, setSelection] = useState();
- *
- * useTextSelection({
- * ref,
- * onSelectionChange: setSelection,
- * });
- *
- * return (
- * <div ref={ref}>
- * <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
- * </div>
- * );
- * }
- * ```
- */
- declare function useTextSelection({ ref, onSelectionChange, onSelectionEnd, isDisabled, }: TextSelectionProps): void;
- interface TextSelectionProps {
- ref: React__default.RefObject<HTMLElement>;
- onSelectionChange: (selection: Selection) => void;
- onSelectionEnd?: (selection: Selection) => void;
- isDisabled?: boolean;
- }
-
- /**
- * Returns the current device type based on the window width.
- *
- * ```jsx
- * const device = useDevice();
- *
- * if (device === "mobile") {
- * return <MobileComponent />;
- * } else if (device === "tablet") {
- * return <TabletComponent />;
- * } else {
- * return <DesktopComponent />;
- * }
- * ```
- *
- * @param element - The element to use to get the owner window. Defaults to
- * `document.body`.
- */
- declare function useDevice(element?: Element | null | undefined): "tablet" | "desktop" | "mobile";
-
- /**
- * Custom hook for accessing PortalContainerProviderContext. This hook allows
- * components to either use a specified portal container or fallback to a
- * default provided via context.
- *
- * @param _portalContainer - An optional HTML element that can be specified as
- * an override.
- * @returns The portal container element where components should be rendered,
- * either the overridden container, one from context or undefined.
- */
- declare function usePortalContainer(_portalContainer?: HTMLElement): HTMLElement | undefined;
-
- declare const Core_Accordion: typeof Accordion;
- declare const Core_AccordionItem: typeof AccordionItem;
- type Core_AccordionItemProps = AccordionItemProps;
- type Core_AccordionProps = AccordionProps;
- declare const Core_ActionButton: typeof ActionButton;
- type Core_ActionButtonProps = ActionButtonProps;
- declare const Core_ActionIconButton: typeof ActionIconButton;
- type Core_ActionIconButtonProps = ActionIconButtonProps;
- declare const Core_AlertDialog: typeof AlertDialog;
- type Core_AlertDialogProps = AlertDialogProps;
- declare const Core_AudioPlayer: typeof AudioPlayer;
- type Core_AudioPlayerProps = AudioPlayerProps;
- declare const Core_Avatar: typeof Avatar;
- type Core_AvatarProps = AvatarProps;
- type Core_BlockProps = BlockProps;
- declare const Core_Box: typeof Box;
- type Core_BoxProps = BoxProps;
- declare const Core_Checkbox: typeof Checkbox;
- type Core_CheckboxProps = CheckboxProps;
- declare const Core_ColorInput: typeof ColorInput;
- type Core_ColorInputProps = ColorInputProps;
- declare const Core_ColorPresetInlineInput: typeof ColorPresetInlineInput;
- type Core_ColorPresetInlineInputProps = ColorPresetInlineInputProps;
- declare const Core_ColorSwatch: typeof ColorSwatch;
- type Core_ColorSwatchProps = ColorSwatchProps;
- declare const Core_DateFormat: typeof DateFormat;
- type Core_DateFormatProps = DateFormatProps;
- declare const Core_Dialog: typeof Dialog;
- type Core_DialogProps = DialogProps;
- declare const Core_DialogTitle: typeof DialogTitle;
- type Core_DialogTitleProps = DialogTitleProps;
- declare const Core_DomNodeRenderer: typeof DomNodeRenderer;
- type Core_DomNodeRendererProps = DomNodeRendererProps;
- declare const Core_Drawer: typeof Drawer;
- type Core_DrawerProps = DrawerProps;
- declare const Core_Editor: typeof Editor;
- type Core_EditorHandle = EditorHandle;
- type Core_EditorProps = EditorProps;
- declare const Core_FileUpload: typeof FileUpload;
- type Core_FileUploadProps = FileUploadProps;
- declare const Core_FreehandCanvas: typeof FreehandCanvas;
- type Core_FreehandCanvasProps = FreehandCanvasProps;
- declare const Core_Group: typeof Group;
- type Core_GroupProps = GroupProps;
- declare const Core_I18nProvider: typeof I18nProvider;
- type Core_I18nResult<T extends LocalizedStrings[keyof LocalizedStrings]> = I18nResult<T>;
- declare const Core_IconColorInputButton: typeof IconColorInputButton;
- declare const Core_ImageDropZone: typeof ImageDropZone;
- type Core_ImageDropZoneProps = ImageDropZoneProps;
- declare const Core_InlineAlert: typeof InlineAlert;
- type Core_InlineAlertProps = InlineAlertProps;
- declare const Core_Link: typeof Link;
- type Core_LinkProps = LinkProps;
- declare const Core_ListBox: typeof ListBox;
- type Core_ListBoxProps = ListBoxProps;
- type Core_ListOption = ListOption;
- declare const Core_Markdown: typeof Markdown;
- type Core_MarkdownProps = MarkdownProps;
- declare const Core_Menu: typeof Menu;
- type Core_MenuItem = MenuItem;
- type Core_MenuProps = MenuProps;
- type Core_MessageDescriptor = MessageDescriptor;
- declare const Core_MessageFormat: typeof MessageFormat;
- type Core_MessageFormatProps = MessageFormatProps;
- declare const Core_Modal: typeof Modal;
- declare const Core_ModalClose: typeof ModalClose;
- declare const Core_ModalContent: typeof ModalContent;
- type Core_ModalContentProps = ModalContentProps;
- type Core_ModalProps = ModalProps;
- declare const Core_ModalTrigger: typeof ModalTrigger;
- declare const Core_NumberFormat: typeof NumberFormat;
- type Core_NumberFormatProps = NumberFormatProps;
- declare const Core_NumberInput: typeof NumberInput;
- type Core_NumberInputProps = NumberInputProps;
- declare const Core_Pagination: typeof Pagination;
- type Core_PaginationProps = PaginationProps;
- declare const Core_Popover: typeof Popover;
- declare const Core_PopoverContent: typeof PopoverContent;
- type Core_PopoverContentProps = PopoverContentProps;
- type Core_PopoverProps = PopoverProps;
- declare const Core_PopoverTrigger: typeof PopoverTrigger;
- type Core_PopoverTriggerProps = PopoverTriggerProps;
- declare const Core_Portal: typeof Portal;
- declare const Core_PortalContainerProvider: typeof PortalContainerProvider;
- type Core_PortalProps = PortalProps;
- declare const Core_Preview: typeof Preview;
- type Core_PreviewProps = PreviewProps;
- declare const Core_ProgressBar: typeof ProgressBar;
- type Core_ProgressBarProps = ProgressBarProps;
- declare const Core_ProgressSpinner: typeof ProgressSpinner;
- type Core_ProgressSpinnerProps = ProgressSpinnerProps;
- declare const Core_RadioGroup: typeof RadioGroup;
- type Core_RadioGroupProps = RadioGroupProps;
- declare const Core_Reaction: typeof Reaction;
- type Core_ReactionProps = ReactionProps;
- declare const Core_ScrollControlButton: typeof ScrollControlButton;
- type Core_ScrollControlButtonProps = ScrollControlButtonProps;
- declare const Core_SearchInput: typeof SearchInput;
- type Core_SearchInputProps = SearchInputProps;
- declare const Core_Select: typeof Select;
- type Core_SelectProps = SelectProps;
- declare const Core_Separator: typeof Separator;
- type Core_SeparatorProps = SeparatorProps;
- declare const Core_Slider: typeof Slider;
- type Core_SliderProps = SliderProps;
- type Core_StylingProps = StylingProps;
- declare const Core_Switch: typeof Switch;
- type Core_SwitchProps = SwitchProps;
- declare const Core_TabItem: typeof TabItem;
- type Core_TabItemProps = TabItemProps;
- declare const Core_Tabs: typeof Tabs;
- type Core_TabsProps = TabsProps;
- declare const Core_TagGroup: typeof TagGroup;
- type Core_TagGroupProps = TagGroupProps;
- declare const Core_TextInput: typeof TextInput;
- type Core_TextInputProps = TextInputProps;
- type Core_TextProps<T extends keyof React__default.JSX.IntrinsicElements = "span"> = TextProps<T>;
- declare const Core_ThemeProvider: typeof ThemeProvider;
- type Core_ThemeProviderProps = ThemeProviderProps;
- declare const Core_ToggleButton: typeof ToggleButton;
- type Core_ToggleButtonProps = ToggleButtonProps;
- declare const Core_ToggleIconButton: typeof ToggleIconButton;
- type Core_ToggleIconButtonProps = ToggleIconButtonProps;
- declare const Core_Toolbar: typeof Toolbar;
- type Core_ToolbarProps = ToolbarProps;
- declare const Core_Tooltip: typeof Tooltip;
- type Core_TooltipProps = TooltipProps;
- declare const Core_Transform: typeof Transform;
- type Core_TransformProps = TransformProps;
- declare const Core_Transition: typeof Transition;
- type Core_TransitionProps = TransitionProps;
- declare const Core_defineMessages: typeof defineMessages;
- declare const Core_isInsideOverlayContent: typeof isInsideOverlayContent;
- declare const Core_useCollator: typeof useCollator;
- declare const Core_useDateFormatter: typeof useDateFormatter;
- declare const Core_useDevice: typeof useDevice;
- declare const Core_useI18n: typeof useI18n;
- declare const Core_useImage: typeof useImage;
- declare const Core_useIntersectionObserver: typeof useIntersectionObserver;
- declare const Core_useIsFirstRender: typeof useIsFirstRender;
- declare const Core_useLocalStorage: typeof useLocalStorage;
- declare const Core_useMutationObserver: typeof useMutationObserver;
- declare const Core_useNumberFormatter: typeof useNumberFormatter;
- declare const Core_usePortalContainer: typeof usePortalContainer;
- declare const Core_useResizeObserver: typeof useResizeObserver;
- declare const Core_useTextSelection: typeof useTextSelection;
- declare const Core_useUndoRedo: typeof useUndoRedo;
- declare const Core_useUserPreferences: typeof useUserPreferences;
- declare namespace Core {
- export { Core_Accordion as Accordion, Core_AccordionItem as AccordionItem, type Core_AccordionItemProps as AccordionItemProps, type Core_AccordionProps as AccordionProps, Core_ActionButton as ActionButton, type Core_ActionButtonProps as ActionButtonProps, Core_ActionIconButton as ActionIconButton, type Core_ActionIconButtonProps as ActionIconButtonProps, Core_AlertDialog as AlertDialog, type Core_AlertDialogProps as AlertDialogProps, Core_AudioPlayer as AudioPlayer, type Core_AudioPlayerProps as AudioPlayerProps, Core_Avatar as Avatar, type Core_AvatarProps as AvatarProps, type Core_BlockProps as BlockProps, Core_Box as Box, type Core_BoxProps as BoxProps, Core_Checkbox as Checkbox, type Core_CheckboxProps as CheckboxProps, Core_ColorInput as ColorInput, type Core_ColorInputProps as ColorInputProps, type ColorPreset$1 as ColorPreset, Core_ColorPresetInlineInput as ColorPresetInlineInput, type Core_ColorPresetInlineInputProps as ColorPresetInlineInputProps, Core_ColorSwatch as ColorSwatch, type Core_ColorSwatchProps as ColorSwatchProps, Core_DateFormat as DateFormat, type Core_DateFormatProps as DateFormatProps, Core_Dialog as Dialog, type Core_DialogProps as DialogProps, Core_DialogTitle as DialogTitle, type Core_DialogTitleProps as DialogTitleProps, Core_DomNodeRenderer as DomNodeRenderer, type Core_DomNodeRendererProps as DomNodeRendererProps, Core_Drawer as Drawer, type Core_DrawerProps as DrawerProps, Core_Editor as Editor, type Core_EditorHandle as EditorHandle, type Core_EditorProps as EditorProps, Core_FileUpload as FileUpload, type Core_FileUploadProps as FileUploadProps, Core_FreehandCanvas as FreehandCanvas, type Core_FreehandCanvasProps as FreehandCanvasProps, Core_Group as Group, type Core_GroupProps as GroupProps, Core_I18nProvider as I18nProvider, type I18nProviderProps$1 as I18nProviderProps, type Core_I18nResult as I18nResult, Core_IconColorInputButton as IconColorInputButton, Core_ImageDropZone as ImageDropZone, type Core_ImageDropZoneProps as ImageDropZoneProps, Core_InlineAlert as InlineAlert, type Core_InlineAlertProps as InlineAlertProps, Core_Link as Link, type Core_LinkProps as LinkProps, Core_ListBox as ListBox, type Core_ListBoxProps as ListBoxProps, type Core_ListOption as ListOption, Core_Markdown as Markdown, type Core_MarkdownProps as MarkdownProps, Core_Menu as Menu, type Core_MenuItem as MenuItem, type Core_MenuProps as MenuProps, type Core_MessageDescriptor as MessageDescriptor, Core_MessageFormat as MessageFormat, type Core_MessageFormatProps as MessageFormatProps, Core_Modal as Modal, Core_ModalClose as ModalClose, Core_ModalContent as ModalContent, type Core_ModalContentProps as ModalContentProps, type Core_ModalProps as ModalProps, Core_ModalTrigger as ModalTrigger, Core_NumberFormat as NumberFormat, type Core_NumberFormatProps as NumberFormatProps, Core_NumberInput as NumberInput, type Core_NumberInputProps as NumberInputProps, Core_Pagination as Pagination, type Core_PaginationProps as PaginationProps, Core_Popover as Popover, Core_PopoverContent as PopoverContent, type Core_PopoverContentProps as PopoverContentProps, type Core_PopoverProps as PopoverProps, Core_PopoverTrigger as PopoverTrigger, type Core_PopoverTriggerProps as PopoverTriggerProps, Core_Portal as Portal, Core_PortalContainerProvider as PortalContainerProvider, type Core_PortalProps as PortalProps, Core_Preview as Preview, type Core_PreviewProps as PreviewProps, Core_ProgressBar as ProgressBar, type Core_ProgressBarProps as ProgressBarProps, Core_ProgressSpinner as ProgressSpinner, type Core_ProgressSpinnerProps as ProgressSpinnerProps, Core_RadioGroup as RadioGroup, type Core_RadioGroupProps as RadioGroupProps, Core_Reaction as Reaction, type Core_ReactionProps as ReactionProps, Core_ScrollControlButton as ScrollControlButton, type Core_ScrollControlButtonProps as ScrollControlButtonProps, Core_SearchInput as SearchInput, type Core_SearchInputProps as SearchInputProps, Core_Select as Select, type Core_SelectProps as SelectProps, Core_Separator as Separator, type Core_SeparatorProps as SeparatorProps, Core_Slider as Slider, type Core_SliderProps as SliderProps, type Core_StylingProps as StylingProps, Core_Switch as Switch, type Core_SwitchProps as SwitchProps, Core_TabItem as TabItem, type Core_TabItemProps as TabItemProps, Core_Tabs as Tabs, type Core_TabsProps as TabsProps, Core_TagGroup as TagGroup, type Core_TagGroupProps as TagGroupProps, Text$1 as Text, Core_TextInput as TextInput, type Core_TextInputProps as TextInputProps, type Core_TextProps as TextProps, Core_ThemeProvider as ThemeProvider, type Core_ThemeProviderProps as ThemeProviderProps, Core_ToggleButton as ToggleButton, type Core_ToggleButtonProps as ToggleButtonProps, Core_ToggleIconButton as ToggleIconButton, type Core_ToggleIconButtonProps as ToggleIconButtonProps, Core_Toolbar as Toolbar, type Core_ToolbarProps as ToolbarProps, Core_Tooltip as Tooltip, type Core_TooltipProps as TooltipProps, Core_Transform as Transform, type Core_TransformProps as TransformProps, Core_Transition as Transition, type Core_TransitionProps as TransitionProps, Core_defineMessages as defineMessages, Core_isInsideOverlayContent as isInsideOverlayContent, Core_useCollator as useCollator, Core_useDateFormatter as useDateFormatter, Core_useDevice as useDevice, Core_useI18n as useI18n, Core_useImage as useImage, Core_useIntersectionObserver as useIntersectionObserver, Core_useIsFirstRender as useIsFirstRender, Core_useLocalStorage as useLocalStorage, Core_useMutationObserver as useMutationObserver, Core_useNumberFormatter as useNumberFormatter, Core_usePortalContainer as usePortalContainer, Core_useResizeObserver as useResizeObserver, Core_useTextSelection as useTextSelection, Core_useUndoRedo as useUndoRedo, Core_useUserPreferences as useUserPreferences };
- }
-
- declare type Any$1 = any;
- declare type IRecord$1 = Record<Any$1, Any$1>;
- declare type AnyComponent = React__default.ComponentType<Any$1> | keyof ReactHTML;
- declare type Child = Block | string | number | ((...args: Any$1[]) => React__default.ReactElement);
- declare type Props<T extends AnyComponent> = Omit<React__default.ComponentPropsWithRef<T>, "children"> & {
- "data-block-id"?: string;
- children?: Child[];
- };
- declare type PropsWithoutChildren<T extends AnyComponent> = Omit<Props<T>, "children">;
- /**
- * The Block class is a wrapper around React components. It is used to create a
- * virtual DOM tree that can be rendered to the DOM.
- */
- declare class Block<T extends AnyComponent = AnyComponent> {
- id: string;
- private readonly _container;
- private readonly _component;
- private _props;
- private _children;
- private parent?;
- constructor(component: AnyComponent, props: Props<T>, options?: {
- container?: HTMLElement;
- ownerDocument?: Document;
- });
- private _setParent;
- /**
- * This getter returns the props of the block.
- *
- * ```tsx
- * const block = new Block("div", { className: "test" });
- *
- * block.props; // { className: "test" }
- * ```
- */
- get props(): PropsWithoutChildren<T>;
- /**
- * This setter sets the props of the block. This method will replace the
- * existing props with the new props. Do not pass children in the props. Use
- * the `children` setter instead.
- *
- * ```tsx
- * const block = new Block("div", { className: "test" });
- *
- * block.props = { className: "test2" };
- * ```
- *
- * @param props
- */
- set props(props: PropsWithoutChildren<T>);
- /**
- * This method will create a React element from the block and all of its
- * children.
- *
- * ```ts
- * const App = () => {
- * const block = new Block("div", { className: "test" });
- * return block.createComponent();
- * // <div className="test" />
- * };
- * ```
- *
- * @param key The key to use for the component.
- * @returns A React element.
- */
- createComponent(key?: Key$2): React__default.ReactElement;
- /**
- * This getter returns a list of the children of the block.
- *
- * ```ts
- * const block = new Block("div", { className: "test" });
- *
- * block.children = ["test"];
- * block.children; // ["test"]
- * ```
- */
- get children(): Child[];
- /**
- * This setter sets the children of the block. This method will replace the
- * existing children with the new children.
- *
- * ```ts
- * const block = new Block("div", { className: "test" });
- *
- * block.children = ["test"];
- * block.children; // ["test"]
- * ```
- *
- * @param children The new children to use.
- */
- set children(children: Child[]);
- /**
- * Prepends children to the block. This method will prepend the children to
- * the beginning of the existing children.
- *
- * ```ts
- * const child1 = new Block("div", { className: "test1", data-block-id: "test1" });
- * const child2 = new Block("div", { className: "test2", data-block-id: "test2" });
- * const block = new Block("div", { className: "test", children: [
- * child1,
- * child2,
- * ]});
- *
- * const child3 = new Block("div", { className: "test3", data-block-id: "test3" });
- * block.prependChildren(child3);
- * block.children; // [child3, child1, child2]
- * ```
- *
- * @param children The children to prepend.
- * @returns The Block instance.
- */
- prependChildren(...children: Child[]): this;
- /**
- * Appends children to the block. This method will append the children to the
- * end of the existing children.
- *
- * ```ts
- * const child1 = new Block("div", { className: "test1", data-block-id: "test1" });
- * const child2 = new Block("div", { className: "test2", data-block-id: "test2" });
- * const block = new Block("div", { className: "test", children: [
- * child1,
- * child2,
- * ]});
- *
- * const child3 = new Block("div", { className: "test3", data-block-id: "test3" });
- *
- * block.appendChildren(child3);
- * block.children; // [child1, child2, child3]
- * ```
- *
- * @param children
- * @returns The Block instance.
- */
- appendChildren(...children: Child[]): this;
- /**
- * This method will search the entire tree of children and then inserts
- * children after the child with the given id. This method will insert the
- * children after the first child with the given id. If the child is not
- * found, the children will not be inserted.
- *
- * ```ts
- * const child1 = new Block("div", { className: "test1", data-block-id: "test1" });
- * const child2 = new Block("div", { className: "test2", data-block-id: "test2" });
- *
- * const block = new Block("div", { className: "test", children: [
- * child1,
- * child2,
- * ]});
- *
- * const child3 = new Block("div", { className: "test3", data-block-id: "test3" });
- * block.insertAfter(child2.id, child3);
- * block.children; // [child1, child2, child3]
- * ```
- *
- * @param block The id of the child block or the block to insert the children
- * after.
- * @param children The children to insert.
- * @returns The Block instance.
- */
- insertBefore(block: string | Block, ...children: Child[]): this;
- /**
- * This method will search the entire tree of children and then inserts
- * children after the child with the given id. This method will insert the
- * children after the first child with the given id. If the child is not
- * found, the children will not be inserted.
- *
- * ```ts
- * const child1 = new Block("div", { className: "test1", data-block-id: "test1" });
- * const child2 = new Block("div", { className: "test2", data-block-id: "test2" });
- * const block = new Block("div", { className: "test", children: [child1, child2] });
- *
- * const child3 = new Block("div", { className: "test3", data-block-id: "test3" });
- *
- * block.insertAfter(child1.id, child3);
- * block.children; // [child1, child3, child2]
- * ```
- *
- * @param block
- * @param children The children to insert.
- * @returns The Block instance.
- */
- insertAfter(block: string | Block, ...children: Child[]): this;
- /**
- * This method will search the entire tree of children and then replaces the
- * child with the given id with the new children. This method will replace the
- * first child with the given id. If the child is not found, the children will
- * not be inserted.
- *
- * ```ts
- * const child1 = new Block("div", { className: "test1", data-block-id: "test1" });
- * const child2 = new Block("div", { className: "test2", data-block-id: "test2" });
- * const block = new Block("div", { className: "test", children: [child1, child2] });
- *
- * const child3 = new Block("div", { className: "test3", data-block-id: "test3" });
- *
- * block.replace(child1.id, child3);
- * block.children; // [child3, child2]
- * ```
- *
- * @param block The id of the child block or the block to replace.
- * @param children The children to insert.
- * @returns The Block instance.
- */
- replace(block: string | Block, ...children: Child[]): this;
- /**
- * Finds a child block by its id. This method will search the entire tree of
- * children. If the child is not found, undefined is returned.
- *
- * ```ts
- * const child1 = new Block("div", {
- * className: "test1",
- * "data-block-id": "test1",
- * });
- * const child2 = new Block("div", {
- * className: "test2",
- * "data-block-id": "test2",
- * });
- * const block = new Block("div", { className: "test" }, child1, child2);
- *
- * block.getBlockById(child2.id); // child2
- * ```
- *
- * @param id The id of the child to find.
- * @returns The child block or undefined.
- */
- getBlockById<T extends AnyComponent>(id: string): Block<T> | undefined;
- /**
- * Finds the blocks by the component. This method will search the entire tree
- * of children. If the child is not found, undefined is returned.
- *
- * ```ts
- * const child1 = new Block("div", {
- * className: "test1",
- * "data-block-id": "test1",
- * });
- * const child2 = new Block("div", {
- * className: "test2",
- * "data-block-id": "test2",
- * });
- * const slider = new Block(Slider, {
- * className: "test",
- * "data-block-id": "test",
- * });
- *
- * const block = new Block(
- * "div",
- * { className: "test" },
- * child1,
- * child2,
- * slider,
- * );
- *
- * block.getBlocksByComponent(Slider); // [slider]
- * ```
- *
- * @param component
- * @returns An array of blocks.
- */
- getBlocksByComponent<T extends AnyComponent>(component: T): Block<T>[];
- private _getChild;
- private _removeChild;
- /**
- * Removes a child block by its id. This method will search the entire tree of
- * children. If the child is not found, undefined is returned.
- *
- * ```ts
- * const child1 = new Block("div", { className: "test1", data-block-id: "test1" });
- * const child2 = new Block("div", { className: "test2", data-block-id: "test2" });
- *
- * const block = new Block("div", { className: "test", children: [child1, child2] });
- *
- * block.removeChildById(child2.id);
- * block.children; // [child1]
- * ```
- *
- * @param id
- */
- removeChildById(id: string): void;
- /**
- * Returns a DOM Node that can be added directly to the DOM. This method will
- * create a DOM Node from the block and all of its children.
- */
- createDOMNode(container?: HTMLElement): HTMLElement;
- /**
- * This method will merge the props of the block with the new props.
- *
- * ```ts
- * const block = new Block("div", { className: "test", id: "testid" });
- *
- * block.mergeProps({ className: "test2" });
- * block.props; // { className: "test2", id: "testid" }
- * ```
- *
- * @param props The new props to use.
- * @returns The Block instance.
- */
- mergeProps(props: Partial<Props<T>>): this;
- /**
- * Sets a single prop on the component. This method will not re-render the
- * component.
- *
- * ```ts
- * const block = new Block("div", { className: "test", id: "testid" });
- *
- * block.setProp("className", "test2");
- * block.props; // { className: "test2", id: "testid" }
- * ```
- *
- * @param key
- * @param value
- * @returns The Block instance.
- */
- setProp<U extends keyof Props<T>>(key: U, value: Props<T>[U]): this;
- /**
- * This method will return a JSON representation of the block and all of its
- * children.
- */
- toJS(): IJSON;
- }
- interface IJSON {
- id?: string;
- component: string;
- props: IRecord$1;
- children: (IJSON | {
- value: string | number | ((...args: Any$1[]) => React__default.ReactElement);
- })[];
- }
-
- declare type Any = any;
- interface BlockId {
- "data-block-id"?: string;
- }
- /**
- * Creates a new Block instance.
- *
- * @param component The component to render.
- * @param props The props to pass to the component.
- * @param children
- */
- declare function createBlock<T extends keyof React__default.ReactHTML>(component: T, props?: Omit<React__default.ComponentPropsWithRef<T>, "children"> & BlockId, ...children: Child[]): Block<T>;
- declare function createBlock<T extends React__default.ForwardRefExoticComponent<Any>>(component: T, props?: Omit<React__default.ComponentPropsWithRef<T>, "children"> & BlockId, ...children: Child[]): Block<T>;
- declare function createBlock<T extends (...args: Any[]) => Any>(component: T, props?: Omit<Parameters<T>[0], "children"> & BlockId, ...children: Child[]): Block<T>;
-
- declare type Messages = {
- action: string;
- addLink: string;
- addSignature: string;
- anonymous: string;
- backgroundColor: string;
- black: string;
- blue: string;
- bold: string;
- cancel: string;
- chat: string;
- chooseColor: string;
- clearSignature: string;
- close: string;
- color: string;
- comment: string;
- commentAction: string;
- commentEditorLabel: string;
- commentOptions: string;
- comments: string;
- commentsCount: string;
- commentThread: string;
- copy: string;
- createStamp: string;
- customStamp: string;
- cut: string;
- darkBlue: string;
- date: string;
- delete: string;
- deleteComment: string;
- deleteCommentConfirmMessage: string;
- discardChanges: string;
- done: string;
- draw: string;
- edit: string;
- editContent: string;
- editLink: string;
- fontColor: string;
- fonts: string;
- help: string;
- image: string;
- italic: string;
- linkAnnotation: string;
- loading: string;
- nMoreComments: string;
- openHelpDialog: string;
- paste: string;
- pause: string;
- play: string;
- preview: string;
- readMore: string;
- redo: string;
- removeLink: string;
- save: string;
- saveSignature: string;
- selectAll: string;
- selectDragImage: string;
- shortcut: string;
- showMore: string;
- signature: string;
- signatures: string;
- signHere: string;
- stampAnnotationTemplatesDialog: string;
- stampText: string;
- storeSignature: string;
- time: string;
- toolbarFocus: string;
- type: string;
- typeSomething: string;
- underline: string;
- undo: string;
- useAnExistingStampDesign: string;
- viewMoreResults: string;
- };
-
- interface SignatureTextInputProps extends StylingProps, Omit<AriaTextFieldOptions<"input">, "isRequired" | "isReadOnly" | "inputElementType" | "validationState" | "isInvalid" | "description" | "errorMessage" | keyof AriaLabelingProps$1> {
- /** The style object to apply to the input element. */
- inputStyle?: React__default.CSSProperties;
- /** The class name to apply to the input element. */
- inputClassName?: string;
- /** The clear button label. */
- clearLabel: string;
- /**
- * Whether the input is inline. This affects the styling of the input.
- *
- * @default true
- */
- isInline?: boolean;
- /** The label for the input. */
- label: string;
- /** The class name to apply to the footer element. */
- footerClassName?: string;
- /** The style object to apply to the footer element. */
- footerStyle?: React__default.CSSProperties;
- }
-
- declare const SignatureTextInput: React__default.ForwardRefExoticComponent<SignatureTextInputProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface DevtoolsProps extends StylingProps {
- /** The children to render. */
- children: React__default.ReactNode;
- /**
- * The stating string for the class name.
- *
- * @default "BaselineUI"
- */
- classStartsWith?: string;
- }
-
- declare const Devtools: React__default.ForwardRefExoticComponent<DevtoolsProps & React__default.RefAttributes<HTMLDivElement>>;
-
- interface StampProps extends StylingProps, AriaLabelingProps$1 {
- /** The height of the stamp. */
- height?: number;
- /** The minimum width of the stamp. */
- minWidth?: number;
- /** The maximum width of the stamp. */
- maxWidth?: number;
- /** The width of the stamp's stroke. */
- strokeWidth?: number;
- /** The color of the stamp's stroke. */
- strokeColor?: string;
- /** The fill color of the stamp. */
- fillColor?: string;
- /** The color of the stamp's font. */
- fontColor?: string;
- /** The font family of the stamp. */
- fontFamily?: string;
- /** The description of the stamp. This is displayed below the `text`. */
- subText?: string;
- /**
- * The main text of the stamp. This is displayed at the center of the stamp if
- * no `subText` is provided. Otherwise, it is displayed above the `subText`.
- */
- text?: string;
- /**
- * The label of the stamp. This is used as the title of the SVG element. It is
- * not visible to the user.
- */
- label?: string | React__default.ReactNode;
- /**
- * The callback function that is called when the dimensions of the stamp
- * change.
- */
- onDimensionsChange?: (dimensions: {
- width: number;
- height: number;
- }) => void;
- }
-
- declare const Stamp: React__default.ForwardRefExoticComponent<StampProps & React__default.RefAttributes<SVGSVGElement>>;
-
- interface CommentProps extends StylingProps {
- /**
- * The list of reactions to show in the comment. If this is not provided, the
- * reactions will not be shown.
- */
- reactions?: ReactionProps[];
- /** The name shown in the comment header. */
- name?: React__default.ReactNode;
- /**
- * The description shown in the comment header. This can be a string or a
- * React node.
- */
- description?: React__default.ReactNode;
- /** The content of the comment. This can be a string or a React node. */
- content: React__default.ReactNode;
- /**
- * The type of the content string. If this is set to "html", the content will
- * be rendered as HTML. If this is set to "plain", the content will be
- * rendered as plain text. This prop is only used when the `content` prop is a
- * string.
- *
- * @default "plain"
- */
- contentStringType?: "plain" | "html";
- /**
- * Indicates whether the element is displayed inline.
- *
- * @default true
- */
- isInline?: boolean;
- /**
- * The avatar properties to be passed to the `Avatar` component. If this is
- * not provided, the avatar will not be shown.
- */
- avatarProps?: Omit<AvatarProps, "size">;
- /**
- * The `aria-label` property assigned to the menu trigger element of the
- * component.
- */
- menuProps?: MenuProps;
- /**
- * The `children` property is an optional prop that accepts a JSX element or
- * an array of JSX elements. The children is displayed at the bottom of the
- * comment.
- */
- children?: React__default.ReactNode;
- /** Represents the unique identifier of a comment in the data. */
- "data-comment-id"?: string;
- }
-
- declare const Comment: React__default.ForwardRefExoticComponent<CommentProps & React__default.RefAttributes<HTMLDivElement>>;
-
- declare const App_Comment: typeof Comment;
- type App_CommentProps = CommentProps;
- declare const App_Devtools: typeof Devtools;
- type App_DevtoolsProps = DevtoolsProps;
- declare const App_SignatureTextInput: typeof SignatureTextInput;
- type App_SignatureTextInputProps = SignatureTextInputProps;
- declare const App_Stamp: typeof Stamp;
- type App_StampProps = StampProps;
- declare namespace App {
- export { App_Comment as Comment, type App_CommentProps as CommentProps, App_Devtools as Devtools, type App_DevtoolsProps as DevtoolsProps, App_SignatureTextInput as SignatureTextInput, type App_SignatureTextInputProps as SignatureTextInputProps, App_Stamp as Stamp, type App_StampProps as StampProps };
- }
-
- /*
- * Copyright 2020 Adobe. All rights reserved.
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
- * OF ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-
- interface AriaLabelingProps {
- /**
- * Defines a string value that labels the current element.
- */
- 'aria-label'?: string,
-
- /**
- * Identifies the element (or elements) that labels the current element.
- */
- 'aria-labelledby'?: string,
-
- /**
- * Identifies the element (or elements) that describes the object.
- */
- 'aria-describedby'?: string,
-
- /**
- * Identifies the element (or elements) that provide a detailed, extended description for the object.
- */
- 'aria-details'?: string
- }
-
- interface State<T> {
- get: <K extends keyof T>(key: K) => T[K];
- set: <K extends keyof T>(key: K, value: T[K]) => void;
- toJS: () => T;
- }
- interface RecipeResult<T> {
- intl: I18nResult<Messages>;
- state: State<T>;
- device: "mobile" | "tablet" | "desktop";
- }
-
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- type IRecord = Record<string, any>;
-
- interface BaseChildrenArgs<T = Record<string, never>>
- extends RecipeResult<T> {
- /** The block component that can be modified */
- ui: Block;
-
- /** The ref of the block component */
- ref: ForwardedRef<HTMLDivElement>;
- }
-
- interface BaseRecipeProps<
- State extends IRecord,
- ChildArgs extends IRecord,
- > {
- /**
- * The initial state of the component. This is useful for controlling the
- * component.
- */
- initialState?: Partial<State>;
-
- /**
- * The state of the component. This is useful for controlling the component.
- * If this is provided, the property with non-defined values will be
- * controlled.
- */
- state?: Partial<State>;
-
- /** The function that is called when the state of the component changes. */
- onStateChange?: (changes: Partial<State>) => void;
-
- /** Optional prop for rendering child components. */
- children?: (props: ChildArgs) => React__default.ReactElement;
- }
-
- interface SharedProps$5 extends StylingProps {
- /**
- * The items to display in the list. Each item can be an image, svg, or text.
- * Each item must have a unique id. The signature list will display the items
- * in the order they are provided.
- */
- items: (PreviewProps & {
- id: Key$2;
- })[];
- /**
- * Callback fired when the user clicks the button to add a signature to the
- * list.
- */
- onAdd?: () => void;
- /**
- * Callback fired when the user clicks the add button on a preview. The delete
- * button is only displayed when this callback is provided.
- *
- * @param id
- */
- onAddFromPreview?: (id: Key$2) => void;
- /**
- * Callback fired when the user clicks the remove button on a preview.
- *
- * @param id
- */
- onRemoveFromPreview?: (id: Key$2) => void;
- /** Callback fired when the user clicks the cancel button. */
- onCancel?: () => void;
- /** The id of the title element. */
- titleId?: string;
- /**
- * The variant of the component. This changes the styling of the component.
- *
- * @default "wide"
- */
- variant?: "wide" | "narrow";
- }
- declare type ChildrenArgs$5 = SharedProps$5 & BaseChildrenArgs<IRecord>;
- interface SignaturesListProps extends SharedProps$5, BaseRecipeProps<IRecord, ChildrenArgs$5> {
- }
-
- declare enum CREATE_SIGNATURE_ALLOWED_TABS {
- DRAW = "DRAW",
- TYPE = "TYPE",
- IMAGE = "IMAGE"
- }
- interface InternalState$3 extends IRecord {
- /**
- * The color of an object. This is a hex value that is applied to the points
- * in `FreehandCanvas` or `SignatureTextInput`
- */
- color: string;
- /**
- * The image that is uploaded. This is a `File` object that is uploaded to the
- * in the Image tab.
- */
- image?: File;
- /**
- * The ink variable represents the ink that is drawn on the canvas. The ink is
- * represented as an array of arrays of points. Each point is represented as
- * an array of two numbers, the x and y coordinates of the point.
- */
- ink?: number[][][];
- /**
- * The text variable represents the text that is input in the text input. The
- * text is represented as a string.
- */
- text?: string;
- /**
- * The current tab that is selected. The tab can be one of the following
- * values: "DRAW", "TYPE", or "IMAGE".
- */
- currentTab: keyof typeof CREATE_SIGNATURE_ALLOWED_TABS;
- /**
- * The selectedFont variable represents the currently selected font for text
- * input.
- */
- selectedFont: string;
- /**
- * Indicates whether the signature should be stored or not.
- *
- * @default false
- */
- shouldStoreSignature: boolean;
- }
- interface SharedProps$4 extends StylingProps {
- /**
- * Indicates whether it is possible to store the signature or not.
- *
- * @default true
- */
- allowStoringSignature?: boolean;
- /**
- * An array of color presets. If not provided, the default color presets will
- * be used.
- *
- * ```js
- * [
- * { color: "#000000", label: "Black" },
- * { color: "#2293fb", label: "Blue" },
- * { color: "#4636e3", label: "Dark Blue" },
- * ];
- * ```
- */
- colorPresets: ColorPreset$1[];
- /**
- * The tabs that should be shown in the signature dialog. The tabs are
- * represented as a string of the tab names. The following tabs are available:
- * "DRAW", "TYPE", and "IMAGE".
- *
- * @default ["DRAW", "TYPE", "IMAGE"]
- */
- allowedTabs?: (keyof typeof CREATE_SIGNATURE_ALLOWED_TABS)[];
- /**
- * An array of font names. Make sure those fonts are available in the
- * application. The names should be the same as the ones used in the
- * application.
- */
- fonts: string[];
- /** The title ID of the component. This is used for accessibility purposes. */
- titleId?: string;
- /** Callback function that is called when a close event is triggered. */
- onCloseRequest: () => void;
- /** Callback function that is called when a signature is added. */
- onAdd: (state: Omit<InternalState$3, "image" | "text" | "ink"> & {
- canvasSize: {
- height: number;
- width: number;
- } | undefined;
- signature?: {
- type: CREATE_SIGNATURE_ALLOWED_TABS.TYPE;
- value?: string;
- } | {
- type: CREATE_SIGNATURE_ALLOWED_TABS.DRAW;
- value?: number[][][];
- } | {
- type: CREATE_SIGNATURE_ALLOWED_TABS.IMAGE;
- value?: File;
- };
- }) => void;
- /**
- * The variant of the variable.
- *
- * @typedef {"narrow" | "wide"} Variant
- */
- variant?: "narrow" | "wide";
- }
- interface ChildrenArgs$4 extends SharedProps$4, BaseChildrenArgs<InternalState$3> {
- }
- interface CreateSignatureProps extends SharedProps$4, BaseRecipeProps<InternalState$3, ChildrenArgs$4> {
- }
-
- interface InternalState$2 extends IRecord {
- text?: string;
- includeDate: boolean;
- includeTime: boolean;
- color: string;
- }
- interface SharedProps$3 extends StylingProps {
- /**
- * The `id` of the title of the component. This is useful for accessibility
- * when the component is used in a dialog.
- */
- titleId?: string;
- /** Callback function that is called when a close event is triggered. */
- onCloseRequest?: () => void;
- /**
- * Callback function that is called when a stamp is added.
- *
- * @param options
- */
- onCreate: (options: {
- text?: string;
- subText?: string;
- color: string;
- width: number;
- }) => void;
- /** An optional array of color presets. */
- colorPresets: {
- color: string;
- label: string;
- }[];
- /**
- * An optional function that returns a lighter variant of the color provided.
- * By default, the color is lightened by 80%.
- *
- * @param color
- */
- getLighterVariant?: (color: string) => string;
- /**
- * A callback function that is called when the user clicks on the "Use
- * existing stamp" button.
- */
- onExistingStampPress?: () => void;
- }
- declare type ChildrenArgs$3 = SharedProps$3 & BaseChildrenArgs<InternalState$2>;
- interface CreateStampProps extends SharedProps$3, BaseRecipeProps<InternalState$2, ChildrenArgs$3> {
- }
-
- interface InternalState$1 extends IRecord {
- }
- interface SharedProps$2 extends StylingProps, Omit<SignaturesListProps, "children" | "onRemoveFromPreview" | "variant" | "initialState" | "onAddFromPreview" | "disabledActions" | "onAdd"> {
- /**
- * Callback fired when the user clicks the preview
- *
- * @param id
- */
- onAdd?: (id: Key$2) => void;
- /** Callback fired when the user clicks the custom stamp button */
- onCustomStampPress?: () => void;
- }
- declare type ChildrenArgs$2 = SharedProps$2 & BaseChildrenArgs<InternalState$1>;
- interface StampsListProps extends SharedProps$2, BaseRecipeProps<InternalState$1, ChildrenArgs$2> {
- }
-
- declare const MessageType: {
- readonly PLAIN: "PLAIN";
- readonly ACTIONS: "ACTIONS";
- readonly ERROR: "ERROR";
- readonly SUGGESTIONS: "SUGGESTIONS";
- readonly ADDITIONAL_CONTEXT: "ADDITIONAL_CONTEXT";
- readonly QUERY_RESULT: "QUERY_RESULT";
- };
- interface MessageAction {
- text: string;
- onPress: () => void;
- }
- interface ErrorMessageType {
- title: string;
- description: string;
- action?: MessageAction;
- }
- interface LinkAction {
- text: string;
- onPress: () => void;
- }
- interface Suggestion {
- text: string;
- onPress: () => void;
- }
- interface IBaseMessage {
- id: string;
- type: keyof typeof MessageType;
- text: string;
- sender: string;
- isComplete: boolean;
- canCopy?: boolean;
- }
- interface PlainMessage extends IBaseMessage {
- type: typeof MessageType.PLAIN;
- }
- interface MessageWithActions extends IBaseMessage {
- type: typeof MessageType.ACTIONS;
- actions: MessageAction[];
- }
- interface MessageWithError extends IBaseMessage {
- type: typeof MessageType.ERROR;
- error: ErrorMessageType;
- }
- interface MessageWithSuggestions extends IBaseMessage {
- type: typeof MessageType.SUGGESTIONS;
- suggestions: Suggestion[];
- }
- interface MessageWithAdditionalContext extends IBaseMessage {
- type: typeof MessageType.ADDITIONAL_CONTEXT;
- additionalContext: string;
- actions: MessageAction[];
- linkToAdditionalContext: LinkAction;
- }
- interface MessageWithQueryResult extends IBaseMessage {
- type: typeof MessageType.QUERY_RESULT;
- links: LinkAction[];
- actionsText: string;
- actions: MessageAction[];
- }
- declare type Message = PlainMessage | MessageWithActions | MessageWithError | MessageWithSuggestions | MessageWithAdditionalContext | MessageWithQueryResult;
- interface SharedProps$1 extends StylingProps {
- /** Callback function that is called when a message is submitted. */
- onMessageSubmit: (message: string) => void;
- /** Callback function that is called when input value changes. */
- onInputChanged: (value: string) => void;
- /** The list of messages to show in the chat window. */
- messages: Message[];
- /**
- * Variant of the dialog
- *
- * @default "default"
- */
- variant?: "default" | "full-width";
- /** Whether to show the loading indicator */
- isLoading?: boolean;
- /** Whether to disable the content */
- isDisabled?: boolean;
- /** Whether to disable message submitting */
- isSubmitDisabled?: boolean;
- /** The value of the input field */
- inputValue?: string;
- /** The title ID of the component. This is used for accessibility purposes. */
- titleId?: string;
- /** The imperative handle for manipulating editor. */
- editorHandle?: React__default.RefObject<EditorHandle>;
- }
- declare type ChildrenArgs$1 = SharedProps$1 & BaseChildrenArgs<IRecord>;
- interface ChatDialogProps extends SharedProps$1, BaseRecipeProps<IRecord, ChildrenArgs$1> {
- }
-
- interface InternalState extends IRecord {
- isExpanded: boolean;
- toDelete: string | null;
- }
- interface SharedProps extends StylingProps, AriaLabelingProps, Pick<EditorProps, "mentionableUsers" | "maxMentionableUsersSuggestions">, Pick<PopoverContentProps, "portalContainer">, Pick<AriaButtonProps, "onPress"> {
- /**
- * The comments to display in the thread. Each comment should have a unique
- * `commentId`.
- */
- comments: (Omit<CommentProps, "data-comment-id" | "menuProps" | "children" | "isInline" | "reactions"> & {
- id: string;
- canDelete?: boolean;
- canEdit?: boolean;
- canBeAnonymous?: boolean;
- isAnonymous?: boolean;
- content?: string;
- })[];
- /** The title of the thread. This is used for accessibility purposes. */
- titleId?: string;
- /** A callback function that is triggered when the editor value changes. */
- onEditorValueChange?: (value: string, id?: string) => void;
- /**
- * The variant of a component specifying its appearance.
- *
- * @default "sidebar"
- */
- variant?: "sidebar" | "popover";
- /** A callback function that is triggered when a comment is added. */
- onCommentAdd?: (content: string) => void;
- /**
- * A callback function that is triggered when a comment is updated. The
- * function receives the `commentId` and the new `content` as arguments.
- */
- onCommentUpdate?: (id: string, content: string) => void;
- /**
- * A callback function that is triggered when a comment is deleted. The
- * function receives the `commentId` as an argument.
- */
- onDelete?: (id: string) => void;
- /** Callback function triggered when the anonymous toggle is changed. */
- onAnonymousToggle?: (id: string, value: boolean) => void;
- /**
- * An array of buttons to display in the editor footer. Each button should
- * have an `aria-label`, an `icon`, and an `onPress` callback.
- */
- editorFooterButtons?: EditorProps["footerButtons"];
- /**
- * Whether to allow the creation of new comments. If set to `false`, the
- * editor will be hidden.
- *
- * @default true
- */
- allowCommentCreation?: boolean;
- /** The default value for the editor. This is used when creating a new comment. */
- defaultEditorValue?: string;
- }
- declare type ChildrenArgs = SharedProps & BaseChildrenArgs<InternalState>;
- interface CommentThreadProps extends SharedProps, BaseRecipeProps<InternalState, ChildrenArgs> {
- }
-
- declare const Recipes: {
- readonly SignaturesList: React.ForwardRefExoticComponent<SignaturesListProps & React.RefAttributes<HTMLDivElement>>;
- readonly CreateSignature: React.ForwardRefExoticComponent<CreateSignatureProps & React.RefAttributes<HTMLDivElement>>;
- readonly StampsList: React.ForwardRefExoticComponent<StampsListProps & React.RefAttributes<HTMLDivElement>>;
- readonly CreateStamp: React.ForwardRefExoticComponent<CreateStampProps & React.RefAttributes<HTMLDivElement>>;
- readonly ChatDialog: React.ForwardRefExoticComponent<ChatDialogProps & React.RefAttributes<HTMLDivElement>>;
- readonly CommentThread: React.ForwardRefExoticComponent<CommentThreadProps & React.RefAttributes<HTMLDivElement>>;
- };
- type InterfacesType = {
- [K in keyof typeof Recipes]: K;
- };
- declare const Interfaces: InterfacesType;
-
- type UI = {
- [K in keyof typeof Interfaces]: (options: {
- props: React__default.ComponentProps<(typeof Recipes)[K]>;
- instance: Instance | null;
- }) => {
- content?: React__default.ReactElement | Node | null;
- decorator?: (props: any) => React__default.ReactElement | Node | null;
- };
- };
-
- type documentEditorUIConfig = {
- thumbnailMinSize: number;
- thumbnailMaxSize: number;
- thumbnailDefaultSize: number;
- };
-
- declare const AutoSaveMode: {
- readonly IMMEDIATE: "IMMEDIATE";
- readonly INTELLIGENT: "INTELLIGENT";
- readonly DISABLED: "DISABLED";
- };
- type IAutoSaveMode = (typeof AutoSaveMode)[keyof typeof AutoSaveMode];
-
- declare const PrintQuality: {
- readonly LOW: "LOW";
- readonly MEDIUM: "MEDIUM";
- readonly HIGH: "HIGH";
- };
- type IPrintQuality = (typeof PrintQuality)[keyof typeof PrintQuality];
-
- declare const ToolbarPlacement: {
- readonly TOP: "TOP";
- readonly BOTTOM: "BOTTOM";
- };
- type IToolbarPlacement = (typeof ToolbarPlacement)[keyof typeof ToolbarPlacement];
-
- declare const ModificationType: {
- readonly CREATED: "CREATED";
- readonly UPDATED: "UPDATED";
- readonly DELETED: "DELETED";
- };
- type IModificationType = (typeof ModificationType)[keyof typeof ModificationType];
-
- type SaveErrorReason = {
- error: any;
- object: any;
- modificationType: IModificationType;
- };
- declare function PSPDFKitSaveError(messageOrError: string | Error, reason: Array<SaveErrorReason>): Error;
- declare namespace PSPDFKitSaveError {
- var prototype: any;
- }
-
- type AnnotationTooltipCallback = (annotation: AnnotationsUnion) => Array<ToolItem>;
-
- declare const FormFieldValue_base: Record$1.Factory<{
- name?: string | undefined;
- value?: string | number | List<string> | null | undefined;
- optionIndexes?: List<number> | undefined;
- isFitting?: boolean | undefined;
- }>;
- declare class FormFieldValue extends FormFieldValue_base {
- name: string;
- value: string | List<string> | null;
- optionIndexes?: List<number>;
- isFitting?: boolean;
- static defaultValues: IObject$1;
- constructor(args?: IObject$1);
- }
-
- type RenderPageCallback = (context: CanvasRenderingContext2D, pageIndex: number, pageSize: Size) => unknown;
-
- type ColorPreset = {
- color: Color$2 | null;
- localization: {
- id: string;
- defaultMessage?: string;
- description?: string;
- };
- };
-
- type FontCallback = (arg0: string) => Promise<Blob>;
-
- interface IFont {
- name: string | null;
- callback: FontCallback | null;
- }
- declare const Font_base: Record$1.Factory<IFont>;
- declare class Font extends Font_base {
- constructor(args: {
- name: string;
- callback?: FontCallback;
- });
- }
-
- declare const ElectronicSignatureCreationMode: {
- readonly DRAW: "DRAW";
- readonly IMAGE: "IMAGE";
- readonly TYPE: "TYPE";
- };
- type IElectronicSignatureCreationMode = (typeof ElectronicSignatureCreationMode)[keyof typeof ElectronicSignatureCreationMode];
-
- type OnOpenUriCallback = (uri: string, isUserInitiated: boolean) => boolean;
-
- declare const UIDateTimeElement: {
- readonly COMMENT_THREAD: "COMMENT_THREAD";
- readonly ANNOTATIONS_SIDEBAR: "ANNOTATIONS_SIDEBAR";
- };
- type IUIDateTimeElement = (typeof UIDateTimeElement)[keyof typeof UIDateTimeElement];
-
- type DateTimeStringCallback = (args: {
- dateTime: Date;
- element: IUIDateTimeElement;
- object: AnnotationsUnion | Comment$1;
- }) => string;
-
- declare const InkEraserMode: {
- readonly POINT: "POINT";
- readonly STROKE: "STROKE";
- };
- type IInkEraserMode = (typeof InkEraserMode)[keyof typeof InkEraserMode];
-
- type BuiltInColorProperty = 'color' | 'stroke-color' | 'fill-color' | 'background-color' | 'font-color' | 'outline-color';
- type AnnotationToolbarColorPresetConfig = {
- presets: ColorPreset[];
- showColorPicker?: boolean;
- };
- type AnnotationToolbarColorPresetsCallback = (options: {
- propertyName: BuiltInColorProperty;
- defaultAnnotationToolbarColorPresets: ColorPreset[];
- }) => AnnotationToolbarColorPresetConfig | undefined;
-
- type EnableRichTextCallback = (annotation: TextAnnotation) => boolean;
-
- type ElectronicSignaturesConfiguration = {
- creationModes?: Readonly<IElectronicSignatureCreationMode[]>;
- fonts?: Readonly<Font[]>;
- setDefaultTypeText?: ElectronicSignatureDefaultTextCallback | string;
- colorPresets?: Readonly<ColorPreset[]>;
- };
- type ElectronicSignatureDefaultTextCallback = () => string | undefined | void;
-
- declare const ProcessorEngine: {
- smallerSize: string;
- fasterProcessing: string;
- };
- type IProcessorEngine = (typeof ProcessorEngine)[keyof typeof ProcessorEngine];
-
- type TrustedCAsCallback = () => Promise<Array<ArrayBuffer | string>>;
-
- declare const Conformance: {
- readonly PDFA_1A: "pdfa-1a";
- readonly PDFA_1B: "pdfa-1b";
- readonly PDFA_2A: "pdfa-2a";
- readonly PDFA_2U: "pdfa-2u";
- readonly PDFA_2B: "pdfa-2b";
- readonly PDFA_3A: "pdfa-3a";
- readonly PDFA_3U: "pdfa-3u";
- readonly PDFA_3B: "pdfa-3b";
- readonly PDFA_4: "pdfa-4";
- readonly PDFA_4E: "pdfa-4e";
- readonly PDFA_4F: "pdfa-4f";
- };
- type IConformance = (typeof Conformance)[keyof typeof Conformance];
-
- type TemplateDataToPopulateDocument = {
- config: DelimiterConfig;
- model: Array<Record<string, unknown>>;
- };
- type DelimiterConfig = {
- delimiter: DelimiterSettings;
- };
- type DelimiterSettings = {
- start: string;
- end: string;
- };
-
- declare const OfficeDocumentFormat: {
- docx: string;
- xlsx: string;
- pptx: string;
- };
- type IDocumentOfficeFormat = (typeof OfficeDocumentFormat)[keyof typeof OfficeDocumentFormat];
-
- type SharedConfiguration = {
- container: string | HTMLElement;
- initialViewState?: ViewState;
- baseUrl?: string;
- serverUrl?: string;
- styleSheets?: Array<string>;
- toolbarItems?: Array<ToolbarItem>;
- annotationPresets?: Record<AnnotationPresetID$1, AnnotationPreset$1>;
- stampAnnotationTemplates?: Array<StampAnnotation | ImageAnnotation>;
- autoSaveMode?: IAutoSaveMode;
- disableHighQualityPrinting?: boolean;
- printMode?: IPrintMode;
- printOptions?: {
- mode?: IPrintMode;
- quality?: IPrintQuality;
- };
- disableTextSelection?: boolean;
- disableForms?: boolean;
- headless?: boolean;
- locale?: string;
- populateInkSignatures?: () => Promise<List<InkAnnotation | ImageAnnotation>>;
- populateStoredSignatures?: () => Promise<List<InkAnnotation | ImageAnnotation>>;
- formFieldsNotSavingSignatures?: Array<string>;
- password?: string;
- disableOpenParameters?: boolean;
- maxPasswordRetries?: number;
- enableServiceWorkerSupport?: boolean;
- preventTextCopy?: boolean;
- renderPageCallback?: RenderPageCallback;
- annotationTooltipCallback?: AnnotationTooltipCallback;
- editableAnnotationTypes?: Array<Class<AnnotationsUnion>>;
- isEditableAnnotation?: IsEditableAnnotationCallback;
- onAnnotationResizeStart?: AnnotationResizeStartCallback;
- customRenderers?: CustomRenderers;
- customUI?: CustomUI;
- theme?: ITheme;
- toolbarPlacement?: IToolbarPlacement;
- minDefaultZoomLevel?: number;
- maxDefaultZoomLevel?: number;
- isEditableComment?: IsEditableCommentCallback;
- restrictAnnotationToPageBounds?: boolean;
- electronicSignatures?: ElectronicSignaturesConfiguration;
- documentEditorFooterItems?: DocumentEditorFooterItem[];
- documentEditorToolbarItems?: DocumentEditorToolbarItem[];
- enableHistory?: boolean;
- onOpenURI?: OnOpenUriCallback;
- dateTimeString?: DateTimeStringCallback;
- annotationToolbarColorPresets?: AnnotationToolbarColorPresetsCallback;
- annotationToolbarItems?: AnnotationToolbarItemsCallback;
- enableClipboardActions?: boolean;
- renderPagePreview?: boolean;
- unstable_inkEraserMode?: IInkEraserMode;
- onWidgetAnnotationCreationStart?: OnWidgetAnnotationCreationStartCallback;
- inlineTextSelectionToolbarItems?: InlineTextSelectionToolbarItemsCallback;
- measurementSnapping?: boolean;
- measurementPrecision?: IMeasurementPrecision;
- measurementScale?: MeasurementScale;
- measurementValueConfiguration?: MeasurementValueConfigurationCallback;
- enableRichText?: EnableRichTextCallback;
- disableMultiSelection?: boolean;
- autoCloseThreshold?: number;
- useIframe?: boolean;
- fontSubstitutions?: FontSubstitution[];
- onCommentCreationStart?: OnCommentCreationStartCallback;
- documentEditorConfiguration?: documentEditorUIConfig;
- ui?: UI;
- };
- type Instant = {
- public: boolean;
- };
- type ServerConfiguration = SharedConfiguration & {
- documentId: string;
- authPayload: {
- jwt: string;
- };
- instant: Instant[keyof Instant];
- anonymousComments?: boolean;
- mentionableUsers?: Array<MentionableUser$1>;
- maxMentionSuggestions?: number;
- };
- type StandaloneConfiguration = SharedConfiguration & {
- document: string | ArrayBuffer;
- baseCoreUrl?: string;
- baseProcessorEngineUrl?: string;
- licenseKey?: string;
- instantJSON?: InstantJSON;
- XFDF?: string;
- XFDFKeepCurrentAnnotations?: boolean;
- XFDFIgnorePageRotation?: boolean;
- disableWebAssemblyStreaming?: boolean;
- disableIndexedDBCaching?: boolean;
- enableAutomaticLinkExtraction?: boolean;
- standaloneInstancesPoolSize?: number;
- overrideMemoryLimit?: number;
- trustedCAsCallback?: TrustedCAsCallback;
- customFonts?: Array<Font>;
- electronAppName?: string;
- appName?: string;
- isSharePoint?: boolean;
- isSalesforce?: boolean;
- productId?: IProductId;
- processorEngine?: IProcessorEngine;
- dynamicFonts?: string;
- inlineWorkers?: boolean;
- };
- type Configuration = ServerConfiguration | StandaloneConfiguration;
-
- type FormFieldFlags = Array<'readOnly' | 'required' | 'noExport'>;
- type FormOptionJSON = {
- label: string;
- value: string;
- };
- type ExportPDFFlags = {
- flatten?: boolean;
- incremental?: boolean;
- includeComments?: boolean;
- saveForPrinting?: boolean;
- excludeAnnotations?: boolean;
- permissions?: {
- userPassword: string;
- ownerPassword: string;
- documentPermissions: Array<IDocumentPermissions>;
- };
- outputFormat?: boolean | PDFAFlags;
- optimize?: boolean | OptimizationFlags;
- flattenElectronicSignatures?: boolean;
- };
- type ExportOfficeFlags = {
- format: IDocumentOfficeFormat;
- };
- type PDFAFlags = {
- conformance?: IConformance;
- vectorization?: boolean;
- rasterization?: boolean;
- };
- type OptimizationFlags = {
- documentFormat?: 'pdf' | 'pdfa';
- grayscaleText?: boolean;
- grayscaleGraphics?: boolean;
- grayscaleFormFields?: boolean;
- grayscaleAnnotations?: boolean;
- grayscaleImages?: boolean;
- disableImages?: boolean;
- mrcCompression?: boolean;
- imageOptimizationQuality?: 1 | 2 | 3 | 4;
- linearize?: boolean;
- };
-
- type FormFieldAdditionalActionsType = {
- onChange?: Action;
- onCalculate?: Action;
- };
- type FormFieldEventTriggerType = keyof FormFieldAdditionalActionsType;
- type FormFieldInputAdditionalActionsType = FormFieldAdditionalActionsType & {
- onInput?: Action;
- onFormat?: Action;
- };
- type FormFieldInputEventTriggerType = keyof FormFieldInputAdditionalActionsType;
- type FormFieldName = string;
- interface IFormField {
- id?: ID;
- pdfObjectId?: number | null;
- annotationIds?: List<string>;
- name?: FormFieldName;
- label?: string;
- readOnly?: boolean;
- required?: boolean;
- noExport?: boolean;
- additionalActions?: any;
- group?: string | null;
- isEditable?: boolean;
- isFillable?: boolean;
- isDeletable?: boolean;
- canSetGroup?: boolean;
- [key: string]: any;
- }
- declare const FormField_base: Record$1.Factory<IFormField>;
- declare class FormField extends FormField_base {
- id: ID;
- name: FormFieldName;
- pdfObjectId: number;
- annotationIds: List<string>;
- label: string;
- readOnly: boolean;
- required: boolean;
- noExport: boolean;
- additionalActions: any;
- group?: string | null;
- isEditable?: boolean;
- isFillable?: boolean;
- isDeletable?: boolean;
- canSetGroup?: boolean;
- static defaultValues: IObject$1;
- constructor(args?: IFormField);
- }
-
- declare class ButtonFormField extends FormField {
- buttonLabel: string | null;
- static defaultValues: IObject$1;
- }
-
- declare const FormOption_base: Record$1.Factory<{
- label: string;
- value: string;
- }>;
- declare class FormOption extends FormOption_base {
- }
-
- declare class CheckBoxFormField extends FormField {
- values: List<string>;
- defaultValues: List<string>;
- options: List<FormOption>;
- optionIndexes?: List<number>;
- static defaultValues: IObject$1;
- }
-
- declare class ChoiceFormField extends FormField {
- options: List<FormOption>;
- values: List<string>;
- defaultValues: List<string>;
- multiSelect: boolean;
- commitOnChange: boolean;
- static defaultValues: IObject$1;
- }
-
- declare class ComboBoxFormField extends ChoiceFormField {
- edit: boolean;
- doNotSpellCheck: boolean;
- static defaultValues: IObject$1;
- }
-
- declare class ListBoxFormField extends ChoiceFormField {
- additionalActions: FormFieldInputAdditionalActionsType | null | undefined;
- }
-
- declare class RadioButtonFormField extends FormField {
- noToggleToOff: boolean;
- radiosInUnison: boolean;
- value: string;
- defaultValue: string;
- options: List<FormOption>;
- optionIndexes?: List<number>;
- static defaultValues: IObject$1;
- }
-
- declare class TextFormField extends FormField {
- value: string;
- defaultValue: string;
- password: boolean;
- maxLength?: number | null;
- doNotSpellCheck: boolean;
- doNotScroll: boolean;
- multiLine: boolean;
- comb: boolean;
- additionalActions: FormFieldInputAdditionalActionsType | null | undefined;
- static defaultValues: IObject$1;
- }
-
- declare class SignatureFormField extends FormField {
- }
-
- interface IComparisonOperation {
- type: IComparisonOperationType;
- options?: {
- numberOfContextWords?: number;
- };
- }
- declare const ComparisonOperation_base: Record$1.Factory<IComparisonOperation>;
- declare class ComparisonOperation extends ComparisonOperation_base {
- constructor(type: IComparisonOperationType, options?: {
- numberOfContextWords?: number;
- });
- }
-
- interface IDocumentDescriptor {
- filePath?: string | ArrayBuffer;
- password?: string;
- pageIndexes: Array<number | [number, number]>;
- jwt?: string;
- }
- declare const DocumentDescriptor_base: Record$1.Factory<IDocumentDescriptor>;
- declare class DocumentDescriptor extends DocumentDescriptor_base {
- constructor(documentDescriptorOptions: IDocumentDescriptor);
- }
-
- type AnnotationPreset = AnnotationPreset$1;
- type AnnotationPresetID = AnnotationPresetID$1;
-
- declare class __dangerousImmutableRecordFactory<TProps extends Record<string, unknown>> {
- has(key: unknown): boolean;
- get<K extends keyof TProps>(key: K): TProps[K];
- set<K extends keyof TProps>(key: K, value: TProps[K]): this;
- delete<K extends keyof TProps>(key: K): this;
- clear(): this;
- update<K extends keyof TProps>(key: K, updater: (value: TProps[K]) => TProps[K]): this;
- merge(...collections: Array<Partial<TProps>>): this;
- mergeWith(merger: (previous?: unknown, next?: unknown, key?: string) => unknown, ...collections: Array<Partial<TProps> | Iterable<[string, unknown]>>): this;
- mergeDeep(...collections: Array<Partial<TProps> | Iterable<[string, unknown]>>): this;
- mergeDeepWith(merger: (previous?: unknown, next?: unknown, key?: string) => unknown, ...collections: Array<Partial<TProps> | Iterable<[string, unknown]>>): this;
- setIn(keyPath: Iterable<unknown>, value: unknown): this;
- deleteIn(keyPath: Iterable<unknown>): this;
- removeIn(keyPath: Iterable<unknown>): this;
- updateIn(keyPath: Iterable<unknown>, notSetValue: unknown, updater: (value: unknown) => unknown): this;
- updateIn(keyPath: Iterable<unknown>, updater: (value: unknown) => unknown): this;
- mergeIn(keyPath: Iterable<unknown>, ...collections: Array<Partial<TProps> | Iterable<[string, unknown]>>): this;
- mergeDeepIn(keyPath: Iterable<unknown>, ...collections: Array<Partial<TProps> | Iterable<[string, unknown]>>): this;
- withMutations(mutator: (mutable: this) => unknown): this;
- asMutable(): this;
- asImmutable(): this;
- getIn(keyPath: Iterable<unknown>, notSetValue?: unknown): unknown;
- toJS(): TProps;
- toJSON(): TProps;
- equals(other: unknown): boolean;
- toSeq(): Seq.Keyed<string, unknown>;
- }
- declare const InheritableImmutableRecord_base: any;
- declare class InheritableImmutableRecord<T extends Record<string, unknown>> extends InheritableImmutableRecord_base {
- constructor(values?: Partial<T> | Iterable<[string, unknown]>);
- }
- interface InheritableImmutableRecord<T extends Record<string, unknown>> extends __dangerousImmutableRecordFactory<T> {
- }
-
- type ID = string;
- type AnnotationProperties = {
- id: string | null;
- name: string | null;
- subject: string | null;
- pdfObjectId: number | null;
- pageIndex: number | null;
- boundingBox: Rect | null;
- opacity: number | null;
- note: string | null;
- creatorName: string | null;
- createdAt: Date | null;
- updatedAt: Date | null;
- customData: Record<string, unknown> | null;
- noView: boolean | null;
- noPrint: boolean | null;
- locked: boolean | null;
- lockedContents: boolean | null;
- readOnly: boolean | null;
- hidden: boolean | null;
- group: string | null | undefined;
- isEditable: boolean | undefined;
- isDeletable: boolean | undefined;
- canSetGroup: boolean | undefined;
- canReply: boolean | undefined;
- rotation: number;
- additionalActions: any;
- noZoom: boolean;
- noRotate: boolean;
- isCommentThreadRoot: boolean;
- isAnonymous: boolean;
- APStreamCache: {
- cache: string;
- } | {
- attach: string;
- } | undefined;
- blendMode: IBlendMode;
- action: any;
- [key: string]: unknown;
- };
- declare class Annotation<T extends AnnotationProperties = AnnotationProperties> extends InheritableImmutableRecord<T> {
- id: ID;
- name: null | string;
- subject: null | string;
- pdfObjectId: null | number;
- pageIndex: number;
- boundingBox: Rect;
- opacity: number;
- note: null | string;
- creatorName: null | string;
- createdAt: Date;
- updatedAt: Date;
- noView: boolean;
- noPrint: boolean;
- locked: boolean;
- lockedContents: boolean;
- readOnly: boolean;
- hidden: boolean;
- customData: null | Record<string, unknown>;
- noZoom: boolean;
- noRotate: boolean;
- additionalActions: any;
- rotation: number;
- blendMode: IBlendMode;
- isCommentThreadRoot: boolean;
- isAnonymous: boolean;
- group?: string | null;
- isEditable?: boolean;
- isDeletable?: boolean;
- canSetGroup?: boolean;
- canReply?: boolean;
- APStreamCache?: {
- cache: string;
- } | {
- attach: string;
- };
- action: any;
- static defaultValues: IObject$1;
- constructor(record?: Partial<T>);
- }
-
- type StampKind = 'Approved' | 'NotApproved' | 'Draft' | 'Final' | 'Completed' | 'Confidential' | 'ForPublicRelease' | 'NotForPublicRelease' | 'ForComment' | 'Void' | 'PreliminaryResults' | 'InformationOnly' | 'Rejected' | 'Accepted' | 'InitialHere' | 'SignHere' | 'Witness' | 'AsIs' | 'Departmental' | 'Experimental' | 'Expired' | 'Sold' | 'TopSecret' | 'Revised' | 'RejectedWithText' | 'Custom';
- interface IStampAnnotation extends AnnotationProperties {
- stampType: string | StampKind | null;
- title: string | null;
- subtitle: string | null;
- color: Color$2 | null;
- xfdfAppearanceStream: string | null;
- xfdfAppearanceStreamOriginalPageRotation: number | null;
- }
- declare class StampAnnotation<T extends IStampAnnotation = IStampAnnotation> extends Annotation<T> {
- stampType: StampKind;
- title: null | string;
- subtitle: null | string;
- color: null | Color$2;
- xfdfAppearanceStream: null | string;
- xfdfAppearanceStreamOriginalPageRotation: null | number;
- static defaultValues: IObject$1;
- static readableName: string;
- }
-
- declare function preloadWorker(configuration: StandaloneConfiguration): Promise<void>;
- declare function load(configuration: Configuration): Promise<Instance>;
- declare function convertToPDF(configuration: StandaloneConfiguration, conformance?: IConformance): Promise<ArrayBuffer>;
- declare function convertToOffice(configuration: StandaloneConfiguration, format: IDocumentOfficeFormat): Promise<ArrayBuffer>;
- declare function populateDocumentTemplate(configuration: StandaloneConfiguration, templateData: TemplateDataToPopulateDocument): Promise<ArrayBuffer>;
-
- declare function serializeAnnotation(annotation: InkAnnotation): AnnotationBackendJSON<InkAnnotationJSON>;
- declare function serializeAnnotation(annotation: LineAnnotation): AnnotationBackendJSON<LineAnnotationJSON>;
- declare function serializeAnnotation(annotation: RectangleAnnotation): AnnotationBackendJSON<RectangleAnnotationJSON>;
- declare function serializeAnnotation(annotation: EllipseAnnotation): AnnotationBackendJSON<EllipseAnnotationJSON>;
- declare function serializeAnnotation(annotation: PolygonAnnotation): AnnotationBackendJSON<PolygonAnnotationJSON>;
- declare function serializeAnnotation(annotation: PolylineAnnotation): AnnotationBackendJSON<PolylineAnnotationJSON>;
- declare function serializeAnnotation(annotation: TextAnnotation): AnnotationBackendJSON<TextAnnotationJSON>;
- declare function serializeAnnotation(annotation: NoteAnnotation): AnnotationBackendJSON<NoteAnnotationJSON>;
- declare function serializeAnnotation(annotation: StampAnnotation): AnnotationBackendJSON<StampAnnotationJSON, 'color'>;
- declare function serializeAnnotation(annotation: ImageAnnotation): AnnotationBackendJSON<ImageAnnotationJSON>;
- declare function serializeAnnotation(annotation: MediaAnnotation): AnnotationBackendJSON<MediaAnnotationJSON>;
- declare function serializeAnnotation(annotation: LinkAnnotation): AnnotationBackendJSON<LinkAnnotationJSON>;
- declare function serializeAnnotation(annotation: WidgetAnnotation): AnnotationBackendJSON<WidgetAnnotationJSON>;
- declare function serializeAnnotation(annotation: TextMarkupAnnotation): AnnotationBackendJSON<TextMarkupAnnotationJSON>;
- declare function serializeAnnotation(annotation: RedactionAnnotation): AnnotationBackendJSON<RedactionAnnotationJSON>;
- declare function serializeAnnotation(annotation: CommentMarkerAnnotation): AnnotationBackendJSON<CommentMarkerAnnotationJSON>;
- declare function serializeAnnotation(annotation: UnknownAnnotation): AnnotationBackendJSON<UnknownAnnotationJSON>;
- declare function serializeAnnotation(annotation: AnnotationsUnion): AnnotationsBackendJSONUnion;
- declare function serializeFormField(formField: FormField): FormFieldJSON;
- declare function serializePreset(preset: AnnotationPreset$1): Record<string, any>;
- declare function unserializePreset(presetJSON: Record<string, any>): AnnotationPreset$1;
-
- type TargetType = string | HTMLElement | Instance | null;
- declare function unload(target: TargetType): boolean;
-
- declare function viewStateFromOpenParameters(viewState: ViewState, hash?: string | null | undefined): ViewState;
-
- type RotatableAnnotation = TextAnnotation | StampAnnotation;
-
- declare const PSPDFKit: {
- UI: {
- Core: typeof Core;
- createBlock: typeof createBlock;
- Recipes: {
- readonly SignaturesList: React.ForwardRefExoticComponent<SignaturesListProps & React.RefAttributes<HTMLDivElement>>;
- readonly CreateSignature: React.ForwardRefExoticComponent<CreateSignatureProps & React.RefAttributes<HTMLDivElement>>;
- readonly StampsList: React.ForwardRefExoticComponent<StampsListProps & React.RefAttributes<HTMLDivElement>>;
- readonly CreateStamp: React.ForwardRefExoticComponent<CreateStampProps & React.RefAttributes<HTMLDivElement>>;
- readonly ChatDialog: React.ForwardRefExoticComponent<ChatDialogProps & React.RefAttributes<HTMLDivElement>>;
- readonly CommentThread: React.ForwardRefExoticComponent<CommentThreadProps & React.RefAttributes<HTMLDivElement>>;
- };
- Interfaces: InterfacesType;
- App: typeof App;
- };
- Immutable: {
- List: typeof List;
- };
- version: string;
- Geometry: {
- Point: typeof Point;
- DrawingPoint: typeof DrawingPoint;
- Rect: typeof Rect;
- Size: typeof Size;
- Inset: typeof Inset;
- };
- Actions: {
- Action: typeof Action;
- GoToAction: typeof GoToAction;
- GoToEmbeddedAction: typeof GoToEmbeddedAction;
- GoToRemoteAction: typeof GoToRemoteAction;
- HideAction: typeof HideAction;
- JavaScriptAction: typeof JavaScriptAction;
- LaunchAction: typeof LaunchAction;
- NamedAction: typeof NamedAction;
- ResetFormAction: typeof ResetFormAction;
- SubmitFormAction: typeof SubmitFormAction;
- URIAction: typeof URIAction;
- };
- Annotations: {
- Annotation: typeof Annotation;
- CommentMarkerAnnotation: typeof CommentMarkerAnnotation;
- HighlightAnnotation: typeof HighlightAnnotation;
- InkAnnotation: typeof InkAnnotation;
- ShapeAnnotation: typeof ShapeAnnotation;
- LineAnnotation: typeof LineAnnotation;
- RectangleAnnotation: typeof RectangleAnnotation;
- EllipseAnnotation: typeof EllipseAnnotation;
- PolygonAnnotation: typeof PolygonAnnotation;
- PolylineAnnotation: typeof PolylineAnnotation;
- LinkAnnotation: typeof LinkAnnotation;
- NoteAnnotation: typeof NoteAnnotation;
- MarkupAnnotation: typeof TextMarkupAnnotation;
- RedactionAnnotation: typeof RedactionAnnotation;
- SquiggleAnnotation: typeof SquiggleAnnotation;
- StampAnnotation: typeof StampAnnotation;
- StrikeOutAnnotation: typeof StrikeOutAnnotation;
- TextAnnotation: typeof TextAnnotation;
- UnderlineAnnotation: typeof UnderlineAnnotation;
- ImageAnnotation: typeof ImageAnnotation;
- UnknownAnnotation: typeof UnknownAnnotation;
- WidgetAnnotation: typeof WidgetAnnotation;
- MediaAnnotation: typeof MediaAnnotation;
- toSerializableObject: typeof serializeAnnotation;
- fromSerializableObject: <K extends AnnotationJSONUnion>(annotation: K) => AnnotationJSONToAnnotation<K>;
- rotate: (annotation: RotatableAnnotation, rotation: number, contentSize?: Size) => RotatableAnnotation;
- };
- AnnotationPresets: {
- toSerializableObject: typeof serializePreset;
- fromSerializableObject: typeof unserializePreset;
- };
- Comment: typeof Comment$1;
- Bookmark: typeof Bookmark;
- CustomOverlayItem: typeof CustomOverlayItem;
- OutlineElement: typeof OutlineElement;
- FormFields: {
- FormField: typeof FormField;
- ButtonFormField: typeof ButtonFormField;
- CheckBoxFormField: typeof CheckBoxFormField;
- ChoiceFormField: typeof ChoiceFormField;
- ComboBoxFormField: typeof ComboBoxFormField;
- ListBoxFormField: typeof ListBoxFormField;
- RadioButtonFormField: typeof RadioButtonFormField;
- TextFormField: typeof TextFormField;
- SignatureFormField: typeof SignatureFormField;
- toSerializableObject: typeof serializeFormField;
- fromSerializableObject: (formField: FormFieldJSON) => FormField;
- };
- FormFieldValue: typeof FormFieldValue;
- FormOption: typeof FormOption;
- Callout: typeof Callout;
- Color: typeof Color$2;
- Instance: typeof Instance;
- preloadWorker: typeof preloadWorker;
- load: typeof load;
- unload: typeof unload;
- convertToOffice: typeof convertToOffice;
- convertToPDF: typeof convertToPDF;
- populateDocumentTemplate: typeof populateDocumentTemplate;
- Error: any;
- SaveError: typeof PSPDFKitSaveError;
- ViewState: typeof ViewState;
- PageInfo: typeof PageInfo;
- TextLine: typeof TextLine;
- InstantClient: typeof InstantClient;
- TextSelection: typeof PublicTextSelection;
- SearchResult: typeof SearchResult;
- SearchState: typeof SearchState;
- AutoSaveMode: {
- readonly IMMEDIATE: "IMMEDIATE";
- readonly INTELLIGENT: "INTELLIGENT";
- readonly DISABLED: "DISABLED";
- };
- SignatureSaveMode: {
- readonly ALWAYS: "ALWAYS";
- readonly NEVER: "NEVER";
- readonly USING_UI: "USING_UI";
- };
- LayoutMode: {
- readonly SINGLE: "SINGLE";
- readonly DOUBLE: "DOUBLE";
- readonly AUTO: "AUTO";
- };
- PrintMode: {
- readonly DOM: "DOM";
- readonly EXPORT_PDF: "EXPORT_PDF";
- };
- PrintQuality: {
- readonly LOW: "LOW";
- readonly MEDIUM: "MEDIUM";
- readonly HIGH: "HIGH";
- };
- ScrollMode: {
- readonly CONTINUOUS: "CONTINUOUS";
- readonly PER_SPREAD: "PER_SPREAD";
- readonly DISABLED: "DISABLED";
- };
- ZoomMode: {
- readonly AUTO: "AUTO";
- readonly FIT_TO_WIDTH: "FIT_TO_WIDTH";
- readonly FIT_TO_VIEWPORT: "FIT_TO_VIEWPORT";
- readonly CUSTOM: "CUSTOM";
- };
- InteractionMode: {
- readonly TEXT_HIGHLIGHTER: "TEXT_HIGHLIGHTER";
- readonly INK: "INK";
- readonly INK_SIGNATURE: "INK_SIGNATURE";
- readonly SIGNATURE: "SIGNATURE";
- readonly STAMP_PICKER: "STAMP_PICKER";
- readonly STAMP_CUSTOM: "STAMP_CUSTOM";
- readonly SHAPE_LINE: "SHAPE_LINE";
- readonly SHAPE_RECTANGLE: "SHAPE_RECTANGLE";
- readonly SHAPE_ELLIPSE: "SHAPE_ELLIPSE";
- readonly SHAPE_POLYGON: "SHAPE_POLYGON";
- readonly SHAPE_POLYLINE: "SHAPE_POLYLINE";
- readonly INK_ERASER: "INK_ERASER";
- readonly NOTE: "NOTE";
- readonly COMMENT_MARKER: "COMMENT_MARKER";
- readonly TEXT: "TEXT";
- readonly CALLOUT: "CALLOUT";
- readonly PAN: "PAN";
- readonly SEARCH: "SEARCH";
- readonly DOCUMENT_EDITOR: "DOCUMENT_EDITOR";
- readonly MARQUEE_ZOOM: "MARQUEE_ZOOM";
- readonly REDACT_TEXT_HIGHLIGHTER: "REDACT_TEXT_HIGHLIGHTER";
- readonly REDACT_SHAPE_RECTANGLE: "REDACT_SHAPE_RECTANGLE";
- readonly DOCUMENT_CROP: "DOCUMENT_CROP";
- readonly BUTTON_WIDGET: "BUTTON_WIDGET";
- readonly TEXT_WIDGET: "TEXT_WIDGET";
- readonly RADIO_BUTTON_WIDGET: "RADIO_BUTTON_WIDGET";
- readonly CHECKBOX_WIDGET: "CHECKBOX_WIDGET";
- readonly COMBO_BOX_WIDGET: "COMBO_BOX_WIDGET";
- readonly LIST_BOX_WIDGET: "LIST_BOX_WIDGET";
- readonly SIGNATURE_WIDGET: "SIGNATURE_WIDGET";
- readonly DATE_WIDGET: "DATE_WIDGET";
- readonly FORM_CREATOR: "FORM_CREATOR";
- readonly LINK: "LINK";
- readonly DISTANCE: "DISTANCE";
- readonly PERIMETER: "PERIMETER";
- readonly RECTANGLE_AREA: "RECTANGLE_AREA";
- readonly ELLIPSE_AREA: "ELLIPSE_AREA";
- readonly POLYGON_AREA: "POLYGON_AREA";
- readonly CONTENT_EDITOR: "CONTENT_EDITOR";
- readonly MULTI_ANNOTATIONS_SELECTION: "MULTI_ANNOTATIONS_SELECTION";
- readonly MEASUREMENT: "MEASUREMENT";
- readonly MEASUREMENT_SETTINGS: "MEASUREMENT_SETTINGS";
- };
- unstable_InkEraserMode: {
- readonly POINT: "POINT";
- readonly STROKE: "STROKE";
- };
- SidebarMode: {
- readonly ANNOTATIONS: "ANNOTATIONS";
- readonly BOOKMARKS: "BOOKMARKS";
- readonly DOCUMENT_OUTLINE: "DOCUMENT_OUTLINE";
- readonly THUMBNAILS: "THUMBNAILS";
- readonly SIGNATURES: "SIGNATURES";
- readonly LAYERS: "LAYERS";
- readonly CUSTOM: "CUSTOM";
- };
- UIElement: {
- readonly Sidebar: "Sidebar";
- };
- Alignment: {
- readonly START: "START";
- readonly END: "END";
- };
- BlendMode: {
- readonly normal: "normal";
- readonly multiply: "multiply";
- readonly screen: "screen";
- readonly overlay: "overlay";
- readonly darken: "darken";
- readonly lighten: "lighten";
- readonly colorDodge: "colorDodge";
- readonly colorBurn: "colorBurn";
- readonly hardLight: "hardLight";
- readonly softLight: "softLight";
- readonly difference: "difference";
- readonly exclusion: "exclusion";
- };
- BorderStyle: {
- readonly solid: "solid";
- readonly dashed: "dashed";
- readonly beveled: "beveled";
- readonly inset: "inset";
- readonly underline: "underline";
- };
- LineCap: {
- readonly square: "square";
- readonly circle: "circle";
- readonly diamond: "diamond";
- readonly openArrow: "openArrow";
- readonly closedArrow: "closedArrow";
- readonly butt: "butt";
- readonly reverseOpenArrow: "reverseOpenArrow";
- readonly reverseClosedArrow: "reverseClosedArrow";
- readonly slash: "slash";
- };
- SidebarPlacement: {
- readonly START: "START";
- readonly END: "END";
- };
- SignatureAppearanceMode: {
- readonly signatureOnly: "signatureOnly";
- readonly signatureAndDescription: "signatureAndDescription";
- readonly descriptionOnly: "descriptionOnly";
- };
- ShowSignatureValidationStatusMode: {
- readonly IF_SIGNED: "IF_SIGNED";
- readonly HAS_WARNINGS: "HAS_WARNINGS";
- readonly HAS_ERRORS: "HAS_ERRORS";
- readonly NEVER: "NEVER";
- };
- NoteIcon: {
- readonly COMMENT: "COMMENT";
- readonly RIGHT_POINTER: "RIGHT_POINTER";
- readonly RIGHT_ARROW: "RIGHT_ARROW";
- readonly CHECK: "CHECK";
- readonly CIRCLE: "CIRCLE";
- readonly CROSS: "CROSS";
- readonly INSERT: "INSERT";
- readonly NEW_PARAGRAPH: "NEW_PARAGRAPH";
- readonly NOTE: "NOTE";
- readonly PARAGRAPH: "PARAGRAPH";
- readonly HELP: "HELP";
- readonly STAR: "STAR";
- readonly KEY: "KEY";
- };
- Theme: {
- readonly LIGHT: "LIGHT";
- readonly DARK: "DARK";
- readonly AUTO: "AUTO";
- };
- ToolbarPlacement: {
- readonly TOP: "TOP";
- readonly BOTTOM: "BOTTOM";
- };
- ElectronicSignatureCreationMode: {
- readonly DRAW: "DRAW";
- readonly IMAGE: "IMAGE";
- readonly TYPE: "TYPE";
- };
- I18n: {
- locales: any;
- messages: {};
- preloadLocalizationData: (locale: string, options?: {
- baseUrl?: string | undefined;
- }) => Promise<void>;
- };
- baseUrl: string | undefined;
- DocumentIntegrityStatus: {
- readonly ok: "ok";
- readonly tampered_document: "tampered_document";
- readonly failed_to_retrieve_signature_contents: "failed_to_retrieve_signature_contents";
- readonly failed_to_retrieve_byterange: "failed_to_retrieve_byterange";
- readonly failed_to_compute_digest: "failed_to_compute_digest";
- readonly failed_retrieve_signing_certificate: "failed_retrieve_signing_certificate";
- readonly failed_retrieve_public_key: "failed_retrieve_public_key";
- readonly failed_encryption_padding: "failed_encryption_padding";
- readonly tampered_or_invalid_timestamp: "tampered_or_invalid_timestamp";
- readonly general_failure: "general_failure";
- };
- SignatureValidationStatus: {
- readonly valid: "valid";
- readonly warning: "warning";
- readonly error: "error";
- };
- SignatureType: {
- CMS: string;
- CAdES: string;
- };
- SignatureContainerType: {
- raw: string;
- pkcs7: string;
- };
- PAdESLevel: {
- readonly b_b: "b-b";
- readonly b_t: "b-t";
- readonly b_lt: "b-lt";
- };
- CertificateChainValidationStatus: {
- readonly ok: "ok";
- readonly ok_but_self_signed: "ok_but_self_signed";
- readonly ok_but_could_not_check_revocation: "ok_but_could_not_check_revocation";
- readonly untrusted: "untrusted";
- readonly expired: "expired";
- readonly not_yet_valid: "not_yet_valid";
- readonly invalid: "invalid";
- readonly revoked: "revoked";
- readonly failed_to_retrieve_signature_contents: "failed_to_retrieve_signature_contents";
- readonly general_validation_problem: "general_validation_problem";
- };
- DocumentValidationStatus: {
- valid: string;
- warning: string;
- error: string;
- not_signed: string;
- };
- AnnotationsWillChangeReason: typeof AnnotationsWillChangeReason;
- DocumentComparisonSourceType: {
- readonly USE_OPEN_DOCUMENT: "USE_OPEN_DOCUMENT";
- readonly USE_FILE_DIALOG: "USE_FILE_DIALOG";
- };
- MeasurementScaleUnitFrom: {
- readonly INCHES: "in";
- readonly MILLIMETERS: "mm";
- readonly CENTIMETERS: "cm";
- readonly POINTS: "pt";
- };
- MeasurementScaleUnitTo: {
- readonly INCHES: "in";
- readonly MILLIMETERS: "mm";
- readonly CENTIMETERS: "cm";
- readonly POINTS: "pt";
- readonly FEET: "ft";
- readonly METERS: "m";
- readonly YARDS: "yd";
- readonly KILOMETERS: "km";
- readonly MILES: "mi";
- };
- MeasurementPrecision: {
- readonly WHOLE: "whole";
- readonly ONE: "oneDp";
- readonly TWO: "twoDp";
- readonly THREE: "threeDp";
- readonly FOUR: "fourDp";
- readonly HALVES: "1/2";
- readonly QUARTERS: "1/4";
- readonly EIGHTHS: "1/8";
- readonly SIXTEENTHS: "1/16";
- };
- MeasurementScale: typeof MeasurementScale;
- ProductId: {
- SharePoint: string;
- Salesforce: string;
- Maui_Android: string;
- Maui_iOS: string;
- Maui_MacCatalyst: string;
- Maui_Windows: string;
- FlutterForWeb: string;
- Electron: string;
- };
- ProcessorEngine: {
- smallerSize: string;
- fasterProcessing: string;
- };
- Conformance: {
- readonly PDFA_1A: "pdfa-1a";
- readonly PDFA_1B: "pdfa-1b";
- readonly PDFA_2A: "pdfa-2a";
- readonly PDFA_2U: "pdfa-2u";
- readonly PDFA_2B: "pdfa-2b";
- readonly PDFA_3A: "pdfa-3a";
- readonly PDFA_3U: "pdfa-3u";
- readonly PDFA_3B: "pdfa-3b";
- readonly PDFA_4: "pdfa-4";
- readonly PDFA_4E: "pdfa-4e";
- readonly PDFA_4F: "pdfa-4f";
- };
- DocumentPermissions: {
- readonly annotationsAndForms: "annotationsAndForms";
- readonly assemble: "assemble";
- readonly extract: "extract";
- readonly extractAccessibility: "extractAccessibility";
- readonly fillForms: "fillForms";
- readonly modification: "modification";
- readonly printHighQuality: "printHighQuality";
- readonly printing: "printing";
- };
- ComparisonOperation: typeof ComparisonOperation;
- DocumentDescriptor: typeof DocumentDescriptor;
- ComparisonOperationType: {
- readonly TEXT: "text";
- };
- OfficeDocumentFormat: {
- docx: string;
- xlsx: string;
- pptx: string;
- };
- viewStateFromOpenParameters: typeof viewStateFromOpenParameters;
- readonly defaultElectronicSignatureColorPresets: ColorPreset[];
- readonly defaultToolbarItems: readonly [{
- readonly type: "sidebar-thumbnails";
- }, {
- readonly type: "sidebar-document-outline";
- }, {
- readonly type: "sidebar-annotations";
- }, {
- readonly type: "sidebar-bookmarks";
- }, {
- readonly type: "sidebar-signatures";
- }, {
- readonly type: "sidebar-layers";
- }, {
- readonly type: "pager";
- }, {
- readonly type: "multi-annotations-selection";
- }, {
- readonly type: "pan";
- }, {
- readonly type: "zoom-out";
- }, {
- readonly type: "zoom-in";
- }, {
- readonly type: "zoom-mode";
- }, {
- readonly type: "spacer";
- }, {
- readonly type: "annotate";
- }, {
- readonly type: "ink";
- }, {
- readonly type: "highlighter";
- }, {
- readonly type: "text-highlighter";
- }, {
- readonly type: "ink-eraser";
- }, {
- readonly type: "signature";
- }, {
- readonly type: "image";
- }, {
- readonly type: "stamp";
- }, {
- readonly type: "note";
- }, {
- readonly type: "text";
- }, {
- readonly type: "callout";
- }, {
- readonly type: "line";
- }, {
- readonly type: "link";
- }, {
- readonly type: "arrow";
- }, {
- readonly type: "rectangle";
- }, {
- readonly type: "ellipse";
- }, {
- readonly type: "polygon";
- }, {
- readonly type: "cloudy-polygon";
- }, {
- readonly type: "polyline";
- }, {
- readonly type: "print";
- }, {
- readonly type: "document-editor";
- }, {
- readonly type: "document-crop";
- }, {
- readonly type: "search";
- }, {
- readonly type: "export-pdf";
- }, {
- readonly type: "debug";
- }];
- readonly defaultDocumentEditorFooterItems: {
- type: BuiltInDocumentEditorFooterItem;
- }[];
- readonly defaultDocumentEditorToolbarItems: {
- type: BuiltInDocumentEditorToolbarItem;
- }[];
- readonly defaultAnnotationPresets: {
- [key: string]: Record<string, unknown>;
- };
- readonly defaultStampAnnotationTemplates: StampAnnotation<IStampAnnotation>[];
- readonly defaultAnnotationsSidebarContent: readonly [typeof EllipseAnnotation, typeof HighlightAnnotation, typeof ImageAnnotation, typeof InkAnnotation, typeof LineAnnotation, typeof NoteAnnotation, typeof PolygonAnnotation, typeof PolylineAnnotation, typeof RectangleAnnotation, typeof SquiggleAnnotation, typeof StampAnnotation, typeof StrikeOutAnnotation, typeof TextAnnotation, typeof UnderlineAnnotation, typeof WidgetAnnotation];
- defaultEditableAnnotationTypes: readonly (typeof TextAnnotation | typeof CommentMarkerAnnotation)[];
- defaultElectronicSignatureCreationModes: readonly ("DRAW" | "IMAGE" | "TYPE")[];
- defaultSigningFonts: readonly Font[];
- Options: {
- MIN_TEXT_ANNOTATION_SIZE: number;
- MIN_INK_ANNOTATION_SIZE: number;
- MIN_SHAPE_ANNOTATION_SIZE: number;
- MIN_IMAGE_ANNOTATION_SIZE: number;
- MIN_STAMP_ANNOTATION_SIZE: number;
- MIN_WIDGET_ANNOTATION_SIZE: number;
- ENABLE_INK_SMOOTH_LINES: boolean;
- INK_EPSILON_RANGE_OPTIMIZATION: number;
- SIGNATURE_SAVE_MODE: ISignatureSaveMode;
- INITIAL_DESKTOP_SIDEBAR_WIDTH: number;
- IGNORE_DOCUMENT_PERMISSIONS: boolean;
- SELECTION_OUTLINE_PADDING: (viewportSize: Size) => number;
- RESIZE_ANCHOR_RADIUS: (viewportSize: Size) => number;
- SELECTION_STROKE_WIDTH: number;
- TEXT_ANNOTATION_AUTOFIT_TEXT_ON_EXPORT: boolean;
- TEXT_ANNOTATION_AUTOFIT_BOUNDING_BOX_ON_EDIT: boolean;
- DISABLE_KEYBOARD_SHORTCUTS: boolean;
- DEFAULT_INK_ERASER_CURSOR_WIDTH: number;
- COLOR_PRESETS: ColorPreset[];
- LINE_CAP_PRESETS: string[];
- LINE_WIDTH_PRESETS: number[] | null | undefined;
- HIGHLIGHT_COLOR_PRESETS: ColorPreset[];
- TEXT_MARKUP_COLOR_PRESETS: ColorPreset[];
- NOTE_COLOR_PRESETS: ColorPreset[];
- PDF_JAVASCRIPT: boolean;
- BREAKPOINT_MD_TOOLBAR: number;
- BREAKPOINT_SM_TOOLBAR: number;
- };
- SearchPattern: {
- readonly CREDIT_CARD_NUMBER: "credit_card_number";
- readonly DATE: "date";
- readonly TIME: "time";
- readonly EMAIL_ADDRESS: "email_address";
- readonly INTERNATIONAL_PHONE_NUMBER: "international_phone_number";
- readonly IP_V4: "ipv4";
- readonly IP_V6: "ipv6";
- readonly MAC_ADDRESS: "mac_address";
- readonly NORTH_AMERICAN_PHONE_NUMBER: "north_american_phone_number";
- readonly SOCIAL_SECURITY_NUMBER: "social_security_number";
- readonly URL: "url";
- readonly US_ZIP_CODE: "us_zip_code";
- readonly VIN: "vin";
- };
- SearchType: {
- readonly TEXT: "text";
- readonly PRESET: "preset";
- readonly REGEX: "regex";
- };
- UIDateTimeElement: {
- readonly COMMENT_THREAD: "COMMENT_THREAD";
- readonly ANNOTATIONS_SIDEBAR: "ANNOTATIONS_SIDEBAR";
- };
- generateInstantId: typeof generateInstantId;
- Font: typeof Font;
- };
-
- export { Action, Annotation, type AnnotationToolbarItem, type AnnotationsUnion, AnnotationsWillChangeReason, Bookmark, ButtonFormField, CheckBoxFormField, ChoiceFormField, Color$2 as Color, ComboBoxFormField, Comment$1 as Comment, CommentMarkerAnnotation, type Configuration, Conformance, CustomOverlayItem, type DocumentEditorFooterItem, type DocumentEditorToolbarItem, DrawingPoint, EllipseAnnotation, type EllipseAnnotationJSON, Font, FormField, FormFieldValue, FormOption, GoToAction, GoToEmbeddedAction, GoToRemoteAction, HideAction, HighlightAnnotation, ImageAnnotation, type ImageAnnotationJSON, InkAnnotation, type InkAnnotationJSON, Inset, Instance, InstantClient, Interfaces, JavaScriptAction, LaunchAction, LineAnnotation, type LineAnnotationJSON, LinkAnnotation, List, ListBoxFormField, type MentionableUser$1 as MentionableUser, NamedAction, NoteAnnotation, type NoteAnnotationJSON, OutlineElement, PageInfo, Point, PolygonAnnotation, type PolygonAnnotationJSON, PolylineAnnotation, type PolylineAnnotationJSON, RadioButtonFormField, Rect, RectangleAnnotation, type RectangleAnnotationJSON, RedactionAnnotation, type RedactionAnnotationJSON, ResetFormAction, SearchResult, SearchState, type ServerConfiguration, ShapeAnnotation, type ShapeAnnotationsUnion, SignatureFormField, Size, SquiggleAnnotation, StampAnnotation, type StampAnnotationJSON, type StandaloneConfiguration, StrikeOutAnnotation, SubmitFormAction, type TemplateDataToPopulateDocument, TextAnnotation, type TextAnnotationJSON, TextFormField, TextLine, TextMarkupAnnotation, type TextMarkupAnnotationJSON, type TextMarkupAnnotationsUnion, PublicTextSelection as TextSelection, type ToolbarItem, URIAction, UnderlineAnnotation, UnknownAnnotation, type UnknownAnnotationJSON, ViewState, WidgetAnnotation, type WidgetAnnotationJSON, PSPDFKit as default };
|