You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.d.ts 635KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084
  1. /// <reference types="react" />
  2. import * as React from 'react';
  3. 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';
  4. declare const SignatureSaveMode: {
  5. readonly ALWAYS: "ALWAYS";
  6. readonly NEVER: "NEVER";
  7. readonly USING_UI: "USING_UI";
  8. };
  9. type ISignatureSaveMode = (typeof SignatureSaveMode)[keyof typeof SignatureSaveMode];
  10. /**
  11. * Copyright (c) 2014-present, Facebook, Inc.
  12. *
  13. * This source code is licensed under the MIT license found in the
  14. * LICENSE file in the root directory of this source tree.
  15. */
  16. /**
  17. * Immutable data encourages pure functions (data-in, data-out) and lends itself
  18. * to much simpler application development and enabling techniques from
  19. * functional programming such as lazy evaluation.
  20. *
  21. * While designed to bring these powerful functional concepts to JavaScript, it
  22. * presents an Object-Oriented API familiar to Javascript engineers and closely
  23. * mirroring that of Array, Map, and Set. It is easy and efficient to convert to
  24. * and from plain Javascript types.
  25. *
  26. * ## How to read these docs
  27. *
  28. * In order to better explain what kinds of values the Immutable.js API expects
  29. * and produces, this documentation is presented in a statically typed dialect of
  30. * JavaScript (like [Flow][] or [TypeScript][]). You *don't need* to use these
  31. * type checking tools in order to use Immutable.js, however becoming familiar
  32. * with their syntax will help you get a deeper understanding of this API.
  33. *
  34. * **A few examples and how to read them.**
  35. *
  36. * All methods describe the kinds of data they accept and the kinds of data
  37. * they return. For example a function which accepts two numbers and returns
  38. * a number would look like this:
  39. *
  40. * ```js
  41. * sum(first: number, second: number): number
  42. * ```
  43. *
  44. * Sometimes, methods can accept different kinds of data or return different
  45. * kinds of data, and this is described with a *type variable*, which is
  46. * typically in all-caps. For example, a function which always returns the same
  47. * kind of data it was provided would look like this:
  48. *
  49. * ```js
  50. * identity<T>(value: T): T
  51. * ```
  52. *
  53. * Type variables are defined with classes and referred to in methods. For
  54. * example, a class that holds onto a value for you might look like this:
  55. *
  56. * ```js
  57. * class Box<T> {
  58. * constructor(value: T)
  59. * getValue(): T
  60. * }
  61. * ```
  62. *
  63. * In order to manipulate Immutable data, methods that we're used to affecting
  64. * a Collection instead return a new Collection of the same type. The type
  65. * `this` refers to the same kind of class. For example, a List which returns
  66. * new Lists when you `push` a value onto it might look like:
  67. *
  68. * ```js
  69. * class List<T> {
  70. * push(value: T): this
  71. * }
  72. * ```
  73. *
  74. * Many methods in Immutable.js accept values which implement the JavaScript
  75. * [Iterable][] protocol, and might appear like `Iterable<string>` for something
  76. * which represents sequence of strings. Typically in JavaScript we use plain
  77. * Arrays (`[]`) when an Iterable is expected, but also all of the Immutable.js
  78. * collections are iterable themselves!
  79. *
  80. * For example, to get a value deep within a structure of data, we might use
  81. * `getIn` which expects an `Iterable` path:
  82. *
  83. * ```
  84. * getIn(path: Iterable<string | number>): any
  85. * ```
  86. *
  87. * To use this method, we could pass an array: `data.getIn([ "key", 2 ])`.
  88. *
  89. *
  90. * Note: All examples are presented in the modern [ES2015][] version of
  91. * JavaScript. Use tools like Babel to support older browsers.
  92. *
  93. * For example:
  94. *
  95. * ```js
  96. * // ES2015
  97. * const mappedFoo = foo.map(x => x * x);
  98. * // ES5
  99. * var mappedFoo = foo.map(function (x) { return x * x; });
  100. * ```
  101. *
  102. * [ES2015]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla
  103. * [TypeScript]: http://www.typescriptlang.org/
  104. * [Flow]: https://flowtype.org/
  105. * [Iterable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols
  106. */
  107. /**
  108. * Lists are ordered indexed dense collections, much like a JavaScript
  109. * Array.
  110. *
  111. * Lists are immutable and fully persistent with O(log32 N) gets and sets,
  112. * and O(1) push and pop.
  113. *
  114. * Lists implement Deque, with efficient addition and removal from both the
  115. * end (`push`, `pop`) and beginning (`unshift`, `shift`).
  116. *
  117. * Unlike a JavaScript Array, there is no distinction between an
  118. * "unset" index and an index set to `undefined`. `List#forEach` visits all
  119. * indices from 0 to size, regardless of whether they were explicitly defined.
  120. */
  121. declare module List {
  122. /**
  123. * True if the provided value is a List
  124. *
  125. * <!-- runkit:activate -->
  126. * ```js
  127. * const { List } = require('immutable');
  128. * List.isList([]); // false
  129. * List.isList(List()); // true
  130. * ```
  131. */
  132. function isList(maybeList: any): maybeList is List<any>;
  133. /**
  134. * Creates a new List containing `values`.
  135. *
  136. * <!-- runkit:activate -->
  137. * ```js
  138. * const { List } = require('immutable');
  139. * List.of(1, 2, 3, 4)
  140. * // List [ 1, 2, 3, 4 ]
  141. * ```
  142. *
  143. * Note: Values are not altered or converted in any way.
  144. *
  145. * <!-- runkit:activate -->
  146. * ```js
  147. * const { List } = require('immutable');
  148. * List.of({x:1}, 2, [3], 4)
  149. * // List [ { x: 1 }, 2, [ 3 ], 4 ]
  150. * ```
  151. */
  152. function of<T>(...values: Array<T>): List<T>;
  153. }
  154. /**
  155. * Create a new immutable List containing the values of the provided
  156. * collection-like.
  157. *
  158. * Note: `List` is a factory function and not a class, and does not use the
  159. * `new` keyword during construction.
  160. *
  161. * <!-- runkit:activate -->
  162. * ```js
  163. * const { List, Set } = require('immutable')
  164. *
  165. * const emptyList = List()
  166. * // List []
  167. *
  168. * const plainArray = [ 1, 2, 3, 4 ]
  169. * const listFromPlainArray = List(plainArray)
  170. * // List [ 1, 2, 3, 4 ]
  171. *
  172. * const plainSet = Set([ 1, 2, 3, 4 ])
  173. * const listFromPlainSet = List(plainSet)
  174. * // List [ 1, 2, 3, 4 ]
  175. *
  176. * const arrayIterator = plainArray[Symbol.iterator]()
  177. * const listFromCollectionArray = List(arrayIterator)
  178. * // List [ 1, 2, 3, 4 ]
  179. *
  180. * listFromPlainArray.equals(listFromCollectionArray) // true
  181. * listFromPlainSet.equals(listFromCollectionArray) // true
  182. * listFromPlainSet.equals(listFromPlainArray) // true
  183. * ```
  184. */
  185. declare function List(): List<any>;
  186. declare function List<T>(): List<T>;
  187. declare function List<T>(collection: Iterable<T>): List<T>;
  188. interface List<T> extends Collection$1.Indexed<T> {
  189. /**
  190. * The number of items in this List.
  191. */
  192. readonly size: number;
  193. // Persistent changes
  194. /**
  195. * Returns a new List which includes `value` at `index`. If `index` already
  196. * exists in this List, it will be replaced.
  197. *
  198. * `index` may be a negative number, which indexes back from the end of the
  199. * List. `v.set(-1, "value")` sets the last item in the List.
  200. *
  201. * If `index` larger than `size`, the returned List's `size` will be large
  202. * enough to include the `index`.
  203. *
  204. * <!-- runkit:activate
  205. * { "preamble": "const { List } = require('immutable');" }
  206. * -->
  207. * ```js
  208. * const originalList = List([ 0 ]);
  209. * // List [ 0 ]
  210. * originalList.set(1, 1);
  211. * // List [ 0, 1 ]
  212. * originalList.set(0, 'overwritten');
  213. * // List [ "overwritten" ]
  214. * originalList.set(2, 2);
  215. * // List [ 0, undefined, 2 ]
  216. *
  217. * List().set(50000, 'value').size;
  218. * // 50001
  219. * ```
  220. *
  221. * Note: `set` can be used in `withMutations`.
  222. */
  223. set(index: number, value: T): List<T>;
  224. /**
  225. * Returns a new List which excludes this `index` and with a size 1 less
  226. * than this List. Values at indices above `index` are shifted down by 1 to
  227. * fill the position.
  228. *
  229. * This is synonymous with `list.splice(index, 1)`.
  230. *
  231. * `index` may be a negative number, which indexes back from the end of the
  232. * List. `v.delete(-1)` deletes the last item in the List.
  233. *
  234. * Note: `delete` cannot be safely used in IE8
  235. *
  236. * <!-- runkit:activate
  237. * { "preamble": "const { List } = require('immutable');" }
  238. * -->
  239. * ```js
  240. * List([ 0, 1, 2, 3, 4 ]).delete(0);
  241. * // List [ 1, 2, 3, 4 ]
  242. * ```
  243. *
  244. * Since `delete()` re-indexes values, it produces a complete copy, which
  245. * has `O(N)` complexity.
  246. *
  247. * Note: `delete` *cannot* be used in `withMutations`.
  248. *
  249. * @alias remove
  250. */
  251. delete(index: number): List<T>;
  252. remove(index: number): List<T>;
  253. /**
  254. * Returns a new List with `value` at `index` with a size 1 more than this
  255. * List. Values at indices above `index` are shifted over by 1.
  256. *
  257. * This is synonymous with `list.splice(index, 0, value)`.
  258. *
  259. * <!-- runkit:activate
  260. * { "preamble": "const { List } = require('immutable');" }
  261. * -->
  262. * ```js
  263. * List([ 0, 1, 2, 3, 4 ]).insert(6, 5)
  264. * // List [ 0, 1, 2, 3, 4, 5 ]
  265. * ```
  266. *
  267. * Since `insert()` re-indexes values, it produces a complete copy, which
  268. * has `O(N)` complexity.
  269. *
  270. * Note: `insert` *cannot* be used in `withMutations`.
  271. */
  272. insert(index: number, value: T): List<T>;
  273. /**
  274. * Returns a new List with 0 size and no values in constant time.
  275. *
  276. * <!-- runkit:activate
  277. * { "preamble": "const { List } = require('immutable');" }
  278. * -->
  279. * ```js
  280. * List([ 1, 2, 3, 4 ]).clear()
  281. * // List []
  282. * ```
  283. *
  284. * Note: `clear` can be used in `withMutations`.
  285. */
  286. clear(): List<T>;
  287. /**
  288. * Returns a new List with the provided `values` appended, starting at this
  289. * List's `size`.
  290. *
  291. * <!-- runkit:activate
  292. * { "preamble": "const { List } = require('immutable');" }
  293. * -->
  294. * ```js
  295. * List([ 1, 2, 3, 4 ]).push(5)
  296. * // List [ 1, 2, 3, 4, 5 ]
  297. * ```
  298. *
  299. * Note: `push` can be used in `withMutations`.
  300. */
  301. push(...values: Array<T>): List<T>;
  302. /**
  303. * Returns a new List with a size ones less than this List, excluding
  304. * the last index in this List.
  305. *
  306. * Note: this differs from `Array#pop` because it returns a new
  307. * List rather than the removed value. Use `last()` to get the last value
  308. * in this List.
  309. *
  310. * ```js
  311. * List([ 1, 2, 3, 4 ]).pop()
  312. * // List[ 1, 2, 3 ]
  313. * ```
  314. *
  315. * Note: `pop` can be used in `withMutations`.
  316. */
  317. pop(): List<T>;
  318. /**
  319. * Returns a new List with the provided `values` prepended, shifting other
  320. * values ahead to higher indices.
  321. *
  322. * <!-- runkit:activate
  323. * { "preamble": "const { List } = require('immutable');" }
  324. * -->
  325. * ```js
  326. * List([ 2, 3, 4]).unshift(1);
  327. * // List [ 1, 2, 3, 4 ]
  328. * ```
  329. *
  330. * Note: `unshift` can be used in `withMutations`.
  331. */
  332. unshift(...values: Array<T>): List<T>;
  333. /**
  334. * Returns a new List with a size ones less than this List, excluding
  335. * the first index in this List, shifting all other values to a lower index.
  336. *
  337. * Note: this differs from `Array#shift` because it returns a new
  338. * List rather than the removed value. Use `first()` to get the first
  339. * value in this List.
  340. *
  341. * <!-- runkit:activate
  342. * { "preamble": "const { List } = require('immutable');" }
  343. * -->
  344. * ```js
  345. * List([ 0, 1, 2, 3, 4 ]).shift();
  346. * // List [ 1, 2, 3, 4 ]
  347. * ```
  348. *
  349. * Note: `shift` can be used in `withMutations`.
  350. */
  351. shift(): List<T>;
  352. /**
  353. * Returns a new List with an updated value at `index` with the return
  354. * value of calling `updater` with the existing value, or `notSetValue` if
  355. * `index` was not set. If called with a single argument, `updater` is
  356. * called with the List itself.
  357. *
  358. * `index` may be a negative number, which indexes back from the end of the
  359. * List. `v.update(-1)` updates the last item in the List.
  360. *
  361. * <!-- runkit:activate
  362. * { "preamble": "const { List } = require('immutable');" }
  363. * -->
  364. * ```js
  365. * const list = List([ 'a', 'b', 'c' ])
  366. * const result = list.update(2, val => val.toUpperCase())
  367. * // List [ "a", "b", "C" ]
  368. * ```
  369. *
  370. * This can be very useful as a way to "chain" a normal function into a
  371. * sequence of methods. RxJS calls this "let" and lodash calls it "thru".
  372. *
  373. * For example, to sum a List after mapping and filtering:
  374. *
  375. * <!-- runkit:activate
  376. * { "preamble": "const { List } = require('immutable');" }
  377. * -->
  378. * ```js
  379. * function sum(collection) {
  380. * return collection.reduce((sum, x) => sum + x, 0)
  381. * }
  382. *
  383. * List([ 1, 2, 3 ])
  384. * .map(x => x + 1)
  385. * .filter(x => x % 2 === 0)
  386. * .update(sum)
  387. * // 6
  388. * ```
  389. *
  390. * Note: `update(index)` can be used in `withMutations`.
  391. *
  392. * @see `Map#update`
  393. */
  394. update(index: number, notSetValue: T, updater: (value: T) => T): this;
  395. update(index: number, updater: (value: T) => T): this;
  396. update<R>(updater: (value: this) => R): R;
  397. /**
  398. * Returns a new List with size `size`. If `size` is less than this
  399. * List's size, the new List will exclude values at the higher indices.
  400. * If `size` is greater than this List's size, the new List will have
  401. * undefined values for the newly available indices.
  402. *
  403. * When building a new List and the final size is known up front, `setSize`
  404. * used in conjunction with `withMutations` may result in the more
  405. * performant construction.
  406. */
  407. setSize(size: number): List<T>;
  408. // Deep persistent changes
  409. /**
  410. * Returns a new List having set `value` at this `keyPath`. If any keys in
  411. * `keyPath` do not exist, a new immutable Map will be created at that key.
  412. *
  413. * Index numbers are used as keys to determine the path to follow in
  414. * the List.
  415. *
  416. * <!-- runkit:activate -->
  417. * ```js
  418. * const { List } = require('immutable')
  419. * const list = List([ 0, 1, 2, List([ 3, 4 ])])
  420. * list.setIn([3, 0], 999);
  421. * // List [ 0, 1, 2, List [ 999, 4 ] ]
  422. * ```
  423. *
  424. * Plain JavaScript Object or Arrays may be nested within an Immutable.js
  425. * Collection, and setIn() can update those values as well, treating them
  426. * immutably by creating new copies of those values with the changes applied.
  427. *
  428. * <!-- runkit:activate -->
  429. * ```js
  430. * const { List } = require('immutable')
  431. * const list = List([ 0, 1, 2, { plain: 'object' }])
  432. * list.setIn([3, 'plain'], 'value');
  433. * // List([ 0, 1, 2, { plain: 'value' }])
  434. * ```
  435. *
  436. * Note: `setIn` can be used in `withMutations`.
  437. */
  438. setIn(keyPath: Iterable<any>, value: any): this;
  439. /**
  440. * Returns a new List having removed the value at this `keyPath`. If any
  441. * keys in `keyPath` do not exist, no change will occur.
  442. *
  443. * <!-- runkit:activate -->
  444. * ```js
  445. * const { List } = require('immutable')
  446. * const list = List([ 0, 1, 2, List([ 3, 4 ])])
  447. * list.deleteIn([3, 0]);
  448. * // List [ 0, 1, 2, List [ 4 ] ]
  449. * ```
  450. *
  451. * Plain JavaScript Object or Arrays may be nested within an Immutable.js
  452. * Collection, and removeIn() can update those values as well, treating them
  453. * immutably by creating new copies of those values with the changes applied.
  454. *
  455. * <!-- runkit:activate -->
  456. * ```js
  457. * const { List } = require('immutable')
  458. * const list = List([ 0, 1, 2, { plain: 'object' }])
  459. * list.removeIn([3, 'plain']);
  460. * // List([ 0, 1, 2, {}])
  461. * ```
  462. *
  463. * Note: `deleteIn` *cannot* be safely used in `withMutations`.
  464. *
  465. * @alias removeIn
  466. */
  467. deleteIn(keyPath: Iterable<any>): this;
  468. removeIn(keyPath: Iterable<any>): this;
  469. /**
  470. * Note: `updateIn` can be used in `withMutations`.
  471. *
  472. * @see `Map#updateIn`
  473. */
  474. updateIn(keyPath: Iterable<any>, notSetValue: any, updater: (value: any) => any): this;
  475. updateIn(keyPath: Iterable<any>, updater: (value: any) => any): this;
  476. /**
  477. * Note: `mergeIn` can be used in `withMutations`.
  478. *
  479. * @see `Map#mergeIn`
  480. */
  481. mergeIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
  482. /**
  483. * Note: `mergeDeepIn` can be used in `withMutations`.
  484. *
  485. * @see `Map#mergeDeepIn`
  486. */
  487. mergeDeepIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
  488. // Transient changes
  489. /**
  490. * Note: Not all methods can be safely used on a mutable collection or within
  491. * `withMutations`! Check the documentation for each method to see if it
  492. * allows being used in `withMutations`.
  493. *
  494. * @see `Map#withMutations`
  495. */
  496. withMutations(mutator: (mutable: this) => any): this;
  497. /**
  498. * An alternative API for withMutations()
  499. *
  500. * Note: Not all methods can be safely used on a mutable collection or within
  501. * `withMutations`! Check the documentation for each method to see if it
  502. * allows being used in `withMutations`.
  503. *
  504. * @see `Map#asMutable`
  505. */
  506. asMutable(): this;
  507. /**
  508. * @see `Map#wasAltered`
  509. */
  510. wasAltered(): boolean;
  511. /**
  512. * @see `Map#asImmutable`
  513. */
  514. asImmutable(): this;
  515. // Sequence algorithms
  516. /**
  517. * Returns a new List with other values or collections concatenated to this one.
  518. *
  519. * Note: `concat` can be used in `withMutations`.
  520. *
  521. * @alias merge
  522. */
  523. concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): List<T | C>;
  524. merge<C>(...collections: Array<Iterable<C>>): List<T | C>;
  525. /**
  526. * Returns a new List with values passed through a
  527. * `mapper` function.
  528. *
  529. * <!-- runkit:activate
  530. * { "preamble": "const { List } = require('immutable');" }
  531. * -->
  532. * ```js
  533. * List([ 1, 2 ]).map(x => 10 * x)
  534. * // List [ 10, 20 ]
  535. * ```
  536. */
  537. map<M>(
  538. mapper: (value: T, key: number, iter: this) => M,
  539. context?: any
  540. ): List<M>;
  541. /**
  542. * Flat-maps the List, returning a new List.
  543. *
  544. * Similar to `list.map(...).flatten(true)`.
  545. */
  546. flatMap<M>(
  547. mapper: (value: T, key: number, iter: this) => Iterable<M>,
  548. context?: any
  549. ): List<M>;
  550. /**
  551. * Returns a new List with only the values for which the `predicate`
  552. * function returns true.
  553. *
  554. * Note: `filter()` always returns a new instance, even if it results in
  555. * not filtering out any values.
  556. */
  557. filter<F extends T>(
  558. predicate: (value: T, index: number, iter: this) => value is F,
  559. context?: any
  560. ): List<F>;
  561. filter(
  562. predicate: (value: T, index: number, iter: this) => any,
  563. context?: any
  564. ): this;
  565. /**
  566. * Returns a List "zipped" with the provided collection.
  567. *
  568. * Like `zipWith`, but using the default `zipper`: creating an `Array`.
  569. *
  570. * <!-- runkit:activate
  571. * { "preamble": "const { List } = require('immutable');" }
  572. * -->
  573. * ```js
  574. * const a = List([ 1, 2, 3 ]);
  575. * const b = List([ 4, 5, 6 ]);
  576. * const c = a.zip(b); // List [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ]
  577. * ```
  578. */
  579. zip<U>(other: Collection$1<any, U>): List<[T,U]>;
  580. zip<U,V>(other: Collection$1<any, U>, other2: Collection$1<any,V>): List<[T,U,V]>;
  581. zip(...collections: Array<Collection$1<any, any>>): List<any>;
  582. /**
  583. * Returns a List "zipped" with the provided collections.
  584. *
  585. * Unlike `zip`, `zipAll` continues zipping until the longest collection is
  586. * exhausted. Missing values from shorter collections are filled with `undefined`.
  587. *
  588. * <!-- runkit:activate
  589. * { "preamble": "const { List } = require('immutable');" }
  590. * -->
  591. * ```js
  592. * const a = List([ 1, 2 ]);
  593. * const b = List([ 3, 4, 5 ]);
  594. * const c = a.zipAll(b); // List [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ]
  595. * ```
  596. *
  597. * Note: Since zipAll will return a collection as large as the largest
  598. * input, some results may contain undefined values. TypeScript cannot
  599. * account for these without cases (as of v2.5).
  600. */
  601. zipAll<U>(other: Collection$1<any, U>): List<[T,U]>;
  602. zipAll<U,V>(other: Collection$1<any, U>, other2: Collection$1<any,V>): List<[T,U,V]>;
  603. zipAll(...collections: Array<Collection$1<any, any>>): List<any>;
  604. /**
  605. * Returns a List "zipped" with the provided collections by using a
  606. * custom `zipper` function.
  607. *
  608. * <!-- runkit:activate
  609. * { "preamble": "const { List } = require('immutable');" }
  610. * -->
  611. * ```js
  612. * const a = List([ 1, 2, 3 ]);
  613. * const b = List([ 4, 5, 6 ]);
  614. * const c = a.zipWith((a, b) => a + b, b);
  615. * // List [ 5, 7, 9 ]
  616. * ```
  617. */
  618. zipWith<U, Z>(
  619. zipper: (value: T, otherValue: U) => Z,
  620. otherCollection: Collection$1<any, U>
  621. ): List<Z>;
  622. zipWith<U, V, Z>(
  623. zipper: (value: T, otherValue: U, thirdValue: V) => Z,
  624. otherCollection: Collection$1<any, U>,
  625. thirdCollection: Collection$1<any, V>
  626. ): List<Z>;
  627. zipWith<Z>(
  628. zipper: (...any: Array<any>) => Z,
  629. ...collections: Array<Collection$1<any, any>>
  630. ): List<Z>;
  631. }
  632. /**
  633. * Immutable Map is an unordered Collection.Keyed of (key, value) pairs with
  634. * `O(log32 N)` gets and `O(log32 N)` persistent sets.
  635. *
  636. * Iteration order of a Map is undefined, however is stable. Multiple
  637. * iterations of the same Map will iterate in the same order.
  638. *
  639. * Map's keys can be of any type, and use `Immutable.is` to determine key
  640. * equality. This allows the use of any value (including NaN) as a key.
  641. *
  642. * Because `Immutable.is` returns equality based on value semantics, and
  643. * Immutable collections are treated as values, any Immutable collection may
  644. * be used as a key.
  645. *
  646. * <!-- runkit:activate -->
  647. * ```js
  648. * const { Map, List } = require('immutable');
  649. * Map().set(List([ 1 ]), 'listofone').get(List([ 1 ]));
  650. * // 'listofone'
  651. * ```
  652. *
  653. * Any JavaScript object may be used as a key, however strict identity is used
  654. * to evaluate key equality. Two similar looking objects will represent two
  655. * different keys.
  656. *
  657. * Implemented by a hash-array mapped trie.
  658. */
  659. declare module Map$1 {
  660. /**
  661. * True if the provided value is a Map
  662. *
  663. * <!-- runkit:activate -->
  664. * ```js
  665. * const { Map } = require('immutable')
  666. * Map.isMap({}) // false
  667. * Map.isMap(Map()) // true
  668. * ```
  669. */
  670. function isMap(maybeMap: any): maybeMap is Map$1<any, any>;
  671. /**
  672. * Creates a new Map from alternating keys and values
  673. *
  674. * <!-- runkit:activate -->
  675. * ```js
  676. * const { Map } = require('immutable')
  677. * Map.of(
  678. * 'key', 'value',
  679. * 'numerical value', 3,
  680. * 0, 'numerical key'
  681. * )
  682. * // Map { 0: "numerical key", "key": "value", "numerical value": 3 }
  683. * ```
  684. *
  685. * @deprecated Use Map([ [ 'k', 'v' ] ]) or Map({ k: 'v' })
  686. */
  687. function of(...keyValues: Array<any>): Map$1<any, any>;
  688. }
  689. /**
  690. * Creates a new Immutable Map.
  691. *
  692. * Created with the same key value pairs as the provided Collection.Keyed or
  693. * JavaScript Object or expects a Collection of [K, V] tuple entries.
  694. *
  695. * Note: `Map` is a factory function and not a class, and does not use the
  696. * `new` keyword during construction.
  697. *
  698. * <!-- runkit:activate -->
  699. * ```js
  700. * const { Map } = require('immutable')
  701. * Map({ key: "value" })
  702. * Map([ [ "key", "value" ] ])
  703. * ```
  704. *
  705. * Keep in mind, when using JS objects to construct Immutable Maps, that
  706. * JavaScript Object properties are always strings, even if written in a
  707. * quote-less shorthand, while Immutable Maps accept keys of any type.
  708. *
  709. * <!-- runkit:activate
  710. * { "preamble": "const { Map } = require('immutable');" }
  711. * -->
  712. * ```js
  713. * let obj = { 1: "one" }
  714. * Object.keys(obj) // [ "1" ]
  715. * assert.equal(obj["1"], obj[1]) // "one" === "one"
  716. *
  717. * let map = Map(obj)
  718. * assert.notEqual(map.get("1"), map.get(1)) // "one" !== undefined
  719. * ```
  720. *
  721. * Property access for JavaScript Objects first converts the key to a string,
  722. * but since Immutable Map keys can be of any type the argument to `get()` is
  723. * not altered.
  724. */
  725. declare function Map$1<K, V>(collection: Iterable<[K, V]>): Map$1<K, V>;
  726. declare function Map$1<T>(collection: Iterable<Iterable<T>>): Map$1<T, T>;
  727. declare function Map$1<V>(obj: {[key: string]: V}): Map$1<string, V>;
  728. declare function Map$1<K, V>(): Map$1<K, V>;
  729. declare function Map$1(): Map$1<any, any>;
  730. interface Map$1<K, V> extends Collection$1.Keyed<K, V> {
  731. /**
  732. * The number of entries in this Map.
  733. */
  734. readonly size: number;
  735. // Persistent changes
  736. /**
  737. * Returns a new Map also containing the new key, value pair. If an equivalent
  738. * key already exists in this Map, it will be replaced.
  739. *
  740. * <!-- runkit:activate -->
  741. * ```js
  742. * const { Map } = require('immutable')
  743. * const originalMap = Map()
  744. * const newerMap = originalMap.set('key', 'value')
  745. * const newestMap = newerMap.set('key', 'newer value')
  746. *
  747. * originalMap
  748. * // Map {}
  749. * newerMap
  750. * // Map { "key": "value" }
  751. * newestMap
  752. * // Map { "key": "newer value" }
  753. * ```
  754. *
  755. * Note: `set` can be used in `withMutations`.
  756. */
  757. set(key: K, value: V): this;
  758. /**
  759. * Returns a new Map which excludes this `key`.
  760. *
  761. * Note: `delete` cannot be safely used in IE8, but is provided to mirror
  762. * the ES6 collection API.
  763. *
  764. * <!-- runkit:activate -->
  765. * ```js
  766. * const { Map } = require('immutable')
  767. * const originalMap = Map({
  768. * key: 'value',
  769. * otherKey: 'other value'
  770. * })
  771. * // Map { "key": "value", "otherKey": "other value" }
  772. * originalMap.delete('otherKey')
  773. * // Map { "key": "value" }
  774. * ```
  775. *
  776. * Note: `delete` can be used in `withMutations`.
  777. *
  778. * @alias remove
  779. */
  780. delete(key: K): this;
  781. remove(key: K): this;
  782. /**
  783. * Returns a new Map which excludes the provided `keys`.
  784. *
  785. * <!-- runkit:activate -->
  786. * ```js
  787. * const { Map } = require('immutable')
  788. * const names = Map({ a: "Aaron", b: "Barry", c: "Connor" })
  789. * names.deleteAll([ 'a', 'c' ])
  790. * // Map { "b": "Barry" }
  791. * ```
  792. *
  793. * Note: `deleteAll` can be used in `withMutations`.
  794. *
  795. * @alias removeAll
  796. */
  797. deleteAll(keys: Iterable<K>): this;
  798. removeAll(keys: Iterable<K>): this;
  799. /**
  800. * Returns a new Map containing no keys or values.
  801. *
  802. * <!-- runkit:activate -->
  803. * ```js
  804. * const { Map } = require('immutable')
  805. * Map({ key: 'value' }).clear()
  806. * // Map {}
  807. * ```
  808. *
  809. * Note: `clear` can be used in `withMutations`.
  810. */
  811. clear(): this;
  812. /**
  813. * Returns a new Map having updated the value at this `key` with the return
  814. * value of calling `updater` with the existing value.
  815. *
  816. * Similar to: `map.set(key, updater(map.get(key)))`.
  817. *
  818. * <!-- runkit:activate -->
  819. * ```js
  820. * const { Map } = require('immutable')
  821. * const aMap = Map({ key: 'value' })
  822. * const newMap = aMap.update('key', value => value + value)
  823. * // Map { "key": "valuevalue" }
  824. * ```
  825. *
  826. * This is most commonly used to call methods on collections within a
  827. * structure of data. For example, in order to `.push()` onto a nested `List`,
  828. * `update` and `push` can be used together:
  829. *
  830. * <!-- runkit:activate
  831. * { "preamble": "const { Map, List } = require('immutable');" }
  832. * -->
  833. * ```js
  834. * const aMap = Map({ nestedList: List([ 1, 2, 3 ]) })
  835. * const newMap = aMap.update('nestedList', list => list.push(4))
  836. * // Map { "nestedList": List [ 1, 2, 3, 4 ] }
  837. * ```
  838. *
  839. * When a `notSetValue` is provided, it is provided to the `updater`
  840. * function when the value at the key does not exist in the Map.
  841. *
  842. * <!-- runkit:activate
  843. * { "preamble": "const { Map } = require('immutable');" }
  844. * -->
  845. * ```js
  846. * const aMap = Map({ key: 'value' })
  847. * const newMap = aMap.update('noKey', 'no value', value => value + value)
  848. * // Map { "key": "value", "noKey": "no valueno value" }
  849. * ```
  850. *
  851. * However, if the `updater` function returns the same value it was called
  852. * with, then no change will occur. This is still true if `notSetValue`
  853. * is provided.
  854. *
  855. * <!-- runkit:activate
  856. * { "preamble": "const { Map } = require('immutable');" }
  857. * -->
  858. * ```js
  859. * const aMap = Map({ apples: 10 })
  860. * const newMap = aMap.update('oranges', 0, val => val)
  861. * // Map { "apples": 10 }
  862. * assert.strictEqual(newMap, map);
  863. * ```
  864. *
  865. * For code using ES2015 or later, using `notSetValue` is discourged in
  866. * favor of function parameter default values. This helps to avoid any
  867. * potential confusion with identify functions as described above.
  868. *
  869. * The previous example behaves differently when written with default values:
  870. *
  871. * <!-- runkit:activate
  872. * { "preamble": "const { Map } = require('immutable');" }
  873. * -->
  874. * ```js
  875. * const aMap = Map({ apples: 10 })
  876. * const newMap = aMap.update('oranges', (val = 0) => val)
  877. * // Map { "apples": 10, "oranges": 0 }
  878. * ```
  879. *
  880. * If no key is provided, then the `updater` function return value is
  881. * returned as well.
  882. *
  883. * <!-- runkit:activate
  884. * { "preamble": "const { Map } = require('immutable');" }
  885. * -->
  886. * ```js
  887. * const aMap = Map({ key: 'value' })
  888. * const result = aMap.update(aMap => aMap.get('key'))
  889. * // "value"
  890. * ```
  891. *
  892. * This can be very useful as a way to "chain" a normal function into a
  893. * sequence of methods. RxJS calls this "let" and lodash calls it "thru".
  894. *
  895. * For example, to sum the values in a Map
  896. *
  897. * <!-- runkit:activate
  898. * { "preamble": "const { Map } = require('immutable');" }
  899. * -->
  900. * ```js
  901. * function sum(collection) {
  902. * return collection.reduce((sum, x) => sum + x, 0)
  903. * }
  904. *
  905. * Map({ x: 1, y: 2, z: 3 })
  906. * .map(x => x + 1)
  907. * .filter(x => x % 2 === 0)
  908. * .update(sum)
  909. * // 6
  910. * ```
  911. *
  912. * Note: `update(key)` can be used in `withMutations`.
  913. */
  914. update(key: K, notSetValue: V, updater: (value: V) => V): this;
  915. update(key: K, updater: (value: V) => V): this;
  916. update<R>(updater: (value: this) => R): R;
  917. /**
  918. * Returns a new Map resulting from merging the provided Collections
  919. * (or JS objects) into this Map. In other words, this takes each entry of
  920. * each collection and sets it on this Map.
  921. *
  922. * Note: Values provided to `merge` are shallowly converted before being
  923. * merged. No nested values are altered.
  924. *
  925. * <!-- runkit:activate -->
  926. * ```js
  927. * const { Map } = require('immutable')
  928. * const one = Map({ a: 10, b: 20, c: 30 })
  929. * const two = Map({ b: 40, a: 50, d: 60 })
  930. * one.merge(two) // Map { "a": 50, "b": 40, "c": 30, "d": 60 }
  931. * two.merge(one) // Map { "b": 20, "a": 10, "d": 60, "c": 30 }
  932. * ```
  933. *
  934. * Note: `merge` can be used in `withMutations`.
  935. *
  936. * @alias concat
  937. */
  938. merge<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): Map$1<K | KC, V | VC>;
  939. merge<C>(...collections: Array<{[key: string]: C}>): Map$1<K | string, V | C>;
  940. concat<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): Map$1<K | KC, V | VC>;
  941. concat<C>(...collections: Array<{[key: string]: C}>): Map$1<K | string, V | C>;
  942. /**
  943. * Like `merge()`, `mergeWith()` returns a new Map resulting from merging
  944. * the provided Collections (or JS objects) into this Map, but uses the
  945. * `merger` function for dealing with conflicts.
  946. *
  947. * <!-- runkit:activate -->
  948. * ```js
  949. * const { Map } = require('immutable')
  950. * const one = Map({ a: 10, b: 20, c: 30 })
  951. * const two = Map({ b: 40, a: 50, d: 60 })
  952. * one.mergeWith((oldVal, newVal) => oldVal / newVal, two)
  953. * // { "a": 0.2, "b": 0.5, "c": 30, "d": 60 }
  954. * two.mergeWith((oldVal, newVal) => oldVal / newVal, one)
  955. * // { "b": 2, "a": 5, "d": 60, "c": 30 }
  956. * ```
  957. *
  958. * Note: `mergeWith` can be used in `withMutations`.
  959. */
  960. mergeWith(
  961. merger: (oldVal: V, newVal: V, key: K) => V,
  962. ...collections: Array<Iterable<[K, V]> | {[key: string]: V}>
  963. ): this;
  964. /**
  965. * Like `merge()`, but when two Collections conflict, it merges them as well,
  966. * recursing deeply through the nested data.
  967. *
  968. * Note: Values provided to `merge` are shallowly converted before being
  969. * merged. No nested values are altered unless they will also be merged at
  970. * a deeper level.
  971. *
  972. * <!-- runkit:activate -->
  973. * ```js
  974. * const { Map } = require('immutable')
  975. * const one = Map({ a: Map({ x: 10, y: 10 }), b: Map({ x: 20, y: 50 }) })
  976. * const two = Map({ a: Map({ x: 2 }), b: Map({ y: 5 }), c: Map({ z: 3 }) })
  977. * one.mergeDeep(two)
  978. * // Map {
  979. * // "a": Map { "x": 2, "y": 10 },
  980. * // "b": Map { "x": 20, "y": 5 },
  981. * // "c": Map { "z": 3 }
  982. * // }
  983. * ```
  984. *
  985. * Note: `mergeDeep` can be used in `withMutations`.
  986. */
  987. mergeDeep(...collections: Array<Iterable<[K, V]> | {[key: string]: V}>): this;
  988. /**
  989. * Like `mergeDeep()`, but when two non-Collections conflict, it uses the
  990. * `merger` function to determine the resulting value.
  991. *
  992. * <!-- runkit:activate -->
  993. * ```js
  994. * const { Map } = require('immutable')
  995. * const one = Map({ a: Map({ x: 10, y: 10 }), b: Map({ x: 20, y: 50 }) })
  996. * const two = Map({ a: Map({ x: 2 }), b: Map({ y: 5 }), c: Map({ z: 3 }) })
  997. * one.mergeDeepWith((oldVal, newVal) => oldVal / newVal, two)
  998. * // Map {
  999. * // "a": Map { "x": 5, "y": 10 },
  1000. * // "b": Map { "x": 20, "y": 10 },
  1001. * // "c": Map { "z": 3 }
  1002. * // }
  1003. * ```
  1004. * Note: `mergeDeepWith` can be used in `withMutations`.
  1005. */
  1006. mergeDeepWith(
  1007. merger: (oldVal: any, newVal: any, key: any) => any,
  1008. ...collections: Array<Iterable<[K, V]> | {[key: string]: V}>
  1009. ): this;
  1010. // Deep persistent changes
  1011. /**
  1012. * Returns a new Map having set `value` at this `keyPath`. If any keys in
  1013. * `keyPath` do not exist, a new immutable Map will be created at that key.
  1014. *
  1015. * <!-- runkit:activate -->
  1016. * ```js
  1017. * const { Map } = require('immutable')
  1018. * const originalMap = Map({
  1019. * subObject: Map({
  1020. * subKey: 'subvalue',
  1021. * subSubObject: Map({
  1022. * subSubKey: 'subSubValue'
  1023. * })
  1024. * })
  1025. * })
  1026. *
  1027. * const newMap = originalMap.setIn(['subObject', 'subKey'], 'ha ha!')
  1028. * // Map {
  1029. * // "subObject": Map {
  1030. * // "subKey": "ha ha!",
  1031. * // "subSubObject": Map { "subSubKey": "subSubValue" }
  1032. * // }
  1033. * // }
  1034. *
  1035. * const newerMap = originalMap.setIn(
  1036. * ['subObject', 'subSubObject', 'subSubKey'],
  1037. * 'ha ha ha!'
  1038. * )
  1039. * // Map {
  1040. * // "subObject": Map {
  1041. * // "subKey": "subvalue",
  1042. * // "subSubObject": Map { "subSubKey": "ha ha ha!" }
  1043. * // }
  1044. * // }
  1045. * ```
  1046. *
  1047. * Plain JavaScript Object or Arrays may be nested within an Immutable.js
  1048. * Collection, and setIn() can update those values as well, treating them
  1049. * immutably by creating new copies of those values with the changes applied.
  1050. *
  1051. * <!-- runkit:activate -->
  1052. * ```js
  1053. * const { Map } = require('immutable')
  1054. * const originalMap = Map({
  1055. * subObject: {
  1056. * subKey: 'subvalue',
  1057. * subSubObject: {
  1058. * subSubKey: 'subSubValue'
  1059. * }
  1060. * }
  1061. * })
  1062. *
  1063. * originalMap.setIn(['subObject', 'subKey'], 'ha ha!')
  1064. * // Map {
  1065. * // "subObject": {
  1066. * // subKey: "ha ha!",
  1067. * // subSubObject: { subSubKey: "subSubValue" }
  1068. * // }
  1069. * // }
  1070. * ```
  1071. *
  1072. * If any key in the path exists but cannot be updated (such as a primitive
  1073. * like number or a custom Object like Date), an error will be thrown.
  1074. *
  1075. * Note: `setIn` can be used in `withMutations`.
  1076. */
  1077. setIn(keyPath: Iterable<any>, value: any): this;
  1078. /**
  1079. * Returns a new Map having removed the value at this `keyPath`. If any keys
  1080. * in `keyPath` do not exist, no change will occur.
  1081. *
  1082. * Note: `deleteIn` can be used in `withMutations`.
  1083. *
  1084. * @alias removeIn
  1085. */
  1086. deleteIn(keyPath: Iterable<any>): this;
  1087. removeIn(keyPath: Iterable<any>): this;
  1088. /**
  1089. * Returns a new Map having applied the `updater` to the entry found at the
  1090. * keyPath.
  1091. *
  1092. * This is most commonly used to call methods on collections nested within a
  1093. * structure of data. For example, in order to `.push()` onto a nested `List`,
  1094. * `updateIn` and `push` can be used together:
  1095. *
  1096. * <!-- runkit:activate -->
  1097. * ```js
  1098. * const { Map, List } = require('immutable')
  1099. * const map = Map({ inMap: Map({ inList: List([ 1, 2, 3 ]) }) })
  1100. * const newMap = map.updateIn(['inMap', 'inList'], list => list.push(4))
  1101. * // Map { "inMap": Map { "inList": List [ 1, 2, 3, 4 ] } }
  1102. * ```
  1103. *
  1104. * If any keys in `keyPath` do not exist, new Immutable `Map`s will
  1105. * be created at those keys. If the `keyPath` does not already contain a
  1106. * value, the `updater` function will be called with `notSetValue`, if
  1107. * provided, otherwise `undefined`.
  1108. *
  1109. * <!-- runkit:activate
  1110. * { "preamble": "const { Map } = require('immutable')" }
  1111. * -->
  1112. * ```js
  1113. * const map = Map({ a: Map({ b: Map({ c: 10 }) }) })
  1114. * const newMap = map.updateIn(['a', 'b', 'c'], val => val * 2)
  1115. * // Map { "a": Map { "b": Map { "c": 20 } } }
  1116. * ```
  1117. *
  1118. * If the `updater` function returns the same value it was called with, then
  1119. * no change will occur. This is still true if `notSetValue` is provided.
  1120. *
  1121. * <!-- runkit:activate
  1122. * { "preamble": "const { Map } = require('immutable')" }
  1123. * -->
  1124. * ```js
  1125. * const map = Map({ a: Map({ b: Map({ c: 10 }) }) })
  1126. * const newMap = map.updateIn(['a', 'b', 'x'], 100, val => val)
  1127. * // Map { "a": Map { "b": Map { "c": 10 } } }
  1128. * assert.strictEqual(newMap, aMap)
  1129. * ```
  1130. *
  1131. * For code using ES2015 or later, using `notSetValue` is discourged in
  1132. * favor of function parameter default values. This helps to avoid any
  1133. * potential confusion with identify functions as described above.
  1134. *
  1135. * The previous example behaves differently when written with default values:
  1136. *
  1137. * <!-- runkit:activate
  1138. * { "preamble": "const { Map } = require('immutable')" }
  1139. * -->
  1140. * ```js
  1141. * const map = Map({ a: Map({ b: Map({ c: 10 }) }) })
  1142. * const newMap = map.updateIn(['a', 'b', 'x'], (val = 100) => val)
  1143. * // Map { "a": Map { "b": Map { "c": 10, "x": 100 } } }
  1144. * ```
  1145. *
  1146. * Plain JavaScript Object or Arrays may be nested within an Immutable.js
  1147. * Collection, and updateIn() can update those values as well, treating them
  1148. * immutably by creating new copies of those values with the changes applied.
  1149. *
  1150. * <!-- runkit:activate
  1151. * { "preamble": "const { Map } = require('immutable')" }
  1152. * -->
  1153. * ```js
  1154. * const map = Map({ a: { b: { c: 10 } } })
  1155. * const newMap = map.updateIn(['a', 'b', 'c'], val => val * 2)
  1156. * // Map { "a": { b: { c: 20 } } }
  1157. * ```
  1158. *
  1159. * If any key in the path exists but cannot be updated (such as a primitive
  1160. * like number or a custom Object like Date), an error will be thrown.
  1161. *
  1162. * Note: `updateIn` can be used in `withMutations`.
  1163. */
  1164. updateIn(keyPath: Iterable<any>, notSetValue: any, updater: (value: any) => any): this;
  1165. updateIn(keyPath: Iterable<any>, updater: (value: any) => any): this;
  1166. /**
  1167. * A combination of `updateIn` and `merge`, returning a new Map, but
  1168. * performing the merge at a point arrived at by following the keyPath.
  1169. * In other words, these two lines are equivalent:
  1170. *
  1171. * ```js
  1172. * map.updateIn(['a', 'b', 'c'], abc => abc.merge(y))
  1173. * map.mergeIn(['a', 'b', 'c'], y)
  1174. * ```
  1175. *
  1176. * Note: `mergeIn` can be used in `withMutations`.
  1177. */
  1178. mergeIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
  1179. /**
  1180. * A combination of `updateIn` and `mergeDeep`, returning a new Map, but
  1181. * performing the deep merge at a point arrived at by following the keyPath.
  1182. * In other words, these two lines are equivalent:
  1183. *
  1184. * ```js
  1185. * map.updateIn(['a', 'b', 'c'], abc => abc.mergeDeep(y))
  1186. * map.mergeDeepIn(['a', 'b', 'c'], y)
  1187. * ```
  1188. *
  1189. * Note: `mergeDeepIn` can be used in `withMutations`.
  1190. */
  1191. mergeDeepIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
  1192. // Transient changes
  1193. /**
  1194. * Every time you call one of the above functions, a new immutable Map is
  1195. * created. If a pure function calls a number of these to produce a final
  1196. * return value, then a penalty on performance and memory has been paid by
  1197. * creating all of the intermediate immutable Maps.
  1198. *
  1199. * If you need to apply a series of mutations to produce a new immutable
  1200. * Map, `withMutations()` creates a temporary mutable copy of the Map which
  1201. * can apply mutations in a highly performant manner. In fact, this is
  1202. * exactly how complex mutations like `merge` are done.
  1203. *
  1204. * As an example, this results in the creation of 2, not 4, new Maps:
  1205. *
  1206. * <!-- runkit:activate -->
  1207. * ```js
  1208. * const { Map } = require('immutable')
  1209. * const map1 = Map()
  1210. * const map2 = map1.withMutations(map => {
  1211. * map.set('a', 1).set('b', 2).set('c', 3)
  1212. * })
  1213. * assert.equal(map1.size, 0)
  1214. * assert.equal(map2.size, 3)
  1215. * ```
  1216. *
  1217. * Note: Not all methods can be used on a mutable collection or within
  1218. * `withMutations`! Read the documentation for each method to see if it
  1219. * is safe to use in `withMutations`.
  1220. */
  1221. withMutations(mutator: (mutable: this) => any): this;
  1222. /**
  1223. * Another way to avoid creation of intermediate Immutable maps is to create
  1224. * a mutable copy of this collection. Mutable copies *always* return `this`,
  1225. * and thus shouldn't be used for equality. Your function should never return
  1226. * a mutable copy of a collection, only use it internally to create a new
  1227. * collection.
  1228. *
  1229. * If possible, use `withMutations` to work with temporary mutable copies as
  1230. * it provides an easier to use API and considers many common optimizations.
  1231. *
  1232. * Note: if the collection is already mutable, `asMutable` returns itself.
  1233. *
  1234. * Note: Not all methods can be used on a mutable collection or within
  1235. * `withMutations`! Read the documentation for each method to see if it
  1236. * is safe to use in `withMutations`.
  1237. *
  1238. * @see `Map#asImmutable`
  1239. */
  1240. asMutable(): this;
  1241. /**
  1242. * Returns true if this is a mutable copy (see `asMutable()`) and mutative
  1243. * alterations have been applied.
  1244. *
  1245. * @see `Map#asMutable`
  1246. */
  1247. wasAltered(): boolean;
  1248. /**
  1249. * The yin to `asMutable`'s yang. Because it applies to mutable collections,
  1250. * this operation is *mutable* and may return itself (though may not
  1251. * return itself, i.e. if the result is an empty collection). Once
  1252. * performed, the original mutable copy must no longer be mutated since it
  1253. * may be the immutable result.
  1254. *
  1255. * If possible, use `withMutations` to work with temporary mutable copies as
  1256. * it provides an easier to use API and considers many common optimizations.
  1257. *
  1258. * @see `Map#asMutable`
  1259. */
  1260. asImmutable(): this;
  1261. // Sequence algorithms
  1262. /**
  1263. * Returns a new Map with values passed through a
  1264. * `mapper` function.
  1265. *
  1266. * Map({ a: 1, b: 2 }).map(x => 10 * x)
  1267. * // Map { a: 10, b: 20 }
  1268. */
  1269. map<M>(
  1270. mapper: (value: V, key: K, iter: this) => M,
  1271. context?: any
  1272. ): Map$1<K, M>;
  1273. /**
  1274. * @see Collection.Keyed.mapKeys
  1275. */
  1276. mapKeys<M>(
  1277. mapper: (key: K, value: V, iter: this) => M,
  1278. context?: any
  1279. ): Map$1<M, V>;
  1280. /**
  1281. * @see Collection.Keyed.mapEntries
  1282. */
  1283. mapEntries<KM, VM>(
  1284. mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
  1285. context?: any
  1286. ): Map$1<KM, VM>;
  1287. /**
  1288. * Flat-maps the Map, returning a new Map.
  1289. *
  1290. * Similar to `data.map(...).flatten(true)`.
  1291. */
  1292. flatMap<KM, VM>(
  1293. mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
  1294. context?: any
  1295. ): Map$1<KM, VM>;
  1296. /**
  1297. * Returns a new Map with only the entries for which the `predicate`
  1298. * function returns true.
  1299. *
  1300. * Note: `filter()` always returns a new instance, even if it results in
  1301. * not filtering out any values.
  1302. */
  1303. filter<F extends V>(
  1304. predicate: (value: V, key: K, iter: this) => value is F,
  1305. context?: any
  1306. ): Map$1<K, F>;
  1307. filter(
  1308. predicate: (value: V, key: K, iter: this) => any,
  1309. context?: any
  1310. ): this;
  1311. /**
  1312. * @see Collection.Keyed.flip
  1313. */
  1314. flip(): Map$1<V, K>;
  1315. }
  1316. /**
  1317. * A type of Map that has the additional guarantee that the iteration order of
  1318. * entries will be the order in which they were set().
  1319. *
  1320. * The iteration behavior of OrderedMap is the same as native ES6 Map and
  1321. * JavaScript Object.
  1322. *
  1323. * Note that `OrderedMap` are more expensive than non-ordered `Map` and may
  1324. * consume more memory. `OrderedMap#set` is amortized O(log32 N), but not
  1325. * stable.
  1326. */
  1327. declare module OrderedMap {
  1328. /**
  1329. * True if the provided value is an OrderedMap.
  1330. */
  1331. function isOrderedMap(maybeOrderedMap: any): maybeOrderedMap is OrderedMap<any, any>;
  1332. }
  1333. /**
  1334. * Creates a new Immutable OrderedMap.
  1335. *
  1336. * Created with the same key value pairs as the provided Collection.Keyed or
  1337. * JavaScript Object or expects a Collection of [K, V] tuple entries.
  1338. *
  1339. * The iteration order of key-value pairs provided to this constructor will
  1340. * be preserved in the OrderedMap.
  1341. *
  1342. * let newOrderedMap = OrderedMap({key: "value"})
  1343. * let newOrderedMap = OrderedMap([["key", "value"]])
  1344. *
  1345. * Note: `OrderedMap` is a factory function and not a class, and does not use
  1346. * the `new` keyword during construction.
  1347. */
  1348. declare function OrderedMap<K, V>(collection: Iterable<[K, V]>): OrderedMap<K, V>;
  1349. declare function OrderedMap<T>(collection: Iterable<Iterable<T>>): OrderedMap<T, T>;
  1350. declare function OrderedMap<V>(obj: {[key: string]: V}): OrderedMap<string, V>;
  1351. declare function OrderedMap<K, V>(): OrderedMap<K, V>;
  1352. declare function OrderedMap(): OrderedMap<any, any>;
  1353. interface OrderedMap<K, V> extends Map$1<K, V> {
  1354. /**
  1355. * The number of entries in this OrderedMap.
  1356. */
  1357. readonly size: number;
  1358. /**
  1359. * Returns a new OrderedMap also containing the new key, value pair. If an
  1360. * equivalent key already exists in this OrderedMap, it will be replaced
  1361. * while maintaining the existing order.
  1362. *
  1363. * <!-- runkit:activate -->
  1364. * ```js
  1365. * const { OrderedMap } = require('immutable')
  1366. * const originalMap = OrderedMap({a:1, b:1, c:1})
  1367. * const updatedMap = originalMap.set('b', 2)
  1368. *
  1369. * originalMap
  1370. * // OrderedMap {a: 1, b: 1, c: 1}
  1371. * updatedMap
  1372. * // OrderedMap {a: 1, b: 2, c: 1}
  1373. * ```
  1374. *
  1375. * Note: `set` can be used in `withMutations`.
  1376. */
  1377. set(key: K, value: V): this;
  1378. /**
  1379. * Returns a new OrderedMap resulting from merging the provided Collections
  1380. * (or JS objects) into this OrderedMap. In other words, this takes each
  1381. * entry of each collection and sets it on this OrderedMap.
  1382. *
  1383. * Note: Values provided to `merge` are shallowly converted before being
  1384. * merged. No nested values are altered.
  1385. *
  1386. * <!-- runkit:activate -->
  1387. * ```js
  1388. * const { OrderedMap } = require('immutable')
  1389. * const one = OrderedMap({ a: 10, b: 20, c: 30 })
  1390. * const two = OrderedMap({ b: 40, a: 50, d: 60 })
  1391. * one.merge(two) // OrderedMap { "a": 50, "b": 40, "c": 30, "d": 60 }
  1392. * two.merge(one) // OrderedMap { "b": 20, "a": 10, "d": 60, "c": 30 }
  1393. * ```
  1394. *
  1395. * Note: `merge` can be used in `withMutations`.
  1396. *
  1397. * @alias concat
  1398. */
  1399. merge<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): OrderedMap<K | KC, V | VC>;
  1400. merge<C>(...collections: Array<{[key: string]: C}>): OrderedMap<K | string, V | C>;
  1401. concat<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): OrderedMap<K | KC, V | VC>;
  1402. concat<C>(...collections: Array<{[key: string]: C}>): OrderedMap<K | string, V | C>;
  1403. // Sequence algorithms
  1404. /**
  1405. * Returns a new OrderedMap with values passed through a
  1406. * `mapper` function.
  1407. *
  1408. * OrderedMap({ a: 1, b: 2 }).map(x => 10 * x)
  1409. * // OrderedMap { "a": 10, "b": 20 }
  1410. *
  1411. * Note: `map()` always returns a new instance, even if it produced the same
  1412. * value at every step.
  1413. */
  1414. map<M>(
  1415. mapper: (value: V, key: K, iter: this) => M,
  1416. context?: any
  1417. ): OrderedMap<K, M>;
  1418. /**
  1419. * @see Collection.Keyed.mapKeys
  1420. */
  1421. mapKeys<M>(
  1422. mapper: (key: K, value: V, iter: this) => M,
  1423. context?: any
  1424. ): OrderedMap<M, V>;
  1425. /**
  1426. * @see Collection.Keyed.mapEntries
  1427. */
  1428. mapEntries<KM, VM>(
  1429. mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
  1430. context?: any
  1431. ): OrderedMap<KM, VM>;
  1432. /**
  1433. * Flat-maps the OrderedMap, returning a new OrderedMap.
  1434. *
  1435. * Similar to `data.map(...).flatten(true)`.
  1436. */
  1437. flatMap<KM, VM>(
  1438. mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
  1439. context?: any
  1440. ): OrderedMap<KM, VM>;
  1441. /**
  1442. * Returns a new OrderedMap with only the entries for which the `predicate`
  1443. * function returns true.
  1444. *
  1445. * Note: `filter()` always returns a new instance, even if it results in
  1446. * not filtering out any values.
  1447. */
  1448. filter<F extends V>(
  1449. predicate: (value: V, key: K, iter: this) => value is F,
  1450. context?: any
  1451. ): OrderedMap<K, F>;
  1452. filter(
  1453. predicate: (value: V, key: K, iter: this) => any,
  1454. context?: any
  1455. ): this;
  1456. /**
  1457. * @see Collection.Keyed.flip
  1458. */
  1459. flip(): OrderedMap<V, K>;
  1460. }
  1461. /**
  1462. * A Collection of unique values with `O(log32 N)` adds and has.
  1463. *
  1464. * When iterating a Set, the entries will be (value, value) pairs. Iteration
  1465. * order of a Set is undefined, however is stable. Multiple iterations of the
  1466. * same Set will iterate in the same order.
  1467. *
  1468. * Set values, like Map keys, may be of any type. Equality is determined using
  1469. * `Immutable.is`, enabling Sets to uniquely include other Immutable
  1470. * collections, custom value types, and NaN.
  1471. */
  1472. declare module Set$1 {
  1473. /**
  1474. * True if the provided value is a Set
  1475. */
  1476. function isSet(maybeSet: any): maybeSet is Set$1<any>;
  1477. /**
  1478. * Creates a new Set containing `values`.
  1479. */
  1480. function of<T>(...values: Array<T>): Set$1<T>;
  1481. /**
  1482. * `Set.fromKeys()` creates a new immutable Set containing the keys from
  1483. * this Collection or JavaScript Object.
  1484. */
  1485. function fromKeys<T>(iter: Collection$1<T, any>): Set$1<T>;
  1486. function fromKeys(obj: {[key: string]: any}): Set$1<string>;
  1487. /**
  1488. * `Set.intersect()` creates a new immutable Set that is the intersection of
  1489. * a collection of other sets.
  1490. *
  1491. * ```js
  1492. * const { Set } = require('immutable')
  1493. * const intersected = Set.intersect([
  1494. * Set([ 'a', 'b', 'c' ])
  1495. * Set([ 'c', 'a', 't' ])
  1496. * ])
  1497. * // Set [ "a", "c"" ]
  1498. * ```
  1499. */
  1500. function intersect<T>(sets: Iterable<Iterable<T>>): Set$1<T>;
  1501. /**
  1502. * `Set.union()` creates a new immutable Set that is the union of a
  1503. * collection of other sets.
  1504. *
  1505. * ```js
  1506. * const { Set } = require('immutable')
  1507. * const unioned = Set.union([
  1508. * Set([ 'a', 'b', 'c' ])
  1509. * Set([ 'c', 'a', 't' ])
  1510. * ])
  1511. * // Set [ "a", "b", "c", "t"" ]
  1512. * ```
  1513. */
  1514. function union<T>(sets: Iterable<Iterable<T>>): Set$1<T>;
  1515. }
  1516. /**
  1517. * Create a new immutable Set containing the values of the provided
  1518. * collection-like.
  1519. *
  1520. * Note: `Set` is a factory function and not a class, and does not use the
  1521. * `new` keyword during construction.
  1522. */
  1523. declare function Set$1(): Set$1<any>;
  1524. declare function Set$1<T>(): Set$1<T>;
  1525. declare function Set$1<T>(collection: Iterable<T>): Set$1<T>;
  1526. interface Set$1<T> extends Collection$1.Set<T> {
  1527. /**
  1528. * The number of items in this Set.
  1529. */
  1530. readonly size: number;
  1531. // Persistent changes
  1532. /**
  1533. * Returns a new Set which also includes this value.
  1534. *
  1535. * Note: `add` can be used in `withMutations`.
  1536. */
  1537. add(value: T): this;
  1538. /**
  1539. * Returns a new Set which excludes this value.
  1540. *
  1541. * Note: `delete` can be used in `withMutations`.
  1542. *
  1543. * Note: `delete` **cannot** be safely used in IE8, use `remove` if
  1544. * supporting old browsers.
  1545. *
  1546. * @alias remove
  1547. */
  1548. delete(value: T): this;
  1549. remove(value: T): this;
  1550. /**
  1551. * Returns a new Set containing no values.
  1552. *
  1553. * Note: `clear` can be used in `withMutations`.
  1554. */
  1555. clear(): this;
  1556. /**
  1557. * Returns a Set including any value from `collections` that does not already
  1558. * exist in this Set.
  1559. *
  1560. * Note: `union` can be used in `withMutations`.
  1561. * @alias merge
  1562. * @alias concat
  1563. */
  1564. union<C>(...collections: Array<Iterable<C>>): Set$1<T | C>;
  1565. merge<C>(...collections: Array<Iterable<C>>): Set$1<T | C>;
  1566. concat<C>(...collections: Array<Iterable<C>>): Set$1<T | C>;
  1567. /**
  1568. * Returns a Set which has removed any values not also contained
  1569. * within `collections`.
  1570. *
  1571. * Note: `intersect` can be used in `withMutations`.
  1572. */
  1573. intersect(...collections: Array<Iterable<T>>): this;
  1574. /**
  1575. * Returns a Set excluding any values contained within `collections`.
  1576. *
  1577. * <!-- runkit:activate -->
  1578. * ```js
  1579. * const { OrderedSet } = require('immutable')
  1580. * OrderedSet([ 1, 2, 3 ]).subtract([1, 3])
  1581. * // OrderedSet [2]
  1582. * ```
  1583. *
  1584. * Note: `subtract` can be used in `withMutations`.
  1585. */
  1586. subtract(...collections: Array<Iterable<T>>): this;
  1587. // Transient changes
  1588. /**
  1589. * Note: Not all methods can be used on a mutable collection or within
  1590. * `withMutations`! Check the documentation for each method to see if it
  1591. * mentions being safe to use in `withMutations`.
  1592. *
  1593. * @see `Map#withMutations`
  1594. */
  1595. withMutations(mutator: (mutable: this) => any): this;
  1596. /**
  1597. * Note: Not all methods can be used on a mutable collection or within
  1598. * `withMutations`! Check the documentation for each method to see if it
  1599. * mentions being safe to use in `withMutations`.
  1600. *
  1601. * @see `Map#asMutable`
  1602. */
  1603. asMutable(): this;
  1604. /**
  1605. * @see `Map#wasAltered`
  1606. */
  1607. wasAltered(): boolean;
  1608. /**
  1609. * @see `Map#asImmutable`
  1610. */
  1611. asImmutable(): this;
  1612. // Sequence algorithms
  1613. /**
  1614. * Returns a new Set with values passed through a
  1615. * `mapper` function.
  1616. *
  1617. * Set([1,2]).map(x => 10 * x)
  1618. * // Set [10,20]
  1619. */
  1620. map<M>(
  1621. mapper: (value: T, key: T, iter: this) => M,
  1622. context?: any
  1623. ): Set$1<M>;
  1624. /**
  1625. * Flat-maps the Set, returning a new Set.
  1626. *
  1627. * Similar to `set.map(...).flatten(true)`.
  1628. */
  1629. flatMap<M>(
  1630. mapper: (value: T, key: T, iter: this) => Iterable<M>,
  1631. context?: any
  1632. ): Set$1<M>;
  1633. /**
  1634. * Returns a new Set with only the values for which the `predicate`
  1635. * function returns true.
  1636. *
  1637. * Note: `filter()` always returns a new instance, even if it results in
  1638. * not filtering out any values.
  1639. */
  1640. filter<F extends T>(
  1641. predicate: (value: T, key: T, iter: this) => value is F,
  1642. context?: any
  1643. ): Set$1<F>;
  1644. filter(
  1645. predicate: (value: T, key: T, iter: this) => any,
  1646. context?: any
  1647. ): this;
  1648. }
  1649. /**
  1650. * A type of Set that has the additional guarantee that the iteration order of
  1651. * values will be the order in which they were `add`ed.
  1652. *
  1653. * The iteration behavior of OrderedSet is the same as native ES6 Set.
  1654. *
  1655. * Note that `OrderedSet` are more expensive than non-ordered `Set` and may
  1656. * consume more memory. `OrderedSet#add` is amortized O(log32 N), but not
  1657. * stable.
  1658. */
  1659. declare module OrderedSet {
  1660. /**
  1661. * True if the provided value is an OrderedSet.
  1662. */
  1663. function isOrderedSet(maybeOrderedSet: any): boolean;
  1664. /**
  1665. * Creates a new OrderedSet containing `values`.
  1666. */
  1667. function of<T>(...values: Array<T>): OrderedSet<T>;
  1668. /**
  1669. * `OrderedSet.fromKeys()` creates a new immutable OrderedSet containing
  1670. * the keys from this Collection or JavaScript Object.
  1671. */
  1672. function fromKeys<T>(iter: Collection$1<T, any>): OrderedSet<T>;
  1673. function fromKeys(obj: {[key: string]: any}): OrderedSet<string>;
  1674. }
  1675. /**
  1676. * Create a new immutable OrderedSet containing the values of the provided
  1677. * collection-like.
  1678. *
  1679. * Note: `OrderedSet` is a factory function and not a class, and does not use
  1680. * the `new` keyword during construction.
  1681. */
  1682. declare function OrderedSet(): OrderedSet<any>;
  1683. declare function OrderedSet<T>(): OrderedSet<T>;
  1684. declare function OrderedSet<T>(collection: Iterable<T>): OrderedSet<T>;
  1685. interface OrderedSet<T> extends Set$1<T> {
  1686. /**
  1687. * The number of items in this OrderedSet.
  1688. */
  1689. readonly size: number;
  1690. /**
  1691. * Returns an OrderedSet including any value from `collections` that does
  1692. * not already exist in this OrderedSet.
  1693. *
  1694. * Note: `union` can be used in `withMutations`.
  1695. * @alias merge
  1696. * @alias concat
  1697. */
  1698. union<C>(...collections: Array<Iterable<C>>): OrderedSet<T | C>;
  1699. merge<C>(...collections: Array<Iterable<C>>): OrderedSet<T | C>;
  1700. concat<C>(...collections: Array<Iterable<C>>): OrderedSet<T | C>;
  1701. // Sequence algorithms
  1702. /**
  1703. * Returns a new Set with values passed through a
  1704. * `mapper` function.
  1705. *
  1706. * OrderedSet([ 1, 2 ]).map(x => 10 * x)
  1707. * // OrderedSet [10, 20]
  1708. */
  1709. map<M>(
  1710. mapper: (value: T, key: T, iter: this) => M,
  1711. context?: any
  1712. ): OrderedSet<M>;
  1713. /**
  1714. * Flat-maps the OrderedSet, returning a new OrderedSet.
  1715. *
  1716. * Similar to `set.map(...).flatten(true)`.
  1717. */
  1718. flatMap<M>(
  1719. mapper: (value: T, key: T, iter: this) => Iterable<M>,
  1720. context?: any
  1721. ): OrderedSet<M>;
  1722. /**
  1723. * Returns a new OrderedSet with only the values for which the `predicate`
  1724. * function returns true.
  1725. *
  1726. * Note: `filter()` always returns a new instance, even if it results in
  1727. * not filtering out any values.
  1728. */
  1729. filter<F extends T>(
  1730. predicate: (value: T, key: T, iter: this) => value is F,
  1731. context?: any
  1732. ): OrderedSet<F>;
  1733. filter(
  1734. predicate: (value: T, key: T, iter: this) => any,
  1735. context?: any
  1736. ): this;
  1737. /**
  1738. * Returns an OrderedSet of the same type "zipped" with the provided
  1739. * collections.
  1740. *
  1741. * Like `zipWith`, but using the default `zipper`: creating an `Array`.
  1742. *
  1743. * ```js
  1744. * const a = OrderedSet([ 1, 2, 3 ])
  1745. * const b = OrderedSet([ 4, 5, 6 ])
  1746. * const c = a.zip(b)
  1747. * // OrderedSet [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ]
  1748. * ```
  1749. */
  1750. zip<U>(other: Collection$1<any, U>): OrderedSet<[T,U]>;
  1751. zip<U,V>(other1: Collection$1<any, U>, other2: Collection$1<any, V>): OrderedSet<[T,U,V]>;
  1752. zip(...collections: Array<Collection$1<any, any>>): OrderedSet<any>;
  1753. /**
  1754. * Returns a OrderedSet of the same type "zipped" with the provided
  1755. * collections.
  1756. *
  1757. * Unlike `zip`, `zipAll` continues zipping until the longest collection is
  1758. * exhausted. Missing values from shorter collections are filled with `undefined`.
  1759. *
  1760. * ```js
  1761. * const a = OrderedSet([ 1, 2 ]);
  1762. * const b = OrderedSet([ 3, 4, 5 ]);
  1763. * const c = a.zipAll(b); // OrderedSet [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ]
  1764. * ```
  1765. *
  1766. * Note: Since zipAll will return a collection as large as the largest
  1767. * input, some results may contain undefined values. TypeScript cannot
  1768. * account for these without cases (as of v2.5).
  1769. */
  1770. zipAll<U>(other: Collection$1<any, U>): OrderedSet<[T,U]>;
  1771. zipAll<U,V>(other1: Collection$1<any, U>, other2: Collection$1<any, V>): OrderedSet<[T,U,V]>;
  1772. zipAll(...collections: Array<Collection$1<any, any>>): OrderedSet<any>;
  1773. /**
  1774. * Returns an OrderedSet of the same type "zipped" with the provided
  1775. * collections by using a custom `zipper` function.
  1776. *
  1777. * @see Seq.Indexed.zipWith
  1778. */
  1779. zipWith<U, Z>(
  1780. zipper: (value: T, otherValue: U) => Z,
  1781. otherCollection: Collection$1<any, U>
  1782. ): OrderedSet<Z>;
  1783. zipWith<U, V, Z>(
  1784. zipper: (value: T, otherValue: U, thirdValue: V) => Z,
  1785. otherCollection: Collection$1<any, U>,
  1786. thirdCollection: Collection$1<any, V>
  1787. ): OrderedSet<Z>;
  1788. zipWith<Z>(
  1789. zipper: (...any: Array<any>) => Z,
  1790. ...collections: Array<Collection$1<any, any>>
  1791. ): OrderedSet<Z>;
  1792. }
  1793. /**
  1794. * Stacks are indexed collections which support very efficient O(1) addition
  1795. * and removal from the front using `unshift(v)` and `shift()`.
  1796. *
  1797. * For familiarity, Stack also provides `push(v)`, `pop()`, and `peek()`, but
  1798. * be aware that they also operate on the front of the list, unlike List or
  1799. * a JavaScript Array.
  1800. *
  1801. * Note: `reverse()` or any inherent reverse traversal (`reduceRight`,
  1802. * `lastIndexOf`, etc.) is not efficient with a Stack.
  1803. *
  1804. * Stack is implemented with a Single-Linked List.
  1805. */
  1806. declare module Stack {
  1807. /**
  1808. * True if the provided value is a Stack
  1809. */
  1810. function isStack(maybeStack: any): maybeStack is Stack<any>;
  1811. /**
  1812. * Creates a new Stack containing `values`.
  1813. */
  1814. function of<T>(...values: Array<T>): Stack<T>;
  1815. }
  1816. /**
  1817. * Create a new immutable Stack containing the values of the provided
  1818. * collection-like.
  1819. *
  1820. * The iteration order of the provided collection is preserved in the
  1821. * resulting `Stack`.
  1822. *
  1823. * Note: `Stack` is a factory function and not a class, and does not use the
  1824. * `new` keyword during construction.
  1825. */
  1826. declare function Stack(): Stack<any>;
  1827. declare function Stack<T>(): Stack<T>;
  1828. declare function Stack<T>(collection: Iterable<T>): Stack<T>;
  1829. interface Stack<T> extends Collection$1.Indexed<T> {
  1830. /**
  1831. * The number of items in this Stack.
  1832. */
  1833. readonly size: number;
  1834. // Reading values
  1835. /**
  1836. * Alias for `Stack.first()`.
  1837. */
  1838. peek(): T | undefined;
  1839. // Persistent changes
  1840. /**
  1841. * Returns a new Stack with 0 size and no values.
  1842. *
  1843. * Note: `clear` can be used in `withMutations`.
  1844. */
  1845. clear(): Stack<T>;
  1846. /**
  1847. * Returns a new Stack with the provided `values` prepended, shifting other
  1848. * values ahead to higher indices.
  1849. *
  1850. * This is very efficient for Stack.
  1851. *
  1852. * Note: `unshift` can be used in `withMutations`.
  1853. */
  1854. unshift(...values: Array<T>): Stack<T>;
  1855. /**
  1856. * Like `Stack#unshift`, but accepts a collection rather than varargs.
  1857. *
  1858. * Note: `unshiftAll` can be used in `withMutations`.
  1859. */
  1860. unshiftAll(iter: Iterable<T>): Stack<T>;
  1861. /**
  1862. * Returns a new Stack with a size ones less than this Stack, excluding
  1863. * the first item in this Stack, shifting all other values to a lower index.
  1864. *
  1865. * Note: this differs from `Array#shift` because it returns a new
  1866. * Stack rather than the removed value. Use `first()` or `peek()` to get the
  1867. * first value in this Stack.
  1868. *
  1869. * Note: `shift` can be used in `withMutations`.
  1870. */
  1871. shift(): Stack<T>;
  1872. /**
  1873. * Alias for `Stack#unshift` and is not equivalent to `List#push`.
  1874. */
  1875. push(...values: Array<T>): Stack<T>;
  1876. /**
  1877. * Alias for `Stack#unshiftAll`.
  1878. */
  1879. pushAll(iter: Iterable<T>): Stack<T>;
  1880. /**
  1881. * Alias for `Stack#shift` and is not equivalent to `List#pop`.
  1882. */
  1883. pop(): Stack<T>;
  1884. // Transient changes
  1885. /**
  1886. * Note: Not all methods can be used on a mutable collection or within
  1887. * `withMutations`! Check the documentation for each method to see if it
  1888. * mentions being safe to use in `withMutations`.
  1889. *
  1890. * @see `Map#withMutations`
  1891. */
  1892. withMutations(mutator: (mutable: this) => any): this;
  1893. /**
  1894. * Note: Not all methods can be used on a mutable collection or within
  1895. * `withMutations`! Check the documentation for each method to see if it
  1896. * mentions being safe to use in `withMutations`.
  1897. *
  1898. * @see `Map#asMutable`
  1899. */
  1900. asMutable(): this;
  1901. /**
  1902. * @see `Map#wasAltered`
  1903. */
  1904. wasAltered(): boolean;
  1905. /**
  1906. * @see `Map#asImmutable`
  1907. */
  1908. asImmutable(): this;
  1909. // Sequence algorithms
  1910. /**
  1911. * Returns a new Stack with other collections concatenated to this one.
  1912. */
  1913. concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): Stack<T | C>;
  1914. /**
  1915. * Returns a new Stack with values passed through a
  1916. * `mapper` function.
  1917. *
  1918. * Stack([ 1, 2 ]).map(x => 10 * x)
  1919. * // Stack [ 10, 20 ]
  1920. *
  1921. * Note: `map()` always returns a new instance, even if it produced the same
  1922. * value at every step.
  1923. */
  1924. map<M>(
  1925. mapper: (value: T, key: number, iter: this) => M,
  1926. context?: any
  1927. ): Stack<M>;
  1928. /**
  1929. * Flat-maps the Stack, returning a new Stack.
  1930. *
  1931. * Similar to `stack.map(...).flatten(true)`.
  1932. */
  1933. flatMap<M>(
  1934. mapper: (value: T, key: number, iter: this) => Iterable<M>,
  1935. context?: any
  1936. ): Stack<M>;
  1937. /**
  1938. * Returns a new Set with only the values for which the `predicate`
  1939. * function returns true.
  1940. *
  1941. * Note: `filter()` always returns a new instance, even if it results in
  1942. * not filtering out any values.
  1943. */
  1944. filter<F extends T>(
  1945. predicate: (value: T, index: number, iter: this) => value is F,
  1946. context?: any
  1947. ): Set$1<F>;
  1948. filter(
  1949. predicate: (value: T, index: number, iter: this) => any,
  1950. context?: any
  1951. ): this;
  1952. /**
  1953. * Returns a Stack "zipped" with the provided collections.
  1954. *
  1955. * Like `zipWith`, but using the default `zipper`: creating an `Array`.
  1956. *
  1957. * ```js
  1958. * const a = Stack([ 1, 2, 3 ]);
  1959. * const b = Stack([ 4, 5, 6 ]);
  1960. * const c = a.zip(b); // Stack [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ]
  1961. * ```
  1962. */
  1963. zip<U>(other: Collection$1<any, U>): Stack<[T,U]>;
  1964. zip<U,V>(other: Collection$1<any, U>, other2: Collection$1<any,V>): Stack<[T,U,V]>;
  1965. zip(...collections: Array<Collection$1<any, any>>): Stack<any>;
  1966. /**
  1967. * Returns a Stack "zipped" with the provided collections.
  1968. *
  1969. * Unlike `zip`, `zipAll` continues zipping until the longest collection is
  1970. * exhausted. Missing values from shorter collections are filled with `undefined`.
  1971. *
  1972. * ```js
  1973. * const a = Stack([ 1, 2 ]);
  1974. * const b = Stack([ 3, 4, 5 ]);
  1975. * const c = a.zipAll(b); // Stack [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ]
  1976. * ```
  1977. *
  1978. * Note: Since zipAll will return a collection as large as the largest
  1979. * input, some results may contain undefined values. TypeScript cannot
  1980. * account for these without cases (as of v2.5).
  1981. */
  1982. zipAll<U>(other: Collection$1<any, U>): Stack<[T,U]>;
  1983. zipAll<U,V>(other: Collection$1<any, U>, other2: Collection$1<any,V>): Stack<[T,U,V]>;
  1984. zipAll(...collections: Array<Collection$1<any, any>>): Stack<any>;
  1985. /**
  1986. * Returns a Stack "zipped" with the provided collections by using a
  1987. * custom `zipper` function.
  1988. *
  1989. * ```js
  1990. * const a = Stack([ 1, 2, 3 ]);
  1991. * const b = Stack([ 4, 5, 6 ]);
  1992. * const c = a.zipWith((a, b) => a + b, b);
  1993. * // Stack [ 5, 7, 9 ]
  1994. * ```
  1995. */
  1996. zipWith<U, Z>(
  1997. zipper: (value: T, otherValue: U) => Z,
  1998. otherCollection: Collection$1<any, U>
  1999. ): Stack<Z>;
  2000. zipWith<U, V, Z>(
  2001. zipper: (value: T, otherValue: U, thirdValue: V) => Z,
  2002. otherCollection: Collection$1<any, U>,
  2003. thirdCollection: Collection$1<any, V>
  2004. ): Stack<Z>;
  2005. zipWith<Z>(
  2006. zipper: (...any: Array<any>) => Z,
  2007. ...collections: Array<Collection$1<any, any>>
  2008. ): Stack<Z>;
  2009. }
  2010. /**
  2011. * A record is similar to a JS object, but enforces a specific set of allowed
  2012. * string keys, and has default values.
  2013. *
  2014. * The `Record()` function produces new Record Factories, which when called
  2015. * create Record instances.
  2016. *
  2017. * ```js
  2018. * const { Record } = require('immutable')
  2019. * const ABRecord = Record({ a: 1, b: 2 })
  2020. * const myRecord = ABRecord({ b: 3 })
  2021. * ```
  2022. *
  2023. * Records always have a value for the keys they define. `remove`ing a key
  2024. * from a record simply resets it to the default value for that key.
  2025. *
  2026. * ```js
  2027. * myRecord.size // 2
  2028. * myRecord.get('a') // 1
  2029. * myRecord.get('b') // 3
  2030. * const myRecordWithoutB = myRecord.remove('b')
  2031. * myRecordWithoutB.get('b') // 2
  2032. * myRecordWithoutB.size // 2
  2033. * ```
  2034. *
  2035. * Values provided to the constructor not found in the Record type will
  2036. * be ignored. For example, in this case, ABRecord is provided a key "x" even
  2037. * though only "a" and "b" have been defined. The value for "x" will be
  2038. * ignored for this record.
  2039. *
  2040. * ```js
  2041. * const myRecord = ABRecord({ b: 3, x: 10 })
  2042. * myRecord.get('x') // undefined
  2043. * ```
  2044. *
  2045. * Because Records have a known set of string keys, property get access works
  2046. * as expected, however property sets will throw an Error.
  2047. *
  2048. * Note: IE8 does not support property access. Only use `get()` when
  2049. * supporting IE8.
  2050. *
  2051. * ```js
  2052. * myRecord.b // 3
  2053. * myRecord.b = 5 // throws Error
  2054. * ```
  2055. *
  2056. * Record Types can be extended as well, allowing for custom methods on your
  2057. * Record. This is not a common pattern in functional environments, but is in
  2058. * many JS programs.
  2059. *
  2060. * However Record Types are more restricted than typical JavaScript classes.
  2061. * They do not use a class constructor, which also means they cannot use
  2062. * class properties (since those are technically part of a constructor).
  2063. *
  2064. * While Record Types can be syntactically created with the JavaScript `class`
  2065. * form, the resulting Record function is actually a factory function, not a
  2066. * class constructor. Even though Record Types are not classes, JavaScript
  2067. * currently requires the use of `new` when creating new Record instances if
  2068. * they are defined as a `class`.
  2069. *
  2070. * ```
  2071. * class ABRecord extends Record({ a: 1, b: 2 }) {
  2072. * getAB() {
  2073. * return this.a + this.b;
  2074. * }
  2075. * }
  2076. *
  2077. * var myRecord = new ABRecord({b: 3})
  2078. * myRecord.getAB() // 4
  2079. * ```
  2080. *
  2081. *
  2082. * **Flow Typing Records:**
  2083. *
  2084. * Immutable.js exports two Flow types designed to make it easier to use
  2085. * Records with flow typed code, `RecordOf<TProps>` and `RecordFactory<TProps>`.
  2086. *
  2087. * When defining a new kind of Record factory function, use a flow type that
  2088. * describes the values the record contains along with `RecordFactory<TProps>`.
  2089. * To type instances of the Record (which the factory function returns),
  2090. * use `RecordOf<TProps>`.
  2091. *
  2092. * Typically, new Record definitions will export both the Record factory
  2093. * function as well as the Record instance type for use in other code.
  2094. *
  2095. * ```js
  2096. * import type { RecordFactory, RecordOf } from 'immutable';
  2097. *
  2098. * // Use RecordFactory<TProps> for defining new Record factory functions.
  2099. * type Point3DProps = { x: number, y: number, z: number };
  2100. * const defaultValues: Point3DProps = { x: 0, y: 0, z: 0 };
  2101. * const makePoint3D: RecordFactory<Point3DProps> = Record(defaultValues);
  2102. * export makePoint3D;
  2103. *
  2104. * // Use RecordOf<T> for defining new instances of that Record.
  2105. * export type Point3D = RecordOf<Point3DProps>;
  2106. * const some3DPoint: Point3D = makePoint3D({ x: 10, y: 20, z: 30 });
  2107. * ```
  2108. *
  2109. * **Flow Typing Record Subclasses:**
  2110. *
  2111. * Records can be subclassed as a means to add additional methods to Record
  2112. * instances. This is generally discouraged in favor of a more functional API,
  2113. * since Subclasses have some minor overhead. However the ability to create
  2114. * a rich API on Record types can be quite valuable.
  2115. *
  2116. * When using Flow to type Subclasses, do not use `RecordFactory<TProps>`,
  2117. * instead apply the props type when subclassing:
  2118. *
  2119. * ```js
  2120. * type PersonProps = {name: string, age: number};
  2121. * const defaultValues: PersonProps = {name: 'Aristotle', age: 2400};
  2122. * const PersonRecord = Record(defaultValues);
  2123. * class Person extends PersonRecord<PersonProps> {
  2124. * getName(): string {
  2125. * return this.get('name')
  2126. * }
  2127. *
  2128. * setName(name: string): this {
  2129. * return this.set('name', name);
  2130. * }
  2131. * }
  2132. * ```
  2133. *
  2134. * **Choosing Records vs plain JavaScript objects**
  2135. *
  2136. * Records offer a persistently immutable alternative to plain JavaScript
  2137. * objects, however they're not required to be used within Immutable.js
  2138. * collections. In fact, the deep-access and deep-updating functions
  2139. * like `getIn()` and `setIn()` work with plain JavaScript Objects as well.
  2140. *
  2141. * Deciding to use Records or Objects in your application should be informed
  2142. * by the tradeoffs and relative benefits of each:
  2143. *
  2144. * - *Runtime immutability*: plain JS objects may be carefully treated as
  2145. * immutable, however Record instances will *throw* if attempted to be
  2146. * mutated directly. Records provide this additional guarantee, however at
  2147. * some marginal runtime cost. While JS objects are mutable by nature, the
  2148. * use of type-checking tools like [Flow](https://medium.com/@gcanti/immutability-with-flow-faa050a1aef4)
  2149. * can help gain confidence in code written to favor immutability.
  2150. *
  2151. * - *Value equality*: Records use value equality when compared with `is()`
  2152. * or `record.equals()`. That is, two Records with the same keys and values
  2153. * are equal. Plain objects use *reference equality*. Two objects with the
  2154. * same keys and values are not equal since they are different objects.
  2155. * This is important to consider when using objects as keys in a `Map` or
  2156. * values in a `Set`, which use equality when retrieving values.
  2157. *
  2158. * - *API methods*: Records have a full featured API, with methods like
  2159. * `.getIn()`, and `.equals()`. These can make working with these values
  2160. * easier, but comes at the cost of not allowing keys with those names.
  2161. *
  2162. * - *Default values*: Records provide default values for every key, which
  2163. * can be useful when constructing Records with often unchanging values.
  2164. * However default values can make using Flow and TypeScript more laborious.
  2165. *
  2166. * - *Serialization*: Records use a custom internal representation to
  2167. * efficiently store and update their values. Converting to and from this
  2168. * form isn't free. If converting Records to plain objects is common,
  2169. * consider sticking with plain objects to begin with.
  2170. */
  2171. declare module Record$1 {
  2172. /**
  2173. * True if `maybeRecord` is an instance of a Record.
  2174. */
  2175. export function isRecord(maybeRecord: any): maybeRecord is Record$1<any>;
  2176. /**
  2177. * Records allow passing a second parameter to supply a descriptive name
  2178. * that appears when converting a Record to a string or in any error
  2179. * messages. A descriptive name for any record can be accessed by using this
  2180. * method. If one was not provided, the string "Record" is returned.
  2181. *
  2182. * ```js
  2183. * const { Record } = require('immutable')
  2184. * const Person = Record({
  2185. * name: null
  2186. * }, 'Person')
  2187. *
  2188. * var me = Person({ name: 'My Name' })
  2189. * me.toString() // "Person { "name": "My Name" }"
  2190. * Record.getDescriptiveName(me) // "Person"
  2191. * ```
  2192. */
  2193. export function getDescriptiveName(record: Record$1<any>): string;
  2194. /**
  2195. * A Record.Factory is created by the `Record()` function. Record instances
  2196. * are created by passing it some of the accepted values for that Record
  2197. * type:
  2198. *
  2199. * <!-- runkit:activate
  2200. * { "preamble": "const { Record } = require('immutable')" }
  2201. * -->
  2202. * ```js
  2203. * // makePerson is a Record Factory function
  2204. * const makePerson = Record({ name: null, favoriteColor: 'unknown' });
  2205. *
  2206. * // alan is a Record instance
  2207. * const alan = makePerson({ name: 'Alan' });
  2208. * ```
  2209. *
  2210. * Note that Record Factories return `Record<TProps> & Readonly<TProps>`,
  2211. * this allows use of both the Record instance API, and direct property
  2212. * access on the resulting instances:
  2213. *
  2214. * <!-- runkit:activate
  2215. * { "preamble": "const { Record } = require('immutable');const makePerson = Record({ name: null, favoriteColor: 'unknown' });const alan = makePerson({ name: 'Alan' });" }
  2216. * -->
  2217. * ```js
  2218. * // Use the Record API
  2219. * console.log('Record API: ' + alan.get('name'))
  2220. *
  2221. * // Or direct property access (Readonly)
  2222. * console.log('property access: ' + alan.name)
  2223. * ```
  2224. *
  2225. * **Flow Typing Records:**
  2226. *
  2227. * Use the `RecordFactory<TProps>` Flow type to get high quality type checking of
  2228. * Records:
  2229. *
  2230. * ```js
  2231. * import type { RecordFactory, RecordOf } from 'immutable';
  2232. *
  2233. * // Use RecordFactory<TProps> for defining new Record factory functions.
  2234. * type PersonProps = { name: ?string, favoriteColor: string };
  2235. * const makePerson: RecordFactory<PersonProps> = Record({ name: null, favoriteColor: 'unknown' });
  2236. *
  2237. * // Use RecordOf<T> for defining new instances of that Record.
  2238. * type Person = RecordOf<PersonProps>;
  2239. * const alan: Person = makePerson({ name: 'Alan' });
  2240. * ```
  2241. */
  2242. export module Factory {}
  2243. export interface Factory<TProps extends Object> {
  2244. (values?: Partial<TProps> | Iterable<[string, any]>): Record$1<TProps> & Readonly<TProps>;
  2245. new (values?: Partial<TProps> | Iterable<[string, any]>): Record$1<TProps> & Readonly<TProps>;
  2246. }
  2247. export function Factory<TProps extends Object>(values?: Partial<TProps> | Iterable<[string, any]>): Record$1<TProps> & Readonly<TProps>;
  2248. }
  2249. /**
  2250. * Unlike other types in Immutable.js, the `Record()` function creates a new
  2251. * Record Factory, which is a function that creates Record instances.
  2252. *
  2253. * See above for examples of using `Record()`.
  2254. *
  2255. * Note: `Record` is a factory function and not a class, and does not use the
  2256. * `new` keyword during construction.
  2257. */
  2258. declare function Record$1<TProps extends object>(defaultValues: TProps, name?: string): Record$1.Factory<TProps>;
  2259. interface Record$1<TProps extends Object> {
  2260. // Reading values
  2261. has(key: string): key is keyof TProps & string;
  2262. /**
  2263. * Returns the value associated with the provided key, which may be the
  2264. * default value defined when creating the Record factory function.
  2265. *
  2266. * If the requested key is not defined by this Record type, then
  2267. * notSetValue will be returned if provided. Note that this scenario would
  2268. * produce an error when using Flow or TypeScript.
  2269. */
  2270. get<K extends keyof TProps>(key: K, notSetValue?: any): TProps[K];
  2271. get<T>(key: string, notSetValue: T): T;
  2272. // Reading deep values
  2273. hasIn(keyPath: Iterable<any>): boolean;
  2274. getIn(keyPath: Iterable<any>): any;
  2275. // Value equality
  2276. equals(other: any): boolean;
  2277. hashCode(): number;
  2278. // Persistent changes
  2279. set<K extends keyof TProps>(key: K, value: TProps[K]): this;
  2280. update<K extends keyof TProps>(key: K, updater: (value: TProps[K]) => TProps[K]): this;
  2281. merge(...collections: Array<Partial<TProps> | Iterable<[string, any]>>): this;
  2282. mergeDeep(...collections: Array<Partial<TProps> | Iterable<[string, any]>>): this;
  2283. mergeWith(
  2284. merger: (oldVal: any, newVal: any, key: keyof TProps) => any,
  2285. ...collections: Array<Partial<TProps> | Iterable<[string, any]>>
  2286. ): this;
  2287. mergeDeepWith(
  2288. merger: (oldVal: any, newVal: any, key: any) => any,
  2289. ...collections: Array<Partial<TProps> | Iterable<[string, any]>>
  2290. ): this;
  2291. /**
  2292. * Returns a new instance of this Record type with the value for the
  2293. * specific key set to its default value.
  2294. *
  2295. * @alias remove
  2296. */
  2297. delete<K extends keyof TProps>(key: K): this;
  2298. remove<K extends keyof TProps>(key: K): this;
  2299. /**
  2300. * Returns a new instance of this Record type with all values set
  2301. * to their default values.
  2302. */
  2303. clear(): this;
  2304. // Deep persistent changes
  2305. setIn(keyPath: Iterable<any>, value: any): this;
  2306. updateIn(keyPath: Iterable<any>, updater: (value: any) => any): this;
  2307. mergeIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
  2308. mergeDeepIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
  2309. /**
  2310. * @alias removeIn
  2311. */
  2312. deleteIn(keyPath: Iterable<any>): this;
  2313. removeIn(keyPath: Iterable<any>): this;
  2314. // Conversion to JavaScript types
  2315. /**
  2316. * Deeply converts this Record to equivalent native JavaScript Object.
  2317. *
  2318. * Note: This method may not be overridden. Objects with custom
  2319. * serialization to plain JS may override toJSON() instead.
  2320. */
  2321. toJS(): { [K in keyof TProps]: any };
  2322. /**
  2323. * Shallowly converts this Record to equivalent native JavaScript Object.
  2324. */
  2325. toJSON(): TProps;
  2326. /**
  2327. * Shallowly converts this Record to equivalent JavaScript Object.
  2328. */
  2329. toObject(): TProps;
  2330. // Transient changes
  2331. /**
  2332. * Note: Not all methods can be used on a mutable collection or within
  2333. * `withMutations`! Only `set` may be used mutatively.
  2334. *
  2335. * @see `Map#withMutations`
  2336. */
  2337. withMutations(mutator: (mutable: this) => any): this;
  2338. /**
  2339. * @see `Map#asMutable`
  2340. */
  2341. asMutable(): this;
  2342. /**
  2343. * @see `Map#wasAltered`
  2344. */
  2345. wasAltered(): boolean;
  2346. /**
  2347. * @see `Map#asImmutable`
  2348. */
  2349. asImmutable(): this;
  2350. // Sequence algorithms
  2351. toSeq(): Seq.Keyed<keyof TProps, TProps[keyof TProps]>;
  2352. [Symbol.iterator](): IterableIterator<[keyof TProps, TProps[keyof TProps]]>;
  2353. }
  2354. /**
  2355. * `Seq` describes a lazy operation, allowing them to efficiently chain
  2356. * use of all the higher-order collection methods (such as `map` and `filter`)
  2357. * by not creating intermediate collections.
  2358. *
  2359. * **Seq is immutable** — Once a Seq is created, it cannot be
  2360. * changed, appended to, rearranged or otherwise modified. Instead, any
  2361. * mutative method called on a `Seq` will return a new `Seq`.
  2362. *
  2363. * **Seq is lazy** — `Seq` does as little work as necessary to respond to any
  2364. * method call. Values are often created during iteration, including implicit
  2365. * iteration when reducing or converting to a concrete data structure such as
  2366. * a `List` or JavaScript `Array`.
  2367. *
  2368. * For example, the following performs no work, because the resulting
  2369. * `Seq`'s values are never iterated:
  2370. *
  2371. * ```js
  2372. * const { Seq } = require('immutable')
  2373. * const oddSquares = Seq([ 1, 2, 3, 4, 5, 6, 7, 8 ])
  2374. * .filter(x => x % 2 !== 0)
  2375. * .map(x => x * x)
  2376. * ```
  2377. *
  2378. * Once the `Seq` is used, it performs only the work necessary. In this
  2379. * example, no intermediate arrays are ever created, filter is called three
  2380. * times, and map is only called once:
  2381. *
  2382. * ```js
  2383. * oddSquares.get(1); // 9
  2384. * ```
  2385. *
  2386. * Any collection can be converted to a lazy Seq with `Seq()`.
  2387. *
  2388. * <!-- runkit:activate -->
  2389. * ```js
  2390. * const { Map } = require('immutable')
  2391. * const map = Map({ a: 1, b: 2, c: 3 }
  2392. * const lazySeq = Seq(map)
  2393. * ```
  2394. *
  2395. * `Seq` allows for the efficient chaining of operations, allowing for the
  2396. * expression of logic that can otherwise be very tedious:
  2397. *
  2398. * ```js
  2399. * lazySeq
  2400. * .flip()
  2401. * .map(key => key.toUpperCase())
  2402. * .flip()
  2403. * // Seq { A: 1, B: 1, C: 1 }
  2404. * ```
  2405. *
  2406. * As well as expressing logic that would otherwise seem memory or time
  2407. * limited, for example `Range` is a special kind of Lazy sequence.
  2408. *
  2409. * <!-- runkit:activate -->
  2410. * ```js
  2411. * const { Range } = require('immutable')
  2412. * Range(1, Infinity)
  2413. * .skip(1000)
  2414. * .map(n => -n)
  2415. * .filter(n => n % 2 === 0)
  2416. * .take(2)
  2417. * .reduce((r, n) => r * n, 1)
  2418. * // 1006008
  2419. * ```
  2420. *
  2421. * Seq is often used to provide a rich collection API to JavaScript Object.
  2422. *
  2423. * ```js
  2424. * Seq({ x: 0, y: 1, z: 2 }).map(v => v * 2).toObject();
  2425. * // { x: 0, y: 2, z: 4 }
  2426. * ```
  2427. */
  2428. declare module Seq {
  2429. /**
  2430. * True if `maybeSeq` is a Seq, it is not backed by a concrete
  2431. * structure such as Map, List, or Set.
  2432. */
  2433. function isSeq(maybeSeq: any): maybeSeq is Seq.Indexed<any> | Seq.Keyed<any, any> | Seq.Set<any>;
  2434. /**
  2435. * `Seq` which represents key-value pairs.
  2436. */
  2437. export module Keyed {}
  2438. /**
  2439. * Always returns a Seq.Keyed, if input is not keyed, expects an
  2440. * collection of [K, V] tuples.
  2441. *
  2442. * Note: `Seq.Keyed` is a conversion function and not a class, and does not
  2443. * use the `new` keyword during construction.
  2444. */
  2445. export function Keyed<K, V>(collection: Iterable<[K, V]>): Seq.Keyed<K, V>;
  2446. export function Keyed<V>(obj: {[key: string]: V}): Seq.Keyed<string, V>;
  2447. export function Keyed<K, V>(): Seq.Keyed<K, V>;
  2448. export function Keyed(): Seq.Keyed<any, any>;
  2449. export interface Keyed<K, V> extends Seq<K, V>, Collection$1.Keyed<K, V> {
  2450. /**
  2451. * Deeply converts this Keyed Seq to equivalent native JavaScript Object.
  2452. *
  2453. * Converts keys to Strings.
  2454. */
  2455. toJS(): Object;
  2456. /**
  2457. * Shallowly converts this Keyed Seq to equivalent native JavaScript Object.
  2458. *
  2459. * Converts keys to Strings.
  2460. */
  2461. toJSON(): { [key: string]: V };
  2462. /**
  2463. * Shallowly converts this collection to an Array.
  2464. */
  2465. toArray(): Array<[K, V]>;
  2466. /**
  2467. * Returns itself
  2468. */
  2469. toSeq(): this;
  2470. /**
  2471. * Returns a new Seq with other collections concatenated to this one.
  2472. *
  2473. * All entries will be present in the resulting Seq, even if they
  2474. * have the same key.
  2475. */
  2476. concat<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): Seq.Keyed<K | KC, V | VC>;
  2477. concat<C>(...collections: Array<{[key: string]: C}>): Seq.Keyed<K | string, V | C>;
  2478. /**
  2479. * Returns a new Seq.Keyed with values passed through a
  2480. * `mapper` function.
  2481. *
  2482. * ```js
  2483. * const { Seq } = require('immutable')
  2484. * Seq.Keyed({ a: 1, b: 2 }).map(x => 10 * x)
  2485. * // Seq { "a": 10, "b": 20 }
  2486. * ```
  2487. *
  2488. * Note: `map()` always returns a new instance, even if it produced the
  2489. * same value at every step.
  2490. */
  2491. map<M>(
  2492. mapper: (value: V, key: K, iter: this) => M,
  2493. context?: any
  2494. ): Seq.Keyed<K, M>;
  2495. /**
  2496. * @see Collection.Keyed.mapKeys
  2497. */
  2498. mapKeys<M>(
  2499. mapper: (key: K, value: V, iter: this) => M,
  2500. context?: any
  2501. ): Seq.Keyed<M, V>;
  2502. /**
  2503. * @see Collection.Keyed.mapEntries
  2504. */
  2505. mapEntries<KM, VM>(
  2506. mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
  2507. context?: any
  2508. ): Seq.Keyed<KM, VM>;
  2509. /**
  2510. * Flat-maps the Seq, returning a Seq of the same type.
  2511. *
  2512. * Similar to `seq.map(...).flatten(true)`.
  2513. */
  2514. flatMap<KM, VM>(
  2515. mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
  2516. context?: any
  2517. ): Seq.Keyed<KM, VM>;
  2518. /**
  2519. * Returns a new Seq with only the entries for which the `predicate`
  2520. * function returns true.
  2521. *
  2522. * Note: `filter()` always returns a new instance, even if it results in
  2523. * not filtering out any values.
  2524. */
  2525. filter<F extends V>(
  2526. predicate: (value: V, key: K, iter: this) => value is F,
  2527. context?: any
  2528. ): Seq.Keyed<K, F>;
  2529. filter(
  2530. predicate: (value: V, key: K, iter: this) => any,
  2531. context?: any
  2532. ): this;
  2533. /**
  2534. * @see Collection.Keyed.flip
  2535. */
  2536. flip(): Seq.Keyed<V, K>;
  2537. }
  2538. /**
  2539. * `Seq` which represents an ordered indexed list of values.
  2540. */
  2541. module Indexed {
  2542. /**
  2543. * Provides an Seq.Indexed of the values provided.
  2544. */
  2545. function of<T>(...values: Array<T>): Seq.Indexed<T>;
  2546. }
  2547. /**
  2548. * Always returns Seq.Indexed, discarding associated keys and
  2549. * supplying incrementing indices.
  2550. *
  2551. * Note: `Seq.Indexed` is a conversion function and not a class, and does
  2552. * not use the `new` keyword during construction.
  2553. */
  2554. export function Indexed(): Seq.Indexed<any>;
  2555. export function Indexed<T>(): Seq.Indexed<T>;
  2556. export function Indexed<T>(collection: Iterable<T>): Seq.Indexed<T>;
  2557. export interface Indexed<T> extends Seq<number, T>, Collection$1.Indexed<T> {
  2558. /**
  2559. * Deeply converts this Indexed Seq to equivalent native JavaScript Array.
  2560. */
  2561. toJS(): Array<any>;
  2562. /**
  2563. * Shallowly converts this Indexed Seq to equivalent native JavaScript Array.
  2564. */
  2565. toJSON(): Array<T>;
  2566. /**
  2567. * Shallowly converts this collection to an Array.
  2568. */
  2569. toArray(): Array<T>;
  2570. /**
  2571. * Returns itself
  2572. */
  2573. toSeq(): this
  2574. /**
  2575. * Returns a new Seq with other collections concatenated to this one.
  2576. */
  2577. concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): Seq.Indexed<T | C>;
  2578. /**
  2579. * Returns a new Seq.Indexed with values passed through a
  2580. * `mapper` function.
  2581. *
  2582. * ```js
  2583. * const { Seq } = require('immutable')
  2584. * Seq.Indexed([ 1, 2 ]).map(x => 10 * x)
  2585. * // Seq [ 10, 20 ]
  2586. * ```
  2587. *
  2588. * Note: `map()` always returns a new instance, even if it produced the
  2589. * same value at every step.
  2590. */
  2591. map<M>(
  2592. mapper: (value: T, key: number, iter: this) => M,
  2593. context?: any
  2594. ): Seq.Indexed<M>;
  2595. /**
  2596. * Flat-maps the Seq, returning a a Seq of the same type.
  2597. *
  2598. * Similar to `seq.map(...).flatten(true)`.
  2599. */
  2600. flatMap<M>(
  2601. mapper: (value: T, key: number, iter: this) => Iterable<M>,
  2602. context?: any
  2603. ): Seq.Indexed<M>;
  2604. /**
  2605. * Returns a new Seq with only the values for which the `predicate`
  2606. * function returns true.
  2607. *
  2608. * Note: `filter()` always returns a new instance, even if it results in
  2609. * not filtering out any values.
  2610. */
  2611. filter<F extends T>(
  2612. predicate: (value: T, index: number, iter: this) => value is F,
  2613. context?: any
  2614. ): Seq.Indexed<F>;
  2615. filter(
  2616. predicate: (value: T, index: number, iter: this) => any,
  2617. context?: any
  2618. ): this;
  2619. /**
  2620. * Returns a Seq "zipped" with the provided collections.
  2621. *
  2622. * Like `zipWith`, but using the default `zipper`: creating an `Array`.
  2623. *
  2624. * ```js
  2625. * const a = Seq([ 1, 2, 3 ]);
  2626. * const b = Seq([ 4, 5, 6 ]);
  2627. * const c = a.zip(b); // Seq [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ]
  2628. * ```
  2629. */
  2630. zip<U>(other: Collection$1<any, U>): Seq.Indexed<[T,U]>;
  2631. zip<U,V>(other: Collection$1<any, U>, other2: Collection$1<any, V>): Seq.Indexed<[T,U,V]>;
  2632. zip(...collections: Array<Collection$1<any, any>>): Seq.Indexed<any>;
  2633. /**
  2634. * Returns a Seq "zipped" with the provided collections.
  2635. *
  2636. * Unlike `zip`, `zipAll` continues zipping until the longest collection is
  2637. * exhausted. Missing values from shorter collections are filled with `undefined`.
  2638. *
  2639. * ```js
  2640. * const a = Seq([ 1, 2 ]);
  2641. * const b = Seq([ 3, 4, 5 ]);
  2642. * const c = a.zipAll(b); // Seq [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ]
  2643. * ```
  2644. */
  2645. zipAll<U>(other: Collection$1<any, U>): Seq.Indexed<[T,U]>;
  2646. zipAll<U,V>(other: Collection$1<any, U>, other2: Collection$1<any, V>): Seq.Indexed<[T,U,V]>;
  2647. zipAll(...collections: Array<Collection$1<any, any>>): Seq.Indexed<any>;
  2648. /**
  2649. * Returns a Seq "zipped" with the provided collections by using a
  2650. * custom `zipper` function.
  2651. *
  2652. * ```js
  2653. * const a = Seq([ 1, 2, 3 ]);
  2654. * const b = Seq([ 4, 5, 6 ]);
  2655. * const c = a.zipWith((a, b) => a + b, b);
  2656. * // Seq [ 5, 7, 9 ]
  2657. * ```
  2658. */
  2659. zipWith<U, Z>(
  2660. zipper: (value: T, otherValue: U) => Z,
  2661. otherCollection: Collection$1<any, U>
  2662. ): Seq.Indexed<Z>;
  2663. zipWith<U, V, Z>(
  2664. zipper: (value: T, otherValue: U, thirdValue: V) => Z,
  2665. otherCollection: Collection$1<any, U>,
  2666. thirdCollection: Collection$1<any, V>
  2667. ): Seq.Indexed<Z>;
  2668. zipWith<Z>(
  2669. zipper: (...any: Array<any>) => Z,
  2670. ...collections: Array<Collection$1<any, any>>
  2671. ): Seq.Indexed<Z>;
  2672. }
  2673. /**
  2674. * `Seq` which represents a set of values.
  2675. *
  2676. * Because `Seq` are often lazy, `Seq.Set` does not provide the same guarantee
  2677. * of value uniqueness as the concrete `Set`.
  2678. */
  2679. export module Set {
  2680. /**
  2681. * Returns a Seq.Set of the provided values
  2682. */
  2683. function of<T>(...values: Array<T>): Seq.Set<T>;
  2684. }
  2685. /**
  2686. * Always returns a Seq.Set, discarding associated indices or keys.
  2687. *
  2688. * Note: `Seq.Set` is a conversion function and not a class, and does not
  2689. * use the `new` keyword during construction.
  2690. */
  2691. export function Set(): Seq.Set<any>;
  2692. export function Set<T>(): Seq.Set<T>;
  2693. export function Set<T>(collection: Iterable<T>): Seq.Set<T>;
  2694. export interface Set<T> extends Seq<T, T>, Collection$1.Set<T> {
  2695. /**
  2696. * Deeply converts this Set Seq to equivalent native JavaScript Array.
  2697. */
  2698. toJS(): Array<any>;
  2699. /**
  2700. * Shallowly converts this Set Seq to equivalent native JavaScript Array.
  2701. */
  2702. toJSON(): Array<T>;
  2703. /**
  2704. * Shallowly converts this collection to an Array.
  2705. */
  2706. toArray(): Array<T>;
  2707. /**
  2708. * Returns itself
  2709. */
  2710. toSeq(): this
  2711. /**
  2712. * Returns a new Seq with other collections concatenated to this one.
  2713. *
  2714. * All entries will be present in the resulting Seq, even if they
  2715. * are duplicates.
  2716. */
  2717. concat<U>(...collections: Array<Iterable<U>>): Seq.Set<T | U>;
  2718. /**
  2719. * Returns a new Seq.Set with values passed through a
  2720. * `mapper` function.
  2721. *
  2722. * ```js
  2723. * Seq.Set([ 1, 2 ]).map(x => 10 * x)
  2724. * // Seq { 10, 20 }
  2725. * ```
  2726. *
  2727. * Note: `map()` always returns a new instance, even if it produced the
  2728. * same value at every step.
  2729. */
  2730. map<M>(
  2731. mapper: (value: T, key: T, iter: this) => M,
  2732. context?: any
  2733. ): Seq.Set<M>;
  2734. /**
  2735. * Flat-maps the Seq, returning a Seq of the same type.
  2736. *
  2737. * Similar to `seq.map(...).flatten(true)`.
  2738. */
  2739. flatMap<M>(
  2740. mapper: (value: T, key: T, iter: this) => Iterable<M>,
  2741. context?: any
  2742. ): Seq.Set<M>;
  2743. /**
  2744. * Returns a new Seq with only the values for which the `predicate`
  2745. * function returns true.
  2746. *
  2747. * Note: `filter()` always returns a new instance, even if it results in
  2748. * not filtering out any values.
  2749. */
  2750. filter<F extends T>(
  2751. predicate: (value: T, key: T, iter: this) => value is F,
  2752. context?: any
  2753. ): Seq.Set<F>;
  2754. filter(
  2755. predicate: (value: T, key: T, iter: this) => any,
  2756. context?: any
  2757. ): this;
  2758. }
  2759. }
  2760. /**
  2761. * Creates a Seq.
  2762. *
  2763. * Returns a particular kind of `Seq` based on the input.
  2764. *
  2765. * * If a `Seq`, that same `Seq`.
  2766. * * If an `Collection`, a `Seq` of the same kind (Keyed, Indexed, or Set).
  2767. * * If an Array-like, an `Seq.Indexed`.
  2768. * * If an Iterable Object, an `Seq.Indexed`.
  2769. * * If an Object, a `Seq.Keyed`.
  2770. *
  2771. * Note: An Iterator itself will be treated as an object, becoming a `Seq.Keyed`,
  2772. * which is usually not what you want. You should turn your Iterator Object into
  2773. * an iterable object by defining a Symbol.iterator (or @@iterator) method which
  2774. * returns `this`.
  2775. *
  2776. * Note: `Seq` is a conversion function and not a class, and does not use the
  2777. * `new` keyword during construction.
  2778. */
  2779. declare function Seq<S extends Seq<any, any>>(seq: S): S;
  2780. declare function Seq<K, V>(collection: Collection$1.Keyed<K, V>): Seq.Keyed<K, V>;
  2781. declare function Seq<T>(collection: Collection$1.Indexed<T>): Seq.Indexed<T>;
  2782. declare function Seq<T>(collection: Collection$1.Set<T>): Seq.Set<T>;
  2783. declare function Seq<T>(collection: Iterable<T>): Seq.Indexed<T>;
  2784. declare function Seq<V>(obj: {[key: string]: V}): Seq.Keyed<string, V>;
  2785. declare function Seq(): Seq<any, any>;
  2786. interface Seq<K, V> extends Collection$1<K, V> {
  2787. /**
  2788. * Some Seqs can describe their size lazily. When this is the case,
  2789. * size will be an integer. Otherwise it will be undefined.
  2790. *
  2791. * For example, Seqs returned from `map()` or `reverse()`
  2792. * preserve the size of the original `Seq` while `filter()` does not.
  2793. *
  2794. * Note: `Range`, `Repeat` and `Seq`s made from `Array`s and `Object`s will
  2795. * always have a size.
  2796. */
  2797. readonly size: number | undefined;
  2798. // Force evaluation
  2799. /**
  2800. * Because Sequences are lazy and designed to be chained together, they do
  2801. * not cache their results. For example, this map function is called a total
  2802. * of 6 times, as each `join` iterates the Seq of three values.
  2803. *
  2804. * var squares = Seq([ 1, 2, 3 ]).map(x => x * x)
  2805. * squares.join() + squares.join()
  2806. *
  2807. * If you know a `Seq` will be used multiple times, it may be more
  2808. * efficient to first cache it in memory. Here, the map function is called
  2809. * only 3 times.
  2810. *
  2811. * var squares = Seq([ 1, 2, 3 ]).map(x => x * x).cacheResult()
  2812. * squares.join() + squares.join()
  2813. *
  2814. * Use this method judiciously, as it must fully evaluate a Seq which can be
  2815. * a burden on memory and possibly performance.
  2816. *
  2817. * Note: after calling `cacheResult`, a Seq will always have a `size`.
  2818. */
  2819. cacheResult(): this;
  2820. // Sequence algorithms
  2821. /**
  2822. * Returns a new Seq with values passed through a
  2823. * `mapper` function.
  2824. *
  2825. * ```js
  2826. * const { Seq } = require('immutable')
  2827. * Seq([ 1, 2 ]).map(x => 10 * x)
  2828. * // Seq [ 10, 20 ]
  2829. * ```
  2830. *
  2831. * Note: `map()` always returns a new instance, even if it produced the same
  2832. * value at every step.
  2833. */
  2834. map<M>(
  2835. mapper: (value: V, key: K, iter: this) => M,
  2836. context?: any
  2837. ): Seq<K, M>;
  2838. /**
  2839. * Returns a new Seq with values passed through a
  2840. * `mapper` function.
  2841. *
  2842. * ```js
  2843. * const { Seq } = require('immutable')
  2844. * Seq([ 1, 2 ]).map(x => 10 * x)
  2845. * // Seq [ 10, 20 ]
  2846. * ```
  2847. *
  2848. * Note: `map()` always returns a new instance, even if it produced the same
  2849. * value at every step.
  2850. * Note: used only for sets.
  2851. */
  2852. map<M>(
  2853. mapper: (value: V, key: K, iter: this) => M,
  2854. context?: any
  2855. ): Seq<M, M>;
  2856. /**
  2857. * Flat-maps the Seq, returning a Seq of the same type.
  2858. *
  2859. * Similar to `seq.map(...).flatten(true)`.
  2860. */
  2861. flatMap<M>(
  2862. mapper: (value: V, key: K, iter: this) => Iterable<M>,
  2863. context?: any
  2864. ): Seq<K, M>;
  2865. /**
  2866. * Flat-maps the Seq, returning a Seq of the same type.
  2867. *
  2868. * Similar to `seq.map(...).flatten(true)`.
  2869. * Note: Used only for sets.
  2870. */
  2871. flatMap<M>(
  2872. mapper: (value: V, key: K, iter: this) => Iterable<M>,
  2873. context?: any
  2874. ): Seq<M, M>;
  2875. /**
  2876. * Returns a new Seq with only the values for which the `predicate`
  2877. * function returns true.
  2878. *
  2879. * Note: `filter()` always returns a new instance, even if it results in
  2880. * not filtering out any values.
  2881. */
  2882. filter<F extends V>(
  2883. predicate: (value: V, key: K, iter: this) => value is F,
  2884. context?: any
  2885. ): Seq<K, F>;
  2886. filter(
  2887. predicate: (value: V, key: K, iter: this) => any,
  2888. context?: any
  2889. ): this;
  2890. }
  2891. /**
  2892. * The `Collection` is a set of (key, value) entries which can be iterated, and
  2893. * is the base class for all collections in `immutable`, allowing them to
  2894. * make use of all the Collection methods (such as `map` and `filter`).
  2895. *
  2896. * Note: A collection is always iterated in the same order, however that order
  2897. * may not always be well defined, as is the case for the `Map` and `Set`.
  2898. *
  2899. * Collection is the abstract base class for concrete data structures. It
  2900. * cannot be constructed directly.
  2901. *
  2902. * Implementations should extend one of the subclasses, `Collection.Keyed`,
  2903. * `Collection.Indexed`, or `Collection.Set`.
  2904. */
  2905. declare module Collection$1 {
  2906. /**
  2907. * @deprecated use `const { isKeyed } = require('immutable')`
  2908. */
  2909. function isKeyed(maybeKeyed: any): maybeKeyed is Collection$1.Keyed<any, any>;
  2910. /**
  2911. * @deprecated use `const { isIndexed } = require('immutable')`
  2912. */
  2913. function isIndexed(maybeIndexed: any): maybeIndexed is Collection$1.Indexed<any>;
  2914. /**
  2915. * @deprecated use `const { isAssociative } = require('immutable')`
  2916. */
  2917. function isAssociative(maybeAssociative: any): maybeAssociative is Collection$1.Keyed<any, any> | Collection$1.Indexed<any>;
  2918. /**
  2919. * @deprecated use `const { isOrdered } = require('immutable')`
  2920. */
  2921. function isOrdered(maybeOrdered: any): boolean;
  2922. /**
  2923. * Keyed Collections have discrete keys tied to each value.
  2924. *
  2925. * When iterating `Collection.Keyed`, each iteration will yield a `[K, V]`
  2926. * tuple, in other words, `Collection#entries` is the default iterator for
  2927. * Keyed Collections.
  2928. */
  2929. export module Keyed {}
  2930. /**
  2931. * Creates a Collection.Keyed
  2932. *
  2933. * Similar to `Collection()`, however it expects collection-likes of [K, V]
  2934. * tuples if not constructed from a Collection.Keyed or JS Object.
  2935. *
  2936. * Note: `Collection.Keyed` is a conversion function and not a class, and
  2937. * does not use the `new` keyword during construction.
  2938. */
  2939. export function Keyed<K, V>(collection: Iterable<[K, V]>): Collection$1.Keyed<K, V>;
  2940. export function Keyed<V>(obj: {[key: string]: V}): Collection$1.Keyed<string, V>;
  2941. export interface Keyed<K, V> extends Collection$1<K, V> {
  2942. /**
  2943. * Deeply converts this Keyed collection to equivalent native JavaScript Object.
  2944. *
  2945. * Converts keys to Strings.
  2946. */
  2947. toJS(): Object;
  2948. /**
  2949. * Shallowly converts this Keyed collection to equivalent native JavaScript Object.
  2950. *
  2951. * Converts keys to Strings.
  2952. */
  2953. toJSON(): { [key: string]: V };
  2954. /**
  2955. * Shallowly converts this collection to an Array.
  2956. */
  2957. toArray(): Array<[K, V]>;
  2958. /**
  2959. * Returns Seq.Keyed.
  2960. * @override
  2961. */
  2962. toSeq(): Seq.Keyed<K, V>;
  2963. // Sequence functions
  2964. /**
  2965. * Returns a new Collection.Keyed of the same type where the keys and values
  2966. * have been flipped.
  2967. *
  2968. * <!-- runkit:activate -->
  2969. * ```js
  2970. * const { Map } = require('immutable')
  2971. * Map({ a: 'z', b: 'y' }).flip()
  2972. * // Map { "z": "a", "y": "b" }
  2973. * ```
  2974. */
  2975. flip(): Collection$1.Keyed<V, K>;
  2976. /**
  2977. * Returns a new Collection with other collections concatenated to this one.
  2978. */
  2979. concat<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): Collection$1.Keyed<K | KC, V | VC>;
  2980. concat<C>(...collections: Array<{[key: string]: C}>): Collection$1.Keyed<K | string, V | C>;
  2981. /**
  2982. * Returns a new Collection.Keyed with values passed through a
  2983. * `mapper` function.
  2984. *
  2985. * ```js
  2986. * const { Collection } = require('immutable')
  2987. * Collection.Keyed({ a: 1, b: 2 }).map(x => 10 * x)
  2988. * // Seq { "a": 10, "b": 20 }
  2989. * ```
  2990. *
  2991. * Note: `map()` always returns a new instance, even if it produced the
  2992. * same value at every step.
  2993. */
  2994. map<M>(
  2995. mapper: (value: V, key: K, iter: this) => M,
  2996. context?: any
  2997. ): Collection$1.Keyed<K, M>;
  2998. /**
  2999. * Returns a new Collection.Keyed of the same type with keys passed through
  3000. * a `mapper` function.
  3001. *
  3002. * <!-- runkit:activate -->
  3003. * ```js
  3004. * const { Map } = require('immutable')
  3005. * Map({ a: 1, b: 2 }).mapKeys(x => x.toUpperCase())
  3006. * // Map { "A": 1, "B": 2 }
  3007. * ```
  3008. *
  3009. * Note: `mapKeys()` always returns a new instance, even if it produced
  3010. * the same key at every step.
  3011. */
  3012. mapKeys<M>(
  3013. mapper: (key: K, value: V, iter: this) => M,
  3014. context?: any
  3015. ): Collection$1.Keyed<M, V>;
  3016. /**
  3017. * Returns a new Collection.Keyed of the same type with entries
  3018. * ([key, value] tuples) passed through a `mapper` function.
  3019. *
  3020. * <!-- runkit:activate -->
  3021. * ```js
  3022. * const { Map } = require('immutable')
  3023. * Map({ a: 1, b: 2 })
  3024. * .mapEntries(([ k, v ]) => [ k.toUpperCase(), v * 2 ])
  3025. * // Map { "A": 2, "B": 4 }
  3026. * ```
  3027. *
  3028. * Note: `mapEntries()` always returns a new instance, even if it produced
  3029. * the same entry at every step.
  3030. */
  3031. mapEntries<KM, VM>(
  3032. mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
  3033. context?: any
  3034. ): Collection$1.Keyed<KM, VM>;
  3035. /**
  3036. * Flat-maps the Collection, returning a Collection of the same type.
  3037. *
  3038. * Similar to `collection.map(...).flatten(true)`.
  3039. */
  3040. flatMap<KM, VM>(
  3041. mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
  3042. context?: any
  3043. ): Collection$1.Keyed<KM, VM>;
  3044. /**
  3045. * Returns a new Collection with only the values for which the `predicate`
  3046. * function returns true.
  3047. *
  3048. * Note: `filter()` always returns a new instance, even if it results in
  3049. * not filtering out any values.
  3050. */
  3051. filter<F extends V>(
  3052. predicate: (value: V, key: K, iter: this) => value is F,
  3053. context?: any
  3054. ): Collection$1.Keyed<K, F>;
  3055. filter(
  3056. predicate: (value: V, key: K, iter: this) => any,
  3057. context?: any
  3058. ): this;
  3059. [Symbol.iterator](): IterableIterator<[K, V]>;
  3060. }
  3061. /**
  3062. * Indexed Collections have incrementing numeric keys. They exhibit
  3063. * slightly different behavior than `Collection.Keyed` for some methods in order
  3064. * to better mirror the behavior of JavaScript's `Array`, and add methods
  3065. * which do not make sense on non-indexed Collections such as `indexOf`.
  3066. *
  3067. * Unlike JavaScript arrays, `Collection.Indexed`s are always dense. "Unset"
  3068. * indices and `undefined` indices are indistinguishable, and all indices from
  3069. * 0 to `size` are visited when iterated.
  3070. *
  3071. * All Collection.Indexed methods return re-indexed Collections. In other words,
  3072. * indices always start at 0 and increment until size. If you wish to
  3073. * preserve indices, using them as keys, convert to a Collection.Keyed by
  3074. * calling `toKeyedSeq`.
  3075. */
  3076. export module Indexed {}
  3077. /**
  3078. * Creates a new Collection.Indexed.
  3079. *
  3080. * Note: `Collection.Indexed` is a conversion function and not a class, and
  3081. * does not use the `new` keyword during construction.
  3082. */
  3083. export function Indexed<T>(collection: Iterable<T>): Collection$1.Indexed<T>;
  3084. export interface Indexed<T> extends Collection$1<number, T> {
  3085. /**
  3086. * Deeply converts this Indexed collection to equivalent native JavaScript Array.
  3087. */
  3088. toJS(): Array<any>;
  3089. /**
  3090. * Shallowly converts this Indexed collection to equivalent native JavaScript Array.
  3091. */
  3092. toJSON(): Array<T>;
  3093. /**
  3094. * Shallowly converts this collection to an Array.
  3095. */
  3096. toArray(): Array<T>;
  3097. // Reading values
  3098. /**
  3099. * Returns the value associated with the provided index, or notSetValue if
  3100. * the index is beyond the bounds of the Collection.
  3101. *
  3102. * `index` may be a negative number, which indexes back from the end of the
  3103. * Collection. `s.get(-1)` gets the last item in the Collection.
  3104. */
  3105. get<NSV>(index: number, notSetValue: NSV): T | NSV;
  3106. get(index: number): T | undefined;
  3107. // Conversion to Seq
  3108. /**
  3109. * Returns Seq.Indexed.
  3110. * @override
  3111. */
  3112. toSeq(): Seq.Indexed<T>;
  3113. /**
  3114. * If this is a collection of [key, value] entry tuples, it will return a
  3115. * Seq.Keyed of those entries.
  3116. */
  3117. fromEntrySeq(): Seq.Keyed<any, any>;
  3118. // Combination
  3119. /**
  3120. * Returns a Collection of the same type with `separator` between each item
  3121. * in this Collection.
  3122. */
  3123. interpose(separator: T): this;
  3124. /**
  3125. * Returns a Collection of the same type with the provided `collections`
  3126. * interleaved into this collection.
  3127. *
  3128. * The resulting Collection includes the first item from each, then the
  3129. * second from each, etc.
  3130. *
  3131. * <!-- runkit:activate
  3132. * { "preamble": "require('immutable')"}
  3133. * -->
  3134. * ```js
  3135. * const { List } = require('immutable')
  3136. * List([ 1, 2, 3 ]).interleave(List([ 'A', 'B', 'C' ]))
  3137. * // List [ 1, "A", 2, "B", 3, "C"" ]
  3138. * ```
  3139. *
  3140. * The shortest Collection stops interleave.
  3141. *
  3142. * <!-- runkit:activate
  3143. * { "preamble": "const { List } = require('immutable')" }
  3144. * -->
  3145. * ```js
  3146. * List([ 1, 2, 3 ]).interleave(
  3147. * List([ 'A', 'B' ]),
  3148. * List([ 'X', 'Y', 'Z' ])
  3149. * )
  3150. * // List [ 1, "A", "X", 2, "B", "Y"" ]
  3151. * ```
  3152. *
  3153. * Since `interleave()` re-indexes values, it produces a complete copy,
  3154. * which has `O(N)` complexity.
  3155. *
  3156. * Note: `interleave` *cannot* be used in `withMutations`.
  3157. */
  3158. interleave(...collections: Array<Collection$1<any, T>>): this;
  3159. /**
  3160. * Splice returns a new indexed Collection by replacing a region of this
  3161. * Collection with new values. If values are not provided, it only skips the
  3162. * region to be removed.
  3163. *
  3164. * `index` may be a negative number, which indexes back from the end of the
  3165. * Collection. `s.splice(-2)` splices after the second to last item.
  3166. *
  3167. * <!-- runkit:activate -->
  3168. * ```js
  3169. * const { List } = require('immutable')
  3170. * List([ 'a', 'b', 'c', 'd' ]).splice(1, 2, 'q', 'r', 's')
  3171. * // List [ "a", "q", "r", "s", "d" ]
  3172. * ```
  3173. *
  3174. * Since `splice()` re-indexes values, it produces a complete copy, which
  3175. * has `O(N)` complexity.
  3176. *
  3177. * Note: `splice` *cannot* be used in `withMutations`.
  3178. */
  3179. splice(
  3180. index: number,
  3181. removeNum: number,
  3182. ...values: Array<T>
  3183. ): this;
  3184. /**
  3185. * Returns a Collection of the same type "zipped" with the provided
  3186. * collections.
  3187. *
  3188. * Like `zipWith`, but using the default `zipper`: creating an `Array`.
  3189. *
  3190. *
  3191. * <!-- runkit:activate
  3192. * { "preamble": "const { List } = require('immutable')" }
  3193. * -->
  3194. * ```js
  3195. * const a = List([ 1, 2, 3 ]);
  3196. * const b = List([ 4, 5, 6 ]);
  3197. * const c = a.zip(b); // List [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ]
  3198. * ```
  3199. */
  3200. zip<U>(other: Collection$1<any, U>): Collection$1.Indexed<[T,U]>;
  3201. zip<U,V>(other: Collection$1<any, U>, other2: Collection$1<any, V>): Collection$1.Indexed<[T,U,V]>;
  3202. zip(...collections: Array<Collection$1<any, any>>): Collection$1.Indexed<any>;
  3203. /**
  3204. * Returns a Collection "zipped" with the provided collections.
  3205. *
  3206. * Unlike `zip`, `zipAll` continues zipping until the longest collection is
  3207. * exhausted. Missing values from shorter collections are filled with `undefined`.
  3208. *
  3209. * ```js
  3210. * const a = List([ 1, 2 ]);
  3211. * const b = List([ 3, 4, 5 ]);
  3212. * const c = a.zipAll(b); // List [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ]
  3213. * ```
  3214. */
  3215. zipAll<U>(other: Collection$1<any, U>): Collection$1.Indexed<[T,U]>;
  3216. zipAll<U,V>(other: Collection$1<any, U>, other2: Collection$1<any, V>): Collection$1.Indexed<[T,U,V]>;
  3217. zipAll(...collections: Array<Collection$1<any, any>>): Collection$1.Indexed<any>;
  3218. /**
  3219. * Returns a Collection of the same type "zipped" with the provided
  3220. * collections by using a custom `zipper` function.
  3221. *
  3222. * <!-- runkit:activate
  3223. * { "preamble": "const { List } = require('immutable')" }
  3224. * -->
  3225. * ```js
  3226. * const a = List([ 1, 2, 3 ]);
  3227. * const b = List([ 4, 5, 6 ]);
  3228. * const c = a.zipWith((a, b) => a + b, b);
  3229. * // List [ 5, 7, 9 ]
  3230. * ```
  3231. */
  3232. zipWith<U, Z>(
  3233. zipper: (value: T, otherValue: U) => Z,
  3234. otherCollection: Collection$1<any, U>
  3235. ): Collection$1.Indexed<Z>;
  3236. zipWith<U, V, Z>(
  3237. zipper: (value: T, otherValue: U, thirdValue: V) => Z,
  3238. otherCollection: Collection$1<any, U>,
  3239. thirdCollection: Collection$1<any, V>
  3240. ): Collection$1.Indexed<Z>;
  3241. zipWith<Z>(
  3242. zipper: (...any: Array<any>) => Z,
  3243. ...collections: Array<Collection$1<any, any>>
  3244. ): Collection$1.Indexed<Z>;
  3245. // Search for value
  3246. /**
  3247. * Returns the first index at which a given value can be found in the
  3248. * Collection, or -1 if it is not present.
  3249. */
  3250. indexOf(searchValue: T): number;
  3251. /**
  3252. * Returns the last index at which a given value can be found in the
  3253. * Collection, or -1 if it is not present.
  3254. */
  3255. lastIndexOf(searchValue: T): number;
  3256. /**
  3257. * Returns the first index in the Collection where a value satisfies the
  3258. * provided predicate function. Otherwise -1 is returned.
  3259. */
  3260. findIndex(
  3261. predicate: (value: T, index: number, iter: this) => boolean,
  3262. context?: any
  3263. ): number;
  3264. /**
  3265. * Returns the last index in the Collection where a value satisfies the
  3266. * provided predicate function. Otherwise -1 is returned.
  3267. */
  3268. findLastIndex(
  3269. predicate: (value: T, index: number, iter: this) => boolean,
  3270. context?: any
  3271. ): number;
  3272. // Sequence algorithms
  3273. /**
  3274. * Returns a new Collection with other collections concatenated to this one.
  3275. */
  3276. concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): Collection$1.Indexed<T | C>;
  3277. /**
  3278. * Returns a new Collection.Indexed with values passed through a
  3279. * `mapper` function.
  3280. *
  3281. * ```js
  3282. * const { Collection } = require('immutable')
  3283. * Collection.Indexed([1,2]).map(x => 10 * x)
  3284. * // Seq [ 1, 2 ]
  3285. * ```
  3286. *
  3287. * Note: `map()` always returns a new instance, even if it produced the
  3288. * same value at every step.
  3289. */
  3290. map<M>(
  3291. mapper: (value: T, key: number, iter: this) => M,
  3292. context?: any
  3293. ): Collection$1.Indexed<M>;
  3294. /**
  3295. * Flat-maps the Collection, returning a Collection of the same type.
  3296. *
  3297. * Similar to `collection.map(...).flatten(true)`.
  3298. */
  3299. flatMap<M>(
  3300. mapper: (value: T, key: number, iter: this) => Iterable<M>,
  3301. context?: any
  3302. ): Collection$1.Indexed<M>;
  3303. /**
  3304. * Returns a new Collection with only the values for which the `predicate`
  3305. * function returns true.
  3306. *
  3307. * Note: `filter()` always returns a new instance, even if it results in
  3308. * not filtering out any values.
  3309. */
  3310. filter<F extends T>(
  3311. predicate: (value: T, index: number, iter: this) => value is F,
  3312. context?: any
  3313. ): Collection$1.Indexed<F>;
  3314. filter(
  3315. predicate: (value: T, index: number, iter: this) => any,
  3316. context?: any
  3317. ): this;
  3318. [Symbol.iterator](): IterableIterator<T>;
  3319. }
  3320. /**
  3321. * Set Collections only represent values. They have no associated keys or
  3322. * indices. Duplicate values are possible in the lazy `Seq.Set`s, however
  3323. * the concrete `Set` Collection does not allow duplicate values.
  3324. *
  3325. * Collection methods on Collection.Set such as `map` and `forEach` will provide
  3326. * the value as both the first and second arguments to the provided function.
  3327. *
  3328. * ```js
  3329. * const { Collection } = require('immutable')
  3330. * const seq = Collection.Set([ 'A', 'B', 'C' ])
  3331. * // Seq { "A", "B", "C" }
  3332. * seq.forEach((v, k) =>
  3333. * assert.equal(v, k)
  3334. * )
  3335. * ```
  3336. */
  3337. export module Set {}
  3338. /**
  3339. * Similar to `Collection()`, but always returns a Collection.Set.
  3340. *
  3341. * Note: `Collection.Set` is a factory function and not a class, and does
  3342. * not use the `new` keyword during construction.
  3343. */
  3344. export function Set<T>(collection: Iterable<T>): Collection$1.Set<T>;
  3345. export interface Set<T> extends Collection$1<T, T> {
  3346. /**
  3347. * Deeply converts this Set collection to equivalent native JavaScript Array.
  3348. */
  3349. toJS(): Array<any>;
  3350. /**
  3351. * Shallowly converts this Set collection to equivalent native JavaScript Array.
  3352. */
  3353. toJSON(): Array<T>;
  3354. /**
  3355. * Shallowly converts this collection to an Array.
  3356. */
  3357. toArray(): Array<T>;
  3358. /**
  3359. * Returns Seq.Set.
  3360. * @override
  3361. */
  3362. toSeq(): Seq.Set<T>;
  3363. // Sequence algorithms
  3364. /**
  3365. * Returns a new Collection with other collections concatenated to this one.
  3366. */
  3367. concat<U>(...collections: Array<Iterable<U>>): Collection$1.Set<T | U>;
  3368. /**
  3369. * Returns a new Collection.Set with values passed through a
  3370. * `mapper` function.
  3371. *
  3372. * ```
  3373. * Collection.Set([ 1, 2 ]).map(x => 10 * x)
  3374. * // Seq { 1, 2 }
  3375. * ```
  3376. *
  3377. * Note: `map()` always returns a new instance, even if it produced the
  3378. * same value at every step.
  3379. */
  3380. map<M>(
  3381. mapper: (value: T, key: T, iter: this) => M,
  3382. context?: any
  3383. ): Collection$1.Set<M>;
  3384. /**
  3385. * Flat-maps the Collection, returning a Collection of the same type.
  3386. *
  3387. * Similar to `collection.map(...).flatten(true)`.
  3388. */
  3389. flatMap<M>(
  3390. mapper: (value: T, key: T, iter: this) => Iterable<M>,
  3391. context?: any
  3392. ): Collection$1.Set<M>;
  3393. /**
  3394. * Returns a new Collection with only the values for which the `predicate`
  3395. * function returns true.
  3396. *
  3397. * Note: `filter()` always returns a new instance, even if it results in
  3398. * not filtering out any values.
  3399. */
  3400. filter<F extends T>(
  3401. predicate: (value: T, key: T, iter: this) => value is F,
  3402. context?: any
  3403. ): Collection$1.Set<F>;
  3404. filter(
  3405. predicate: (value: T, key: T, iter: this) => any,
  3406. context?: any
  3407. ): this;
  3408. [Symbol.iterator](): IterableIterator<T>;
  3409. }
  3410. }
  3411. /**
  3412. * Creates a Collection.
  3413. *
  3414. * The type of Collection created is based on the input.
  3415. *
  3416. * * If an `Collection`, that same `Collection`.
  3417. * * If an Array-like, an `Collection.Indexed`.
  3418. * * If an Object with an Iterator defined, an `Collection.Indexed`.
  3419. * * If an Object, an `Collection.Keyed`.
  3420. *
  3421. * This methods forces the conversion of Objects and Strings to Collections.
  3422. * If you want to ensure that a Collection of one item is returned, use
  3423. * `Seq.of`.
  3424. *
  3425. * Note: An Iterator itself will be treated as an object, becoming a `Seq.Keyed`,
  3426. * which is usually not what you want. You should turn your Iterator Object into
  3427. * an iterable object by defining a Symbol.iterator (or @@iterator) method which
  3428. * returns `this`.
  3429. *
  3430. * Note: `Collection` is a conversion function and not a class, and does not
  3431. * use the `new` keyword during construction.
  3432. */
  3433. declare function Collection$1<I extends Collection$1<any, any>>(collection: I): I;
  3434. declare function Collection$1<T>(collection: Iterable<T>): Collection$1.Indexed<T>;
  3435. declare function Collection$1<V>(obj: {[key: string]: V}): Collection$1.Keyed<string, V>;
  3436. interface Collection$1<K, V> extends ValueObject {
  3437. // Value equality
  3438. /**
  3439. * True if this and the other Collection have value equality, as defined
  3440. * by `Immutable.is()`.
  3441. *
  3442. * Note: This is equivalent to `Immutable.is(this, other)`, but provided to
  3443. * allow for chained expressions.
  3444. */
  3445. equals(other: any): boolean;
  3446. /**
  3447. * Computes and returns the hashed identity for this Collection.
  3448. *
  3449. * The `hashCode` of a Collection is used to determine potential equality,
  3450. * and is used when adding this to a `Set` or as a key in a `Map`, enabling
  3451. * lookup via a different instance.
  3452. *
  3453. * <!-- runkit:activate
  3454. * { "preamble": "const { Set, List } = require('immutable')" }
  3455. * -->
  3456. * ```js
  3457. * const a = List([ 1, 2, 3 ]);
  3458. * const b = List([ 1, 2, 3 ]);
  3459. * assert.notStrictEqual(a, b); // different instances
  3460. * const set = Set([ a ]);
  3461. * assert.equal(set.has(b), true);
  3462. * ```
  3463. *
  3464. * If two values have the same `hashCode`, they are [not guaranteed
  3465. * to be equal][Hash Collision]. If two values have different `hashCode`s,
  3466. * they must not be equal.
  3467. *
  3468. * [Hash Collision]: http://en.wikipedia.org/wiki/Collision_(computer_science)
  3469. */
  3470. hashCode(): number;
  3471. // Reading values
  3472. /**
  3473. * Returns the value associated with the provided key, or notSetValue if
  3474. * the Collection does not contain this key.
  3475. *
  3476. * Note: it is possible a key may be associated with an `undefined` value,
  3477. * so if `notSetValue` is not provided and this method returns `undefined`,
  3478. * that does not guarantee the key was not found.
  3479. */
  3480. get<NSV>(key: K, notSetValue: NSV): V | NSV;
  3481. get(key: K): V | undefined;
  3482. /**
  3483. * True if a key exists within this `Collection`, using `Immutable.is`
  3484. * to determine equality
  3485. */
  3486. has(key: K): boolean;
  3487. /**
  3488. * True if a value exists within this `Collection`, using `Immutable.is`
  3489. * to determine equality
  3490. * @alias contains
  3491. */
  3492. includes(value: V): boolean;
  3493. contains(value: V): boolean;
  3494. /**
  3495. * In case the `Collection` is not empty returns the first element of the
  3496. * `Collection`.
  3497. * In case the `Collection` is empty returns the optional default
  3498. * value if provided, if no default value is provided returns undefined.
  3499. */
  3500. first<NSV>(notSetValue?: NSV): V | NSV;
  3501. /**
  3502. * In case the `Collection` is not empty returns the last element of the
  3503. * `Collection`.
  3504. * In case the `Collection` is empty returns the optional default
  3505. * value if provided, if no default value is provided returns undefined.
  3506. */
  3507. last<NSV>(notSetValue?: NSV): V | NSV;
  3508. // Reading deep values
  3509. /**
  3510. * Returns the value found by following a path of keys or indices through
  3511. * nested Collections.
  3512. *
  3513. * <!-- runkit:activate -->
  3514. * ```js
  3515. * const { Map, List } = require('immutable')
  3516. * const deepData = Map({ x: List([ Map({ y: 123 }) ]) });
  3517. * deepData.getIn(['x', 0, 'y']) // 123
  3518. * ```
  3519. *
  3520. * Plain JavaScript Object or Arrays may be nested within an Immutable.js
  3521. * Collection, and getIn() can access those values as well:
  3522. *
  3523. * <!-- runkit:activate -->
  3524. * ```js
  3525. * const { Map, List } = require('immutable')
  3526. * const deepData = Map({ x: [ { y: 123 } ] });
  3527. * deepData.getIn(['x', 0, 'y']) // 123
  3528. * ```
  3529. */
  3530. getIn(searchKeyPath: Iterable<any>, notSetValue?: any): any;
  3531. /**
  3532. * True if the result of following a path of keys or indices through nested
  3533. * Collections results in a set value.
  3534. */
  3535. hasIn(searchKeyPath: Iterable<any>): boolean;
  3536. // Persistent changes
  3537. /**
  3538. * This can be very useful as a way to "chain" a normal function into a
  3539. * sequence of methods. RxJS calls this "let" and lodash calls it "thru".
  3540. *
  3541. * For example, to sum a Seq after mapping and filtering:
  3542. *
  3543. * <!-- runkit:activate -->
  3544. * ```js
  3545. * const { Seq } = require('immutable')
  3546. *
  3547. * function sum(collection) {
  3548. * return collection.reduce((sum, x) => sum + x, 0)
  3549. * }
  3550. *
  3551. * Seq([ 1, 2, 3 ])
  3552. * .map(x => x + 1)
  3553. * .filter(x => x % 2 === 0)
  3554. * .update(sum)
  3555. * // 6
  3556. * ```
  3557. */
  3558. update<R>(updater: (value: this) => R): R;
  3559. // Conversion to JavaScript types
  3560. /**
  3561. * Deeply converts this Collection to equivalent native JavaScript Array or Object.
  3562. *
  3563. * `Collection.Indexed`, and `Collection.Set` become `Array`, while
  3564. * `Collection.Keyed` become `Object`, converting keys to Strings.
  3565. */
  3566. toJS(): Array<any> | { [key: string]: any };
  3567. /**
  3568. * Shallowly converts this Collection to equivalent native JavaScript Array or Object.
  3569. *
  3570. * `Collection.Indexed`, and `Collection.Set` become `Array`, while
  3571. * `Collection.Keyed` become `Object`, converting keys to Strings.
  3572. */
  3573. toJSON(): Array<V> | { [key: string]: V };
  3574. /**
  3575. * Shallowly converts this collection to an Array.
  3576. *
  3577. * `Collection.Indexed`, and `Collection.Set` produce an Array of values.
  3578. * `Collection.Keyed` produce an Array of [key, value] tuples.
  3579. */
  3580. toArray(): Array<V> | Array<[K, V]>;
  3581. /**
  3582. * Shallowly converts this Collection to an Object.
  3583. *
  3584. * Converts keys to Strings.
  3585. */
  3586. toObject(): { [key: string]: V };
  3587. // Conversion to Collections
  3588. /**
  3589. * Converts this Collection to a Map, Throws if keys are not hashable.
  3590. *
  3591. * Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided
  3592. * for convenience and to allow for chained expressions.
  3593. */
  3594. toMap(): Map$1<K, V>;
  3595. /**
  3596. * Converts this Collection to a Map, maintaining the order of iteration.
  3597. *
  3598. * Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but
  3599. * provided for convenience and to allow for chained expressions.
  3600. */
  3601. toOrderedMap(): OrderedMap<K, V>;
  3602. /**
  3603. * Converts this Collection to a Set, discarding keys. Throws if values
  3604. * are not hashable.
  3605. *
  3606. * Note: This is equivalent to `Set(this)`, but provided to allow for
  3607. * chained expressions.
  3608. */
  3609. toSet(): Set$1<V>;
  3610. /**
  3611. * Converts this Collection to a Set, maintaining the order of iteration and
  3612. * discarding keys.
  3613. *
  3614. * Note: This is equivalent to `OrderedSet(this.valueSeq())`, but provided
  3615. * for convenience and to allow for chained expressions.
  3616. */
  3617. toOrderedSet(): OrderedSet<V>;
  3618. /**
  3619. * Converts this Collection to a List, discarding keys.
  3620. *
  3621. * This is similar to `List(collection)`, but provided to allow for chained
  3622. * expressions. However, when called on `Map` or other keyed collections,
  3623. * `collection.toList()` discards the keys and creates a list of only the
  3624. * values, whereas `List(collection)` creates a list of entry tuples.
  3625. *
  3626. * <!-- runkit:activate -->
  3627. * ```js
  3628. * const { Map, List } = require('immutable')
  3629. * var myMap = Map({ a: 'Apple', b: 'Banana' })
  3630. * List(myMap) // List [ [ "a", "Apple" ], [ "b", "Banana" ] ]
  3631. * myMap.toList() // List [ "Apple", "Banana" ]
  3632. * ```
  3633. */
  3634. toList(): List<V>;
  3635. /**
  3636. * Converts this Collection to a Stack, discarding keys. Throws if values
  3637. * are not hashable.
  3638. *
  3639. * Note: This is equivalent to `Stack(this)`, but provided to allow for
  3640. * chained expressions.
  3641. */
  3642. toStack(): Stack<V>;
  3643. // Conversion to Seq
  3644. /**
  3645. * Converts this Collection to a Seq of the same kind (indexed,
  3646. * keyed, or set).
  3647. */
  3648. toSeq(): Seq<K, V>;
  3649. /**
  3650. * Returns a Seq.Keyed from this Collection where indices are treated as keys.
  3651. *
  3652. * This is useful if you want to operate on an
  3653. * Collection.Indexed and preserve the [index, value] pairs.
  3654. *
  3655. * The returned Seq will have identical iteration order as
  3656. * this Collection.
  3657. *
  3658. * <!-- runkit:activate -->
  3659. * ```js
  3660. * const { Seq } = require('immutable')
  3661. * const indexedSeq = Seq([ 'A', 'B', 'C' ])
  3662. * // Seq [ "A", "B", "C" ]
  3663. * indexedSeq.filter(v => v === 'B')
  3664. * // Seq [ "B" ]
  3665. * const keyedSeq = indexedSeq.toKeyedSeq()
  3666. * // Seq { 0: "A", 1: "B", 2: "C" }
  3667. * keyedSeq.filter(v => v === 'B')
  3668. * // Seq { 1: "B" }
  3669. * ```
  3670. */
  3671. toKeyedSeq(): Seq.Keyed<K, V>;
  3672. /**
  3673. * Returns an Seq.Indexed of the values of this Collection, discarding keys.
  3674. */
  3675. toIndexedSeq(): Seq.Indexed<V>;
  3676. /**
  3677. * Returns a Seq.Set of the values of this Collection, discarding keys.
  3678. */
  3679. toSetSeq(): Seq.Set<V>;
  3680. // Iterators
  3681. /**
  3682. * An iterator of this `Collection`'s keys.
  3683. *
  3684. * Note: this will return an ES6 iterator which does not support
  3685. * Immutable.js sequence algorithms. Use `keySeq` instead, if this is
  3686. * what you want.
  3687. */
  3688. keys(): IterableIterator<K>;
  3689. /**
  3690. * An iterator of this `Collection`'s values.
  3691. *
  3692. * Note: this will return an ES6 iterator which does not support
  3693. * Immutable.js sequence algorithms. Use `valueSeq` instead, if this is
  3694. * what you want.
  3695. */
  3696. values(): IterableIterator<V>;
  3697. /**
  3698. * An iterator of this `Collection`'s entries as `[ key, value ]` tuples.
  3699. *
  3700. * Note: this will return an ES6 iterator which does not support
  3701. * Immutable.js sequence algorithms. Use `entrySeq` instead, if this is
  3702. * what you want.
  3703. */
  3704. entries(): IterableIterator<[K, V]>;
  3705. // Collections (Seq)
  3706. /**
  3707. * Returns a new Seq.Indexed of the keys of this Collection,
  3708. * discarding values.
  3709. */
  3710. keySeq(): Seq.Indexed<K>;
  3711. /**
  3712. * Returns an Seq.Indexed of the values of this Collection, discarding keys.
  3713. */
  3714. valueSeq(): Seq.Indexed<V>;
  3715. /**
  3716. * Returns a new Seq.Indexed of [key, value] tuples.
  3717. */
  3718. entrySeq(): Seq.Indexed<[K, V]>;
  3719. // Sequence algorithms
  3720. /**
  3721. * Returns a new Collection of the same type with values passed through a
  3722. * `mapper` function.
  3723. *
  3724. * <!-- runkit:activate -->
  3725. * ```js
  3726. * const { Collection } = require('immutable')
  3727. * Collection({ a: 1, b: 2 }).map(x => 10 * x)
  3728. * // Seq { "a": 10, "b": 20 }
  3729. * ```
  3730. *
  3731. * Note: `map()` always returns a new instance, even if it produced the same
  3732. * value at every step.
  3733. */
  3734. map<M>(
  3735. mapper: (value: V, key: K, iter: this) => M,
  3736. context?: any
  3737. ): Collection$1<K, M>;
  3738. /**
  3739. * Note: used only for sets, which return Collection<M, M> but are otherwise
  3740. * identical to normal `map()`.
  3741. *
  3742. * @ignore
  3743. */
  3744. map<M>(...args: never[]): any;
  3745. /**
  3746. * Returns a new Collection of the same type with only the entries for which
  3747. * the `predicate` function returns true.
  3748. *
  3749. * <!-- runkit:activate -->
  3750. * ```js
  3751. * const { Map } = require('immutable')
  3752. * Map({ a: 1, b: 2, c: 3, d: 4}).filter(x => x % 2 === 0)
  3753. * // Map { "b": 2, "d": 4 }
  3754. * ```
  3755. *
  3756. * Note: `filter()` always returns a new instance, even if it results in
  3757. * not filtering out any values.
  3758. */
  3759. filter<F extends V>(
  3760. predicate: (value: V, key: K, iter: this) => value is F,
  3761. context?: any
  3762. ): Collection$1<K, F>;
  3763. filter(
  3764. predicate: (value: V, key: K, iter: this) => any,
  3765. context?: any
  3766. ): this;
  3767. /**
  3768. * Returns a new Collection of the same type with only the entries for which
  3769. * the `predicate` function returns false.
  3770. *
  3771. * <!-- runkit:activate -->
  3772. * ```js
  3773. * const { Map } = require('immutable')
  3774. * Map({ a: 1, b: 2, c: 3, d: 4}).filterNot(x => x % 2 === 0)
  3775. * // Map { "a": 1, "c": 3 }
  3776. * ```
  3777. *
  3778. * Note: `filterNot()` always returns a new instance, even if it results in
  3779. * not filtering out any values.
  3780. */
  3781. filterNot(
  3782. predicate: (value: V, key: K, iter: this) => boolean,
  3783. context?: any
  3784. ): this;
  3785. /**
  3786. * Returns a new Collection of the same type in reverse order.
  3787. */
  3788. reverse(): this;
  3789. /**
  3790. * Returns a new Collection of the same type which includes the same entries,
  3791. * stably sorted by using a `comparator`.
  3792. *
  3793. * If a `comparator` is not provided, a default comparator uses `<` and `>`.
  3794. *
  3795. * `comparator(valueA, valueB)`:
  3796. *
  3797. * * Returns `0` if the elements should not be swapped.
  3798. * * Returns `-1` (or any negative number) if `valueA` comes before `valueB`
  3799. * * Returns `1` (or any positive number) if `valueA` comes after `valueB`
  3800. * * Is pure, i.e. it must always return the same value for the same pair
  3801. * of values.
  3802. *
  3803. * When sorting collections which have no defined order, their ordered
  3804. * equivalents will be returned. e.g. `map.sort()` returns OrderedMap.
  3805. *
  3806. * <!-- runkit:activate -->
  3807. * ```js
  3808. * const { Map } = require('immutable')
  3809. * Map({ "c": 3, "a": 1, "b": 2 }).sort((a, b) => {
  3810. * if (a < b) { return -1; }
  3811. * if (a > b) { return 1; }
  3812. * if (a === b) { return 0; }
  3813. * });
  3814. * // OrderedMap { "a": 1, "b": 2, "c": 3 }
  3815. * ```
  3816. *
  3817. * Note: `sort()` Always returns a new instance, even if the original was
  3818. * already sorted.
  3819. *
  3820. * Note: This is always an eager operation.
  3821. */
  3822. sort(comparator?: (valueA: V, valueB: V) => number): this;
  3823. /**
  3824. * Like `sort`, but also accepts a `comparatorValueMapper` which allows for
  3825. * sorting by more sophisticated means:
  3826. *
  3827. * hitters.sortBy(hitter => hitter.avgHits)
  3828. *
  3829. * Note: `sortBy()` Always returns a new instance, even if the original was
  3830. * already sorted.
  3831. *
  3832. * Note: This is always an eager operation.
  3833. */
  3834. sortBy<C>(
  3835. comparatorValueMapper: (value: V, key: K, iter: this) => C,
  3836. comparator?: (valueA: C, valueB: C) => number
  3837. ): this;
  3838. /**
  3839. * Returns a `Collection.Keyed` of `Collection.Keyeds`, grouped by the return
  3840. * value of the `grouper` function.
  3841. *
  3842. * Note: This is always an eager operation.
  3843. *
  3844. * <!-- runkit:activate -->
  3845. * ```js
  3846. * const { List, Map } = require('immutable')
  3847. * const listOfMaps = List([
  3848. * Map({ v: 0 }),
  3849. * Map({ v: 1 }),
  3850. * Map({ v: 1 }),
  3851. * Map({ v: 0 }),
  3852. * Map({ v: 2 })
  3853. * ])
  3854. * const groupsOfMaps = listOfMaps.groupBy(x => x.get('v'))
  3855. * // Map {
  3856. * // 0: List [ Map{ "v": 0 }, Map { "v": 0 } ],
  3857. * // 1: List [ Map{ "v": 1 }, Map { "v": 1 } ],
  3858. * // 2: List [ Map{ "v": 2 } ],
  3859. * // }
  3860. * ```
  3861. */
  3862. groupBy<G>(
  3863. grouper: (value: V, key: K, iter: this) => G,
  3864. context?: any
  3865. ): /*Map*/Seq.Keyed<G, /*this*/Collection$1<K, V>>;
  3866. // Side effects
  3867. /**
  3868. * The `sideEffect` is executed for every entry in the Collection.
  3869. *
  3870. * Unlike `Array#forEach`, if any call of `sideEffect` returns
  3871. * `false`, the iteration will stop. Returns the number of entries iterated
  3872. * (including the last iteration which returned false).
  3873. */
  3874. forEach(
  3875. sideEffect: (value: V, key: K, iter: this) => any,
  3876. context?: any
  3877. ): number;
  3878. // Creating subsets
  3879. /**
  3880. * Returns a new Collection of the same type representing a portion of this
  3881. * Collection from start up to but not including end.
  3882. *
  3883. * If begin is negative, it is offset from the end of the Collection. e.g.
  3884. * `slice(-2)` returns a Collection of the last two entries. If it is not
  3885. * provided the new Collection will begin at the beginning of this Collection.
  3886. *
  3887. * If end is negative, it is offset from the end of the Collection. e.g.
  3888. * `slice(0, -1)` returns a Collection of everything but the last entry. If
  3889. * it is not provided, the new Collection will continue through the end of
  3890. * this Collection.
  3891. *
  3892. * If the requested slice is equivalent to the current Collection, then it
  3893. * will return itself.
  3894. */
  3895. slice(begin?: number, end?: number): this;
  3896. /**
  3897. * Returns a new Collection of the same type containing all entries except
  3898. * the first.
  3899. */
  3900. rest(): this;
  3901. /**
  3902. * Returns a new Collection of the same type containing all entries except
  3903. * the last.
  3904. */
  3905. butLast(): this;
  3906. /**
  3907. * Returns a new Collection of the same type which excludes the first `amount`
  3908. * entries from this Collection.
  3909. */
  3910. skip(amount: number): this;
  3911. /**
  3912. * Returns a new Collection of the same type which excludes the last `amount`
  3913. * entries from this Collection.
  3914. */
  3915. skipLast(amount: number): this;
  3916. /**
  3917. * Returns a new Collection of the same type which includes entries starting
  3918. * from when `predicate` first returns false.
  3919. *
  3920. * <!-- runkit:activate -->
  3921. * ```js
  3922. * const { List } = require('immutable')
  3923. * List([ 'dog', 'frog', 'cat', 'hat', 'god' ])
  3924. * .skipWhile(x => x.match(/g/))
  3925. * // List [ "cat", "hat", "god"" ]
  3926. * ```
  3927. */
  3928. skipWhile(
  3929. predicate: (value: V, key: K, iter: this) => boolean,
  3930. context?: any
  3931. ): this;
  3932. /**
  3933. * Returns a new Collection of the same type which includes entries starting
  3934. * from when `predicate` first returns true.
  3935. *
  3936. * <!-- runkit:activate -->
  3937. * ```js
  3938. * const { List } = require('immutable')
  3939. * List([ 'dog', 'frog', 'cat', 'hat', 'god' ])
  3940. * .skipUntil(x => x.match(/hat/))
  3941. * // List [ "hat", "god"" ]
  3942. * ```
  3943. */
  3944. skipUntil(
  3945. predicate: (value: V, key: K, iter: this) => boolean,
  3946. context?: any
  3947. ): this;
  3948. /**
  3949. * Returns a new Collection of the same type which includes the first `amount`
  3950. * entries from this Collection.
  3951. */
  3952. take(amount: number): this;
  3953. /**
  3954. * Returns a new Collection of the same type which includes the last `amount`
  3955. * entries from this Collection.
  3956. */
  3957. takeLast(amount: number): this;
  3958. /**
  3959. * Returns a new Collection of the same type which includes entries from this
  3960. * Collection as long as the `predicate` returns true.
  3961. *
  3962. * <!-- runkit:activate -->
  3963. * ```js
  3964. * const { List } = require('immutable')
  3965. * List([ 'dog', 'frog', 'cat', 'hat', 'god' ])
  3966. * .takeWhile(x => x.match(/o/))
  3967. * // List [ "dog", "frog" ]
  3968. * ```
  3969. */
  3970. takeWhile(
  3971. predicate: (value: V, key: K, iter: this) => boolean,
  3972. context?: any
  3973. ): this;
  3974. /**
  3975. * Returns a new Collection of the same type which includes entries from this
  3976. * Collection as long as the `predicate` returns false.
  3977. *
  3978. * <!-- runkit:activate -->
  3979. * ```js
  3980. * const { List } = require('immutable')
  3981. * List([ 'dog', 'frog', 'cat', 'hat', 'god' ])
  3982. * .takeUntil(x => x.match(/at/))
  3983. * // List [ "dog", "frog" ]
  3984. * ```
  3985. */
  3986. takeUntil(
  3987. predicate: (value: V, key: K, iter: this) => boolean,
  3988. context?: any
  3989. ): this;
  3990. // Combination
  3991. /**
  3992. * Returns a new Collection of the same type with other values and
  3993. * collection-like concatenated to this one.
  3994. *
  3995. * For Seqs, all entries will be present in the resulting Seq, even if they
  3996. * have the same key.
  3997. */
  3998. concat(...valuesOrCollections: Array<any>): Collection$1<any, any>;
  3999. /**
  4000. * Flattens nested Collections.
  4001. *
  4002. * Will deeply flatten the Collection by default, returning a Collection of the
  4003. * same type, but a `depth` can be provided in the form of a number or
  4004. * boolean (where true means to shallowly flatten one level). A depth of 0
  4005. * (or shallow: false) will deeply flatten.
  4006. *
  4007. * Flattens only others Collection, not Arrays or Objects.
  4008. *
  4009. * Note: `flatten(true)` operates on Collection<any, Collection<K, V>> and
  4010. * returns Collection<K, V>
  4011. */
  4012. flatten(depth?: number): Collection$1<any, any>;
  4013. flatten(shallow?: boolean): Collection$1<any, any>;
  4014. /**
  4015. * Flat-maps the Collection, returning a Collection of the same type.
  4016. *
  4017. * Similar to `collection.map(...).flatten(true)`.
  4018. */
  4019. flatMap<M>(
  4020. mapper: (value: V, key: K, iter: this) => Iterable<M>,
  4021. context?: any
  4022. ): Collection$1<K, M>;
  4023. /**
  4024. * Flat-maps the Collection, returning a Collection of the same type.
  4025. *
  4026. * Similar to `collection.map(...).flatten(true)`.
  4027. * Used for Dictionaries only.
  4028. */
  4029. flatMap<KM, VM>(
  4030. mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
  4031. context?: any
  4032. ): Collection$1<KM, VM>;
  4033. // Reducing a value
  4034. /**
  4035. * Reduces the Collection to a value by calling the `reducer` for every entry
  4036. * in the Collection and passing along the reduced value.
  4037. *
  4038. * If `initialReduction` is not provided, the first item in the
  4039. * Collection will be used.
  4040. *
  4041. * @see `Array#reduce`.
  4042. */
  4043. reduce<R>(
  4044. reducer: (reduction: R, value: V, key: K, iter: this) => R,
  4045. initialReduction: R,
  4046. context?: any
  4047. ): R;
  4048. reduce<R>(
  4049. reducer: (reduction: V | R, value: V, key: K, iter: this) => R
  4050. ): R;
  4051. /**
  4052. * Reduces the Collection in reverse (from the right side).
  4053. *
  4054. * Note: Similar to this.reverse().reduce(), and provided for parity
  4055. * with `Array#reduceRight`.
  4056. */
  4057. reduceRight<R>(
  4058. reducer: (reduction: R, value: V, key: K, iter: this) => R,
  4059. initialReduction: R,
  4060. context?: any
  4061. ): R;
  4062. reduceRight<R>(
  4063. reducer: (reduction: V | R, value: V, key: K, iter: this) => R
  4064. ): R;
  4065. /**
  4066. * True if `predicate` returns true for all entries in the Collection.
  4067. */
  4068. every(
  4069. predicate: (value: V, key: K, iter: this) => boolean,
  4070. context?: any
  4071. ): boolean;
  4072. /**
  4073. * True if `predicate` returns true for any entry in the Collection.
  4074. */
  4075. some(
  4076. predicate: (value: V, key: K, iter: this) => boolean,
  4077. context?: any
  4078. ): boolean;
  4079. /**
  4080. * Joins values together as a string, inserting a separator between each.
  4081. * The default separator is `","`.
  4082. */
  4083. join(separator?: string): string;
  4084. /**
  4085. * Returns true if this Collection includes no values.
  4086. *
  4087. * For some lazy `Seq`, `isEmpty` might need to iterate to determine
  4088. * emptiness. At most one iteration will occur.
  4089. */
  4090. isEmpty(): boolean;
  4091. /**
  4092. * Returns the size of this Collection.
  4093. *
  4094. * Regardless of if this Collection can describe its size lazily (some Seqs
  4095. * cannot), this method will always return the correct size. E.g. it
  4096. * evaluates a lazy `Seq` if necessary.
  4097. *
  4098. * If `predicate` is provided, then this returns the count of entries in the
  4099. * Collection for which the `predicate` returns true.
  4100. */
  4101. count(): number;
  4102. count(
  4103. predicate: (value: V, key: K, iter: this) => boolean,
  4104. context?: any
  4105. ): number;
  4106. /**
  4107. * Returns a `Seq.Keyed` of counts, grouped by the return value of
  4108. * the `grouper` function.
  4109. *
  4110. * Note: This is not a lazy operation.
  4111. */
  4112. countBy<G>(
  4113. grouper: (value: V, key: K, iter: this) => G,
  4114. context?: any
  4115. ): Map$1<G, number>;
  4116. // Search for value
  4117. /**
  4118. * Returns the first value for which the `predicate` returns true.
  4119. */
  4120. find(
  4121. predicate: (value: V, key: K, iter: this) => boolean,
  4122. context?: any,
  4123. notSetValue?: V
  4124. ): V | undefined;
  4125. /**
  4126. * Returns the last value for which the `predicate` returns true.
  4127. *
  4128. * Note: `predicate` will be called for each entry in reverse.
  4129. */
  4130. findLast(
  4131. predicate: (value: V, key: K, iter: this) => boolean,
  4132. context?: any,
  4133. notSetValue?: V
  4134. ): V | undefined;
  4135. /**
  4136. * Returns the first [key, value] entry for which the `predicate` returns true.
  4137. */
  4138. findEntry(
  4139. predicate: (value: V, key: K, iter: this) => boolean,
  4140. context?: any,
  4141. notSetValue?: V
  4142. ): [K, V] | undefined;
  4143. /**
  4144. * Returns the last [key, value] entry for which the `predicate`
  4145. * returns true.
  4146. *
  4147. * Note: `predicate` will be called for each entry in reverse.
  4148. */
  4149. findLastEntry(
  4150. predicate: (value: V, key: K, iter: this) => boolean,
  4151. context?: any,
  4152. notSetValue?: V
  4153. ): [K, V] | undefined;
  4154. /**
  4155. * Returns the key for which the `predicate` returns true.
  4156. */
  4157. findKey(
  4158. predicate: (value: V, key: K, iter: this) => boolean,
  4159. context?: any
  4160. ): K | undefined;
  4161. /**
  4162. * Returns the last key for which the `predicate` returns true.
  4163. *
  4164. * Note: `predicate` will be called for each entry in reverse.
  4165. */
  4166. findLastKey(
  4167. predicate: (value: V, key: K, iter: this) => boolean,
  4168. context?: any
  4169. ): K | undefined;
  4170. /**
  4171. * Returns the key associated with the search value, or undefined.
  4172. */
  4173. keyOf(searchValue: V): K | undefined;
  4174. /**
  4175. * Returns the last key associated with the search value, or undefined.
  4176. */
  4177. lastKeyOf(searchValue: V): K | undefined;
  4178. /**
  4179. * Returns the maximum value in this collection. If any values are
  4180. * comparatively equivalent, the first one found will be returned.
  4181. *
  4182. * The `comparator` is used in the same way as `Collection#sort`. If it is not
  4183. * provided, the default comparator is `>`.
  4184. *
  4185. * When two values are considered equivalent, the first encountered will be
  4186. * returned. Otherwise, `max` will operate independent of the order of input
  4187. * as long as the comparator is commutative. The default comparator `>` is
  4188. * commutative *only* when types do not differ.
  4189. *
  4190. * If `comparator` returns 0 and either value is NaN, undefined, or null,
  4191. * that value will be returned.
  4192. */
  4193. max(comparator?: (valueA: V, valueB: V) => number): V | undefined;
  4194. /**
  4195. * Like `max`, but also accepts a `comparatorValueMapper` which allows for
  4196. * comparing by more sophisticated means:
  4197. *
  4198. * hitters.maxBy(hitter => hitter.avgHits);
  4199. *
  4200. */
  4201. maxBy<C>(
  4202. comparatorValueMapper: (value: V, key: K, iter: this) => C,
  4203. comparator?: (valueA: C, valueB: C) => number
  4204. ): V | undefined;
  4205. /**
  4206. * Returns the minimum value in this collection. If any values are
  4207. * comparatively equivalent, the first one found will be returned.
  4208. *
  4209. * The `comparator` is used in the same way as `Collection#sort`. If it is not
  4210. * provided, the default comparator is `<`.
  4211. *
  4212. * When two values are considered equivalent, the first encountered will be
  4213. * returned. Otherwise, `min` will operate independent of the order of input
  4214. * as long as the comparator is commutative. The default comparator `<` is
  4215. * commutative *only* when types do not differ.
  4216. *
  4217. * If `comparator` returns 0 and either value is NaN, undefined, or null,
  4218. * that value will be returned.
  4219. */
  4220. min(comparator?: (valueA: V, valueB: V) => number): V | undefined;
  4221. /**
  4222. * Like `min`, but also accepts a `comparatorValueMapper` which allows for
  4223. * comparing by more sophisticated means:
  4224. *
  4225. * hitters.minBy(hitter => hitter.avgHits);
  4226. *
  4227. */
  4228. minBy<C>(
  4229. comparatorValueMapper: (value: V, key: K, iter: this) => C,
  4230. comparator?: (valueA: C, valueB: C) => number
  4231. ): V | undefined;
  4232. // Comparison
  4233. /**
  4234. * True if `iter` includes every value in this Collection.
  4235. */
  4236. isSubset(iter: Iterable<V>): boolean;
  4237. /**
  4238. * True if this Collection includes every value in `iter`.
  4239. */
  4240. isSuperset(iter: Iterable<V>): boolean;
  4241. }
  4242. /**
  4243. * The interface to fulfill to qualify as a Value Object.
  4244. */
  4245. interface ValueObject {
  4246. /**
  4247. * True if this and the other Collection have value equality, as defined
  4248. * by `Immutable.is()`.
  4249. *
  4250. * Note: This is equivalent to `Immutable.is(this, other)`, but provided to
  4251. * allow for chained expressions.
  4252. */
  4253. equals(other: any): boolean;
  4254. /**
  4255. * Computes and returns the hashed identity for this Collection.
  4256. *
  4257. * The `hashCode` of a Collection is used to determine potential equality,
  4258. * and is used when adding this to a `Set` or as a key in a `Map`, enabling
  4259. * lookup via a different instance.
  4260. *
  4261. * <!-- runkit:activate -->
  4262. * ```js
  4263. * const { List, Set } = require('immutable');
  4264. * const a = List([ 1, 2, 3 ]);
  4265. * const b = List([ 1, 2, 3 ]);
  4266. * assert.notStrictEqual(a, b); // different instances
  4267. * const set = Set([ a ]);
  4268. * assert.equal(set.has(b), true);
  4269. * ```
  4270. *
  4271. * Note: hashCode() MUST return a Uint32 number. The easiest way to
  4272. * guarantee this is to return `myHash | 0` from a custom implementation.
  4273. *
  4274. * If two values have the same `hashCode`, they are [not guaranteed
  4275. * to be equal][Hash Collision]. If two values have different `hashCode`s,
  4276. * they must not be equal.
  4277. *
  4278. * Note: `hashCode()` is not guaranteed to always be called before
  4279. * `equals()`. Most but not all Immutable.js collections use hash codes to
  4280. * organize their internal data structures, while all Immutable.js
  4281. * collections use equality during lookups.
  4282. *
  4283. * [Hash Collision]: http://en.wikipedia.org/wiki/Collision_(computer_science)
  4284. */
  4285. hashCode(): number;
  4286. }
  4287. type IFunction<T = void> = (...args: Array<any>) => T;
  4288. type IObject$1 = Record<string, any>;
  4289. type Without<T, U> = {
  4290. [P in Exclude<keyof T, keyof U>]?: never;
  4291. };
  4292. type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
  4293. type Class<T> = new (...args: Array<any>) => T;
  4294. declare const TransformationMatrix_base: Record$1.Factory<{
  4295. a: number;
  4296. b: number;
  4297. c: number;
  4298. d: number;
  4299. e: number;
  4300. f: number;
  4301. }>;
  4302. declare class TransformationMatrix extends TransformationMatrix_base {
  4303. a: number;
  4304. b: number;
  4305. c: number;
  4306. d: number;
  4307. e: number;
  4308. f: number;
  4309. static defaultValues: IObject$1;
  4310. static IDENTITY: TransformationMatrix;
  4311. translate({ x: tx, y: ty }: {
  4312. x: number;
  4313. y: number;
  4314. }): TransformationMatrix;
  4315. translateX(tx: number): TransformationMatrix;
  4316. translateY(ty: number): TransformationMatrix;
  4317. scale(sx: number, sy?: number): TransformationMatrix;
  4318. transform(a2: number, b2: number, c2: number, d2: number, e2: number, f2: number): TransformationMatrix;
  4319. rotate(degCW: number): TransformationMatrix;
  4320. rotateRad(a: number): TransformationMatrix;
  4321. inverse(): TransformationMatrix;
  4322. toCssValue(): string;
  4323. applyToPoint([x, y]: [number, number]): [number, number];
  4324. applyToVector([x, y]: [number, number]): [number, number];
  4325. }
  4326. interface PointCtorProps {
  4327. x?: number;
  4328. y?: number;
  4329. [k: string]: unknown;
  4330. }
  4331. declare const Point_base: Record$1.Factory<PointCtorProps>;
  4332. declare class Point extends Point_base {
  4333. x: number;
  4334. y: number;
  4335. static defaultValues: IObject$1;
  4336. constructor(options?: PointCtorProps);
  4337. scale(sx: number, sy?: number): this;
  4338. translate({ x: tx, y: ty }: {
  4339. x: number;
  4340. y: number;
  4341. }): this;
  4342. translateX(tx: number): this;
  4343. translateY(ty: number): this;
  4344. distance(other: this): number;
  4345. rotate(deg: number): this;
  4346. apply(matrix: TransformationMatrix): this;
  4347. }
  4348. interface IDrawingPoint extends PointCtorProps {
  4349. intensity?: number;
  4350. }
  4351. declare class DrawingPoint extends Point {
  4352. intensity: number;
  4353. static defaultValues: IObject$1;
  4354. constructor(options?: IDrawingPoint);
  4355. }
  4356. interface ISize {
  4357. width: number;
  4358. height: number;
  4359. }
  4360. declare const Size_base: Record$1.Factory<ISize>;
  4361. declare class Size extends Size_base {
  4362. scale(factor: number): Size;
  4363. ceil(): Size;
  4364. floor(): Size;
  4365. swapDimensions(): Size;
  4366. apply(matrix: TransformationMatrix): Size;
  4367. }
  4368. interface IRect {
  4369. left?: number;
  4370. top?: number;
  4371. width?: number;
  4372. height?: number;
  4373. }
  4374. declare const Rect_base: Record$1.Factory<IRect>;
  4375. declare class Rect extends Rect_base {
  4376. left: number;
  4377. top: number;
  4378. width: number;
  4379. height: number;
  4380. static defaultValues: IObject$1;
  4381. constructor(options?: IRect);
  4382. get right(): number;
  4383. get bottom(): number;
  4384. static fromClientRect({ top, left, width, height }: ClientRect): Rect;
  4385. static union(rects: List<Rect>): Rect;
  4386. static getCenteredRect(inner: Size, outer: Size): Rect;
  4387. static fromInset(inset: Inset): Rect;
  4388. static fromPoints(...points: Point[]): Rect;
  4389. expandToIncludePoints(...points: Point[]): Rect;
  4390. static areRectsCloserThan(a: Rect, b: Rect, distance: number): boolean;
  4391. static areVerticallyAligned(a: Rect, b: Rect, thresholdDistance: number): boolean;
  4392. translate({ x: tx, y: ty }: Point): Rect;
  4393. translateX(tx: number): Rect;
  4394. translateY(ty: number): Rect;
  4395. scale(sx: number, sy?: number): Rect;
  4396. grow(growth: number): Rect;
  4397. getLocation(): Point;
  4398. getSize(): Size;
  4399. getCenter(): Point;
  4400. setLocation(location: Point): Rect;
  4401. roundOverlap(): Rect;
  4402. round(): Rect;
  4403. isPointInside(point: Point): boolean;
  4404. isRectInside(other: Rect): boolean;
  4405. isRectOverlapping(other: Rect): boolean;
  4406. normalize(): Rect;
  4407. apply(matrix: TransformationMatrix): Rect;
  4408. }
  4409. interface IInset {
  4410. left: number;
  4411. top: number;
  4412. right: number;
  4413. bottom: number;
  4414. }
  4415. declare const Inset_base: Record$1.Factory<IInset>;
  4416. declare class Inset extends Inset_base {
  4417. static applyToRect(inset: Inset, rect: Rect): Rect;
  4418. static fromRect(rect: Rect): Inset;
  4419. static fromValue(insetValue: number): Inset;
  4420. apply(matrix: TransformationMatrix): Inset;
  4421. setScale(scale: number): Inset;
  4422. }
  4423. type InsetJSON = [left: number, top: number, right: number, bottom: number];
  4424. type ActionCtorProps = {
  4425. subActions?: List<Action> | null;
  4426. };
  4427. declare abstract class Action extends InheritableImmutableRecord<ActionCtorProps> {
  4428. subActions?: List<Action> | null | undefined;
  4429. protected constructor(args?: ActionCtorProps);
  4430. }
  4431. type ActionTriggerEventType = 'onPointerEnter' | 'onPointerLeave' | 'onPointerDown' | 'onPointerUp' | 'onPageOpen' | 'onPageClose' | 'onPageVisible' | 'onPageHidden';
  4432. interface IGoToAction extends ActionCtorProps {
  4433. pageIndex?: number;
  4434. }
  4435. declare class GoToAction extends Action {
  4436. pageIndex: number;
  4437. static defaultValues: IObject$1;
  4438. constructor(args?: IGoToAction);
  4439. }
  4440. interface IGoToEmbeddedAction extends ActionCtorProps {
  4441. newWindow?: boolean;
  4442. relativePath?: string;
  4443. targetType?: 'parent' | 'child';
  4444. }
  4445. declare class GoToEmbeddedAction extends Action {
  4446. newWindow: boolean;
  4447. relativePath: string;
  4448. targetType: 'parent' | 'child';
  4449. static defaultValues: IObject$1;
  4450. constructor(args?: IGoToEmbeddedAction);
  4451. }
  4452. interface IGoToRemoteAction extends ActionCtorProps {
  4453. relativePath?: string;
  4454. namedDestination?: string;
  4455. }
  4456. declare class GoToRemoteAction extends Action {
  4457. relativePath: string;
  4458. namedDestination: string;
  4459. static defaultValues: IObject$1;
  4460. constructor(args?: IGoToRemoteAction);
  4461. }
  4462. type AnnotationReference = {
  4463. fieldName: string;
  4464. } | {
  4465. pdfObjectId: number;
  4466. };
  4467. interface IHideAction extends ActionCtorProps {
  4468. hide?: boolean;
  4469. annotationReferences?: List<AnnotationReference>;
  4470. }
  4471. declare class HideAction extends Action {
  4472. hide: boolean;
  4473. annotationReferences: List<AnnotationReference>;
  4474. static defaultValues: IObject$1;
  4475. constructor(args?: IHideAction);
  4476. }
  4477. interface IJavaScriptAction extends ActionCtorProps {
  4478. script?: string;
  4479. }
  4480. declare class JavaScriptAction extends Action {
  4481. script: string;
  4482. static defaultValues: IObject$1;
  4483. constructor(args?: IJavaScriptAction);
  4484. }
  4485. interface ILaunchAction extends ActionCtorProps {
  4486. filePath?: string;
  4487. }
  4488. declare class LaunchAction extends Action {
  4489. filePath: string;
  4490. static defaultValues: IObject$1;
  4491. constructor(args?: ILaunchAction);
  4492. }
  4493. interface INamedAction extends ActionCtorProps {
  4494. action?: string;
  4495. }
  4496. declare class NamedAction extends Action {
  4497. action: string;
  4498. static defaultValues: IObject$1;
  4499. constructor(args?: INamedAction);
  4500. }
  4501. interface IResetFormAction extends ActionCtorProps {
  4502. fields?: List<string> | null | undefined;
  4503. includeExclude?: boolean;
  4504. }
  4505. declare class ResetFormAction extends Action {
  4506. fields: List<string> | null | undefined;
  4507. includeExclude: boolean;
  4508. static defaultValues: IObject$1;
  4509. constructor(args?: IResetFormAction);
  4510. }
  4511. interface ISubmitFormAction extends ActionCtorProps {
  4512. uri?: string;
  4513. fields?: List<string>;
  4514. includeExclude?: boolean;
  4515. includeNoValueFields?: boolean;
  4516. exportFormat?: boolean;
  4517. getMethod?: boolean;
  4518. submitCoordinated?: boolean;
  4519. xfdf?: boolean;
  4520. includeAppendSaves?: boolean;
  4521. includeAnnotations?: boolean;
  4522. submitPDF?: boolean;
  4523. canonicalFormat?: boolean;
  4524. excludeNonUserAnnotations?: boolean;
  4525. excludeFKey?: boolean;
  4526. embedForm?: boolean;
  4527. }
  4528. declare class SubmitFormAction extends Action {
  4529. uri: string;
  4530. fields: List<string> | null | undefined;
  4531. includeExclude: boolean;
  4532. includeNoValueFields: boolean;
  4533. exportFormat: boolean;
  4534. getMethod: boolean;
  4535. submitCoordinated: boolean;
  4536. xfdf: boolean;
  4537. includeAppendSaves: boolean;
  4538. includeAnnotations: boolean;
  4539. submitPDF: boolean;
  4540. canonicalFormat: boolean;
  4541. excludeNonUserAnnotations: boolean;
  4542. excludeFKey: boolean;
  4543. embedForm: boolean;
  4544. static defaultValues: IObject$1;
  4545. constructor(args?: ISubmitFormAction);
  4546. }
  4547. interface IURIAction extends ActionCtorProps {
  4548. uri?: string;
  4549. }
  4550. declare class URIAction extends Action {
  4551. uri: string;
  4552. static defaultValues: IObject$1;
  4553. constructor(args?: IURIAction);
  4554. }
  4555. declare const Color_base: Record$1.Factory<{
  4556. r: number;
  4557. g: number;
  4558. b: number;
  4559. transparent: boolean;
  4560. }>;
  4561. declare class Color$2 extends Color_base {
  4562. static BLACK: Color$2;
  4563. static GREY: Color$2;
  4564. static WHITE: Color$2;
  4565. static DARK_BLUE: Color$2;
  4566. static RED: Color$2;
  4567. static PURPLE: Color$2;
  4568. static PINK: Color$2;
  4569. static GREEN: Color$2;
  4570. static ORANGE: Color$2;
  4571. static YELLOW: Color$2;
  4572. static LIGHT_BLUE: Color$2;
  4573. static LIGHT_RED: Color$2;
  4574. static LIGHT_GREEN: Color$2;
  4575. static LIGHT_YELLOW: Color$2;
  4576. static BLUE: Color$2;
  4577. static LIGHT_ORANGE: Color$2;
  4578. static LIGHT_GREY: Color$2;
  4579. static DARK_GREY: Color$2;
  4580. static MAUVE: Color$2;
  4581. static TRANSPARENT: Color$2;
  4582. static fromHex: (hexColor: string) => Color$2;
  4583. constructor(args: {
  4584. r?: number;
  4585. g?: number;
  4586. b?: number;
  4587. transparent?: boolean;
  4588. });
  4589. lighter(percent: number): Color$2;
  4590. darker(percent: number): Color$2;
  4591. equals(color: Color$2 | {
  4592. r: number;
  4593. g: number;
  4594. b: number;
  4595. transparent: boolean;
  4596. }): boolean;
  4597. saturate(percent: number): Color$2;
  4598. sRGBToRGBComponent(RGBComponent: number): number;
  4599. relativeLuminance(): number;
  4600. contrastRatio(color: Color$2): number;
  4601. toCSSValue(): string;
  4602. toHex(): string;
  4603. }
  4604. declare const BlendMode: {
  4605. readonly normal: "normal";
  4606. readonly multiply: "multiply";
  4607. readonly screen: "screen";
  4608. readonly overlay: "overlay";
  4609. readonly darken: "darken";
  4610. readonly lighten: "lighten";
  4611. readonly colorDodge: "colorDodge";
  4612. readonly colorBurn: "colorBurn";
  4613. readonly hardLight: "hardLight";
  4614. readonly softLight: "softLight";
  4615. readonly difference: "difference";
  4616. readonly exclusion: "exclusion";
  4617. };
  4618. type IBlendMode = (typeof BlendMode)[keyof typeof BlendMode];
  4619. interface ITextMarkupAnnotation extends AnnotationProperties {
  4620. rects: List<Rect>;
  4621. color: Color$2;
  4622. blendMode: IBlendMode;
  4623. }
  4624. declare class TextMarkupAnnotation<T extends ITextMarkupAnnotation = ITextMarkupAnnotation> extends Annotation<T> {
  4625. rects: List<Rect>;
  4626. color: Color$2;
  4627. blendMode: IBlendMode;
  4628. static defaultValues: IObject$1;
  4629. static readableName: string;
  4630. }
  4631. interface IHighlightAnnotation extends ITextMarkupAnnotation {
  4632. color: Color$2;
  4633. blendMode: IBlendMode | 'multiply';
  4634. }
  4635. declare class HighlightAnnotation<T extends IHighlightAnnotation = IHighlightAnnotation> extends TextMarkupAnnotation<T> {
  4636. blendMode: IBlendMode;
  4637. static className: string;
  4638. static readableName: string;
  4639. static defaultValues: IObject$1;
  4640. }
  4641. interface IImageAnnotation extends AnnotationProperties {
  4642. description: string | null;
  4643. fileName: string | null;
  4644. contentType: string | null;
  4645. imageAttachmentId: string | null;
  4646. isSignature: boolean;
  4647. xfdfAppearanceStream: string | null;
  4648. xfdfAppearanceStreamOriginalPageRotation: number | null;
  4649. }
  4650. declare class ImageAnnotation<T extends IImageAnnotation = IImageAnnotation> extends Annotation<T> {
  4651. description: null | string;
  4652. fileName: null | string;
  4653. contentType: string;
  4654. imageAttachmentId: string;
  4655. isSignature: boolean;
  4656. xfdfAppearanceStream: null | string;
  4657. xfdfAppearanceStreamOriginalPageRotation: null | number;
  4658. static defaultValues: IObject$1;
  4659. static readableName: string;
  4660. }
  4661. interface IInkAnnotation extends AnnotationProperties {
  4662. lines: List<List<DrawingPoint>>;
  4663. lineWidth: number | null;
  4664. strokeColor: Color$2 | null;
  4665. backgroundColor: Color$2 | null;
  4666. isDrawnNaturally: boolean;
  4667. isSignature: boolean;
  4668. }
  4669. declare class InkAnnotation<T extends IInkAnnotation = IInkAnnotation> extends Annotation<T> {
  4670. lines: List<List<DrawingPoint>>;
  4671. lineWidth: number;
  4672. strokeColor: Color$2 | null;
  4673. backgroundColor: Color$2 | null;
  4674. isDrawnNaturally: boolean;
  4675. isSignature: boolean;
  4676. static defaultValues: IObject$1;
  4677. static readableName: string;
  4678. }
  4679. declare const MeasurementPrecision: {
  4680. readonly WHOLE: "whole";
  4681. readonly ONE: "oneDp";
  4682. readonly TWO: "twoDp";
  4683. readonly THREE: "threeDp";
  4684. readonly FOUR: "fourDp";
  4685. readonly HALVES: "1/2";
  4686. readonly QUARTERS: "1/4";
  4687. readonly EIGHTHS: "1/8";
  4688. readonly SIXTEENTHS: "1/16";
  4689. };
  4690. type IMeasurementPrecision = (typeof MeasurementPrecision)[keyof typeof MeasurementPrecision];
  4691. declare const MeasurementScaleUnitFrom: {
  4692. readonly INCHES: "in";
  4693. readonly MILLIMETERS: "mm";
  4694. readonly CENTIMETERS: "cm";
  4695. readonly POINTS: "pt";
  4696. };
  4697. type IMeasurementScaleUnitFrom = (typeof MeasurementScaleUnitFrom)[keyof typeof MeasurementScaleUnitFrom];
  4698. declare const MeasurementScaleUnitTo: {
  4699. readonly INCHES: "in";
  4700. readonly MILLIMETERS: "mm";
  4701. readonly CENTIMETERS: "cm";
  4702. readonly POINTS: "pt";
  4703. readonly FEET: "ft";
  4704. readonly METERS: "m";
  4705. readonly YARDS: "yd";
  4706. readonly KILOMETERS: "km";
  4707. readonly MILES: "mi";
  4708. };
  4709. type IMeasurementScaleUnitTo = (typeof MeasurementScaleUnitTo)[keyof typeof MeasurementScaleUnitTo];
  4710. interface IMeasurementScale {
  4711. unitFrom: IMeasurementScaleUnitFrom;
  4712. unitTo: IMeasurementScaleUnitTo;
  4713. fromValue: number;
  4714. toValue: number;
  4715. }
  4716. declare const MeasurementScale_base: Record$1.Factory<IMeasurementScale>;
  4717. declare class MeasurementScale extends MeasurementScale_base {
  4718. }
  4719. interface IShapeAnnotation extends AnnotationProperties {
  4720. strokeDashArray: [number, number] | null;
  4721. strokeWidth: number | null;
  4722. strokeColor: Color$2 | null;
  4723. fillColor: Color$2 | null;
  4724. measurementScale: MeasurementScale | null;
  4725. measurementPrecision: IMeasurementPrecision | null;
  4726. }
  4727. declare abstract class ShapeAnnotation<T extends IShapeAnnotation = IShapeAnnotation> extends Annotation<T> {
  4728. strokeDashArray: null | [number, number];
  4729. strokeWidth: number;
  4730. strokeColor: null | Color$2;
  4731. fillColor: null | Color$2;
  4732. measurementPrecision: null | IMeasurementPrecision;
  4733. measurementScale: null | MeasurementScale;
  4734. static readableName: string;
  4735. static defaultValues: IObject$1;
  4736. isMeasurement(): boolean;
  4737. getMeasurementDetails: () => {
  4738. value: number;
  4739. label: string;
  4740. };
  4741. }
  4742. declare const LineCap: {
  4743. readonly square: "square";
  4744. readonly circle: "circle";
  4745. readonly diamond: "diamond";
  4746. readonly openArrow: "openArrow";
  4747. readonly closedArrow: "closedArrow";
  4748. readonly butt: "butt";
  4749. readonly reverseOpenArrow: "reverseOpenArrow";
  4750. readonly reverseClosedArrow: "reverseClosedArrow";
  4751. readonly slash: "slash";
  4752. };
  4753. type ILineCap = (typeof LineCap)[keyof typeof LineCap];
  4754. type LineCapsType = {
  4755. start?: ILineCap | null;
  4756. end?: ILineCap | null;
  4757. };
  4758. interface ILineAnnotation extends IShapeAnnotation {
  4759. startPoint: Point | null;
  4760. endPoint: Point | null;
  4761. lineCaps: LineCapsType | null;
  4762. points: List<Point> | null;
  4763. }
  4764. declare class LineAnnotation<T extends ILineAnnotation = ILineAnnotation> extends ShapeAnnotation<T> {
  4765. startPoint: Point;
  4766. endPoint: Point;
  4767. lineCaps: LineCapsType | null;
  4768. points: List<Point> | null;
  4769. static defaultValues: IObject$1;
  4770. static readableName: string;
  4771. }
  4772. interface IRectangleAnnotation extends IShapeAnnotation {
  4773. cloudyBorderIntensity?: number | null;
  4774. cloudyBorderInset?: Inset | null;
  4775. }
  4776. declare class RectangleAnnotation<T extends IRectangleAnnotation = IRectangleAnnotation> extends ShapeAnnotation<T> {
  4777. cloudyBorderIntensity: null | number;
  4778. cloudyBorderInset: null | Inset;
  4779. measurementBBox: null | Rect;
  4780. static defaultValues: IObject$1;
  4781. static readableName: string;
  4782. constructor(options?: Partial<T>);
  4783. }
  4784. interface IEllipseAnnotation extends IShapeAnnotation {
  4785. cloudyBorderIntensity?: number | null;
  4786. cloudyBorderInset?: Inset | null;
  4787. }
  4788. declare class EllipseAnnotation<T extends IEllipseAnnotation = IEllipseAnnotation> extends ShapeAnnotation<T> {
  4789. cloudyBorderIntensity: null | number;
  4790. cloudyBorderInset: null | Inset;
  4791. measurementBBox: null | Rect;
  4792. static defaultValues: IObject$1;
  4793. static readableName: string;
  4794. constructor(options?: Partial<T>);
  4795. }
  4796. interface IPolygonAnnotation extends IShapeAnnotation {
  4797. points: List<Point> | null;
  4798. cloudyBorderIntensity: number | null;
  4799. }
  4800. declare class PolygonAnnotation<T extends IPolygonAnnotation = IPolygonAnnotation> extends ShapeAnnotation<T> {
  4801. points: List<Point>;
  4802. cloudyBorderIntensity: null | number;
  4803. static defaultValues: IObject$1;
  4804. static readableName: string;
  4805. }
  4806. interface IPolyLineAnnotation extends IShapeAnnotation {
  4807. points: List<Point> | null;
  4808. lineCaps: LineCapsType | null;
  4809. }
  4810. declare class PolylineAnnotation<T extends IPolyLineAnnotation = IPolyLineAnnotation> extends ShapeAnnotation<T> {
  4811. points: List<Point>;
  4812. lineCaps: null | LineCapsType;
  4813. static defaultValues: IObject$1;
  4814. static readableName: string;
  4815. }
  4816. declare const BorderStyle: {
  4817. readonly solid: "solid";
  4818. readonly dashed: "dashed";
  4819. readonly beveled: "beveled";
  4820. readonly inset: "inset";
  4821. readonly underline: "underline";
  4822. };
  4823. type IBorderStyle = (typeof BorderStyle)[keyof typeof BorderStyle];
  4824. interface ILinkAnnotation extends AnnotationProperties {
  4825. action: Action | null;
  4826. borderColor: Color$2 | null;
  4827. borderStyle: IBorderStyle | null;
  4828. borderWidth: number | null;
  4829. }
  4830. declare class LinkAnnotation<T extends ILinkAnnotation = ILinkAnnotation> extends Annotation<T> {
  4831. action: Action;
  4832. borderColor: null | Color$2;
  4833. borderStyle: null | IBorderStyle;
  4834. borderWidth: null | number;
  4835. static readableName: string;
  4836. static defaultValues: IObject$1;
  4837. }
  4838. declare const NoteIcon: {
  4839. readonly COMMENT: "COMMENT";
  4840. readonly RIGHT_POINTER: "RIGHT_POINTER";
  4841. readonly RIGHT_ARROW: "RIGHT_ARROW";
  4842. readonly CHECK: "CHECK";
  4843. readonly CIRCLE: "CIRCLE";
  4844. readonly CROSS: "CROSS";
  4845. readonly INSERT: "INSERT";
  4846. readonly NEW_PARAGRAPH: "NEW_PARAGRAPH";
  4847. readonly NOTE: "NOTE";
  4848. readonly PARAGRAPH: "PARAGRAPH";
  4849. readonly HELP: "HELP";
  4850. readonly STAR: "STAR";
  4851. readonly KEY: "KEY";
  4852. };
  4853. type INoteIcon = (typeof NoteIcon)[keyof typeof NoteIcon];
  4854. interface INoteAnnotation extends AnnotationProperties {
  4855. text: {
  4856. format: 'plain';
  4857. value: string;
  4858. };
  4859. icon: string | INoteIcon;
  4860. color: Color$2;
  4861. }
  4862. declare class NoteAnnotation<T extends INoteAnnotation = INoteAnnotation> extends Annotation<T> {
  4863. text: {
  4864. format: 'plain';
  4865. value: string;
  4866. };
  4867. icon: INoteIcon;
  4868. color: Color$2;
  4869. static isEditable: boolean;
  4870. static readableName: string;
  4871. static defaultValues: IObject$1;
  4872. }
  4873. interface ISquiggleAnnotation extends ITextMarkupAnnotation {
  4874. color: Color$2;
  4875. }
  4876. declare class SquiggleAnnotation<T extends ISquiggleAnnotation = ISquiggleAnnotation> extends TextMarkupAnnotation<T> {
  4877. static className: string;
  4878. static readableName: string;
  4879. static defaultValues: IObject$1;
  4880. }
  4881. interface IStrikeOutAnnotation extends ITextMarkupAnnotation {
  4882. color: Color$2;
  4883. }
  4884. declare class StrikeOutAnnotation<T extends IStrikeOutAnnotation = IStrikeOutAnnotation> extends TextMarkupAnnotation<T> {
  4885. static className: string;
  4886. static readableName: string;
  4887. static defaultValues: IObject$1;
  4888. }
  4889. type ICallout = {
  4890. start: Point | null;
  4891. knee: Point | null;
  4892. end: Point | null;
  4893. cap: ILineCap | null;
  4894. innerRectInset: Inset | null;
  4895. };
  4896. declare class Callout extends InheritableImmutableRecord<ICallout> {
  4897. start: Point | null;
  4898. knee: Point | null;
  4899. end: Point | null;
  4900. cap: ILineCap | null;
  4901. innerRectInset: Inset | null;
  4902. static defaultValues: {
  4903. start: null;
  4904. knee: null;
  4905. end: null;
  4906. cap: null;
  4907. innerRectInset: null;
  4908. };
  4909. }
  4910. interface ITextAnnotation extends AnnotationProperties {
  4911. text: {
  4912. format: 'plain' | 'xhtml';
  4913. value: string | null;
  4914. };
  4915. fontColor: Color$2 | null;
  4916. backgroundColor: Color$2 | null;
  4917. font: string;
  4918. fontSize: number | null;
  4919. isBold: boolean | null;
  4920. isItalic: boolean | null;
  4921. horizontalAlign: 'left' | 'center' | 'right';
  4922. verticalAlign: 'top' | 'center' | 'bottom';
  4923. callout: Callout | null;
  4924. borderStyle: IBorderStyle | null;
  4925. borderWidth: number | null;
  4926. borderColor: Color$2 | null;
  4927. isFitting: boolean;
  4928. lineHeightFactor: number | null;
  4929. }
  4930. declare class TextAnnotation<T extends ITextAnnotation = ITextAnnotation> extends Annotation<T> {
  4931. text: {
  4932. format: 'plain' | 'xhtml';
  4933. value: string;
  4934. };
  4935. fontColor: null | Color$2;
  4936. backgroundColor: null | Color$2;
  4937. font: string;
  4938. fontSize: number;
  4939. isBold: boolean;
  4940. isItalic: boolean;
  4941. horizontalAlign: 'left' | 'center' | 'right';
  4942. verticalAlign: 'top' | 'center' | 'bottom';
  4943. isFitting: boolean;
  4944. callout: null | Callout;
  4945. borderStyle: null | IBorderStyle;
  4946. borderWidth: null | number;
  4947. borderColor: Color$2 | null;
  4948. lineHeightFactor: null | number;
  4949. static defaultValues: IObject$1;
  4950. static readonly isEditable = true;
  4951. static readonly readableName = "Text";
  4952. static readonly fontSizePresets: readonly number[];
  4953. }
  4954. interface IUnderlineAnnotation extends ITextMarkupAnnotation {
  4955. color: Color$2;
  4956. }
  4957. declare class UnderlineAnnotation<T extends IUnderlineAnnotation = IUnderlineAnnotation> extends TextMarkupAnnotation<T> {
  4958. static className: string;
  4959. static readableName: string;
  4960. static defaultValues: IObject$1;
  4961. }
  4962. declare class UnknownAnnotation extends Annotation {
  4963. }
  4964. type FontSize = 'auto' | number;
  4965. type WidgetActionTriggerEventType = ActionTriggerEventType | 'onFocus' | 'onBlur';
  4966. type WidgetAnnotationAdditionalActionsType = {
  4967. onFocus?: JavaScriptAction;
  4968. onBlur?: JavaScriptAction;
  4969. onChange?: JavaScriptAction;
  4970. onFormat?: JavaScriptAction;
  4971. onInput?: JavaScriptAction;
  4972. onPointerDown?: Action;
  4973. onPointerUp?: Action;
  4974. onPointerEnter?: Action;
  4975. onPointerLeave?: Action;
  4976. };
  4977. interface IWidgetAnnotation extends AnnotationProperties {
  4978. formFieldName: string | null;
  4979. borderColor: Color$2 | null;
  4980. borderStyle: IBorderStyle | null;
  4981. borderDashArray: number[] | null;
  4982. borderWidth: number | null;
  4983. backgroundColor: Color$2 | null;
  4984. fontSize: FontSize | null;
  4985. font: string | null;
  4986. fontColor: Color$2 | null;
  4987. isBold: boolean | null;
  4988. isItalic: boolean | null;
  4989. horizontalAlign: 'left' | 'center' | 'right' | null;
  4990. verticalAlign: 'top' | 'center' | 'bottom' | null;
  4991. additionalActions: WidgetAnnotationAdditionalActionsType | null;
  4992. rotation: number;
  4993. lineHeightFactor: number | null;
  4994. buttonIconUpdatedAt: number | null;
  4995. }
  4996. declare class WidgetAnnotation<T extends IWidgetAnnotation = IWidgetAnnotation> extends Annotation<T> {
  4997. formFieldName: string;
  4998. borderColor: null | Color$2;
  4999. borderStyle: null | IBorderStyle;
  5000. borderDashArray: null | number[];
  5001. borderWidth: null | number;
  5002. backgroundColor: null | Color$2;
  5003. fontSize: null | FontSize;
  5004. font: null | string;
  5005. fontColor: null | Color$2;
  5006. isBold: boolean;
  5007. isItalic: boolean;
  5008. horizontalAlign: 'left' | 'center' | 'right' | null;
  5009. verticalAlign: 'top' | 'center' | 'bottom' | null;
  5010. additionalActions: null | WidgetAnnotationAdditionalActionsType;
  5011. rotation: number;
  5012. lineHeightFactor: null | number;
  5013. action: null | Action;
  5014. buttonIconUpdatedAt: null | number;
  5015. static defaultValues: IObject$1;
  5016. static readableName: string;
  5017. }
  5018. declare class CommentMarkerAnnotation extends Annotation {
  5019. static readableName: string;
  5020. }
  5021. interface IRedactionAnnotation extends ITextMarkupAnnotation {
  5022. color: Color$2;
  5023. fillColor: null | Color$2;
  5024. overlayText: null | string;
  5025. repeatOverlayText: null | boolean;
  5026. outlineColor: null | Color$2;
  5027. }
  5028. declare class RedactionAnnotation<T extends IRedactionAnnotation = IRedactionAnnotation> extends TextMarkupAnnotation<T> {
  5029. fillColor: null | Color$2;
  5030. overlayText: null | string;
  5031. repeatOverlayText: null | boolean;
  5032. outlineColor: null | Color$2;
  5033. color: Color$2;
  5034. static readableName: string;
  5035. static defaultValues: IObject$1;
  5036. }
  5037. interface IMediaAnnotation extends AnnotationProperties {
  5038. description: null | string;
  5039. fileName: null | string;
  5040. contentType: string | null;
  5041. mediaAttachmentId: string | null;
  5042. }
  5043. declare class MediaAnnotation<T extends IMediaAnnotation = IMediaAnnotation> extends Annotation<T> {
  5044. description: null | string;
  5045. fileName: null | string;
  5046. contentType: string | null;
  5047. mediaAttachmentId: string | null;
  5048. static defaultValues: IObject$1;
  5049. static readableName: string;
  5050. }
  5051. type SignatureInfo = {
  5052. type: 'pspdfkit/signature-info';
  5053. signatureType?: SignatureTypeType | null | undefined;
  5054. signerName: string | null | undefined;
  5055. creationDate: Date | null | undefined;
  5056. signatureReason: string | null | undefined;
  5057. signatureLocation: string | null | undefined;
  5058. documentIntegrityStatus: DocumentIntegrityStatusType;
  5059. certificateChainValidationStatus: CertificateChainValidationStatusType;
  5060. signatureValidationStatus: SignatureValidationStatusType;
  5061. isTrusted: boolean;
  5062. isSelfSigned: boolean;
  5063. isExpired: boolean;
  5064. documentModifiedSinceSignature: boolean;
  5065. signatureFormFQN: string;
  5066. PAdESSignatureLevel?: PAdESLevelType | null;
  5067. validFrom: string | null | undefined;
  5068. validUntil: string | null | undefined;
  5069. timestampInfo: {
  5070. type: 'pspdfkit/timestamp-info';
  5071. signerName: string | null | undefined;
  5072. };
  5073. ltv: boolean;
  5074. };
  5075. declare const DocumentIntegrityStatus: {
  5076. readonly ok: "ok";
  5077. readonly tampered_document: "tampered_document";
  5078. readonly failed_to_retrieve_signature_contents: "failed_to_retrieve_signature_contents";
  5079. readonly failed_to_retrieve_byterange: "failed_to_retrieve_byterange";
  5080. readonly failed_to_compute_digest: "failed_to_compute_digest";
  5081. readonly failed_retrieve_signing_certificate: "failed_retrieve_signing_certificate";
  5082. readonly failed_retrieve_public_key: "failed_retrieve_public_key";
  5083. readonly failed_encryption_padding: "failed_encryption_padding";
  5084. readonly tampered_or_invalid_timestamp: "tampered_or_invalid_timestamp";
  5085. readonly general_failure: "general_failure";
  5086. };
  5087. type DocumentIntegrityStatusType = (typeof DocumentIntegrityStatus)[keyof typeof DocumentIntegrityStatus];
  5088. declare const CertificateChainValidationStatus: {
  5089. readonly ok: "ok";
  5090. readonly ok_but_self_signed: "ok_but_self_signed";
  5091. readonly ok_but_could_not_check_revocation: "ok_but_could_not_check_revocation";
  5092. readonly untrusted: "untrusted";
  5093. readonly expired: "expired";
  5094. readonly not_yet_valid: "not_yet_valid";
  5095. readonly invalid: "invalid";
  5096. readonly revoked: "revoked";
  5097. readonly failed_to_retrieve_signature_contents: "failed_to_retrieve_signature_contents";
  5098. readonly general_validation_problem: "general_validation_problem";
  5099. };
  5100. type CertificateChainValidationStatusType = (typeof CertificateChainValidationStatus)[keyof typeof CertificateChainValidationStatus];
  5101. declare const SignatureValidationStatus: {
  5102. readonly valid: "valid";
  5103. readonly warning: "warning";
  5104. readonly error: "error";
  5105. };
  5106. type SignatureValidationStatusType = (typeof SignatureValidationStatus)[keyof typeof SignatureValidationStatus];
  5107. declare const SignatureType: {
  5108. CMS: string;
  5109. CAdES: string;
  5110. };
  5111. type SignatureTypeType = (typeof SignatureType)[keyof typeof SignatureType];
  5112. declare const PAdESLevel: {
  5113. readonly b_b: "b-b";
  5114. readonly b_t: "b-t";
  5115. readonly b_lt: "b-lt";
  5116. };
  5117. type PAdESLevelType = (typeof PAdESLevel)[keyof typeof PAdESLevel];
  5118. type SignaturesInfo = {
  5119. status: DocumentValidationStatusType;
  5120. checkedAt: Date;
  5121. signatures?: Array<SignatureInfo>;
  5122. documentModifiedSinceSignature?: boolean;
  5123. };
  5124. declare const DocumentValidationStatus: {
  5125. valid: string;
  5126. warning: string;
  5127. error: string;
  5128. not_signed: string;
  5129. };
  5130. type DocumentValidationStatusType = keyof typeof DocumentValidationStatus;
  5131. type Glyph = {
  5132. c: string;
  5133. rect: Rect;
  5134. };
  5135. type IAnnotationJSON = Omit<BaseAnnotationJSON, 'id' | 'group' | 'permissions'>;
  5136. declare class AnnotationSerializer {
  5137. static VERSION: number;
  5138. annotation: AnnotationsUnion;
  5139. constructor(annotation: AnnotationsUnion);
  5140. toJSON(): Omit<BaseAnnotationJSON, 'type'>;
  5141. static fromJSON(id: ID | null, json: IAnnotationJSON, options?: ICollaboratorPermissionsOptions): {
  5142. group?: string | null | undefined;
  5143. canSetGroup?: boolean | undefined;
  5144. isEditable?: boolean | undefined;
  5145. isDeletable?: boolean | undefined;
  5146. blendMode?: IBlendMode | undefined;
  5147. id: string | null;
  5148. name: string | null;
  5149. subject: string | null;
  5150. pdfObjectId: number | null;
  5151. pageIndex: number;
  5152. opacity: number;
  5153. boundingBox: Rect;
  5154. noPrint: boolean;
  5155. noZoom: boolean;
  5156. noRotate: boolean;
  5157. noView: boolean;
  5158. hidden: boolean;
  5159. locked: boolean;
  5160. lockedContents: boolean;
  5161. readOnly: boolean;
  5162. action: Action | null | undefined;
  5163. note: string | null;
  5164. createdAt: Date;
  5165. updatedAt: Date;
  5166. creatorName: string | null;
  5167. customData: Record<string, unknown> | null;
  5168. isCommentThreadRoot: boolean;
  5169. isAnonymous: boolean;
  5170. };
  5171. static blendModeObjectForAnnotation(json: IAnnotationJSON): {
  5172. blendMode: IBlendMode;
  5173. } | null;
  5174. serializeFlags(): ("noView" | "noPrint" | "locked" | "lockedContents" | "readOnly" | "hidden" | "noZoom" | "noRotate")[] | null;
  5175. }
  5176. declare class InkAnnotationSerializer extends AnnotationSerializer {
  5177. annotation: InkAnnotation;
  5178. constructor(annotation: InkAnnotation);
  5179. toJSON(): InkAnnotationJSON;
  5180. static fromJSON(id: ID | null, json: Omit<InkAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): InkAnnotation;
  5181. _linesToJSON(): {
  5182. points: [number, number][][];
  5183. intensities: number[][];
  5184. };
  5185. static _JSONToLines(linesJSON: {
  5186. points: Array<Array<[number, number]>>;
  5187. intensities: Array<Array<number>>;
  5188. }): List<List<DrawingPoint>>;
  5189. }
  5190. declare abstract class ShapeAnnotationSerializer extends AnnotationSerializer {
  5191. annotation: ShapeAnnotationsUnion;
  5192. toJSON(): ShapeAnnotationJSON;
  5193. static fromJSON(id: ID | null, json: Omit<ShapeAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): {
  5194. strokeWidth: number | null;
  5195. strokeColor: Color$2 | null;
  5196. fillColor: Color$2 | null;
  5197. strokeDashArray: [number, number] | null | undefined;
  5198. measurementPrecision: IMeasurementPrecision | null | undefined;
  5199. measurementScale: MeasurementScale | null;
  5200. group?: string | null | undefined;
  5201. canSetGroup?: boolean | undefined;
  5202. isEditable?: boolean | undefined;
  5203. isDeletable?: boolean | undefined;
  5204. blendMode?: IBlendMode | undefined;
  5205. id: string | null;
  5206. name: string | null;
  5207. subject: string | null;
  5208. pdfObjectId: number | null;
  5209. pageIndex: number;
  5210. opacity: number;
  5211. boundingBox: Rect;
  5212. noPrint: boolean;
  5213. noZoom: boolean;
  5214. noRotate: boolean;
  5215. noView: boolean;
  5216. hidden: boolean;
  5217. locked: boolean;
  5218. lockedContents: boolean;
  5219. readOnly: boolean;
  5220. action: Action | null | undefined;
  5221. note: string | null;
  5222. createdAt: Date;
  5223. updatedAt: Date;
  5224. creatorName: string | null;
  5225. customData: Record<string, unknown> | null;
  5226. isCommentThreadRoot: boolean;
  5227. isAnonymous: boolean;
  5228. };
  5229. _pointsToJSON(): Array<[number, number]>;
  5230. static _JSONToPoints(pointsJSON: Array<[number, number]>): List<Point>;
  5231. static _JSONLinesToPoints(linesJSON: {
  5232. points: Array<Array<[number, number]>>;
  5233. intensities: Array<Array<number>>;
  5234. }): List<Point>;
  5235. }
  5236. type MeasurementScaleJSON = {
  5237. unitFrom: IMeasurementScaleUnitFrom;
  5238. unitTo: IMeasurementScaleUnitTo;
  5239. from: number;
  5240. to: number;
  5241. };
  5242. declare class LineAnnotationSerializer extends ShapeAnnotationSerializer {
  5243. annotation: LineAnnotation;
  5244. toJSON(): LineAnnotationJSON;
  5245. static fromJSON(id: ID | null, json: Omit<LineAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): LineAnnotation;
  5246. }
  5247. declare class RectangleAnnotationSerializer extends ShapeAnnotationSerializer {
  5248. annotation: RectangleAnnotation;
  5249. toJSON(): RectangleAnnotationJSON;
  5250. static fromJSON(id: ID | null, json: Omit<RectangleAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): RectangleAnnotation;
  5251. }
  5252. declare class EllipseAnnotationSerializer extends ShapeAnnotationSerializer {
  5253. annotation: EllipseAnnotation;
  5254. toJSON(): EllipseAnnotationJSON;
  5255. static fromJSON(id: ID | null, json: Omit<EllipseAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): EllipseAnnotation;
  5256. }
  5257. declare class PolygonAnnotationSerializer extends ShapeAnnotationSerializer {
  5258. annotation: PolygonAnnotation;
  5259. toJSON(): PolygonAnnotationJSON;
  5260. static fromJSON(id: ID | null, json: Omit<PolygonAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: IObject$1): PolygonAnnotation;
  5261. }
  5262. declare class PolylineAnnotationSerializer extends ShapeAnnotationSerializer {
  5263. annotation: PolylineAnnotation;
  5264. toJSON(): PolylineAnnotationJSON;
  5265. static fromJSON(id: ID | null, json: Omit<PolylineAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): PolylineAnnotation;
  5266. }
  5267. declare class LinkAnnotationSerializer extends AnnotationSerializer {
  5268. annotation: LinkAnnotation;
  5269. constructor(annotation: LinkAnnotation);
  5270. toJSON(): LinkAnnotationJSON;
  5271. static fromJSON(id: ID | null, json: Omit<LinkAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): LinkAnnotation;
  5272. }
  5273. declare abstract class BaseTextMarkupSerializer extends AnnotationSerializer {
  5274. annotation: RedactionAnnotation | TextMarkupAnnotation;
  5275. constructor(annotation: RedactionAnnotation | TextMarkupAnnotation);
  5276. toJSON(): BaseTextMarkupAnnotationJSON;
  5277. static fromJSON(id: ID | null, json: Omit<BaseTextMarkupAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): {
  5278. rects: List<Rect>;
  5279. group?: string | null | undefined;
  5280. canSetGroup?: boolean | undefined;
  5281. isEditable?: boolean | undefined;
  5282. isDeletable?: boolean | undefined;
  5283. blendMode?: IBlendMode | undefined;
  5284. id: string | null;
  5285. name: string | null;
  5286. subject: string | null;
  5287. pdfObjectId: number | null;
  5288. pageIndex: number;
  5289. opacity: number;
  5290. boundingBox: Rect;
  5291. noPrint: boolean;
  5292. noZoom: boolean;
  5293. noRotate: boolean;
  5294. noView: boolean;
  5295. hidden: boolean;
  5296. locked: boolean;
  5297. lockedContents: boolean;
  5298. readOnly: boolean;
  5299. action: Action | null | undefined;
  5300. note: string | null;
  5301. createdAt: Date;
  5302. updatedAt: Date;
  5303. creatorName: string | null;
  5304. customData: Record<string, unknown> | null;
  5305. isCommentThreadRoot: boolean;
  5306. isAnonymous: boolean;
  5307. };
  5308. }
  5309. declare class TextMarkupAnnotationSerializer extends BaseTextMarkupSerializer {
  5310. annotation: TextMarkupAnnotationsUnion;
  5311. constructor(annotation: TextMarkupAnnotationsUnion);
  5312. toJSON(): TextMarkupAnnotationJSON;
  5313. static fromJSON(id: ID | null, json: Omit<TextMarkupAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): TextMarkupAnnotationsUnion;
  5314. typeForAnnotation(): "pspdfkit/markup/highlight" | "pspdfkit/markup/squiggly" | "pspdfkit/markup/strikeout" | "pspdfkit/markup/underline" | "pspdfkit/markup/redaction";
  5315. }
  5316. declare class RedactionAnnotationSerializer extends BaseTextMarkupSerializer {
  5317. annotation: RedactionAnnotation;
  5318. constructor(annotation: RedactionAnnotation);
  5319. toJSON(): RedactionAnnotationJSON;
  5320. static fromJSON(id: ID | null, json: Omit<RedactionAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): RedactionAnnotation;
  5321. }
  5322. declare class TextAnnotationSerializer extends AnnotationSerializer {
  5323. annotation: TextAnnotation;
  5324. constructor(annotation: TextAnnotation);
  5325. toJSON(): TextAnnotationJSON;
  5326. static fromJSON(id: ID | null, json: Omit<TextAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): TextAnnotation;
  5327. _calloutToJSON(): {
  5328. start: [number, number];
  5329. knee: [number, number] | null;
  5330. end: [number, number];
  5331. cap: ILineCap | null;
  5332. innerRectInset: InsetJSON | null;
  5333. } | null;
  5334. static _JSONToCallout(calloutJSON: TextAnnotationJSON['callout']): Callout | null | undefined;
  5335. }
  5336. declare class NoteAnnotationSerializer extends AnnotationSerializer {
  5337. annotation: NoteAnnotation;
  5338. constructor(annotation: NoteAnnotation);
  5339. toJSON(): NoteAnnotationJSON;
  5340. static fromJSON(id: ID | null, json: Omit<NoteAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): NoteAnnotation;
  5341. }
  5342. declare class ImageAnnotationSerializer extends AnnotationSerializer {
  5343. annotation: ImageAnnotation;
  5344. constructor(annotation: ImageAnnotation);
  5345. toJSON(): ImageAnnotationJSON;
  5346. static fromJSON(id: ID | null, json: Omit<ImageAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): ImageAnnotation;
  5347. }
  5348. declare class StampAnnotationSerializer extends AnnotationSerializer {
  5349. annotation: StampAnnotation;
  5350. constructor(annotation: StampAnnotation);
  5351. toJSON(): StampAnnotationJSON;
  5352. static fromJSON(id: ID | null, json: Omit<StampAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): StampAnnotation;
  5353. }
  5354. declare class WidgetAnnotationSerializer extends AnnotationSerializer {
  5355. annotation: WidgetAnnotation;
  5356. constructor(annotation: WidgetAnnotation);
  5357. toJSON(): WidgetAnnotationJSON;
  5358. static fromJSON(id: ID | null, json: Omit<WidgetAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): WidgetAnnotation;
  5359. }
  5360. type InstantID = string;
  5361. declare function generateInstantId(): InstantID;
  5362. declare class CommentMarkerAnnotationSerializer extends AnnotationSerializer {
  5363. annotation: CommentMarkerAnnotation;
  5364. constructor(annotation: CommentMarkerAnnotation);
  5365. toJSON(): CommentMarkerAnnotationJSON;
  5366. static fromJSON(id: InstantID | null, json: Omit<CommentMarkerAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): CommentMarkerAnnotation;
  5367. }
  5368. declare class UnknownAnnotationSerializer extends AnnotationSerializer {
  5369. annotation: UnknownAnnotation;
  5370. constructor(annotation: UnknownAnnotation);
  5371. toJSON(): UnknownAnnotationJSON;
  5372. static fromJSON(id: ID | null, json: Omit<UnknownAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): UnknownAnnotation;
  5373. }
  5374. declare class MediaAnnotationSerializer extends AnnotationSerializer {
  5375. annotation: MediaAnnotation;
  5376. constructor(annotation: MediaAnnotation);
  5377. toJSON(): MediaAnnotationJSON;
  5378. static fromJSON(id: ID | null, json: Omit<MediaAnnotationJSON, 'id' | 'group' | 'permissions'>, options?: ICollaboratorPermissionsOptions): MediaAnnotation;
  5379. }
  5380. type AnnotationSerializerTypeMap = {
  5381. 'pspdfkit/ink': {
  5382. serializer: InkAnnotationSerializer;
  5383. annotation: InkAnnotation;
  5384. json: InkAnnotationJSON;
  5385. jsonForBackend: AnnotationBackendJSON<InkAnnotationJSON>;
  5386. };
  5387. 'pspdfkit/shape/line': {
  5388. serializer: LineAnnotationSerializer;
  5389. annotation: LineAnnotation;
  5390. json: LineAnnotationJSON;
  5391. jsonForBackend: AnnotationBackendJSON<LineAnnotationJSON>;
  5392. };
  5393. 'pspdfkit/shape/rectangle': {
  5394. serializer: RectangleAnnotationSerializer;
  5395. annotation: RectangleAnnotation;
  5396. json: RectangleAnnotationJSON;
  5397. jsonForBackend: AnnotationBackendJSON<RectangleAnnotationJSON>;
  5398. };
  5399. 'pspdfkit/shape/ellipse': {
  5400. serializer: EllipseAnnotationSerializer;
  5401. annotation: EllipseAnnotation;
  5402. json: EllipseAnnotationJSON;
  5403. jsonForBackend: AnnotationBackendJSON<EllipseAnnotationJSON>;
  5404. };
  5405. 'pspdfkit/shape/polygon': {
  5406. serializer: PolygonAnnotationSerializer;
  5407. annotation: PolygonAnnotation;
  5408. json: PolygonAnnotationJSON;
  5409. jsonForBackend: AnnotationBackendJSON<PolygonAnnotationJSON>;
  5410. };
  5411. 'pspdfkit/shape/polyline': {
  5412. serializer: PolylineAnnotationSerializer;
  5413. annotation: PolylineAnnotation;
  5414. json: PolylineAnnotationJSON;
  5415. jsonForBackend: AnnotationBackendJSON<PolylineAnnotationJSON>;
  5416. };
  5417. 'pspdfkit/link': {
  5418. serializer: LinkAnnotationSerializer;
  5419. annotation: LinkAnnotation;
  5420. json: LinkAnnotationJSON;
  5421. jsonForBackend: AnnotationBackendJSON<LinkAnnotationJSON>;
  5422. };
  5423. 'pspdfkit/markup/highlight': {
  5424. serializer: TextMarkupAnnotationSerializer;
  5425. annotation: HighlightAnnotation;
  5426. json: TextMarkupAnnotationJSON;
  5427. jsonForBackend: AnnotationBackendJSON<TextMarkupAnnotationJSON>;
  5428. };
  5429. 'pspdfkit/markup/squiggly': {
  5430. serializer: TextMarkupAnnotationSerializer;
  5431. annotation: SquiggleAnnotation;
  5432. json: TextMarkupAnnotationJSON;
  5433. jsonForBackend: AnnotationBackendJSON<TextMarkupAnnotationJSON>;
  5434. };
  5435. 'pspdfkit/markup/strikeout': {
  5436. serializer: TextMarkupAnnotationSerializer;
  5437. annotation: StrikeOutAnnotation;
  5438. json: TextMarkupAnnotationJSON;
  5439. jsonForBackend: AnnotationBackendJSON<TextMarkupAnnotationJSON>;
  5440. };
  5441. 'pspdfkit/markup/underline': {
  5442. serializer: TextMarkupAnnotationSerializer;
  5443. annotation: UnderlineAnnotation;
  5444. json: TextMarkupAnnotationJSON;
  5445. jsonForBackend: AnnotationBackendJSON<TextMarkupAnnotationJSON>;
  5446. };
  5447. 'pspdfkit/markup/redaction': {
  5448. serializer: RedactionAnnotationSerializer;
  5449. annotation: RedactionAnnotation;
  5450. json: RedactionAnnotationJSON;
  5451. jsonForBackend: AnnotationBackendJSON<RedactionAnnotationJSON>;
  5452. };
  5453. 'pspdfkit/text': {
  5454. serializer: TextAnnotationSerializer;
  5455. annotation: TextAnnotation;
  5456. json: TextAnnotationJSON;
  5457. jsonForBackend: AnnotationBackendJSON<TextAnnotationJSON>;
  5458. };
  5459. 'pspdfkit/note': {
  5460. serializer: NoteAnnotationSerializer;
  5461. annotation: NoteAnnotation;
  5462. json: NoteAnnotationJSON;
  5463. jsonForBackend: AnnotationBackendJSON<NoteAnnotationJSON>;
  5464. };
  5465. 'pspdfkit/image': {
  5466. serializer: ImageAnnotationSerializer;
  5467. annotation: ImageAnnotation;
  5468. json: ImageAnnotationJSON;
  5469. jsonForBackend: AnnotationBackendJSON<ImageAnnotationJSON>;
  5470. };
  5471. 'pspdfkit/stamp': {
  5472. serializer: StampAnnotationSerializer;
  5473. annotation: StampAnnotation;
  5474. json: StampAnnotationJSON;
  5475. jsonForBackend: AnnotationBackendJSON<StampAnnotationJSON, 'color'>;
  5476. };
  5477. 'pspdfkit/widget': {
  5478. serializer: WidgetAnnotationSerializer;
  5479. annotation: WidgetAnnotation;
  5480. json: WidgetAnnotationJSON;
  5481. jsonForBackend: AnnotationBackendJSON<WidgetAnnotationJSON>;
  5482. };
  5483. 'pspdfkit/comment-marker': {
  5484. serializer: CommentMarkerAnnotationSerializer;
  5485. annotation: CommentMarkerAnnotation;
  5486. json: CommentMarkerAnnotationJSON;
  5487. jsonForBackend: AnnotationBackendJSON<CommentMarkerAnnotationJSON>;
  5488. };
  5489. 'pspdfkit/unknown': {
  5490. serializer: UnknownAnnotationSerializer;
  5491. annotation: UnknownAnnotation;
  5492. json: UnknownAnnotationJSON;
  5493. jsonForBackend: AnnotationBackendJSON<UnknownAnnotationJSON>;
  5494. };
  5495. 'pspdfkit/media': {
  5496. serializer: MediaAnnotationSerializer;
  5497. annotation: MediaAnnotation;
  5498. json: MediaAnnotationJSON;
  5499. jsonForBackend: AnnotationBackendJSON<MediaAnnotationJSON>;
  5500. };
  5501. };
  5502. type GetTypeFromAnnotationJSON<T extends {
  5503. type: keyof AnnotationSerializerTypeMap;
  5504. }> = T extends {
  5505. type: infer U;
  5506. } ? U : never;
  5507. type AnnotationJSONToAnnotation<T extends {
  5508. type: keyof AnnotationSerializerTypeMap;
  5509. }> = AnnotationSerializerTypeMap[GetTypeFromAnnotationJSON<T>]['annotation'];
  5510. type Intersection<T, U> = T extends U ? T : never;
  5511. type BackendRequiredKeys = 'id' | 'v' | 'pageIndex' | 'type' | 'bbox';
  5512. type AnnotationBackendJSON<K extends BaseAnnotationJSON = AnnotationJSONUnion, R extends string = never> = {
  5513. [P in keyof K]?: NonNullable<K[P]>;
  5514. } & {
  5515. [P in Intersection<keyof K, BackendRequiredKeys | R>]-?: Exclude<NonNullable<K[P]>, undefined>;
  5516. };
  5517. type AnnotationsUnion = {
  5518. [K in keyof AnnotationSerializerTypeMap]: AnnotationSerializerTypeMap[K]['annotation'];
  5519. }[keyof AnnotationSerializerTypeMap];
  5520. type AnnotationsUnionClass = {
  5521. [K in keyof AnnotationSerializerTypeMap]: Class<AnnotationSerializerTypeMap[K]['annotation']>;
  5522. }[keyof AnnotationSerializerTypeMap];
  5523. type ShapeAnnotationsUnion = PolylineAnnotation | PolygonAnnotation | LineAnnotation | RectangleAnnotation | EllipseAnnotation;
  5524. type AnnotationsBackendJSONUnion = {
  5525. [K in keyof AnnotationSerializerTypeMap]: AnnotationSerializerTypeMap[K]['jsonForBackend'];
  5526. }[keyof AnnotationSerializerTypeMap];
  5527. type TextMarkupAnnotationsUnion = HighlightAnnotation | UnderlineAnnotation | StrikeOutAnnotation | SquiggleAnnotation | RedactionAnnotation;
  5528. type CommentJSON = {
  5529. id?: string | null;
  5530. type: 'pspdfkit/comment';
  5531. v: 2;
  5532. rootId: string | number | null;
  5533. pageIndex: number | null;
  5534. pdfObjectId?: number | null;
  5535. creatorName?: string | null;
  5536. name?: string | null;
  5537. createdAt: string | Date;
  5538. updatedAt: string | Date;
  5539. text: {
  5540. value: string | null;
  5541. format: 'xhtml' | 'plain';
  5542. };
  5543. customData?: {
  5544. [key: string]: unknown;
  5545. } | null;
  5546. isAnonymous?: boolean | null;
  5547. } & ICollaboratorPermissionsOptions;
  5548. type CommentProps$1 = {
  5549. id: InstantID | null;
  5550. rootId: InstantID | null;
  5551. pageIndex: null | number;
  5552. pdfObjectId: number | null;
  5553. creatorName: string | null;
  5554. createdAt: Date;
  5555. updatedAt: Date;
  5556. text: {
  5557. format: 'plain' | 'xhtml';
  5558. value: string | null;
  5559. };
  5560. customData: Record<string, unknown> | null;
  5561. group?: string | null;
  5562. isEditable?: boolean;
  5563. isDeletable?: boolean;
  5564. canSetGroup?: boolean;
  5565. isAnonymous?: boolean | null;
  5566. };
  5567. declare const Comment_base: Record$1.Factory<CommentProps$1>;
  5568. declare class Comment$1 extends Comment_base {
  5569. static toSerializableObject: (comment: Comment$1) => CommentJSON;
  5570. static fromSerializableObject: (comment: CommentJSON) => Comment$1;
  5571. getMentionedUserIds(): Set$1<string>;
  5572. }
  5573. type MentionableUser$1 = {
  5574. id: string;
  5575. name: string;
  5576. avatarUrl?: string;
  5577. displayName: string;
  5578. description?: string;
  5579. };
  5580. type IGroup = string | null | undefined;
  5581. type IPermissions = {
  5582. edit: boolean;
  5583. delete: boolean;
  5584. setGroup: boolean;
  5585. fill?: boolean;
  5586. reply?: boolean;
  5587. };
  5588. type ICollaboratorPermissionsOptions = {
  5589. group?: IGroup;
  5590. permissions?: IPermissions;
  5591. };
  5592. type SerializedAdditionalActionsType = {
  5593. [key in ActionTriggerEventType | FormFieldEventTriggerType | FormFieldInputEventTriggerType | WidgetActionTriggerEventType]?: {
  5594. type: string;
  5595. [key: string]: unknown;
  5596. };
  5597. };
  5598. type FontSubstitution = {
  5599. pattern: string;
  5600. target: string;
  5601. };
  5602. declare const ComparisonOperationType: {
  5603. readonly TEXT: "text";
  5604. };
  5605. type IComparisonOperationType = (typeof ComparisonOperationType)[keyof typeof ComparisonOperationType];
  5606. declare global {
  5607. interface SymbolConstructor {
  5608. readonly observable: symbol;
  5609. }
  5610. }
  5611. type OnCommentCreationStartCallback = (comment: Comment$1) => Comment$1;
  5612. interface ITextLine {
  5613. id: number | null;
  5614. pageIndex: number | null;
  5615. boundingBox: Rect;
  5616. contents: string;
  5617. }
  5618. declare const TextLine_base: Record$1.Factory<ITextLine>;
  5619. declare class TextLine extends TextLine_base {
  5620. }
  5621. type CustomOverlayItemID = string;
  5622. interface ICustomOverlayItem {
  5623. disableAutoZoom?: boolean;
  5624. id: CustomOverlayItemID | null;
  5625. node: Node | null;
  5626. noRotate?: boolean;
  5627. pageIndex: number;
  5628. position: Point;
  5629. onAppear?: null | ((...args: Array<any>) => any);
  5630. onDisappear?: null | ((...args: Array<any>) => any);
  5631. }
  5632. declare const CustomOverlayItem_base: Record$1.Factory<ICustomOverlayItem>;
  5633. declare class CustomOverlayItem extends CustomOverlayItem_base {
  5634. disableAutoZoom: boolean;
  5635. id: CustomOverlayItemID;
  5636. node: Node;
  5637. noRotate: boolean;
  5638. pageIndex: number;
  5639. position: Point;
  5640. onAppear?: ((...args: Array<any>) => any) | null;
  5641. onDisappear?: ((...args: Array<any>) => any) | null;
  5642. constructor(args: ICustomOverlayItem);
  5643. }
  5644. declare class PageInfo {
  5645. index: number;
  5646. label: string;
  5647. height: number;
  5648. width: number;
  5649. rotation: number;
  5650. rawPdfBoxes: RawPdfBoxes;
  5651. }
  5652. declare const ViewportPadding_base: Record$1.Factory<{
  5653. horizontal: number;
  5654. vertical: number;
  5655. }>;
  5656. declare class ViewportPadding extends ViewportPadding_base {
  5657. }
  5658. declare const LayoutMode: {
  5659. readonly SINGLE: "SINGLE";
  5660. readonly DOUBLE: "DOUBLE";
  5661. readonly AUTO: "AUTO";
  5662. };
  5663. type ILayoutMode = (typeof LayoutMode)[keyof typeof LayoutMode];
  5664. declare const ScrollMode: {
  5665. readonly CONTINUOUS: "CONTINUOUS";
  5666. readonly PER_SPREAD: "PER_SPREAD";
  5667. readonly DISABLED: "DISABLED";
  5668. };
  5669. type IScrollMode = (typeof ScrollMode)[keyof typeof ScrollMode];
  5670. declare const SidebarPlacement: {
  5671. readonly START: "START";
  5672. readonly END: "END";
  5673. };
  5674. type ISidebarPlacement = (typeof SidebarPlacement)[keyof typeof SidebarPlacement];
  5675. declare const ZoomMode: {
  5676. readonly AUTO: "AUTO";
  5677. readonly FIT_TO_WIDTH: "FIT_TO_WIDTH";
  5678. readonly FIT_TO_VIEWPORT: "FIT_TO_VIEWPORT";
  5679. readonly CUSTOM: "CUSTOM";
  5680. };
  5681. type IZoomMode = (typeof ZoomMode)[keyof typeof ZoomMode];
  5682. declare const ShowSignatureValidationStatusMode: {
  5683. readonly IF_SIGNED: "IF_SIGNED";
  5684. readonly HAS_WARNINGS: "HAS_WARNINGS";
  5685. readonly HAS_ERRORS: "HAS_ERRORS";
  5686. readonly NEVER: "NEVER";
  5687. };
  5688. type IShowSignatureValidationStatusMode = (typeof ShowSignatureValidationStatusMode)[keyof typeof ShowSignatureValidationStatusMode];
  5689. declare const InteractionMode: {
  5690. readonly TEXT_HIGHLIGHTER: "TEXT_HIGHLIGHTER";
  5691. readonly INK: "INK";
  5692. readonly INK_SIGNATURE: "INK_SIGNATURE";
  5693. readonly SIGNATURE: "SIGNATURE";
  5694. readonly STAMP_PICKER: "STAMP_PICKER";
  5695. readonly STAMP_CUSTOM: "STAMP_CUSTOM";
  5696. readonly SHAPE_LINE: "SHAPE_LINE";
  5697. readonly SHAPE_RECTANGLE: "SHAPE_RECTANGLE";
  5698. readonly SHAPE_ELLIPSE: "SHAPE_ELLIPSE";
  5699. readonly SHAPE_POLYGON: "SHAPE_POLYGON";
  5700. readonly SHAPE_POLYLINE: "SHAPE_POLYLINE";
  5701. readonly INK_ERASER: "INK_ERASER";
  5702. readonly NOTE: "NOTE";
  5703. readonly COMMENT_MARKER: "COMMENT_MARKER";
  5704. readonly TEXT: "TEXT";
  5705. readonly CALLOUT: "CALLOUT";
  5706. readonly PAN: "PAN";
  5707. readonly SEARCH: "SEARCH";
  5708. readonly DOCUMENT_EDITOR: "DOCUMENT_EDITOR";
  5709. readonly MARQUEE_ZOOM: "MARQUEE_ZOOM";
  5710. readonly REDACT_TEXT_HIGHLIGHTER: "REDACT_TEXT_HIGHLIGHTER";
  5711. readonly REDACT_SHAPE_RECTANGLE: "REDACT_SHAPE_RECTANGLE";
  5712. readonly DOCUMENT_CROP: "DOCUMENT_CROP";
  5713. readonly BUTTON_WIDGET: "BUTTON_WIDGET";
  5714. readonly TEXT_WIDGET: "TEXT_WIDGET";
  5715. readonly RADIO_BUTTON_WIDGET: "RADIO_BUTTON_WIDGET";
  5716. readonly CHECKBOX_WIDGET: "CHECKBOX_WIDGET";
  5717. readonly COMBO_BOX_WIDGET: "COMBO_BOX_WIDGET";
  5718. readonly LIST_BOX_WIDGET: "LIST_BOX_WIDGET";
  5719. readonly SIGNATURE_WIDGET: "SIGNATURE_WIDGET";
  5720. readonly DATE_WIDGET: "DATE_WIDGET";
  5721. readonly FORM_CREATOR: "FORM_CREATOR";
  5722. readonly LINK: "LINK";
  5723. readonly DISTANCE: "DISTANCE";
  5724. readonly PERIMETER: "PERIMETER";
  5725. readonly RECTANGLE_AREA: "RECTANGLE_AREA";
  5726. readonly ELLIPSE_AREA: "ELLIPSE_AREA";
  5727. readonly POLYGON_AREA: "POLYGON_AREA";
  5728. readonly CONTENT_EDITOR: "CONTENT_EDITOR";
  5729. readonly MULTI_ANNOTATIONS_SELECTION: "MULTI_ANNOTATIONS_SELECTION";
  5730. readonly MEASUREMENT: "MEASUREMENT";
  5731. readonly MEASUREMENT_SETTINGS: "MEASUREMENT_SETTINGS";
  5732. };
  5733. type IInteractionMode = (typeof InteractionMode)[keyof typeof InteractionMode];
  5734. declare const SidebarMode: {
  5735. readonly ANNOTATIONS: "ANNOTATIONS";
  5736. readonly BOOKMARKS: "BOOKMARKS";
  5737. readonly DOCUMENT_OUTLINE: "DOCUMENT_OUTLINE";
  5738. readonly THUMBNAILS: "THUMBNAILS";
  5739. readonly SIGNATURES: "SIGNATURES";
  5740. readonly LAYERS: "LAYERS";
  5741. readonly CUSTOM: "CUSTOM";
  5742. };
  5743. type ISidebarMode = (typeof SidebarMode)[keyof typeof SidebarMode];
  5744. declare const Alignment: {
  5745. readonly START: "START";
  5746. readonly END: "END";
  5747. };
  5748. type IAlignment = (typeof Alignment)[keyof typeof Alignment];
  5749. type SidebarOptions<T extends AnnotationsSidebarOptions | LayersSidebarOptions> = T extends AnnotationsSidebarOptions ? {
  5750. [SidebarMode.ANNOTATIONS]: AnnotationsSidebarOptions;
  5751. } : {
  5752. [SidebarMode.LAYERS]: LayersSidebarOptions;
  5753. };
  5754. type AnnotationsSidebarOptions = {
  5755. includeContent: Array<AnnotationsUnionClass | Class<Comment$1>>;
  5756. };
  5757. type LayersSidebarOptions = {
  5758. lockedLayers: number[];
  5759. iconsAlignment: IAlignment;
  5760. };
  5761. type Rotation$1 = 0 | 90 | 180 | 270;
  5762. interface IViewState {
  5763. allowPrinting: boolean;
  5764. allowExport: boolean;
  5765. currentPageIndex: number;
  5766. instance: Instance | null;
  5767. interactionMode: IInteractionMode | null;
  5768. keepFirstSpreadAsSinglePage: boolean;
  5769. layoutMode: ILayoutMode;
  5770. pageSpacing: number;
  5771. pagesRotation: Rotation$1;
  5772. readOnly: boolean;
  5773. scrollMode: IScrollMode;
  5774. showAnnotations: boolean;
  5775. showComments: boolean;
  5776. showAnnotationNotes: boolean;
  5777. showToolbar: boolean;
  5778. enableAnnotationToolbar: boolean;
  5779. sidebarMode: ISidebarMode | null | undefined;
  5780. sidebarOptions: SidebarOptions<AnnotationsSidebarOptions | LayersSidebarOptions>;
  5781. sidebarPlacement: ISidebarPlacement;
  5782. spreadSpacing: number;
  5783. viewportPadding: ViewportPadding;
  5784. zoom: IZoomMode | number;
  5785. zoomStep: number;
  5786. formDesignMode: boolean;
  5787. showSignatureValidationStatus: IShowSignatureValidationStatusMode;
  5788. previewRedactionMode: boolean;
  5789. canScrollWhileDrawing: boolean;
  5790. keepSelectedTool: boolean;
  5791. resolvedLayoutMode: ILayoutMode;
  5792. sidebarWidth: number;
  5793. disablePointSnapping: boolean;
  5794. enableAlwaysScrollToZoom: boolean;
  5795. forceRenderWidgetsInAnnotationsOrder: boolean;
  5796. prerenderedPageSpreads: number | null;
  5797. }
  5798. declare const ViewState_base: Record$1.Factory<IViewState>;
  5799. declare class ViewState extends ViewState_base {
  5800. zoomIn(): ViewState;
  5801. zoomOut(): ViewState;
  5802. rotateLeft(): ViewState;
  5803. rotateRight(): ViewState;
  5804. goToNextPage(): ViewState;
  5805. goToPreviousPage(): ViewState;
  5806. }
  5807. declare class InstantClient {
  5808. clientId: string;
  5809. userId: string | null | undefined;
  5810. }
  5811. declare const PrintMode: {
  5812. readonly DOM: "DOM";
  5813. readonly EXPORT_PDF: "EXPORT_PDF";
  5814. };
  5815. type IPrintMode = (typeof PrintMode)[keyof typeof PrintMode];
  5816. declare function toJSON(bookmark: Bookmark): BookmarkJSON;
  5817. type ID$1 = string;
  5818. type BookmarkProps = {
  5819. id: ID$1 | null;
  5820. pdfBookmarkId: ID$1 | null;
  5821. name: string | null;
  5822. sortKey: number | null;
  5823. action: Action | null;
  5824. };
  5825. declare const Bookmark_base: Record$1.Factory<BookmarkProps>;
  5826. declare class Bookmark extends Bookmark_base {
  5827. id: ID$1;
  5828. action: Action;
  5829. static toSerializableObject: typeof toJSON;
  5830. static fromSerializableObject: (bookmark: BookmarkJSON) => Bookmark;
  5831. }
  5832. 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")[];
  5833. type ToolItemType = 'custom';
  5834. type ToolItem = {
  5835. type: ToolItemType;
  5836. node?: Node;
  5837. id?: string;
  5838. title?: string;
  5839. className?: string;
  5840. icon?: string;
  5841. onPress?: IFunction;
  5842. selected?: boolean;
  5843. disabled?: boolean;
  5844. };
  5845. type AnnotationPreset$1 = Record<string, any>;
  5846. type AnnotationPresetID$1 = string;
  5847. type ToolbarItemType = ToolItemType | (typeof allowedToolbarTypes)[number];
  5848. type ToolbarItem = Omit<ToolItem, 'type'> & {
  5849. type: ToolbarItemType;
  5850. mediaQueries?: string[];
  5851. responsiveGroup?: string;
  5852. dropdownGroup?: string;
  5853. preset?: AnnotationPresetID$1;
  5854. onKeyPress?: (...args: Array<any>) => any;
  5855. };
  5856. type OutlineElementProps = {
  5857. children: List<OutlineElement>;
  5858. title: string;
  5859. color: Color$2 | null;
  5860. isBold: boolean;
  5861. isItalic: boolean;
  5862. isExpanded: boolean;
  5863. action: Action | null;
  5864. };
  5865. declare const OutlineElement_base: Record$1.Factory<OutlineElementProps>;
  5866. declare class OutlineElement extends OutlineElement_base {
  5867. }
  5868. type BaseFormFieldJSON = {
  5869. v: 1;
  5870. pdfObjectId?: number | null;
  5871. annotationIds: Array<string>;
  5872. name: string;
  5873. label: string;
  5874. flags?: FormFieldFlags;
  5875. id: string;
  5876. additionalActions?: SerializedAdditionalActionsType;
  5877. group?: IGroup;
  5878. permissions?: IPermissions;
  5879. };
  5880. type ChoiceFormFieldJSON = BaseFormFieldJSON & {
  5881. type: 'pspdfkit/form-field/listbox' | 'pspdfkit/form-field/combobox';
  5882. options: Array<FormOptionJSON>;
  5883. multiSelect: boolean;
  5884. commitOnChange: boolean;
  5885. defaultValues: Array<string>;
  5886. };
  5887. type ListBoxFormFieldJSON = ChoiceFormFieldJSON & {
  5888. type: 'pspdfkit/form-field/listbox';
  5889. };
  5890. type DoNotSpellCheckPropertyPair = XOR<Record<'doNotSpellCheck', boolean>, Record<'doNotSpellcheck', boolean>>;
  5891. type ComboBoxFormFieldJSON = ChoiceFormFieldJSON & {
  5892. type: 'pspdfkit/form-field/combobox';
  5893. edit: boolean;
  5894. } & DoNotSpellCheckPropertyPair;
  5895. type CheckBoxFormFieldJSON = BaseFormFieldJSON & {
  5896. type: 'pspdfkit/form-field/checkbox';
  5897. options: Array<FormOptionJSON>;
  5898. defaultValues: Array<string>;
  5899. };
  5900. type RadioButtonFormFieldJSON = BaseFormFieldJSON & {
  5901. type: 'pspdfkit/form-field/radio';
  5902. options: Array<FormOptionJSON>;
  5903. noToggleToOff: boolean;
  5904. radiosInUnison: boolean;
  5905. defaultValue: string;
  5906. };
  5907. type TextFormFieldJSON = BaseFormFieldJSON & {
  5908. type: 'pspdfkit/form-field/text';
  5909. password: boolean;
  5910. maxLength?: number | null;
  5911. doNotScroll: boolean;
  5912. multiLine: boolean;
  5913. defaultValue: string;
  5914. comb: boolean;
  5915. } & DoNotSpellCheckPropertyPair;
  5916. type ButtonFormFieldJSON = BaseFormFieldJSON & {
  5917. type: 'pspdfkit/form-field/button';
  5918. buttonLabel: string | null;
  5919. };
  5920. type SignatureFormFieldJSON = BaseFormFieldJSON & {
  5921. type: 'pspdfkit/form-field/signature';
  5922. };
  5923. type FormFieldJSON = ListBoxFormFieldJSON | ComboBoxFormFieldJSON | RadioButtonFormFieldJSON | CheckBoxFormFieldJSON | TextFormFieldJSON | ButtonFormFieldJSON | SignatureFormFieldJSON;
  5924. type SerializedJSON = {
  5925. skippedPdfObjectIds?: number[];
  5926. annotations?: AnnotationJSONUnion[];
  5927. formFields?: FormFieldJSON[];
  5928. skippedPdfFormFieldIds?: number[];
  5929. formFieldValues?: Record<string, any>[];
  5930. comments?: Record<string, any>[];
  5931. skippedComments?: number[];
  5932. attachments?: Record<string, {
  5933. binary: string;
  5934. contentType: string;
  5935. }>;
  5936. skippedPdfBookmarkIds?: string[];
  5937. bookmarks?: BookmarkJSON[];
  5938. };
  5939. type InstantJSON = SerializedJSON & {
  5940. format: 'https://pspdfkit.com/instant-json/v1';
  5941. pdfId?: {
  5942. permanent: string;
  5943. changing: string;
  5944. };
  5945. };
  5946. declare const SearchResult_base: Record$1.Factory<{
  5947. pageIndex: number | null;
  5948. previewText: string;
  5949. locationInPreview: number | null;
  5950. lengthInPreview: number | null;
  5951. rectsOnPage: List<Rect>;
  5952. isAnnotation: boolean | null;
  5953. annotationRect?: Rect | null | undefined;
  5954. }>;
  5955. declare class SearchResult extends SearchResult_base {
  5956. }
  5957. declare const SearchState_base: Record$1.Factory<ISearchState>;
  5958. declare class SearchState extends SearchState_base {
  5959. }
  5960. interface ISearchState {
  5961. isFocused: boolean;
  5962. isLoading: boolean;
  5963. term: string;
  5964. focusedResultIndex: number;
  5965. results: List<SearchResult>;
  5966. minSearchQueryLength: number;
  5967. }
  5968. type IsEditableAnnotationCallback = (annotation: AnnotationsUnion) => boolean;
  5969. type Rotation = 0 | 90 | 180 | 270;
  5970. type AddPageConfiguration = {
  5971. backgroundColor: Color$2;
  5972. pageWidth: number;
  5973. pageHeight: number;
  5974. rotateBy: Rotation;
  5975. insets?: Rect;
  5976. };
  5977. type OperationAttachment = string | File | Blob;
  5978. type min = number;
  5979. type max = number;
  5980. type Range$1 = [min, max];
  5981. type ImportPageIndex = Array<number | Range$1>;
  5982. type DocumentMetadata = {
  5983. title?: string;
  5984. author?: string;
  5985. };
  5986. type NonSerializableDocumentOperationsCommon = {
  5987. type: 'removePages';
  5988. pageIndexes: Array<number>;
  5989. } | {
  5990. type: 'duplicatePages';
  5991. pageIndexes: Array<number>;
  5992. } | {
  5993. type: 'movePages';
  5994. pageIndexes: Array<number>;
  5995. afterPageIndex: number;
  5996. } | {
  5997. type: 'movePages';
  5998. pageIndexes: Array<number>;
  5999. beforePageIndex: number;
  6000. } | {
  6001. type: 'rotatePages';
  6002. pageIndexes: Array<number>;
  6003. rotateBy: Rotation;
  6004. } | {
  6005. type: 'keepPages';
  6006. pageIndexes: Array<number>;
  6007. } | {
  6008. type: 'importDocument';
  6009. afterPageIndex: number;
  6010. treatImportedDocumentAsOnePage?: boolean;
  6011. document: OperationAttachment;
  6012. importedPageIndexes?: ImportPageIndex;
  6013. } | {
  6014. type: 'importDocument';
  6015. beforePageIndex: number;
  6016. treatImportedDocumentAsOnePage?: boolean;
  6017. document: OperationAttachment;
  6018. importedPageIndexes?: ImportPageIndex;
  6019. } | {
  6020. type: 'setPageLabel';
  6021. pageIndexes?: Array<number>;
  6022. pageLabel?: string;
  6023. } | {
  6024. type: 'performOcr';
  6025. pageIndexes?: Array<number> | 'all';
  6026. language: string;
  6027. } | {
  6028. type: 'applyRedactions';
  6029. } | {
  6030. type: 'updateMetadata';
  6031. metadata: DocumentMetadata;
  6032. };
  6033. type NonSerializableDocumentOperations = {
  6034. type: 'applyInstantJson';
  6035. instantJson: Record<string, any>;
  6036. dataFilePath?: OperationAttachment;
  6037. } | {
  6038. type: 'applyXfdf';
  6039. xfdf: string;
  6040. ignorePageRotation?: boolean;
  6041. dataFilePath?: OperationAttachment;
  6042. } | {
  6043. type: 'flattenAnnotations';
  6044. pageIndexes?: Array<number>;
  6045. annotationIds?: string[];
  6046. noteAnnotationBackgroundColor?: Color$2;
  6047. noteAnnotationOpacity?: number;
  6048. };
  6049. type DocumentOperation = (AddPageConfiguration & {
  6050. type: 'addPage';
  6051. afterPageIndex: number;
  6052. }) | (AddPageConfiguration & {
  6053. type: 'addPage';
  6054. beforePageIndex: number;
  6055. }) | {
  6056. type: 'cropPages';
  6057. pageIndexes?: Array<number>;
  6058. cropBox: Rect;
  6059. } | {
  6060. type: 'addPageMargins';
  6061. pageIndexes?: Array<number>;
  6062. margins: Inset;
  6063. } | NonSerializableDocumentOperationsCommon | NonSerializableDocumentOperations;
  6064. type RendererConfiguration = {
  6065. node: Node;
  6066. append?: boolean | null;
  6067. noZoom?: boolean | null;
  6068. onDisappear?: ((arg0: Node | null) => void) | null;
  6069. };
  6070. type CustomRenderers = {
  6071. Annotation?: (arg0: {
  6072. annotation: AnnotationsUnion;
  6073. }) => RendererConfiguration | null | undefined;
  6074. CommentAvatar?: (arg0: {
  6075. comment: Comment$1;
  6076. }) => RendererConfiguration | null | undefined;
  6077. };
  6078. type IsEditableCommentCallback = (comment: Comment$1) => boolean;
  6079. type TwoStepSignatureCallback = (arg0: {
  6080. hash: string;
  6081. fileContents: ArrayBuffer | null;
  6082. dataToBeSigned: ArrayBuffer;
  6083. }) => Promise<ArrayBuffer>;
  6084. type SignatureMetadata = {
  6085. signerName?: string;
  6086. signatureReason?: string;
  6087. signatureLocation?: string;
  6088. };
  6089. type SignaturePosition = {
  6090. pageIndex: number;
  6091. boundingBox: Rect;
  6092. };
  6093. declare const SignatureAppearanceMode: {
  6094. readonly signatureOnly: "signatureOnly";
  6095. readonly signatureAndDescription: "signatureAndDescription";
  6096. readonly descriptionOnly: "descriptionOnly";
  6097. };
  6098. type ISignatureAppearanceMode = (typeof SignatureAppearanceMode)[keyof typeof SignatureAppearanceMode];
  6099. type SignatureAppearance = {
  6100. mode?: ISignatureAppearanceMode;
  6101. showSigner?: boolean;
  6102. showSignDate?: boolean;
  6103. showReason?: boolean;
  6104. showLocation?: boolean;
  6105. showWatermark?: boolean;
  6106. showDateTimezone?: boolean;
  6107. watermarkImage?: Blob | File;
  6108. graphicImage?: Blob | File;
  6109. };
  6110. type SignatureContainerType = 'raw' | 'pkcs7';
  6111. type TimestampType = {
  6112. url: string;
  6113. username?: string;
  6114. password?: string;
  6115. };
  6116. type SigningData = {
  6117. certificates?: ArrayBuffer[] | string[];
  6118. signatureType: SignatureTypeType;
  6119. privateKey?: string;
  6120. signatureContainer?: SignatureContainerType;
  6121. timestamp?: TimestampType;
  6122. ltv?: boolean;
  6123. };
  6124. type SignaturePreparationData = {
  6125. placeholderSize?: number;
  6126. flatten?: boolean;
  6127. formFieldName?: string;
  6128. position?: SignaturePosition;
  6129. appearance?: SignatureAppearance;
  6130. };
  6131. type SignatureCreationData = SignaturePreparationData & {
  6132. signatureMetadata?: SignatureMetadata;
  6133. } & {
  6134. signingData?: SigningData;
  6135. };
  6136. type SigningServiceData = {
  6137. signingToken: string;
  6138. };
  6139. type RedactionAnnotationPreset = {
  6140. fillColor?: Color$2;
  6141. overlayText?: string;
  6142. repeatOverlayText?: boolean;
  6143. color?: Color$2;
  6144. outlineColor?: Color$2;
  6145. creatorName?: string;
  6146. };
  6147. type Change = AnnotationsUnion | Bookmark | FormField | FormFieldValue | Comment$1;
  6148. type DocumentEditorUIHandler = {
  6149. setOperations: (callback: (stagedDocumentOperations: List<DocumentOperation | List<DocumentOperation>>) => List<DocumentOperation | List<DocumentOperation>>, clearPagesSelection?: boolean) => void | Promise<void>;
  6150. getSelectedPageIndexes: () => number[];
  6151. };
  6152. type BuiltInDocumentEditorFooterItem = 'cancel' | 'spacer' | 'save-as' | 'save' | 'selected-pages' | 'loading-indicator';
  6153. type BasicDocumentEditorFooterItem = {
  6154. type: BuiltInDocumentEditorFooterItem | 'custom';
  6155. node?: Node;
  6156. className?: string;
  6157. id?: string;
  6158. onPress?: (e: MouseEvent, documentEditorUIHandler?: DocumentEditorUIHandler, id?: string) => void;
  6159. };
  6160. type DocumentEditorFooterItem = Omit<BasicDocumentEditorFooterItem, 'type' | 'onPress'> & ({
  6161. type: BuiltInDocumentEditorFooterItem;
  6162. onPress?: (e: Event) => void;
  6163. } | {
  6164. type: 'custom';
  6165. onPress?: (e: Event, documentEditorUIHandler: DocumentEditorUIHandler, id?: string) => void;
  6166. });
  6167. type BuiltInDocumentEditorToolbarItem = 'add' | 'remove' | 'duplicate' | 'rotate-left' | 'rotate-right' | 'move' | 'move-left' | 'move-right' | 'import-document' | 'spacer' | 'undo' | 'redo' | 'select-all' | 'select-none';
  6168. type DocumentEditorBuiltinToolbarItem = Omit<ToolItem, 'type' | 'onPress'> & {
  6169. type: BuiltInDocumentEditorToolbarItem;
  6170. onPress?: (e: Event) => void;
  6171. };
  6172. type DocumentEditorToolbarItem = Omit<ToolItem, 'type' | 'onPress'> & (DocumentEditorBuiltinToolbarItem | {
  6173. type: 'custom';
  6174. onPress?: (e: Event, documentEditorUIHandler: DocumentEditorUIHandler, id?: string) => void;
  6175. });
  6176. type AnnotationsResizeEvent = {
  6177. annotation: AnnotationsUnion;
  6178. isShiftPressed: boolean;
  6179. resizeAnchor: ResizeAnchor;
  6180. };
  6181. type ResizeAnchor = 'TOP' | 'BOTTOM' | 'LEFT' | 'RIGHT' | 'TOP_LEFT' | 'TOP_RIGHT' | 'BOTTOM_RIGHT' | 'BOTTOM_LEFT';
  6182. type AnnotationResizeStartCallbackConfiguration = {
  6183. maintainAspectRatio?: boolean;
  6184. minWidth?: number | undefined;
  6185. minHeight?: number | undefined;
  6186. maxWidth?: number | undefined;
  6187. maxHeight?: number | undefined;
  6188. };
  6189. type AnnotationResizeStartCallback = (event: AnnotationsResizeEvent) => AnnotationResizeStartCallbackConfiguration;
  6190. declare const UIElement: {
  6191. readonly Sidebar: "Sidebar";
  6192. };
  6193. type IUIElement = (typeof UIElement)[keyof typeof UIElement];
  6194. type RendererProps = {
  6195. containerNode: Node;
  6196. items?: List<any> | null;
  6197. };
  6198. type ItemRendererProps = {
  6199. itemContainerNode: Node;
  6200. item: any;
  6201. };
  6202. type ItemCustomRenderer = (itemRendererProps: ItemRendererProps) => void;
  6203. type UIRendererConfiguration = {
  6204. node: Node;
  6205. onRenderItem?: ItemCustomRenderer;
  6206. };
  6207. type Renderer$1 = (rendererProps: RendererProps) => UIRendererConfiguration;
  6208. type CustomUISidebarConfiguration = Partial<{
  6209. [K in ISidebarMode]: Renderer$1;
  6210. }>;
  6211. type CustomUIElementConfiguration = CustomUISidebarConfiguration;
  6212. type CustomUI = Partial<Record<IUIElement, CustomUIElementConfiguration>>;
  6213. declare const SearchType: {
  6214. readonly TEXT: "text";
  6215. readonly PRESET: "preset";
  6216. readonly REGEX: "regex";
  6217. };
  6218. type ISearchType = (typeof SearchType)[keyof typeof SearchType];
  6219. declare const SearchPattern: {
  6220. readonly CREDIT_CARD_NUMBER: "credit_card_number";
  6221. readonly DATE: "date";
  6222. readonly TIME: "time";
  6223. readonly EMAIL_ADDRESS: "email_address";
  6224. readonly INTERNATIONAL_PHONE_NUMBER: "international_phone_number";
  6225. readonly IP_V4: "ipv4";
  6226. readonly IP_V6: "ipv6";
  6227. readonly MAC_ADDRESS: "mac_address";
  6228. readonly NORTH_AMERICAN_PHONE_NUMBER: "north_american_phone_number";
  6229. readonly SOCIAL_SECURITY_NUMBER: "social_security_number";
  6230. readonly URL: "url";
  6231. readonly US_ZIP_CODE: "us_zip_code";
  6232. readonly VIN: "vin";
  6233. };
  6234. type ISearchPattern = (typeof SearchPattern)[keyof typeof SearchPattern];
  6235. type AnnotationsPressEvent = {
  6236. annotation: AnnotationsUnion;
  6237. nativeEvent: Event;
  6238. preventDefault?: () => void;
  6239. selected: boolean;
  6240. };
  6241. declare enum AnnotationsWillChangeReason {
  6242. DRAW_START = "DRAW_START",
  6243. DRAW_END = "DRAW_END",
  6244. TEXT_EDIT_START = "TEXT_EDIT_START",
  6245. TEXT_EDIT_END = "TEXT_EDIT_END",
  6246. SELECT_START = "SELECT_START",
  6247. SELECT_END = "SELECT_END",
  6248. MOVE_START = "MOVE_START",
  6249. MOVE_END = "MOVE_END",
  6250. RESIZE_START = "RESIZE_START",
  6251. RESIZE_END = "RESIZE_END",
  6252. ROTATE_START = "ROTATE_START",
  6253. ROTATE_END = "ROTATE_END",
  6254. DELETE_START = "DELETE_START",
  6255. DELETE_END = "DELETE_END",
  6256. PROPERTY_CHANGE = "PROPERTY_CHANGE"
  6257. }
  6258. type PagePressEvent = {
  6259. pageIndex: number;
  6260. point: Point;
  6261. nativeEvent: Event;
  6262. };
  6263. type AnnotationPresetsUpdateEvent = {
  6264. preventDefault: () => boolean;
  6265. currentPreset: AnnotationPresetID;
  6266. currentPresetProperties: AnnotationPreset;
  6267. newPresetProperties: AnnotationPreset;
  6268. };
  6269. type AnnotationsFocusEvent = {
  6270. annotation: AnnotationsUnion;
  6271. nativeEvent: FocusEvent;
  6272. };
  6273. type AnnotationsBlurEvent = {
  6274. annotation: AnnotationsUnion;
  6275. nativeEvent: FocusEvent;
  6276. };
  6277. type SaveStateChangeEvent = {
  6278. hasUnsavedChanges: boolean;
  6279. };
  6280. type SearchTermChangeEvent = {
  6281. term: string;
  6282. preventDefault: () => void;
  6283. };
  6284. type TextLinePressEvent = {
  6285. textLine: TextLine;
  6286. point: Point;
  6287. nativeEvent: Event;
  6288. };
  6289. type CropAreaChangeStartEvent = {
  6290. cropBox: Rect;
  6291. pageIndex: number;
  6292. };
  6293. type CropAreaChangeStopEvent = {
  6294. cropBox: Rect;
  6295. pageIndex: number;
  6296. };
  6297. type AnnotationsTransformEvent = {
  6298. annotation: AnnotationsUnion;
  6299. };
  6300. type AnnotationsCopyEvent = {
  6301. annotation: AnnotationsUnion;
  6302. };
  6303. type AnnotationsCutEvent = {
  6304. annotation: AnnotationsUnion;
  6305. };
  6306. type AnnotationsDuplicateEvent = {
  6307. annotations: AnnotationsUnion[];
  6308. formFields?: FormField[];
  6309. originalAnnotations: AnnotationsUnion[];
  6310. originalFormFields?: Map$1<string, FormField>;
  6311. };
  6312. type AnnotationsPasteEvent = AnnotationsDuplicateEvent & {
  6313. previousAction: 'COPY' | 'CUT';
  6314. };
  6315. interface ITextSelection$1 {
  6316. startNestedContentBlockId: string | null;
  6317. startTextLineId: number | null;
  6318. startPageIndex: number | null;
  6319. startNode: Text | null;
  6320. startOffset: number | null;
  6321. endNestedContentBlockId: string | null;
  6322. endTextLineId: number | null;
  6323. endPageIndex: number | null;
  6324. endNode: Text | null;
  6325. endOffset: number | null;
  6326. getText: (() => Promise<string>) | null;
  6327. getSelectedTextLines: (() => Promise<List<TextLine>>) | null;
  6328. getBoundingClientRect: (() => Promise<Rect | null>) | null;
  6329. getSelectedRectsPerPage: (() => Promise<List<{
  6330. pageIndex: number;
  6331. rects: List<Rect>;
  6332. }>>) | null;
  6333. }
  6334. declare const PublicTextSelection_base: Record$1.Factory<ITextSelection$1>;
  6335. declare class PublicTextSelection extends PublicTextSelection_base {
  6336. startTextLineId: number;
  6337. startNestedContentBlockId: string;
  6338. startPageIndex: number;
  6339. startNode: Text;
  6340. startOffset: number;
  6341. endTextLineId: number;
  6342. endNestedContentBlockId: string;
  6343. endPageIndex: number;
  6344. endNode: Text;
  6345. endOffset: number;
  6346. getText: () => Promise<string>;
  6347. getSelectedTextLines: () => Promise<List<TextLine>>;
  6348. getBoundingClientRect: () => Promise<Rect | null>;
  6349. getSelectedRectsPerPage: () => Promise<List<{
  6350. pageIndex: number;
  6351. rects: List<Rect>;
  6352. }>>;
  6353. }
  6354. interface AnnotationNoteProps extends INoteAnnotation {
  6355. parentAnnotation: AnnotationsUnion | null;
  6356. position: Point;
  6357. notePosition?: Point;
  6358. }
  6359. declare class AnnotationNote<T extends AnnotationNoteProps = AnnotationNoteProps> extends NoteAnnotation<T> {
  6360. parentAnnotation?: AnnotationsUnion;
  6361. position: Point;
  6362. notePosition?: Point;
  6363. static defaultValues: IObject$1;
  6364. }
  6365. type AnnotationNotePressEvent = {
  6366. preventDefault: () => boolean;
  6367. annotationNote?: AnnotationNote | null;
  6368. };
  6369. type AnnotationNoteHoverEvent = {
  6370. preventDefault: () => boolean;
  6371. annotationNote?: AnnotationNote | null;
  6372. };
  6373. declare const DocumentComparisonSourceType: {
  6374. readonly USE_OPEN_DOCUMENT: "USE_OPEN_DOCUMENT";
  6375. readonly USE_FILE_DIALOG: "USE_FILE_DIALOG";
  6376. };
  6377. type IDocumentComparisonSourceType = (typeof DocumentComparisonSourceType)[keyof typeof DocumentComparisonSourceType];
  6378. type DocumentComparisonSource = {
  6379. source: IDocumentComparisonSourceType | string | ArrayBuffer | Promise<string | ArrayBuffer>;
  6380. pageIndex?: number;
  6381. };
  6382. type DocumentComparisonStrokeColors = {
  6383. documentA?: Color$2;
  6384. documentB?: Color$2;
  6385. };
  6386. type DocumentComparisonConfiguration = {
  6387. documentA: DocumentComparisonSource;
  6388. documentB: DocumentComparisonSource;
  6389. strokeColors?: DocumentComparisonStrokeColors;
  6390. blendMode?: IBlendMode;
  6391. autoCompare: boolean;
  6392. };
  6393. type DocumentComparisonUIStartEvent = DocumentComparisonConfiguration;
  6394. type CommentsMentionEvent = {
  6395. comment: Comment$1;
  6396. modifications: List<{
  6397. userId: string;
  6398. action: 'ADDED' | 'REMOVED';
  6399. }>;
  6400. };
  6401. type Signature = InkAnnotation | ImageAnnotation;
  6402. interface HistoryEvent<T> {
  6403. action: T;
  6404. before: AnnotationsUnion;
  6405. after: AnnotationsUnion;
  6406. }
  6407. interface EventMap {
  6408. 'viewState.change': (viewState: ViewState, previousViewState: ViewState) => void;
  6409. 'viewState.currentPageIndex.change': (pageIndex: number) => void;
  6410. 'viewState.zoom.change': (zoom: number) => void;
  6411. 'annotationPresets.update': (event: AnnotationPresetsUpdateEvent) => void;
  6412. 'annotations.blur': (event: AnnotationsBlurEvent) => void;
  6413. 'annotations.change': () => void;
  6414. 'annotations.create': (annotations: List<AnnotationsUnion>) => void;
  6415. 'annotations.delete': (annotations: List<AnnotationsUnion>) => void;
  6416. 'annotations.didSave': () => void;
  6417. 'annotations.focus': (event: AnnotationsFocusEvent) => void;
  6418. 'annotations.load': (annotations: List<AnnotationsUnion>) => void;
  6419. 'annotations.press': (event: AnnotationsPressEvent) => void;
  6420. 'annotations.update': (annotations: List<AnnotationsUnion>) => void;
  6421. 'annotations.willChange': (event: {
  6422. reason: AnnotationsWillChangeReason;
  6423. annotations: List<AnnotationsUnion>;
  6424. }) => void;
  6425. 'annotations.willSave': () => void;
  6426. 'annotationSelection.change': (annotation?: AnnotationsUnion) => void;
  6427. 'annotations.transform': (event: AnnotationsTransformEvent) => void;
  6428. 'annotations.copy': (event: AnnotationsCopyEvent) => void;
  6429. 'annotations.cut': (event: AnnotationsCutEvent) => void;
  6430. 'annotations.paste': (event: AnnotationsPasteEvent) => void;
  6431. 'annotations.duplicate': (event: AnnotationsDuplicateEvent) => void;
  6432. 'bookmarks.change': () => void;
  6433. 'bookmarks.create': (bookmarks: List<Bookmark>) => void;
  6434. 'bookmarks.update': (bookmarks: List<Bookmark>) => void;
  6435. 'bookmarks.delete': (bookmarks: List<Bookmark>) => void;
  6436. 'bookmarks.load': (bookmarks: List<Bookmark>) => void;
  6437. 'bookmarks.didSave': () => void;
  6438. 'bookmarks.willSave': () => void;
  6439. 'comments.change': () => void;
  6440. 'comments.create': (comments: List<Comment$1>) => void;
  6441. 'comments.delete': (comments: List<Comment$1>) => void;
  6442. 'comments.update': (comments: List<Comment$1>) => void;
  6443. 'comments.load': () => void;
  6444. 'comments.willSave': () => void;
  6445. 'comments.didSave': () => void;
  6446. 'instant.connectedClients.change': (clients: Map$1<string, InstantClient>) => void;
  6447. 'document.change': (operations: DocumentOperation[]) => void;
  6448. 'document.saveStateChange': (event: SaveStateChangeEvent) => void;
  6449. 'formFieldValues.update': (formFields: List<FormField>) => void;
  6450. 'formFieldValues.willSave': () => void;
  6451. 'formFieldValues.didSave': (res: {
  6452. response: Response;
  6453. error: Error;
  6454. }) => void;
  6455. 'forms.willSubmit': (event: {
  6456. preventDefault: () => void;
  6457. }) => void;
  6458. 'forms.didSubmit': (event: {
  6459. preventDefault: () => void;
  6460. }) => void;
  6461. 'formFields.change': () => void;
  6462. 'formFields.create': (formFields: List<FormField>) => void;
  6463. 'formFields.delete': (formFields: List<FormField>) => void;
  6464. 'formFields.didSave': () => void;
  6465. 'formFields.load': (formFields: List<FormField>) => void;
  6466. 'formFields.update': (formFields: List<FormField>) => void;
  6467. 'formFields.willSave': () => void;
  6468. 'search.stateChange': (searchState: SearchState) => void;
  6469. 'search.termChange': (event: SearchTermChangeEvent) => void;
  6470. 'storedSignatures.change': () => void;
  6471. 'storedSignatures.create': (signature: Signature) => void;
  6472. 'storedSignatures.delete': (signature: Signature) => void;
  6473. 'storedSignatures.update': (signatures: List<Signature>) => void;
  6474. 'textLine.press': (event: TextLinePressEvent) => void;
  6475. 'textSelection.change': (selection: PublicTextSelection | null) => void;
  6476. 'history.change': (event: HistoryEvent<'undo' | 'redo'>) => void;
  6477. 'history.willChange': (event: {
  6478. type: 'create' | 'update' | 'delete';
  6479. annotation: Annotation;
  6480. preventDefault: () => void;
  6481. }) => void;
  6482. 'history.clear': () => void;
  6483. 'history.redo': (event: HistoryEvent<'redo'>) => void;
  6484. 'history.undo': (event: HistoryEvent<'undo'>) => void;
  6485. 'page.press': (event: PagePressEvent) => void;
  6486. 'inkSignatures.create': (signature: Signature) => void;
  6487. 'inkSignatures.delete': (signature: Signature) => void;
  6488. 'inkSignatures.update': (signatures: Signature[]) => void;
  6489. 'inkSignatures.change': () => void;
  6490. 'cropArea.changeStart': (opts: CropAreaChangeStartEvent) => void;
  6491. 'cropArea.changeStop': (opts: CropAreaChangeStopEvent) => void;
  6492. 'documentComparisonUI.start': (opts: DocumentComparisonUIStartEvent) => void;
  6493. 'documentComparisonUI.end': () => void;
  6494. 'annotationNote.press': (event: AnnotationNotePressEvent) => void;
  6495. 'annotationNote.hover': (event: AnnotationNoteHoverEvent) => void;
  6496. 'comments.mention': (event: CommentsMentionEvent) => void;
  6497. }
  6498. interface IEmbeddedFile {
  6499. id: ID;
  6500. attachmentId: string;
  6501. description: null | string;
  6502. fileName: null | string;
  6503. fileSize: null | number;
  6504. updatedAt: null | Date;
  6505. }
  6506. declare const EmbeddedFile_base: Record$1.Factory<IEmbeddedFile>;
  6507. declare class EmbeddedFile extends EmbeddedFile_base {
  6508. }
  6509. 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';
  6510. type BuiltInAnnotationToolbarItem = {
  6511. type: IAnnotationToolbarType;
  6512. };
  6513. type Shared = Omit<ToolItem, 'selected' | 'type'> & {
  6514. onPress?: (nativeEvent: MouseEvent, id?: string) => void;
  6515. iconClassName?: string;
  6516. onIconPress?: (nativeEvent: MouseEvent, id?: string) => void;
  6517. };
  6518. type AnnotationToolbarItem = (Omit<Shared, 'node'> & {
  6519. type: IAnnotationToolbarType;
  6520. }) | (Omit<Shared, 'icon'> & {
  6521. id: string;
  6522. type: 'custom';
  6523. icon?: string | Node;
  6524. node?: Node;
  6525. });
  6526. type AnnotationToolbarItemsCallback = (annotation: AnnotationsUnion, options: {
  6527. defaultAnnotationToolbarItems: BuiltInAnnotationToolbarItem[];
  6528. hasDesktopLayout: boolean;
  6529. }) => AnnotationToolbarItem[];
  6530. type OnWidgetAnnotationCreationStartCallback = (annotation: WidgetAnnotation, formField: FormField) => {
  6531. annotation?: WidgetAnnotation;
  6532. formField?: FormField;
  6533. };
  6534. interface ITextRange {
  6535. startNode: Text | null;
  6536. startOffset: number | null;
  6537. endNode: Text | null;
  6538. endOffset: number | null;
  6539. }
  6540. declare const TextRange_base: Record$1.Factory<ITextRange>;
  6541. declare class TextRange extends TextRange_base {
  6542. startNode: Text;
  6543. startOffset: number;
  6544. endNode: Text;
  6545. endOffset: number;
  6546. startAndEndIds(): {
  6547. startTextLineId: number;
  6548. endTextLineId: number;
  6549. startNestedContentBlockId: string;
  6550. endNestedContentBlockId: string;
  6551. startPageIndex: number;
  6552. endPageIndex: number;
  6553. } | null;
  6554. }
  6555. interface ITextSelection {
  6556. textRange: TextRange | null;
  6557. startTextLineId: number | null;
  6558. endTextLineId: number | null;
  6559. startNestedContentBlockId: string | null;
  6560. endNestedContentBlockId: string | null;
  6561. startPageIndex: number | null;
  6562. endPageIndex: number | null;
  6563. }
  6564. declare const TextSelection_base: Record$1.Factory<ITextSelection>;
  6565. declare class TextSelection extends TextSelection_base {
  6566. }
  6567. declare const builtInItems: readonly ["highlight", "strikeout", "underline", "squiggle", "redact-text-highlighter", "comment", "document-assistant"];
  6568. type InlineToolbarType = (typeof builtInItems)[number];
  6569. type InlineTextSelectionToolbarItem = Omit<ToolItem, 'type'> & {
  6570. type: InlineToolbarType | 'custom';
  6571. };
  6572. type InlineTextSelectionToolbarItemsCallback = (options: {
  6573. defaultItems: InlineTextSelectionToolbarItem[];
  6574. hasDesktopLayout: boolean;
  6575. }, selection: TextSelection) => InlineTextSelectionToolbarItem[];
  6576. type MeasurementValueConfiguration = {
  6577. name?: string;
  6578. scale: IMeasurementScale;
  6579. precision: IMeasurementPrecision;
  6580. selected?: boolean;
  6581. };
  6582. type MeasurementValueConfigurationCallback = (configuration: MeasurementValueConfiguration[]) => MeasurementValueConfiguration[];
  6583. declare const DocumentPermissionsEnum: {
  6584. readonly annotationsAndForms: "annotationsAndForms";
  6585. readonly assemble: "assemble";
  6586. readonly extract: "extract";
  6587. readonly extractAccessibility: "extractAccessibility";
  6588. readonly fillForms: "fillForms";
  6589. readonly modification: "modification";
  6590. readonly printHighQuality: "printHighQuality";
  6591. readonly printing: "printing";
  6592. };
  6593. type IDocumentPermissions = (typeof DocumentPermissionsEnum)[keyof typeof DocumentPermissionsEnum];
  6594. type OCGLayer = {
  6595. name: string;
  6596. ocgId: number;
  6597. radioGroup?: number;
  6598. };
  6599. type OCGCollection = {
  6600. name?: string;
  6601. ocgId?: number;
  6602. layers: OCGLayer[];
  6603. };
  6604. type OCG = OCGLayer | OCGCollection;
  6605. type OCGLayers = OCG[];
  6606. type OCGLayersVisibilityState = {
  6607. visibleLayerIds: number[];
  6608. };
  6609. type ViewStateSetter = (currentState: ViewState) => ViewState;
  6610. type ToolbarItemsSetter = (currentState: ToolbarItem[]) => ToolbarItem[];
  6611. type StoredSignaturesSetter = (annotations: List<InkAnnotation | ImageAnnotation>) => List<InkAnnotation | ImageAnnotation>;
  6612. type SearchStateSetter = (currentState: SearchState) => SearchState;
  6613. type AnnotationPresetsSetter = (currentState: Record<string, AnnotationPreset$1>) => Record<string, AnnotationPreset$1>;
  6614. type StampAnnotationTemplatesSetter = (currentState: Array<StampAnnotation | ImageAnnotation>) => Array<StampAnnotation | ImageAnnotation>;
  6615. type SetDocumentEditorFooterFunction = (currentState: DocumentEditorFooterItem[]) => DocumentEditorFooterItem[];
  6616. type SetDocumentEditorToolbarFunction = (currentState: DocumentEditorToolbarItem[]) => DocumentEditorToolbarItem[];
  6617. declare class Instance {
  6618. totalPageCount: number;
  6619. pageInfoForIndex: (pageIndex: number) => PageInfo | null | undefined;
  6620. textLinesForPageIndex: (pageIndex: number) => Promise<List<TextLine>>;
  6621. getMarkupAnnotationText: (annotation: TextMarkupAnnotationsUnion) => Promise<string>;
  6622. getTextFromRects: (pageIndex: number, rects: List<Rect>) => Promise<string>;
  6623. getDocumentPermissions: () => Promise<Record<IDocumentPermissions, boolean>>;
  6624. currentZoomLevel: number;
  6625. maximumZoomLevel: number;
  6626. minimumZoomLevel: number;
  6627. zoomStep: number;
  6628. disablePointSnapping: boolean;
  6629. connectedClients: Map$1<string, InstantClient>;
  6630. addEventListener: <K extends keyof EventMap>(action: K, listener: EventMap[K]) => void;
  6631. removeEventListener: <K extends keyof EventMap>(action: K, listener: EventMap[K]) => void;
  6632. jumpToRect: (pageIndex: number, rect: Rect) => void;
  6633. jumpAndZoomToRect: (pageIndex: number, rect: Rect) => void;
  6634. transformContentClientToPageSpace: <T extends Rect | Point>(rectOrPoint: T, pageIndex: number) => T;
  6635. transformContentPageToClientSpace: <T extends Rect | Point>(rectOrPoint: T, pageIndex: number) => T;
  6636. transformClientToPageSpace: <T extends Rect | Point>(rectOrPoint: T, pageIndex: number) => T;
  6637. transformPageToClientSpace: <T extends Rect | Point>(rectOrPoint: T, pageIndex: number) => T;
  6638. transformRawToPageSpace: (rawInset: InsetJSON | Inset, pageIndex: number) => Rect;
  6639. transformPageToRawSpace: (rect: Rect, pageIndex: number) => Inset;
  6640. exportOffice: (options: ExportOfficeFlags) => Promise<ArrayBuffer>;
  6641. exportPDF: (flags?: ExportPDFFlags) => Promise<ArrayBuffer>;
  6642. exportXFDF: () => Promise<string>;
  6643. exportInstantJSON: (version?: number) => Promise<InstantJSON>;
  6644. renderPageAsArrayBuffer: (options: {
  6645. width: number;
  6646. } | {
  6647. height: number;
  6648. }, pageIndex: number) => Promise<ArrayBuffer>;
  6649. renderPageAsImageURL: (options: {
  6650. width: number;
  6651. } | {
  6652. height: number;
  6653. }, pageIndex: number) => Promise<string>;
  6654. print: (printMode?: IPrintMode | {
  6655. mode?: IPrintMode;
  6656. excludeAnnotations?: boolean;
  6657. }) => void;
  6658. abortPrint: () => void;
  6659. setCustomRenderers: (customRenderers: CustomRenderers) => void;
  6660. setCustomUIConfiguration: (customUIConfigurationOrConfigurationSetter: CustomUI | ((customUI: CustomUI | null) => CustomUI)) => void;
  6661. getDocumentOutline: () => Promise<List<OutlineElement>>;
  6662. setDocumentOutline: (outline: List<OutlineElement>) => void;
  6663. getPageGlyphs: (pageIndex: number) => Promise<List<Glyph>>;
  6664. setAnnotationCreatorName: (annotationCreatorName?: string | null) => void;
  6665. setOnWidgetAnnotationCreationStart: (callback: OnWidgetAnnotationCreationStartCallback) => void;
  6666. setOnCommentCreationStart: (callback: OnCommentCreationStartCallback) => void;
  6667. getLayers: () => Promise<OCGLayers>;
  6668. getLayersVisibilityState: () => Promise<OCGLayersVisibilityState>;
  6669. setLayersVisibilityState: (visibilityState: OCGLayersVisibilityState) => Promise<void>;
  6670. contentWindow: Window;
  6671. contentDocument: Document | ShadowRoot;
  6672. readonly viewState: ViewState;
  6673. setViewState: (stateOrFunction: ViewStateSetter | ViewState) => void;
  6674. readonly toolbarItems: ToolbarItem[];
  6675. setToolbarItems: (stateOrFunction: ToolbarItemsSetter | ToolbarItem[]) => void;
  6676. setAnnotationToolbarItems: (annotationToolbarItemsCallback: AnnotationToolbarItemsCallback) => void;
  6677. setInlineTextSelectionToolbarItems: (InlineTextSelectionToolbarItemsCallback: InlineTextSelectionToolbarItemsCallback) => void;
  6678. annotationPresets: Record<AnnotationPresetID$1, AnnotationPreset$1>;
  6679. setAnnotationPresets: (stateOrFunction: AnnotationPresetsSetter | Record<AnnotationPresetID$1, AnnotationPreset$1>) => void;
  6680. setCurrentAnnotationPreset: (annotationPresetID?: string | null) => void;
  6681. readonly currentAnnotationPreset: string | null | undefined;
  6682. readonly stampAnnotationTemplates: Array<StampAnnotation | ImageAnnotation>;
  6683. setStampAnnotationTemplates: (stateOrFunction: StampAnnotationTemplatesSetter | Array<StampAnnotation | ImageAnnotation>) => void;
  6684. getAnnotations: (pageIndex: number) => Promise<List<AnnotationsUnion>>;
  6685. createAttachment: (file: Blob) => Promise<string>;
  6686. getAttachment: (attachmentId: string) => Promise<Blob>;
  6687. calculateFittingTextAnnotationBoundingBox: (annotation: TextAnnotation) => TextAnnotation;
  6688. setOnAnnotationResizeStart: (callback: AnnotationResizeStartCallback) => void;
  6689. getOverlappingAnnotations: (annotationOrFormField: AnnotationsUnion | FormField) => Promise<List<AnnotationsUnion>>;
  6690. getBookmarks: () => Promise<List<Bookmark>>;
  6691. getFormFields: () => Promise<List<FormField>>;
  6692. getFormFieldValues: () => Record<string, null | string | Array<string>>;
  6693. setFormFieldValues: (formFieldValues: Record<string, null | string | Array<string>>) => void;
  6694. getTextSelection: () => Record<string, any> | null | undefined;
  6695. getSelectedAnnotation: () => AnnotationsUnion | null | undefined;
  6696. getSelectedAnnotations: () => List<AnnotationsUnion> | null | undefined;
  6697. getAnnotationsGroups: () => Map$1<string, {
  6698. groupKey: string;
  6699. annotationsIds: Set$1<ID>;
  6700. }> | null | undefined;
  6701. setSelectedAnnotation: (annotationOrAnnotationId?: (AnnotationsUnion | ID) | null) => void;
  6702. setSelectedAnnotations: (annotationsOrAnnotationsId?: List<AnnotationsUnion | ID> | null) => void;
  6703. groupAnnotations: (annotationsOrAnnotationsId?: List<AnnotationsUnion | ID>) => void;
  6704. deleteAnnotationsGroup: (annotationGroupId?: string) => void;
  6705. setEditingAnnotation: (annotationOrAnnotationId?: (AnnotationsUnion | ID) | null, autoSelectText?: boolean | null) => void;
  6706. setCustomOverlayItem: (item: CustomOverlayItem) => void;
  6707. removeCustomOverlayItem: (id: CustomOverlayItemID) => void;
  6708. readonly locale: string;
  6709. setLocale: (arg0: string) => Promise<void>;
  6710. getInkSignatures: () => Promise<List<InkAnnotation | ImageAnnotation>>;
  6711. getStoredSignatures: () => Promise<List<InkAnnotation | ImageAnnotation>>;
  6712. setInkSignatures: (stateOrFunction: StoredSignaturesSetter | List<InkAnnotation | ImageAnnotation>) => Promise<void>;
  6713. setStoredSignatures: (stateOrFunction: StoredSignaturesSetter | List<InkAnnotation | ImageAnnotation>) => Promise<void>;
  6714. search: (term: string, options?: {
  6715. startPageIndex?: number;
  6716. endPageIndex?: number;
  6717. searchType?: ISearchType;
  6718. searchInAnnotations?: boolean;
  6719. caseSensitive?: boolean;
  6720. }) => Promise<List<SearchResult>>;
  6721. startUISearch: (term: string) => void;
  6722. readonly searchState: SearchState;
  6723. setSearchState: (stateOrFunction: SearchStateSetter | SearchState) => void;
  6724. readonly editableAnnotationTypes: Array<Class<AnnotationsUnion>>;
  6725. setEditableAnnotationTypes: (arg0: Array<Class<AnnotationsUnion>>) => void;
  6726. setIsEditableAnnotation: (arg0: IsEditableAnnotationCallback) => void;
  6727. setIsEditableComment: (arg0: IsEditableCommentCallback) => void;
  6728. setGroup: (group: string) => void;
  6729. resetGroup: () => void;
  6730. setMentionableUsers: (users: MentionableUser$1[]) => void;
  6731. setMaxMentionSuggestions: (maxSuggestions: number) => void;
  6732. getComments: () => Promise<List<Comment$1>>;
  6733. setDocumentEditorFooterItems: (stateOrFunction: DocumentEditorFooterItem[] | SetDocumentEditorFooterFunction) => void;
  6734. setDocumentEditorToolbarItems: (stateOrFunction: DocumentEditorToolbarItem[] | SetDocumentEditorToolbarFunction) => void;
  6735. getSignaturesInfo: () => Promise<SignaturesInfo>;
  6736. signDocument: (arg0: SignatureCreationData | null, arg1?: TwoStepSignatureCallback | SigningServiceData) => Promise<void>;
  6737. setSignaturesLTV: (certificates?: ArrayBuffer[] | string[]) => Promise<SignaturesInfo>;
  6738. applyOperations: (operations: Array<DocumentOperation>) => Promise<void>;
  6739. exportPDFWithOperations: (arg0: Array<DocumentOperation>) => Promise<ArrayBuffer>;
  6740. applyRedactions: () => Promise<void>;
  6741. save: () => Promise<void>;
  6742. hasUnsavedChanges: () => boolean;
  6743. ensureChangesSaved: (changes: Change | Array<Change>) => Promise<Array<Change>>;
  6744. create: (changes: Change | Array<Change> | List<Change>) => Promise<Array<Change>>;
  6745. update: (changes: Change | Array<Change> | List<Change>) => Promise<Array<Change>>;
  6746. delete: (ids: InstantID | Change | Array<InstantID | Change> | List<InstantID | Change>) => Promise<Array<Change>>;
  6747. toggleClipboardActions: (enable: boolean) => void;
  6748. setMeasurementSnapping: (enable: boolean) => void;
  6749. setMeasurementPrecision: (precision: IMeasurementPrecision) => void;
  6750. setMeasurementScale: (scale: MeasurementScale) => void;
  6751. setMeasurementValueConfiguration: (configurationCallback: MeasurementValueConfigurationCallback) => void;
  6752. createRedactionsBySearch: (term: string | ISearchPattern, options?: {
  6753. searchType?: ISearchType;
  6754. searchInAnnotations?: boolean;
  6755. caseSensitive?: boolean;
  6756. annotationPreset?: RedactionAnnotationPreset;
  6757. }) => Promise<List<string>>;
  6758. history: {
  6759. undo: () => Promise<boolean>;
  6760. redo: () => Promise<boolean>;
  6761. clear: () => void;
  6762. enable: () => void;
  6763. disable: () => void;
  6764. canUndo: () => boolean;
  6765. canRedo: () => boolean;
  6766. };
  6767. setDocumentComparisonMode: (documentComparisonConfiguration: DocumentComparisonConfiguration | null) => void;
  6768. compareDocuments: (comparisonDocuments: ComparisonDocuments, operations: ComparisonOperation) => Promise<DocumentComparisonResult>;
  6769. getEmbeddedFiles: () => Promise<List<EmbeddedFile>>;
  6770. getPageTabOrder: (pageIndex: number) => Promise<ID[]>;
  6771. setPageTabOrder: (pageIndex: number, annotationIdsSortCallback: (tabOrderedAnnotations: AnnotationsUnion[]) => ID[]) => Promise<void>;
  6772. enableAlwaysScrollToZoom: boolean;
  6773. }
  6774. type ComparisonDocuments = {
  6775. originalDocument: DocumentDescriptor;
  6776. changedDocument: DocumentDescriptor;
  6777. };
  6778. type Range = {
  6779. position: number;
  6780. length: number;
  6781. };
  6782. type TextBlock = {
  6783. range: Range;
  6784. rects: number[][];
  6785. };
  6786. type Operation = {
  6787. type: 'insert' | 'delete' | 'equal';
  6788. text: string;
  6789. originalTextBlocks: TextBlock;
  6790. changedTextBlocks: TextBlock;
  6791. };
  6792. type Hunk = {
  6793. originalRange: Range;
  6794. changedRange: Range;
  6795. operations: Operation[];
  6796. };
  6797. type ComparisonResult = {
  6798. type: 'text';
  6799. hunks: Hunk[];
  6800. };
  6801. type PageComparisonResult = {
  6802. originalPageIndex: number;
  6803. changedPageIndex: number;
  6804. comparisonResults: ComparisonResult[];
  6805. };
  6806. type DocumentComparisonResult = {
  6807. documentComparisonResults: PageComparisonResult[];
  6808. } | null;
  6809. declare const ProductId: {
  6810. SharePoint: string;
  6811. Salesforce: string;
  6812. Maui_Android: string;
  6813. Maui_iOS: string;
  6814. Maui_MacCatalyst: string;
  6815. Maui_Windows: string;
  6816. FlutterForWeb: string;
  6817. Electron: string;
  6818. };
  6819. type IProductId = (typeof ProductId)[keyof typeof ProductId];
  6820. type ActionFlags = 'includeExclude' | 'includeNoValueFields' | 'exportFormat' | 'getMethod' | 'submitCoordinated' | 'xfdf' | 'includeAppendSaves' | 'includeAnnotations' | 'submitPDF' | 'canonicalFormat' | 'excludeNonUserAnnotations' | 'excludeFKey' | 'embedForm';
  6821. type ActionJSON = {
  6822. type: 'uri';
  6823. uri: string;
  6824. subactions?: Array<ActionJSON>;
  6825. } | {
  6826. type: 'goTo';
  6827. pageIndex: number;
  6828. subactions?: Array<ActionJSON>;
  6829. } | {
  6830. type: 'goToEmbedded';
  6831. newWindow: boolean;
  6832. relativePath: string;
  6833. targetType: 'parent' | 'child';
  6834. subactions?: Array<ActionJSON>;
  6835. } | {
  6836. type: 'goToRemote';
  6837. relativePath: string;
  6838. namedDestination: string;
  6839. subactions?: Array<ActionJSON>;
  6840. } | {
  6841. type: 'hide';
  6842. hide: boolean;
  6843. annotationReferences: Array<AnnotationReference>;
  6844. subactions?: Array<ActionJSON>;
  6845. } | {
  6846. type: 'resetForm';
  6847. fields: Array<string> | null;
  6848. flags: string | null;
  6849. subactions?: Array<ActionJSON>;
  6850. } | {
  6851. type: 'submitForm';
  6852. uri: string;
  6853. fields: Array<string> | null;
  6854. flags: Array<ActionFlags> | null;
  6855. subactions?: Array<ActionJSON>;
  6856. } | {
  6857. type: 'launch';
  6858. filePath: string;
  6859. subactions?: Array<ActionJSON>;
  6860. } | {
  6861. type: 'named';
  6862. action: string;
  6863. subactions?: Array<ActionJSON>;
  6864. } | {
  6865. type: 'javaScript';
  6866. script: string;
  6867. subactions?: Array<ActionJSON>;
  6868. };
  6869. type BookmarkJSON = {
  6870. v: 1;
  6871. type: 'pspdfkit/bookmark';
  6872. id: string;
  6873. name: string | null;
  6874. sortKey: number | null;
  6875. action: ActionJSON;
  6876. pdfBookmarkId: string | null;
  6877. };
  6878. type RawPdfBoxes = {
  6879. bleedBox: null | IRectJSON;
  6880. cropBox: null | IRectJSON;
  6881. mediaBox: null | IRectJSON;
  6882. trimBox: null | IRectJSON;
  6883. };
  6884. type IRectJSON = [left: number, top: number, width: number, height: number];
  6885. type BaseAnnotationJSON = {
  6886. v: number;
  6887. 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';
  6888. name?: string | null;
  6889. id: string;
  6890. subject?: string | null;
  6891. pdfObjectId?: number | null;
  6892. pageIndex: number;
  6893. bbox: IRectJSON;
  6894. opacity?: number;
  6895. flags?: ('noPrint' | 'noZoom' | 'noRotate' | 'noView' | 'hidden' | 'locked' | 'lockedContents' | 'readOnly')[] | null;
  6896. action?: ActionJSON | null;
  6897. note?: string | null;
  6898. createdAt?: string | Date;
  6899. updatedAt?: string | Date;
  6900. creatorName?: string | null;
  6901. customData?: Record<string, unknown> | null;
  6902. isCommentThreadRoot?: boolean;
  6903. isAnonymous?: boolean;
  6904. APStreamCache?: {
  6905. cache: string;
  6906. } | {
  6907. attach: string;
  6908. };
  6909. blendMode?: IBlendMode | null;
  6910. } & ICollaboratorPermissionsOptions;
  6911. type ImageAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
  6912. type: 'pspdfkit/image';
  6913. description?: string | null;
  6914. fileName?: string | null;
  6915. contentType: string;
  6916. imageAttachmentId: string;
  6917. rotation: number;
  6918. isSignature?: boolean;
  6919. xfdfAppearanceStream?: string;
  6920. xfdfAppearanceStreamOriginalPageRotation?: number;
  6921. };
  6922. type ShapeAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
  6923. strokeWidth: number;
  6924. strokeColor: string | null;
  6925. fillColor: string | null;
  6926. strokeDashArray?: [number, number] | null;
  6927. measurementPrecision?: IMeasurementPrecision | null;
  6928. measurementScale?: MeasurementScaleJSON | null;
  6929. lineWidth?: number | null;
  6930. };
  6931. type EllipseAnnotationJSON = ShapeAnnotationJSON & {
  6932. type: 'pspdfkit/shape/ellipse';
  6933. cloudyBorderIntensity: number | null;
  6934. cloudyBorderInset: InsetJSON | null;
  6935. measurementBBox: IRectJSON | null;
  6936. };
  6937. type LineAnnotationJSON = ShapeAnnotationJSON & {
  6938. type: 'pspdfkit/shape/line';
  6939. startPoint: [number, number];
  6940. endPoint: [number, number];
  6941. lineCaps?: LineCapsType | null;
  6942. lines?: {
  6943. points: [number, number][][];
  6944. intensities: number[][];
  6945. };
  6946. };
  6947. type PolygonAnnotationJSON = ShapeAnnotationJSON & {
  6948. type: 'pspdfkit/shape/polygon';
  6949. points: [number, number][];
  6950. cloudyBorderIntensity: number | null;
  6951. lines?: {
  6952. points: [number, number][][];
  6953. intensities: number[][];
  6954. };
  6955. };
  6956. type PolylineAnnotationJSON = ShapeAnnotationJSON & {
  6957. type: 'pspdfkit/shape/polyline';
  6958. points: [number, number][];
  6959. lineCaps?: LineCapsType | null;
  6960. lines?: {
  6961. points: [number, number][][];
  6962. intensities: number[][];
  6963. };
  6964. };
  6965. type RectangleAnnotationJSON = ShapeAnnotationJSON & {
  6966. type: 'pspdfkit/shape/rectangle';
  6967. cloudyBorderIntensity: number | null;
  6968. cloudyBorderInset?: InsetJSON | null;
  6969. measurementBBox: IRectJSON | null;
  6970. };
  6971. type InkAnnotationJSON = BaseAnnotationJSON & {
  6972. type: 'pspdfkit/ink';
  6973. lines: {
  6974. points: [number, number][][];
  6975. intensities: number[][];
  6976. };
  6977. lineWidth: number;
  6978. strokeColor: string | null;
  6979. backgroundColor: string | null;
  6980. isDrawnNaturally: boolean;
  6981. isSignature: boolean;
  6982. };
  6983. type LinkAnnotationJSON = BaseAnnotationJSON & {
  6984. type: 'pspdfkit/link';
  6985. borderColor?: string | null;
  6986. borderWidth?: number | null;
  6987. borderStyle?: IBorderStyle | null;
  6988. };
  6989. type NoteAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
  6990. type: 'pspdfkit/note';
  6991. text?: {
  6992. format: 'plain';
  6993. value: string;
  6994. };
  6995. icon?: string;
  6996. color?: string;
  6997. };
  6998. type MediaAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
  6999. type: 'pspdfkit/media';
  7000. description: string | null;
  7001. fileName: string | null;
  7002. contentType: string | null;
  7003. mediaAttachmentId: string | null;
  7004. };
  7005. type BaseTextMarkupAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
  7006. rects: [number, number, number, number][];
  7007. };
  7008. type TextMarkupAnnotationJSON = BaseTextMarkupAnnotationJSON & {
  7009. type: 'pspdfkit/markup/highlight' | 'pspdfkit/markup/squiggly' | 'pspdfkit/markup/strikeout' | 'pspdfkit/markup/underline' | 'pspdfkit/markup/redaction';
  7010. color: string | null;
  7011. };
  7012. type RedactionAnnotationJSON = BaseTextMarkupAnnotationJSON & {
  7013. type: 'pspdfkit/markup/redaction';
  7014. fillColor?: string | null;
  7015. outlineColor?: string | null;
  7016. overlayText?: string | null;
  7017. repeatOverlayText?: boolean | null;
  7018. rotation?: number;
  7019. color?: string | null;
  7020. };
  7021. type StampAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
  7022. type: 'pspdfkit/stamp';
  7023. stampType: StampKind;
  7024. title: string | null;
  7025. color?: string | null;
  7026. subTitle?: string | null;
  7027. subtitle: string | null;
  7028. rotation: number | null;
  7029. xfdfAppearanceStream?: string;
  7030. xfdfAppearanceStreamOriginalPageRotation?: number;
  7031. kind?: StampKind;
  7032. };
  7033. type TextAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
  7034. type: 'pspdfkit/text';
  7035. text: {
  7036. format: 'xhtml' | 'plain';
  7037. value: string;
  7038. };
  7039. fontColor?: string | null;
  7040. backgroundColor?: string | null;
  7041. font?: string | null;
  7042. rotation?: number | null;
  7043. fontSize?: number | null;
  7044. fontStyle?: string[] | null;
  7045. horizontalAlign?: 'left' | 'center' | 'right';
  7046. verticalAlign?: 'top' | 'center' | 'bottom';
  7047. callout?: {
  7048. start: [number, number];
  7049. knee?: [number, number] | null;
  7050. end: [number, number];
  7051. cap?: ILineCap | null;
  7052. innerRectInset?: InsetJSON | null;
  7053. } | null;
  7054. borderStyle?: IBorderStyle | null;
  7055. borderWidth?: number | null;
  7056. borderColor?: string | null;
  7057. isFitting?: boolean;
  7058. lineHeightFactor?: number | null;
  7059. };
  7060. type UnknownAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
  7061. type: 'pspdfkit/unknown';
  7062. };
  7063. type WidgetAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
  7064. type: 'pspdfkit/widget';
  7065. formFieldName: string;
  7066. borderColor?: string | null;
  7067. borderStyle?: IBorderStyle | null;
  7068. borderDashArray?: number[] | null;
  7069. borderWidth?: number | null;
  7070. font?: string | null;
  7071. fontSize?: 'auto' | number | null;
  7072. fontColor?: string | null;
  7073. backgroundColor?: string | null;
  7074. horizontalAlign?: 'left' | 'center' | 'right' | null;
  7075. verticalAlign?: 'top' | 'center' | 'bottom' | null;
  7076. fontStyle?: string[] | null | undefined;
  7077. rotation?: number;
  7078. additionalActions?: SerializedAdditionalActionsType | null;
  7079. lineHeightFactor?: number | null;
  7080. };
  7081. type CommentMarkerAnnotationJSON = Omit<BaseAnnotationJSON, 'type'> & {
  7082. type: 'pspdfkit/comment-marker';
  7083. };
  7084. type AnnotationJSONUnion = TextMarkupAnnotationJSON | TextAnnotationJSON | WidgetAnnotationJSON | RedactionAnnotationJSON | StampAnnotationJSON | NoteAnnotationJSON | LinkAnnotationJSON | InkAnnotationJSON | RectangleAnnotationJSON | PolylineAnnotationJSON | PolygonAnnotationJSON | LineAnnotationJSON | EllipseAnnotationJSON | ImageAnnotationJSON | UnknownAnnotationJSON | MediaAnnotationJSON | CommentMarkerAnnotationJSON;
  7085. declare const Theme$1: {
  7086. readonly LIGHT: "LIGHT";
  7087. readonly DARK: "DARK";
  7088. readonly AUTO: "AUTO";
  7089. };
  7090. type ITheme = (typeof Theme$1)[keyof typeof Theme$1];
  7091. interface ResolvedDateTimeFormatOptions extends Intl.ResolvedDateTimeFormatOptions {
  7092. hourCycle?: Intl.DateTimeFormatOptions['hourCycle'];
  7093. }
  7094. interface DateRangeFormatPart extends Intl.DateTimeFormatPart {
  7095. source: 'startRange' | 'endRange' | 'shared';
  7096. }
  7097. /** A wrapper around Intl.DateTimeFormat that fixes various browser bugs, and polyfills new features. */
  7098. declare class DateFormatter implements Intl.DateTimeFormat {
  7099. constructor(locale: string, options?: Intl.DateTimeFormatOptions);
  7100. /** Formats a date as a string according to the locale and format options passed to the constructor. */
  7101. format(value: Date): string;
  7102. /** Formats a date to an array of parts such as separators, numbers, punctuation, and more. */
  7103. formatToParts(value: Date): Intl.DateTimeFormatPart[];
  7104. /** Formats a date range as a string. */
  7105. formatRange(start: Date, end: Date): string;
  7106. /** Formats a date range as an array of parts. */
  7107. formatRangeToParts(start: Date, end: Date): DateRangeFormatPart[];
  7108. /** Returns the resolved formatting options based on the values passed to the constructor. */
  7109. resolvedOptions(): ResolvedDateTimeFormatOptions;
  7110. }
  7111. /*
  7112. * Copyright 2020 Adobe. All rights reserved.
  7113. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  7114. * you may not use this file except in compliance with the License. You may obtain a copy
  7115. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  7116. *
  7117. * Unless required by applicable law or agreed to in writing, software distributed under
  7118. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  7119. * OF ANY KIND, either express or implied. See the License for the specific language
  7120. * governing permissions and limitations under the License.
  7121. */
  7122. interface AriaLabelingProps$1 {
  7123. /**
  7124. * Defines a string value that labels the current element.
  7125. */
  7126. 'aria-label'?: string,
  7127. /**
  7128. * Identifies the element (or elements) that labels the current element.
  7129. */
  7130. 'aria-labelledby'?: string,
  7131. /**
  7132. * Identifies the element (or elements) that describes the object.
  7133. */
  7134. 'aria-describedby'?: string,
  7135. /**
  7136. * Identifies the element (or elements) that provide a detailed, extended description for the object.
  7137. */
  7138. 'aria-details'?: string
  7139. }
  7140. interface AriaValidationProps {
  7141. // https://www.w3.org/TR/wai-aria-1.2/#aria-errormessage
  7142. /**
  7143. * Identifies the element that provides an error message for the object.
  7144. */
  7145. 'aria-errormessage'?: string
  7146. }
  7147. // A set of common DOM props that are allowed on any component
  7148. // Ensure this is synced with DOMPropNames in filterDOMProps
  7149. interface DOMProps {
  7150. /**
  7151. * The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
  7152. */
  7153. id?: string
  7154. }
  7155. interface FocusableDOMProps extends DOMProps {
  7156. /**
  7157. * Whether to exclude the element from the sequential tab order. If true,
  7158. * the element will not be focusable via the keyboard by tabbing. This should
  7159. * be avoided except in rare scenarios where an alternative means of accessing
  7160. * the element or its functionality via the keyboard is available.
  7161. */
  7162. excludeFromTabOrder?: boolean
  7163. }
  7164. interface TextInputDOMEvents {
  7165. // Clipboard events
  7166. /**
  7167. * Handler that is called when the user copies text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncopy).
  7168. */
  7169. onCopy?: ClipboardEventHandler<HTMLInputElement>,
  7170. /**
  7171. * Handler that is called when the user cuts text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncut).
  7172. */
  7173. onCut?: ClipboardEventHandler<HTMLInputElement>,
  7174. /**
  7175. * Handler that is called when the user pastes text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/onpaste).
  7176. */
  7177. onPaste?: ClipboardEventHandler<HTMLInputElement>,
  7178. // Composition events
  7179. /**
  7180. * 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).
  7181. */
  7182. onCompositionStart?: CompositionEventHandler<HTMLInputElement>,
  7183. /**
  7184. * 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).
  7185. */
  7186. onCompositionEnd?: CompositionEventHandler<HTMLInputElement>,
  7187. /**
  7188. * 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).
  7189. */
  7190. onCompositionUpdate?: CompositionEventHandler<HTMLInputElement>,
  7191. // Selection events
  7192. /**
  7193. * 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).
  7194. */
  7195. onSelect?: ReactEventHandler<HTMLInputElement>,
  7196. // Input events
  7197. /**
  7198. * 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).
  7199. */
  7200. onBeforeInput?: FormEventHandler<HTMLInputElement>,
  7201. /**
  7202. * Handler that is called when the input value is modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event).
  7203. */
  7204. onInput?: FormEventHandler<HTMLInputElement>
  7205. }
  7206. interface InputDOMProps {
  7207. /**
  7208. * 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).
  7209. */
  7210. name?: string
  7211. }
  7212. // DOM props that apply to all text inputs
  7213. // Ensure this is synced with useTextField
  7214. interface TextInputDOMProps extends DOMProps, InputDOMProps, TextInputDOMEvents {
  7215. /**
  7216. * 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).
  7217. */
  7218. autoComplete?: string,
  7219. /**
  7220. * The maximum number of characters supported by the input. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefmaxlength).
  7221. */
  7222. maxLength?: number,
  7223. /**
  7224. * The minimum number of characters required by the input. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefminlength).
  7225. */
  7226. minLength?: number,
  7227. /**
  7228. * 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).
  7229. */
  7230. pattern?: string,
  7231. /**
  7232. * Content that appears in the input when it is empty. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefplaceholder).
  7233. */
  7234. placeholder?: string,
  7235. /**
  7236. * The type of input to render. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdeftype).
  7237. */
  7238. type?: 'text' | 'search' | 'url' | 'tel' | 'email' | 'password' | (string & {}),
  7239. /**
  7240. * 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).
  7241. */
  7242. inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'
  7243. }
  7244. // Make sure to update filterDOMProps.ts when updating this.
  7245. interface LinkDOMProps {
  7246. /** A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href). */
  7247. href?: string,
  7248. /** The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target). */
  7249. target?: HTMLAttributeAnchorTarget,
  7250. /** The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel). */
  7251. rel?: string,
  7252. /** 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). */
  7253. download?: boolean | string,
  7254. /** 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). */
  7255. ping?: string,
  7256. /** 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). */
  7257. referrerPolicy?: HTMLAttributeReferrerPolicy
  7258. }
  7259. /** Any focusable element, including both HTML and SVG elements. */
  7260. interface FocusableElement extends Element, HTMLOrSVGElement {}
  7261. /** All DOM attributes supported across both HTML and SVG elements. */
  7262. interface DOMAttributes<T = FocusableElement> extends AriaAttributes, DOMAttributes$1<T> {
  7263. id?: string | undefined,
  7264. role?: AriaRole | undefined,
  7265. tabIndex?: number | undefined,
  7266. style?: CSSProperties | undefined,
  7267. className?: string | undefined
  7268. }
  7269. /*
  7270. * Copyright 2020 Adobe. All rights reserved.
  7271. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  7272. * you may not use this file except in compliance with the License. You may obtain a copy
  7273. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  7274. *
  7275. * Unless required by applicable law or agreed to in writing, software distributed under
  7276. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  7277. * OF ANY KIND, either express or implied. See the License for the specific language
  7278. * governing permissions and limitations under the License.
  7279. */
  7280. type ValidationState = 'valid' | 'invalid';
  7281. type ValidationError = string | string[];
  7282. interface Validation<T> {
  7283. /** Whether user input is required on the input before form submission. */
  7284. isRequired?: boolean,
  7285. /** Whether the input value is invalid. */
  7286. isInvalid?: boolean,
  7287. /** @deprecated Use `isInvalid` instead. */
  7288. validationState?: ValidationState,
  7289. /**
  7290. * Whether to use native HTML form validation to prevent form submission
  7291. * when the value is missing or invalid, or mark the field as required
  7292. * or invalid via ARIA.
  7293. * @default 'aria'
  7294. */
  7295. validationBehavior?: 'aria' | 'native',
  7296. /**
  7297. * A function that returns an error message if a given value is invalid.
  7298. * Validation errors are displayed to the user when the form is submitted
  7299. * if `validationBehavior="native"`. For realtime validation, use the `isInvalid`
  7300. * prop instead.
  7301. */
  7302. validate?: (value: T) => ValidationError | true | null | undefined
  7303. }
  7304. interface ValidationResult {
  7305. /** Whether the input value is invalid. */
  7306. isInvalid: boolean,
  7307. /** The current error messages for the input if it is invalid, otherwise an empty array. */
  7308. validationErrors: string[],
  7309. /** The native validation details for the input. */
  7310. validationDetails: ValidityState
  7311. }
  7312. interface InputBase {
  7313. /** Whether the input is disabled. */
  7314. isDisabled?: boolean,
  7315. /** Whether the input can be selected but not changed by the user. */
  7316. isReadOnly?: boolean
  7317. }
  7318. interface ValueBase<T, C = T> {
  7319. /** The current value (controlled). */
  7320. value?: T,
  7321. /** The default value (uncontrolled). */
  7322. defaultValue?: T,
  7323. /** Handler that is called when the value changes. */
  7324. onChange?: (value: C) => void
  7325. }
  7326. interface TextInputBase {
  7327. /** Temporary text that occupies the text input when it is empty. */
  7328. placeholder?: string
  7329. }
  7330. interface RangeInputBase<T> {
  7331. /** The smallest value allowed for the input. */
  7332. minValue?: T,
  7333. /** The largest value allowed for the input. */
  7334. maxValue?: T,
  7335. /** The amount that the input value changes with each increment or decrement "tick". */
  7336. step?: T // ??
  7337. }
  7338. interface HelpTextProps {
  7339. /** A description for the field. Provides a hint such as specific requirements for what to choose. */
  7340. description?: ReactNode,
  7341. /** An error message for the field. */
  7342. errorMessage?: ReactNode | ((v: ValidationResult) => ReactNode)
  7343. }
  7344. /*
  7345. * Copyright 2020 Adobe. All rights reserved.
  7346. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  7347. * you may not use this file except in compliance with the License. You may obtain a copy
  7348. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  7349. *
  7350. * Unless required by applicable law or agreed to in writing, software distributed under
  7351. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  7352. * OF ANY KIND, either express or implied. See the License for the specific language
  7353. * governing permissions and limitations under the License.
  7354. */
  7355. interface SingleSelection {
  7356. /** Whether the collection allows empty selection. */
  7357. disallowEmptySelection?: boolean,
  7358. /** The currently selected key in the collection (controlled). */
  7359. selectedKey?: Key$1 | null,
  7360. /** The initial selected key in the collection (uncontrolled). */
  7361. defaultSelectedKey?: Key$1,
  7362. /** Handler that is called when the selection changes. */
  7363. onSelectionChange?: (key: Key$1) => any
  7364. }
  7365. type SelectionMode = 'none' | 'single' | 'multiple';
  7366. type SelectionBehavior = 'toggle' | 'replace';
  7367. type Selection$1 = 'all' | Set<Key$1>;
  7368. interface MultipleSelection {
  7369. /** The type of selection that is allowed in the collection. */
  7370. selectionMode?: SelectionMode,
  7371. /** Whether the collection allows empty selection. */
  7372. disallowEmptySelection?: boolean,
  7373. /** The currently selected keys in the collection (controlled). */
  7374. selectedKeys?: 'all' | Iterable<Key$1>,
  7375. /** The initial selected keys in the collection (uncontrolled). */
  7376. defaultSelectedKeys?: 'all' | Iterable<Key$1>,
  7377. /** Handler that is called when the selection changes. */
  7378. onSelectionChange?: (keys: Selection$1) => any,
  7379. /** The currently disabled keys in the collection (controlled). */
  7380. disabledKeys?: Iterable<Key$1>
  7381. }
  7382. type FocusStrategy = 'first' | 'last';
  7383. type DisabledBehavior = 'selection' | 'all';
  7384. /*
  7385. * Copyright 2020 Adobe. All rights reserved.
  7386. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  7387. * you may not use this file except in compliance with the License. You may obtain a copy
  7388. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  7389. *
  7390. * Unless required by applicable law or agreed to in writing, software distributed under
  7391. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  7392. * OF ANY KIND, either express or implied. See the License for the specific language
  7393. * governing permissions and limitations under the License.
  7394. */
  7395. interface DragDropEvent {
  7396. /** The x coordinate of the event, relative to the target element. */
  7397. x: number,
  7398. /** The y coordinate of the event, relative to the target element. */
  7399. y: number
  7400. }
  7401. type DropOperation = 'copy' | 'link' | 'move' | 'cancel';
  7402. interface DragItem {
  7403. [type: string]: string
  7404. }
  7405. interface DragStartEvent extends DragDropEvent {
  7406. /** The event type. */
  7407. type: 'dragstart'
  7408. }
  7409. interface DragMoveEvent extends DragDropEvent {
  7410. /** The event type. */
  7411. type: 'dragmove'
  7412. }
  7413. interface DragEndEvent extends DragDropEvent {
  7414. /** The event type. */
  7415. type: 'dragend',
  7416. /** The drop operation that occurred. */
  7417. dropOperation: DropOperation
  7418. }
  7419. interface DropEnterEvent extends DragDropEvent {
  7420. /** The event type. */
  7421. type: 'dropenter'
  7422. }
  7423. interface DropMoveEvent extends DragDropEvent {
  7424. /** The event type. */
  7425. type: 'dropmove'
  7426. }
  7427. interface DropActivateEvent extends DragDropEvent {
  7428. /** The event type. */
  7429. type: 'dropactivate'
  7430. }
  7431. interface DropExitEvent extends DragDropEvent {
  7432. /** The event type. */
  7433. type: 'dropexit'
  7434. }
  7435. interface TextDropItem {
  7436. /** The item kind. */
  7437. kind: 'text',
  7438. /**
  7439. * The drag types available for this item.
  7440. * These are often mime types, but may be custom app-specific types.
  7441. */
  7442. types: Set<string>,
  7443. /** Returns the data for the given type as a string. */
  7444. getText(type: string): Promise<string>
  7445. }
  7446. interface FileDropItem {
  7447. /** The item kind. */
  7448. kind: 'file',
  7449. /** The file type (usually a mime type). */
  7450. type: string,
  7451. /** The file name. */
  7452. name: string,
  7453. /** Returns the contents of the file as a blob. */
  7454. getFile(): Promise<File>,
  7455. /** Returns the contents of the file as a string. */
  7456. getText(): Promise<string>
  7457. }
  7458. interface DirectoryDropItem {
  7459. /** The item kind. */
  7460. kind: 'directory',
  7461. /** The directory name. */
  7462. name: string,
  7463. /** Returns the entries contained within the directory. */
  7464. getEntries(): AsyncIterable<FileDropItem | DirectoryDropItem>
  7465. }
  7466. type DropItem = TextDropItem | FileDropItem | DirectoryDropItem;
  7467. interface DropEvent extends DragDropEvent {
  7468. /** The event type. */
  7469. type: 'drop',
  7470. /** The drop operation that should occur. */
  7471. dropOperation: DropOperation,
  7472. /** The dropped items. */
  7473. items: DropItem[]
  7474. }
  7475. type DropPosition = 'on' | 'before' | 'after';
  7476. interface RootDropTarget {
  7477. /** The event type. */
  7478. type: 'root'
  7479. }
  7480. interface ItemDropTarget {
  7481. /** The drop target type. */
  7482. type: 'item',
  7483. /** The item key. */
  7484. key: Key$1,
  7485. /** The drop position relative to the item. */
  7486. dropPosition: DropPosition
  7487. }
  7488. type DropTarget = RootDropTarget | ItemDropTarget;
  7489. interface DroppableCollectionEnterEvent extends DropEnterEvent {
  7490. /** The drop target. */
  7491. target: DropTarget
  7492. }
  7493. interface DroppableCollectionActivateEvent extends DropActivateEvent {
  7494. /** The drop target. */
  7495. target: DropTarget
  7496. }
  7497. interface DroppableCollectionExitEvent extends DropExitEvent {
  7498. /** The drop target. */
  7499. target: DropTarget
  7500. }
  7501. interface DroppableCollectionDropEvent extends DropEvent {
  7502. /** The drop target. */
  7503. target: DropTarget
  7504. }
  7505. interface DroppableCollectionInsertDropEvent {
  7506. /** The dropped items. */
  7507. items: DropItem[],
  7508. /** The drop operation that should occur. */
  7509. dropOperation: DropOperation,
  7510. /** The drop target. */
  7511. target: ItemDropTarget
  7512. }
  7513. interface DroppableCollectionRootDropEvent {
  7514. /** The dropped items. */
  7515. items: DropItem[],
  7516. /** The drop operation that should occur. */
  7517. dropOperation: DropOperation
  7518. }
  7519. interface DroppableCollectionOnItemDropEvent {
  7520. /** The dropped items. */
  7521. items: DropItem[],
  7522. /** The drop operation that should occur. */
  7523. dropOperation: DropOperation,
  7524. /** Whether the drag originated within the same collection as the drop. */
  7525. isInternal: boolean,
  7526. /** The drop target. */
  7527. target: ItemDropTarget
  7528. }
  7529. interface DroppableCollectionReorderEvent {
  7530. /** The keys of the items that were reordered. */
  7531. keys: Set<Key$1>,
  7532. /** The drop operation that should occur. */
  7533. dropOperation: DropOperation,
  7534. /** The drop target. */
  7535. target: ItemDropTarget
  7536. }
  7537. interface DragTypes {
  7538. /** Returns whether the drag contains data of the given type. */
  7539. has(type: string | symbol): boolean
  7540. }
  7541. interface DropTargetDelegate {
  7542. /**
  7543. * Returns a drop target within a collection for the given x and y coordinates.
  7544. * The point is provided relative to the top left corner of the collection container.
  7545. * A drop target can be checked to see if it is valid using the provided `isValidDropTarget` function.
  7546. */
  7547. getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget | null
  7548. }
  7549. interface DroppableCollectionUtilityOptions {
  7550. /**
  7551. * The drag types that the droppable collection accepts. If the collection accepts directories, include `DIRECTORY_DRAG_TYPE` in your array of allowed types.
  7552. * @default 'all'
  7553. */
  7554. acceptedDragTypes?: 'all' | Array<string | symbol>,
  7555. /**
  7556. * Handler that is called when external items are dropped "between" items.
  7557. */
  7558. onInsert?: (e: DroppableCollectionInsertDropEvent) => void,
  7559. /**
  7560. * Handler that is called when external items are dropped on the droppable collection's root.
  7561. */
  7562. onRootDrop?: (e: DroppableCollectionRootDropEvent) => void,
  7563. /**
  7564. * Handler that is called when items are dropped "on" an item.
  7565. */
  7566. onItemDrop?: (e: DroppableCollectionOnItemDropEvent) => void,
  7567. /**
  7568. * Handler that is called when items are reordered via drag in the source collection.
  7569. */
  7570. onReorder?: (e: DroppableCollectionReorderEvent) => void,
  7571. /**
  7572. * A function returning whether a given target in the droppable collection is a valid "on" drop target for the current drag types.
  7573. */
  7574. shouldAcceptItemDrop?: (target: ItemDropTarget, types: DragTypes) => boolean
  7575. }
  7576. interface DroppableCollectionBaseProps {
  7577. /** Handler that is called when a valid drag enters a drop target. */
  7578. onDropEnter?: (e: DroppableCollectionEnterEvent) => void,
  7579. /**
  7580. * Handler that is called after a valid drag is held over a drop target for a period of time.
  7581. * @private
  7582. */
  7583. onDropActivate?: (e: DroppableCollectionActivateEvent) => void,
  7584. /** Handler that is called when a valid drag exits a drop target. */
  7585. onDropExit?: (e: DroppableCollectionExitEvent) => void,
  7586. /**
  7587. * Handler that is called when a valid drag is dropped on a drop target. When defined, this overrides other
  7588. * drop handlers such as `onInsert`, and `onItemDrop`.
  7589. */
  7590. onDrop?: (e: DroppableCollectionDropEvent) => void,
  7591. /**
  7592. * A function returning the drop operation to be performed when items matching the given types are dropped
  7593. * on the drop target.
  7594. */
  7595. getDropOperation?: (target: DropTarget, types: DragTypes, allowedOperations: DropOperation[]) => DropOperation
  7596. }
  7597. interface DroppableCollectionProps extends DroppableCollectionUtilityOptions, DroppableCollectionBaseProps {}
  7598. interface DraggableCollectionStartEvent extends DragStartEvent {
  7599. /** The keys of the items that were dragged. */
  7600. keys: Set<Key$1>
  7601. }
  7602. interface DraggableCollectionMoveEvent extends DragMoveEvent {
  7603. /** The keys of the items that were dragged. */
  7604. keys: Set<Key$1>
  7605. }
  7606. interface DraggableCollectionEndEvent extends DragEndEvent {
  7607. /** The keys of the items that were dragged. */
  7608. keys: Set<Key$1>,
  7609. /** Whether the drop ended within the same collection as it originated. */
  7610. isInternal: boolean
  7611. }
  7612. type DragPreviewRenderer = (items: DragItem[], callback: (node: HTMLElement) => void) => void;
  7613. interface DraggableCollectionProps {
  7614. /** Handler that is called when a drag operation is started. */
  7615. onDragStart?: (e: DraggableCollectionStartEvent) => void,
  7616. /** Handler that is called when the drag is moved. */
  7617. onDragMove?: (e: DraggableCollectionMoveEvent) => void,
  7618. /** Handler that is called when the drag operation is ended, either as a result of a drop or a cancellation. */
  7619. onDragEnd?: (e: DraggableCollectionEndEvent) => void,
  7620. /** A function that returns the items being dragged. */
  7621. getItems: (keys: Set<Key$1>) => DragItem[],
  7622. /** The ref of the element that will be rendered as the drag preview while dragging. */
  7623. preview?: RefObject<DragPreviewRenderer>,
  7624. /** Function that returns the drop operations that are allowed for the dragged items. If not provided, all drop operations are allowed. */
  7625. getAllowedDropOperations?: () => DropOperation[]
  7626. }
  7627. /*
  7628. * Copyright 2020 Adobe. All rights reserved.
  7629. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  7630. * you may not use this file except in compliance with the License. You may obtain a copy
  7631. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  7632. *
  7633. * Unless required by applicable law or agreed to in writing, software distributed under
  7634. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  7635. * OF ANY KIND, either express or implied. See the License for the specific language
  7636. * governing permissions and limitations under the License.
  7637. */
  7638. interface ItemProps$1<T> extends LinkDOMProps {
  7639. /** Rendered contents of the item or child items. */
  7640. children: ReactNode,
  7641. /** Rendered contents of the item if `children` contains child items. */
  7642. title?: ReactNode, // label?? contents?
  7643. /** A string representation of the item's contents, used for features like typeahead. */
  7644. textValue?: string,
  7645. /** An accessibility label for this item. */
  7646. 'aria-label'?: string,
  7647. /** A list of child item objects. Used for dynamic collections. */
  7648. childItems?: Iterable<T>,
  7649. /** Whether this item has children, even if not loaded yet. */
  7650. hasChildItems?: boolean
  7651. }
  7652. type ItemElement<T> = ReactElement<ItemProps$1<T>>;
  7653. type ItemRenderer<T> = (item: T) => ItemElement<T>;
  7654. interface SectionProps<T> {
  7655. /** Rendered contents of the section, e.g. a header. */
  7656. title?: ReactNode,
  7657. /** An accessibility label for the section. */
  7658. 'aria-label'?: string,
  7659. /** Static child items or a function to render children. */
  7660. children: ItemElement<T> | ItemElement<T>[] | ItemRenderer<T>,
  7661. /** Item objects in the section. */
  7662. items?: Iterable<T>
  7663. }
  7664. type SectionElement<T> = ReactElement<SectionProps<T>>;
  7665. type CollectionElement<T> = SectionElement<T> | ItemElement<T>;
  7666. type CollectionChildren<T> = CollectionElement<T> | CollectionElement<T>[] | ((item: T) => CollectionElement<T>);
  7667. interface CollectionBase<T> {
  7668. /** The contents of the collection. */
  7669. children: CollectionChildren<T>,
  7670. /** Item objects in the collection. */
  7671. items?: Iterable<T>,
  7672. /** The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with. */
  7673. disabledKeys?: Iterable<Key$1>
  7674. }
  7675. interface CollectionStateBase<T, C extends Collection<Node$1<T>> = Collection<Node$1<T>>> extends Partial<CollectionBase<T>> {
  7676. /** A pre-constructed collection to use instead of building one from items and children. */
  7677. collection?: C
  7678. }
  7679. interface KeyboardDelegate {
  7680. /** Returns the key visually below the given one, or `null` for none. */
  7681. getKeyBelow?(key: Key$1): Key$1 | null,
  7682. /** Returns the key visually above the given one, or `null` for none. */
  7683. getKeyAbove?(key: Key$1): Key$1 | null,
  7684. /** Returns the key visually to the left of the given one, or `null` for none. */
  7685. getKeyLeftOf?(key: Key$1): Key$1 | null,
  7686. /** Returns the key visually to the right of the given one, or `null` for none. */
  7687. getKeyRightOf?(key: Key$1): Key$1 | null,
  7688. /** Returns the key visually one page below the given one, or `null` for none. */
  7689. getKeyPageBelow?(key: Key$1): Key$1 | null,
  7690. /** Returns the key visually one page above the given one, or `null` for none. */
  7691. getKeyPageAbove?(key: Key$1): Key$1 | null,
  7692. /** Returns the first key, or `null` for none. */
  7693. getFirstKey?(key?: Key$1, global?: boolean): Key$1 | null,
  7694. /** Returns the last key, or `null` for none. */
  7695. getLastKey?(key?: Key$1, global?: boolean): Key$1 | null,
  7696. /** Returns the next key after `fromKey` that matches the given search string, or `null` for none. */
  7697. getKeyForSearch?(search: string, fromKey?: Key$1): Key$1 | null
  7698. }
  7699. /**
  7700. * A generic interface to access a readonly sequential
  7701. * collection of unique keyed items.
  7702. */
  7703. interface Collection<T> extends Iterable<T> {
  7704. /** The number of items in the collection. */
  7705. readonly size: number,
  7706. /** Iterate over all keys in the collection. */
  7707. getKeys(): Iterable<Key$1>,
  7708. /** Get an item by its key. */
  7709. getItem(key: Key$1): T | null,
  7710. /** Get an item by the index of its key. */
  7711. at(idx: number): T | null,
  7712. /** Get the key that comes before the given key in the collection. */
  7713. getKeyBefore(key: Key$1): Key$1 | null,
  7714. /** Get the key that comes after the given key in the collection. */
  7715. getKeyAfter(key: Key$1): Key$1 | null,
  7716. /** Get the first key in the collection. */
  7717. getFirstKey(): Key$1 | null,
  7718. /** Get the last key in the collection. */
  7719. getLastKey(): Key$1 | null,
  7720. /** Iterate over the child items of the given key. */
  7721. getChildren?(key: Key$1): Iterable<T>,
  7722. /** Returns a string representation of the item's contents. */
  7723. getTextValue?(key: Key$1): string
  7724. }
  7725. interface Node$1<T> {
  7726. /** The type of item this node represents. */
  7727. type: string,
  7728. /** A unique key for the node. */
  7729. key: Key$1,
  7730. /** The object value the node was created from. */
  7731. value: T | null,
  7732. /** The level of depth this node is at in the hierarchy. */
  7733. level: number,
  7734. /** Whether this item has children, even if not loaded yet. */
  7735. hasChildNodes: boolean,
  7736. /**
  7737. * The loaded children of this node.
  7738. * @deprecated Use `collection.getChildren(node.key)` instead.
  7739. */
  7740. childNodes: Iterable<Node$1<T>>,
  7741. /** The rendered contents of this node (e.g. JSX). */
  7742. rendered: ReactNode,
  7743. /** A string value for this node, used for features like typeahead. */
  7744. textValue: string,
  7745. /** An accessibility label for this node. */
  7746. 'aria-label'?: string,
  7747. /** The index of this node within its parent. */
  7748. index?: number,
  7749. /** A function that should be called to wrap the rendered node. */
  7750. wrapper?: (element: ReactElement) => ReactElement,
  7751. /** The key of the parent node. */
  7752. parentKey?: Key$1 | null,
  7753. /** The key of the node before this node. */
  7754. prevKey?: Key$1 | null,
  7755. /** The key of the node after this node. */
  7756. nextKey?: Key$1 | null,
  7757. /** Additional properties specific to a particular node type. */
  7758. props?: any,
  7759. /** @private */
  7760. shouldInvalidate?: (context: unknown) => boolean
  7761. }
  7762. /*
  7763. * Copyright 2020 Adobe. All rights reserved.
  7764. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  7765. * you may not use this file except in compliance with the License. You may obtain a copy
  7766. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  7767. *
  7768. * Unless required by applicable law or agreed to in writing, software distributed under
  7769. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  7770. * OF ANY KIND, either express or implied. See the License for the specific language
  7771. * governing permissions and limitations under the License.
  7772. */
  7773. // Event bubbling can be problematic in real-world applications, so the default for React Spectrum components
  7774. // is not to propagate. This can be overridden by calling continuePropagation() on the event.
  7775. type BaseEvent<T extends SyntheticEvent> = T & {
  7776. /**
  7777. * Use continuePropagation.
  7778. * @deprecated */
  7779. stopPropagation(): void,
  7780. continuePropagation(): void
  7781. }
  7782. type KeyboardEvent = BaseEvent<KeyboardEvent$1<any>>;
  7783. type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard' | 'virtual';
  7784. interface PressEvent {
  7785. /** The type of press event being fired. */
  7786. type: 'pressstart' | 'pressend' | 'pressup' | 'press',
  7787. /** The pointer type that triggered the press event. */
  7788. pointerType: PointerType,
  7789. /** The target element of the press event. */
  7790. target: Element,
  7791. /** Whether the shift keyboard modifier was held during the press event. */
  7792. shiftKey: boolean,
  7793. /** Whether the ctrl keyboard modifier was held during the press event. */
  7794. ctrlKey: boolean,
  7795. /** Whether the meta keyboard modifier was held during the press event. */
  7796. metaKey: boolean,
  7797. /** Whether the alt keyboard modifier was held during the press event. */
  7798. altKey: boolean,
  7799. /**
  7800. * By default, press events stop propagation to parent elements.
  7801. * In cases where a handler decides not to handle a specific event,
  7802. * it can call `continuePropagation()` to allow a parent to handle it.
  7803. */
  7804. continuePropagation(): void
  7805. }
  7806. interface LongPressEvent extends Omit<PressEvent, 'type' | 'continuePropagation'> {
  7807. /** The type of long press event being fired. */
  7808. type: 'longpressstart' | 'longpressend' | 'longpress'
  7809. }
  7810. interface KeyboardEvents {
  7811. /** Handler that is called when a key is pressed. */
  7812. onKeyDown?: (e: KeyboardEvent) => void,
  7813. /** Handler that is called when a key is released. */
  7814. onKeyUp?: (e: KeyboardEvent) => void
  7815. }
  7816. interface FocusEvents<Target = Element> {
  7817. /** Handler that is called when the element receives focus. */
  7818. onFocus?: (e: FocusEvent$1<Target>) => void,
  7819. /** Handler that is called when the element loses focus. */
  7820. onBlur?: (e: FocusEvent$1<Target>) => void,
  7821. /** Handler that is called when the element's focus status changes. */
  7822. onFocusChange?: (isFocused: boolean) => void
  7823. }
  7824. interface PressEvents {
  7825. /** Handler that is called when the press is released over the target. */
  7826. onPress?: (e: PressEvent) => void,
  7827. /** Handler that is called when a press interaction starts. */
  7828. onPressStart?: (e: PressEvent) => void,
  7829. /**
  7830. * Handler that is called when a press interaction ends, either
  7831. * over the target or when the pointer leaves the target.
  7832. */
  7833. onPressEnd?: (e: PressEvent) => void,
  7834. /** Handler that is called when the press state changes. */
  7835. onPressChange?: (isPressed: boolean) => void,
  7836. /**
  7837. * Handler that is called when a press is released over the target, regardless of
  7838. * whether it started on the target or not.
  7839. */
  7840. onPressUp?: (e: PressEvent) => void
  7841. }
  7842. interface FocusableProps<Target = Element> extends FocusEvents<Target>, KeyboardEvents {
  7843. /** Whether the element should receive focus on render. */
  7844. autoFocus?: boolean
  7845. }
  7846. /*
  7847. * Copyright 2020 Adobe. All rights reserved.
  7848. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  7849. * you may not use this file except in compliance with the License. You may obtain a copy
  7850. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  7851. *
  7852. * Unless required by applicable law or agreed to in writing, software distributed under
  7853. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  7854. * OF ANY KIND, either express or implied. See the License for the specific language
  7855. * governing permissions and limitations under the License.
  7856. */
  7857. interface LabelableProps {
  7858. /** The content to display as the label. */
  7859. label?: ReactNode
  7860. }
  7861. /*
  7862. * Copyright 2020 Adobe. All rights reserved.
  7863. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  7864. * you may not use this file except in compliance with the License. You may obtain a copy
  7865. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  7866. *
  7867. * Unless required by applicable law or agreed to in writing, software distributed under
  7868. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  7869. * OF ANY KIND, either express or implied. See the License for the specific language
  7870. * governing permissions and limitations under the License.
  7871. */
  7872. type Orientation = 'horizontal' | 'vertical';
  7873. /*
  7874. * Copyright 2020 Adobe. All rights reserved.
  7875. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  7876. * you may not use this file except in compliance with the License. You may obtain a copy
  7877. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  7878. *
  7879. * Unless required by applicable law or agreed to in writing, software distributed under
  7880. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  7881. * OF ANY KIND, either express or implied. See the License for the specific language
  7882. * governing permissions and limitations under the License.
  7883. */
  7884. type Direction = 'ltr' | 'rtl';
  7885. /*
  7886. * Copyright 2023 Adobe. All rights reserved.
  7887. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  7888. * you may not use this file except in compliance with the License. You may obtain a copy
  7889. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  7890. *
  7891. * Unless required by applicable law or agreed to in writing, software distributed under
  7892. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  7893. * OF ANY KIND, either express or implied. See the License for the specific language
  7894. * governing permissions and limitations under the License.
  7895. */
  7896. type Key$1 = string | number;
  7897. /*
  7898. * Copyright 2020 Adobe. All rights reserved.
  7899. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  7900. * you may not use this file except in compliance with the License. You may obtain a copy
  7901. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  7902. *
  7903. * Unless required by applicable law or agreed to in writing, software distributed under
  7904. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  7905. * OF ANY KIND, either express or implied. See the License for the specific language
  7906. * governing permissions and limitations under the License.
  7907. */
  7908. interface ToggleProps extends InputBase, Validation<boolean>, FocusableProps {
  7909. /**
  7910. * The label for the element.
  7911. */
  7912. children?: ReactNode,
  7913. /**
  7914. * Whether the element should be selected (uncontrolled).
  7915. */
  7916. defaultSelected?: boolean,
  7917. /**
  7918. * Whether the element should be selected (controlled).
  7919. */
  7920. isSelected?: boolean,
  7921. /**
  7922. * Handler that is called when the element's selection state changes.
  7923. */
  7924. onChange?: (isSelected: boolean) => void,
  7925. /**
  7926. * 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).
  7927. */
  7928. value?: string
  7929. }
  7930. interface AriaToggleProps extends ToggleProps, FocusableDOMProps, AriaLabelingProps$1, AriaValidationProps, InputDOMProps {
  7931. /**
  7932. * Identifies the element (or elements) whose contents or presence are controlled by the current element.
  7933. */
  7934. 'aria-controls'?: string
  7935. }
  7936. interface CheckboxProps$1 extends ToggleProps {
  7937. /**
  7938. * Indeterminism is presentational only.
  7939. * The indeterminate visual representation remains regardless of user interaction.
  7940. */
  7941. isIndeterminate?: boolean
  7942. }
  7943. interface AriaCheckboxProps extends CheckboxProps$1, AriaToggleProps {}
  7944. /*
  7945. * Copyright 2020 Adobe. All rights reserved.
  7946. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  7947. * you may not use this file except in compliance with the License. You may obtain a copy
  7948. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  7949. *
  7950. * Unless required by applicable law or agreed to in writing, software distributed under
  7951. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  7952. * OF ANY KIND, either express or implied. See the License for the specific language
  7953. * governing permissions and limitations under the License.
  7954. */
  7955. type Placement = 'bottom' | 'bottom left' | 'bottom right' | 'bottom start' | 'bottom end' |
  7956. 'top' | 'top left' | 'top right' | 'top start' | 'top end' |
  7957. 'left' | 'left top' | 'left bottom' | 'start' | 'start top' | 'start bottom' |
  7958. 'right' | 'right top' | 'right bottom' | 'end' | 'end top' | 'end bottom';
  7959. interface PositionProps {
  7960. /**
  7961. * The placement of the element with respect to its anchor element.
  7962. * @default 'bottom'
  7963. */
  7964. placement?: Placement,
  7965. /**
  7966. * The placement padding that should be applied between the element and its
  7967. * surrounding container.
  7968. * @default 12
  7969. */
  7970. containerPadding?: number,
  7971. /**
  7972. * The additional offset applied along the main axis between the element and its
  7973. * anchor element.
  7974. * @default 0
  7975. */
  7976. offset?: number,
  7977. /**
  7978. * The additional offset applied along the cross axis between the element and its
  7979. * anchor element.
  7980. * @default 0
  7981. */
  7982. crossOffset?: number,
  7983. /**
  7984. * Whether the element should flip its orientation (e.g. top to bottom or left to right) when
  7985. * there is insufficient room for it to render completely.
  7986. * @default true
  7987. */
  7988. shouldFlip?: boolean,
  7989. // /**
  7990. // * The element that should be used as the bounding container when calculating container offset
  7991. // * or whether it should flip.
  7992. // */
  7993. // boundaryElement?: Element,
  7994. /** Whether the element is rendered. */
  7995. isOpen?: boolean
  7996. }
  7997. interface OverlayTriggerProps$1 {
  7998. /** Whether the overlay is open by default (controlled). */
  7999. isOpen?: boolean,
  8000. /** Whether the overlay is open by default (uncontrolled). */
  8001. defaultOpen?: boolean,
  8002. /** Handler that is called when the overlay's open state changes. */
  8003. onOpenChange?: (isOpen: boolean) => void
  8004. }
  8005. interface OverlayTriggerState {
  8006. /** Whether the overlay is currently open. */
  8007. readonly isOpen: boolean;
  8008. /** Sets whether the overlay is open. */
  8009. setOpen(isOpen: boolean): void;
  8010. /** Opens the overlay. */
  8011. open(): void;
  8012. /** Closes the overlay. */
  8013. close(): void;
  8014. /** Toggles the overlay's visibility. */
  8015. toggle(): void;
  8016. }
  8017. /*
  8018. * Copyright 2020 Adobe. All rights reserved.
  8019. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  8020. * you may not use this file except in compliance with the License. You may obtain a copy
  8021. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  8022. *
  8023. * Unless required by applicable law or agreed to in writing, software distributed under
  8024. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  8025. * OF ANY KIND, either express or implied. See the License for the specific language
  8026. * governing permissions and limitations under the License.
  8027. */
  8028. interface SelectProps$1<T> extends CollectionBase<T>, Omit<InputBase, 'isReadOnly'>, Validation<Key$1>, HelpTextProps, LabelableProps, TextInputBase, Omit<SingleSelection, 'disallowEmptySelection'>, FocusableProps {
  8029. /** Sets the open state of the menu. */
  8030. isOpen?: boolean,
  8031. /** Sets the default open state of the menu. */
  8032. defaultOpen?: boolean,
  8033. /** Method that is called when the open state of the menu changes. */
  8034. onOpenChange?: (isOpen: boolean) => void
  8035. }
  8036. interface AriaSelectProps<T> extends SelectProps$1<T>, DOMProps, AriaLabelingProps$1, FocusableDOMProps {
  8037. /**
  8038. * 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).
  8039. */
  8040. autoComplete?: string,
  8041. /**
  8042. * The name of the input, used when submitting an HTML form.
  8043. */
  8044. name?: string
  8045. }
  8046. interface FocusState {
  8047. /** Whether the collection is currently focused. */
  8048. readonly isFocused: boolean;
  8049. /** Sets whether the collection is focused. */
  8050. setFocused(isFocused: boolean): void;
  8051. /** The current focused key in the collection. */
  8052. readonly focusedKey: Key$1;
  8053. /** Whether the first or last child of the focused key should receive focus. */
  8054. readonly childFocusStrategy: FocusStrategy;
  8055. /** Sets the focused key, and optionally, whether the first or last child of that key should receive focus. */
  8056. setFocusedKey(key: Key$1, child?: FocusStrategy): void;
  8057. }
  8058. interface MultipleSelectionState extends FocusState {
  8059. /** The type of selection that is allowed in the collection. */
  8060. readonly selectionMode: SelectionMode;
  8061. /** The selection behavior for the collection. */
  8062. readonly selectionBehavior: SelectionBehavior;
  8063. /** Sets the selection behavior for the collection. */
  8064. setSelectionBehavior(selectionBehavior: SelectionBehavior): void;
  8065. /** Whether the collection allows empty selection. */
  8066. readonly disallowEmptySelection: boolean;
  8067. /** The currently selected keys in the collection. */
  8068. readonly selectedKeys: Selection$1;
  8069. /** Sets the selected keys in the collection. */
  8070. setSelectedKeys(keys: Selection$1): void;
  8071. /** The currently disabled keys in the collection. */
  8072. readonly disabledKeys: Set<Key$1>;
  8073. /** Whether `disabledKeys` applies to selection, actions, or both. */
  8074. readonly disabledBehavior: DisabledBehavior;
  8075. }
  8076. interface MultipleSelectionManager extends FocusState {
  8077. /** The type of selection that is allowed in the collection. */
  8078. readonly selectionMode: SelectionMode;
  8079. /** The selection behavior for the collection. */
  8080. readonly selectionBehavior: SelectionBehavior;
  8081. /** Whether the collection allows empty selection. */
  8082. readonly disallowEmptySelection?: boolean;
  8083. /** The currently selected keys in the collection. */
  8084. readonly selectedKeys: Set<Key$1>;
  8085. /** Whether the selection is empty. */
  8086. readonly isEmpty: boolean;
  8087. /** Whether all items in the collection are selected. */
  8088. readonly isSelectAll: boolean;
  8089. /** The first selected key in the collection. */
  8090. readonly firstSelectedKey: Key$1 | null;
  8091. /** The last selected key in the collection. */
  8092. readonly lastSelectedKey: Key$1 | null;
  8093. /** The currently disabled keys in the collection. */
  8094. readonly disabledKeys: Set<Key$1>;
  8095. /** Whether `disabledKeys` applies to selection, actions, or both. */
  8096. readonly disabledBehavior: DisabledBehavior;
  8097. /** Returns whether a key is selected. */
  8098. isSelected(key: Key$1): boolean;
  8099. /** Returns whether the current selection is equal to the given selection. */
  8100. isSelectionEqual(selection: Set<Key$1>): boolean;
  8101. /** Extends the selection to the given key. */
  8102. extendSelection(toKey: Key$1): void;
  8103. /** Toggles whether the given key is selected. */
  8104. toggleSelection(key: Key$1): void;
  8105. /** Replaces the selection with only the given key. */
  8106. replaceSelection(key: Key$1): void;
  8107. /** Replaces the selection with the given keys. */
  8108. setSelectedKeys(keys: Iterable<Key$1>): void;
  8109. /** Selects all items in the collection. */
  8110. selectAll(): void;
  8111. /** Removes all keys from the selection. */
  8112. clearSelection(): void;
  8113. /** Toggles between select all and an empty selection. */
  8114. toggleSelectAll(): void;
  8115. /**
  8116. * Toggles, replaces, or extends selection to the given key depending
  8117. * on the pointer event and collection's selection mode.
  8118. */
  8119. select(key: Key$1, e?: PressEvent | LongPressEvent | PointerEvent): void;
  8120. /** Returns whether the given key can be selected. */
  8121. canSelectItem(key: Key$1): boolean;
  8122. /** Returns whether the given key is non-interactive, i.e. both selection and actions are disabled. */
  8123. isDisabled(key: Key$1): boolean;
  8124. /** Sets the selection behavior for the collection. */
  8125. setSelectionBehavior(selectionBehavior: SelectionBehavior): void;
  8126. /** Returns whether the given key is a hyperlink. */
  8127. isLink(key: Key$1): boolean;
  8128. }
  8129. interface MultipleSelectionStateProps extends MultipleSelection {
  8130. /** How multiple selection should behave in the collection. */
  8131. selectionBehavior?: SelectionBehavior;
  8132. /** Whether onSelectionChange should fire even if the new set of keys is the same as the last. */
  8133. allowDuplicateSelectionEvents?: boolean;
  8134. /** Whether `disabledKeys` applies to all interactions, or only selection. */
  8135. disabledBehavior?: DisabledBehavior;
  8136. }
  8137. interface SelectionManagerOptions {
  8138. allowsCellSelection?: boolean;
  8139. }
  8140. /**
  8141. * An interface for reading and updating multiple selection state.
  8142. */
  8143. declare class SelectionManager implements MultipleSelectionManager {
  8144. constructor(collection: Collection<Node$1<unknown>>, state: MultipleSelectionState, options?: SelectionManagerOptions);
  8145. /**
  8146. * The type of selection that is allowed in the collection.
  8147. */
  8148. get selectionMode(): SelectionMode;
  8149. /**
  8150. * Whether the collection allows empty selection.
  8151. */
  8152. get disallowEmptySelection(): boolean;
  8153. /**
  8154. * The selection behavior for the collection.
  8155. */
  8156. get selectionBehavior(): SelectionBehavior;
  8157. /**
  8158. * Sets the selection behavior for the collection.
  8159. */
  8160. setSelectionBehavior(selectionBehavior: SelectionBehavior): void;
  8161. /**
  8162. * Whether the collection is currently focused.
  8163. */
  8164. get isFocused(): boolean;
  8165. /**
  8166. * Sets whether the collection is focused.
  8167. */
  8168. setFocused(isFocused: boolean): void;
  8169. /**
  8170. * The current focused key in the collection.
  8171. */
  8172. get focusedKey(): Key$1;
  8173. /** Whether the first or last child of the focused key should receive focus. */
  8174. get childFocusStrategy(): FocusStrategy;
  8175. /**
  8176. * Sets the focused key.
  8177. */
  8178. setFocusedKey(key: Key$1 | null, childFocusStrategy?: FocusStrategy): void;
  8179. /**
  8180. * The currently selected keys in the collection.
  8181. */
  8182. get selectedKeys(): Set<Key$1>;
  8183. /**
  8184. * The raw selection value for the collection.
  8185. * Either 'all' for select all, or a set of keys.
  8186. */
  8187. get rawSelection(): Selection$1;
  8188. /**
  8189. * Returns whether a key is selected.
  8190. */
  8191. isSelected(key: Key$1): boolean;
  8192. /**
  8193. * Whether the selection is empty.
  8194. */
  8195. get isEmpty(): boolean;
  8196. /**
  8197. * Whether all items in the collection are selected.
  8198. */
  8199. get isSelectAll(): boolean;
  8200. get firstSelectedKey(): Key$1 | null;
  8201. get lastSelectedKey(): Key$1 | null;
  8202. get disabledKeys(): Set<Key$1>;
  8203. get disabledBehavior(): DisabledBehavior;
  8204. /**
  8205. * Extends the selection to the given key.
  8206. */
  8207. extendSelection(toKey: Key$1): void;
  8208. /**
  8209. * Toggles whether the given key is selected.
  8210. */
  8211. toggleSelection(key: Key$1): void;
  8212. /**
  8213. * Replaces the selection with only the given key.
  8214. */
  8215. replaceSelection(key: Key$1): void;
  8216. /**
  8217. * Replaces the selection with the given keys.
  8218. */
  8219. setSelectedKeys(keys: Iterable<Key$1>): void;
  8220. /**
  8221. * Selects all items in the collection.
  8222. */
  8223. selectAll(): void;
  8224. /**
  8225. * Removes all keys from the selection.
  8226. */
  8227. clearSelection(): void;
  8228. /**
  8229. * Toggles between select all and an empty selection.
  8230. */
  8231. toggleSelectAll(): void;
  8232. select(key: Key$1, e?: PressEvent | LongPressEvent | PointerEvent): void;
  8233. /**
  8234. * Returns whether the current selection is equal to the given selection.
  8235. */
  8236. isSelectionEqual(selection: Set<Key$1>): boolean;
  8237. canSelectItem(key: Key$1): boolean;
  8238. isDisabled(key: Key$1): boolean;
  8239. isLink(key: Key$1): boolean;
  8240. }
  8241. interface ListProps<T> extends CollectionStateBase<T>, MultipleSelectionStateProps {
  8242. /** Filter function to generate a filtered list of nodes. */
  8243. filter?: (nodes: Iterable<Node$1<T>>) => Iterable<Node$1<T>>;
  8244. /** @private */
  8245. suppressTextValueWarning?: boolean;
  8246. }
  8247. interface ListState<T> {
  8248. /** A collection of items in the list. */
  8249. collection: Collection<Node$1<T>>;
  8250. /** A set of items that are disabled. */
  8251. disabledKeys: Set<Key$1>;
  8252. /** A selection manager to read and update multiple selection state. */
  8253. selectionManager: SelectionManager;
  8254. }
  8255. interface SelectStateOptions<T> extends Omit<SelectProps$1<T>, 'children'>, CollectionStateBase<T> {
  8256. }
  8257. interface DraggableCollectionStateOptions extends DraggableCollectionProps {
  8258. /** A collection of items. */
  8259. collection: Collection<Node$1<unknown>>;
  8260. /** An interface for reading and updating multiple selection state. */
  8261. selectionManager: MultipleSelectionManager;
  8262. }
  8263. interface DroppableCollectionStateOptions extends Omit<DroppableCollectionProps, 'onDropMove' | 'onDropActivate'> {
  8264. /** A collection of items. */
  8265. collection: Collection<Node$1<unknown>>;
  8266. /** An interface for reading and updating multiple selection state. */
  8267. selectionManager: MultipleSelectionManager;
  8268. }
  8269. /*
  8270. * Copyright 2020 Adobe. All rights reserved.
  8271. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  8272. * you may not use this file except in compliance with the License. You may obtain a copy
  8273. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  8274. *
  8275. * Unless required by applicable law or agreed to in writing, software distributed under
  8276. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  8277. * OF ANY KIND, either express or implied. See the License for the specific language
  8278. * governing permissions and limitations under the License.
  8279. */
  8280. type MenuTriggerType = 'press' | 'longPress';
  8281. interface MenuTriggerProps extends OverlayTriggerProps$1 {
  8282. /**
  8283. * How the menu is triggered.
  8284. * @default 'press'
  8285. */
  8286. trigger?: MenuTriggerType
  8287. }
  8288. interface MenuProps$1<T> extends CollectionBase<T>, MultipleSelection {
  8289. /** Where the focus should be set. */
  8290. autoFocus?: boolean | FocusStrategy,
  8291. /** Whether keyboard navigation is circular. */
  8292. shouldFocusWrap?: boolean,
  8293. /** Handler that is called when an item is selected. */
  8294. onAction?: (key: Key$1) => void,
  8295. /** Handler that is called when the menu should close after selecting an item. */
  8296. onClose?: () => void
  8297. }
  8298. interface AriaMenuProps<T> extends MenuProps$1<T>, DOMProps, AriaLabelingProps$1 {}
  8299. /*
  8300. * Copyright 2020 Adobe. All rights reserved.
  8301. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  8302. * you may not use this file except in compliance with the License. You may obtain a copy
  8303. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  8304. *
  8305. * Unless required by applicable law or agreed to in writing, software distributed under
  8306. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  8307. * OF ANY KIND, either express or implied. See the License for the specific language
  8308. * governing permissions and limitations under the License.
  8309. */
  8310. interface RadioGroupProps$1 extends ValueBase<string>, InputBase, InputDOMProps, Validation<string | null>, LabelableProps, HelpTextProps, FocusEvents {
  8311. /**
  8312. * The axis the Radio Button(s) should align with.
  8313. * @default 'vertical'
  8314. */
  8315. orientation?: Orientation
  8316. }
  8317. interface AriaRadioGroupProps extends RadioGroupProps$1, DOMProps, AriaLabelingProps$1, AriaValidationProps {}
  8318. /*
  8319. * Copyright 2020 Adobe. All rights reserved.
  8320. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  8321. * you may not use this file except in compliance with the License. You may obtain a copy
  8322. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  8323. *
  8324. * Unless required by applicable law or agreed to in writing, software distributed under
  8325. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  8326. * OF ANY KIND, either express or implied. See the License for the specific language
  8327. * governing permissions and limitations under the License.
  8328. */
  8329. interface TextFieldProps extends InputBase, Validation<string>, HelpTextProps, FocusableProps, TextInputBase, ValueBase<string>, LabelableProps {}
  8330. interface AriaTextFieldProps extends TextFieldProps, AriaLabelingProps$1, FocusableDOMProps, TextInputDOMProps, AriaValidationProps {
  8331. // https://www.w3.org/TR/wai-aria-1.2/#textbox
  8332. /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
  8333. 'aria-activedescendant'?: string,
  8334. /**
  8335. * 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
  8336. * presented if they are made.
  8337. */
  8338. 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both',
  8339. /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
  8340. 'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'
  8341. }
  8342. /*
  8343. * Copyright 2020 Adobe. All rights reserved.
  8344. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  8345. * you may not use this file except in compliance with the License. You may obtain a copy
  8346. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  8347. *
  8348. * Unless required by applicable law or agreed to in writing, software distributed under
  8349. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  8350. * OF ANY KIND, either express or implied. See the License for the specific language
  8351. * governing permissions and limitations under the License.
  8352. */
  8353. interface SearchFieldProps extends TextFieldProps {
  8354. /** Handler that is called when the SearchField is submitted. */
  8355. onSubmit?: (value: string) => void,
  8356. /** Handler that is called when the clear button is pressed. */
  8357. onClear?: () => void
  8358. }
  8359. interface AriaSearchFieldProps extends SearchFieldProps, AriaTextFieldProps {}
  8360. interface SliderProps$1<T = number | number[]> extends RangeInputBase<number>, ValueBase<T>, LabelableProps {
  8361. /**
  8362. * The orientation of the Slider.
  8363. * @default 'horizontal'
  8364. */
  8365. orientation?: Orientation,
  8366. /** Whether the whole Slider is disabled. */
  8367. isDisabled?: boolean,
  8368. /** Fired when the slider stops moving, due to being let go. */
  8369. onChangeEnd?: (value: T) => void,
  8370. // These are duplicated from ValueBase to define defaults for the docs.
  8371. /**
  8372. * The slider's minimum value.
  8373. * @default 0
  8374. */
  8375. minValue?: number,
  8376. /**
  8377. * The slider's maximum value.
  8378. * @default 100
  8379. */
  8380. maxValue?: number,
  8381. /**
  8382. * The slider's step value.
  8383. * @default 1
  8384. */
  8385. step?: number
  8386. }
  8387. interface AriaSliderProps<T = number | number[]> extends SliderProps$1<T>, DOMProps, AriaLabelingProps$1 {}
  8388. interface SliderStateOptions<T> extends SliderProps$1<T> {
  8389. numberFormatter: Intl.NumberFormat;
  8390. }
  8391. /*
  8392. * Copyright 2020 Adobe. All rights reserved.
  8393. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  8394. * you may not use this file except in compliance with the License. You may obtain a copy
  8395. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  8396. *
  8397. * Unless required by applicable law or agreed to in writing, software distributed under
  8398. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  8399. * OF ANY KIND, either express or implied. See the License for the specific language
  8400. * governing permissions and limitations under the License.
  8401. */
  8402. interface NumberFieldProps extends InputBase, Validation<number>, FocusableProps, TextInputBase, ValueBase<number>, RangeInputBase<number>, LabelableProps, HelpTextProps {
  8403. /**
  8404. * Formatting options for the value displayed in the number field.
  8405. * This also affects what characters are allowed to be typed by the user.
  8406. */
  8407. formatOptions?: Intl.NumberFormatOptions
  8408. }
  8409. interface AriaNumberFieldProps extends NumberFieldProps, DOMProps, AriaLabelingProps$1, TextInputDOMEvents {
  8410. /** A custom aria-label for the decrement button. If not provided, the localized string "Decrement" is used. */
  8411. decrementAriaLabel?: string,
  8412. /** A custom aria-label for the increment button. If not provided, the localized string "Increment" is used. */
  8413. incrementAriaLabel?: string,
  8414. /**
  8415. * Enables or disables changing the value with scroll.
  8416. */
  8417. isWheelDisabled?: boolean
  8418. }
  8419. interface NumberFieldStateOptions extends NumberFieldProps {
  8420. /**
  8421. * The locale that should be used for parsing.
  8422. * @default 'en-US'
  8423. */
  8424. locale: string;
  8425. }
  8426. declare let Item$1: <T>(props: ItemProps$1<T>) => JSX.Element;
  8427. /*
  8428. * Copyright 2020 Adobe. All rights reserved.
  8429. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  8430. * you may not use this file except in compliance with the License. You may obtain a copy
  8431. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  8432. *
  8433. * Unless required by applicable law or agreed to in writing, software distributed under
  8434. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  8435. * OF ANY KIND, either express or implied. See the License for the specific language
  8436. * governing permissions and limitations under the License.
  8437. */
  8438. interface TabListProps<T> extends CollectionBase<T>, Omit<SingleSelection, 'disallowEmptySelection'> {
  8439. /**
  8440. * Whether the TabList is disabled.
  8441. * Shows that a selection exists, but is not available in that circumstance.
  8442. */
  8443. isDisabled?: boolean
  8444. }
  8445. interface AriaTabListBase extends AriaLabelingProps$1 {
  8446. /**
  8447. * Whether tabs are activated automatically on focus or manually.
  8448. * @default 'automatic'
  8449. */
  8450. keyboardActivation?: 'automatic' | 'manual',
  8451. /**
  8452. * The orientation of the tabs.
  8453. * @default 'horizontal'
  8454. */
  8455. orientation?: Orientation
  8456. }
  8457. interface AriaTabListProps<T> extends TabListProps<T>, AriaTabListBase, DOMProps, AriaLabelingProps$1 {}
  8458. /*
  8459. * Copyright 2020 Adobe. All rights reserved.
  8460. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  8461. * you may not use this file except in compliance with the License. You may obtain a copy
  8462. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  8463. *
  8464. * Unless required by applicable law or agreed to in writing, software distributed under
  8465. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  8466. * OF ANY KIND, either express or implied. See the License for the specific language
  8467. * governing permissions and limitations under the License.
  8468. */
  8469. interface TooltipTriggerProps extends OverlayTriggerProps$1 {
  8470. /**
  8471. * Whether the tooltip should be disabled, independent from the trigger.
  8472. */
  8473. isDisabled?: boolean,
  8474. /**
  8475. * The delay time for the tooltip to show up. [See guidelines](https://spectrum.adobe.com/page/tooltip/#Immediate-or-delayed-appearance).
  8476. * @default 1500
  8477. */
  8478. delay?: number,
  8479. /**
  8480. * The delay time for the tooltip to close. [See guidelines](https://spectrum.adobe.com/page/tooltip/#Warmup-and-cooldown).
  8481. * @default 500
  8482. */
  8483. closeDelay?: number,
  8484. /**
  8485. * By default, opens for both focus and hover. Can be made to open only for focus.
  8486. */
  8487. trigger?: 'focus'
  8488. }
  8489. interface TooltipProps$1 {
  8490. isOpen?: boolean
  8491. }
  8492. interface AriaTooltipProps extends TooltipProps$1, DOMProps, AriaLabelingProps$1 {}
  8493. /*
  8494. * Copyright 2020 Adobe. All rights reserved.
  8495. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  8496. * you may not use this file except in compliance with the License. You may obtain a copy
  8497. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  8498. *
  8499. * Unless required by applicable law or agreed to in writing, software distributed under
  8500. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  8501. * OF ANY KIND, either express or implied. See the License for the specific language
  8502. * governing permissions and limitations under the License.
  8503. */
  8504. interface LinkProps$1 extends PressEvents, FocusableProps {}
  8505. interface AriaLinkProps extends LinkProps$1, LinkDOMProps, AriaLabelingProps$1 { }
  8506. /*
  8507. * Copyright 2020 Adobe. All rights reserved.
  8508. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  8509. * you may not use this file except in compliance with the License. You may obtain a copy
  8510. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  8511. *
  8512. * Unless required by applicable law or agreed to in writing, software distributed under
  8513. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  8514. * OF ANY KIND, either express or implied. See the License for the specific language
  8515. * governing permissions and limitations under the License.
  8516. */
  8517. interface ButtonProps extends PressEvents, FocusableProps {
  8518. /** Whether the button is disabled. */
  8519. isDisabled?: boolean,
  8520. /** The content to display in the button. */
  8521. children?: ReactNode
  8522. }
  8523. interface ToggleButtonProps$1 extends ButtonProps {
  8524. /** Whether the element should be selected (controlled). */
  8525. isSelected?: boolean,
  8526. /** Whether the element should be selected (uncontrolled). */
  8527. defaultSelected?: boolean,
  8528. /** Handler that is called when the element's selection state changes. */
  8529. onChange?: (isSelected: boolean) => void
  8530. }
  8531. interface AriaButtonElementTypeProps<T extends ElementType = 'button'> {
  8532. /**
  8533. * The HTML element or React element used to render the button, e.g. 'div', 'a', or `RouterLink`.
  8534. * @default 'button'
  8535. */
  8536. elementType?: T | JSXElementConstructor<any>
  8537. }
  8538. interface LinkButtonProps<T extends ElementType = 'button'> extends AriaButtonElementTypeProps<T> {
  8539. /** A URL to link to if elementType="a". */
  8540. href?: string,
  8541. /** The target window for the link. */
  8542. target?: string,
  8543. /** The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel). */
  8544. rel?: string
  8545. }
  8546. interface AriaBaseButtonProps extends FocusableDOMProps, AriaLabelingProps$1 {
  8547. /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
  8548. 'aria-expanded'?: boolean | 'true' | 'false',
  8549. /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
  8550. 'aria-haspopup'?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | 'true' | 'false',
  8551. /** Identifies the element (or elements) whose contents or presence are controlled by the current element. */
  8552. 'aria-controls'?: string,
  8553. /** Indicates the current "pressed" state of toggle buttons. */
  8554. 'aria-pressed'?: boolean | 'true' | 'false' | 'mixed',
  8555. /**
  8556. * The behavior of the button when used in an HTML form.
  8557. * @default 'button'
  8558. */
  8559. type?: 'button' | 'submit' | 'reset'
  8560. }
  8561. interface AriaButtonProps<T extends ElementType = 'button'> extends ButtonProps, LinkButtonProps<T>, AriaBaseButtonProps {}
  8562. interface AriaToggleButtonProps<T extends ElementType = 'button'> extends ToggleButtonProps$1, AriaBaseButtonProps, AriaButtonElementTypeProps<T> {}
  8563. /*
  8564. * Copyright 2020 Adobe. All rights reserved.
  8565. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  8566. * you may not use this file except in compliance with the License. You may obtain a copy
  8567. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  8568. *
  8569. * Unless required by applicable law or agreed to in writing, software distributed under
  8570. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  8571. * OF ANY KIND, either express or implied. See the License for the specific language
  8572. * governing permissions and limitations under the License.
  8573. */
  8574. interface ListBoxProps$1<T> extends CollectionBase<T>, MultipleSelection, FocusEvents {
  8575. /** Whether to auto focus the listbox or an option. */
  8576. autoFocus?: boolean | FocusStrategy,
  8577. /** Whether focus should wrap around when the end/start is reached. */
  8578. shouldFocusWrap?: boolean
  8579. }
  8580. interface AriaListBoxPropsBase<T> extends ListBoxProps$1<T>, DOMProps, AriaLabelingProps$1 {}
  8581. interface AriaListBoxProps<T> extends AriaListBoxPropsBase<T> {
  8582. /**
  8583. * An optional visual label for the listbox.
  8584. */
  8585. label?: ReactNode,
  8586. /** How multiple selection should behave in the collection. */
  8587. selectionBehavior?: SelectionBehavior,
  8588. /**
  8589. * Handler that is called when a user performs an action on an item. The exact user event depends on
  8590. * the collection's `selectionBehavior` prop and the interaction modality.
  8591. */
  8592. onAction?: (key: Key$1) => void
  8593. }
  8594. interface SelectableItemStates {
  8595. /** Whether the item is currently in a pressed state. */
  8596. isPressed: boolean;
  8597. /** Whether the item is currently selected. */
  8598. isSelected: boolean;
  8599. /** Whether the item is currently focused. */
  8600. isFocused: boolean;
  8601. /**
  8602. * Whether the item is non-interactive, i.e. both selection and actions are disabled and the item may
  8603. * not be focused. Dependent on `disabledKeys` and `disabledBehavior`.
  8604. */
  8605. isDisabled: boolean;
  8606. /**
  8607. * Whether the item may be selected, dependent on `selectionMode`, `disabledKeys`, and `disabledBehavior`.
  8608. */
  8609. allowsSelection: boolean;
  8610. /**
  8611. * Whether the item has an action, dependent on `onAction`, `disabledKeys`,
  8612. * and `disabledBehavior`. It may also change depending on the current selection state
  8613. * of the list (e.g. when selection is primary). This can be used to enable or disable hover
  8614. * styles or other visual indications of interactivity.
  8615. */
  8616. hasAction: boolean;
  8617. }
  8618. interface AriaListBoxOptions<T> extends Omit<AriaListBoxProps<T>, 'children'> {
  8619. /** Whether the listbox uses virtual scrolling. */
  8620. isVirtualized?: boolean;
  8621. /**
  8622. * An optional keyboard delegate implementation for type to select,
  8623. * to override the default.
  8624. */
  8625. keyboardDelegate?: KeyboardDelegate;
  8626. /**
  8627. * Whether the listbox items should use virtual focus instead of being focused directly.
  8628. */
  8629. shouldUseVirtualFocus?: boolean;
  8630. /** Whether selection should occur on press up instead of press down. */
  8631. shouldSelectOnPressUp?: boolean;
  8632. /** Whether options should be focused when the user hovers over them. */
  8633. shouldFocusOnHover?: boolean;
  8634. /**
  8635. * The behavior of links in the collection.
  8636. * - 'action': link behaves like onAction.
  8637. * - 'selection': link follows selection interactions (e.g. if URL drives selection).
  8638. * - 'override': links override all other interactions (link items are not selectable).
  8639. * @default 'override'
  8640. */
  8641. linkBehavior?: 'action' | 'selection' | 'override';
  8642. }
  8643. interface OptionAria extends SelectableItemStates {
  8644. /** Props for the option element. */
  8645. optionProps: DOMAttributes;
  8646. /** Props for the main text element inside the option. */
  8647. labelProps: DOMAttributes;
  8648. /** Props for the description text element inside the option, if any. */
  8649. descriptionProps: DOMAttributes;
  8650. /** Whether the option is currently focused. */
  8651. isFocused: boolean;
  8652. /** Whether the option is keyboard focused. */
  8653. isFocusVisible: boolean;
  8654. }
  8655. /*
  8656. * Copyright 2020 Adobe. All rights reserved.
  8657. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  8658. * you may not use this file except in compliance with the License. You may obtain a copy
  8659. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  8660. *
  8661. * Unless required by applicable law or agreed to in writing, software distributed under
  8662. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  8663. * OF ANY KIND, either express or implied. See the License for the specific language
  8664. * governing permissions and limitations under the License.
  8665. */
  8666. interface AriaDialogProps extends DOMProps, AriaLabelingProps$1 {
  8667. /**
  8668. * The accessibility role for the dialog.
  8669. * @default 'dialog'
  8670. */
  8671. role?: 'dialog' | 'alertdialog'
  8672. }
  8673. interface DropOptions {
  8674. /** A ref for the droppable element. */
  8675. ref: RefObject<HTMLElement>;
  8676. /**
  8677. * A function returning the drop operation to be performed when items matching the given types are dropped
  8678. * on the drop target.
  8679. */
  8680. getDropOperation?: (types: DragTypes, allowedOperations: DropOperation[]) => DropOperation;
  8681. /** A function that returns the drop operation for a specific point within the target. */
  8682. getDropOperationForPoint?: (types: DragTypes, allowedOperations: DropOperation[], x: number, y: number) => DropOperation;
  8683. /** Handler that is called when a valid drag enters the drop target. */
  8684. onDropEnter?: (e: DropEnterEvent) => void;
  8685. /** Handler that is called when a valid drag is moved within the drop target. */
  8686. onDropMove?: (e: DropMoveEvent) => void;
  8687. /**
  8688. * Handler that is called after a valid drag is held over the drop target for a period of time.
  8689. * This typically opens the item so that the user can drop within it.
  8690. * @private
  8691. */
  8692. onDropActivate?: (e: DropActivateEvent) => void;
  8693. /** Handler that is called when a valid drag exits the drop target. */
  8694. onDropExit?: (e: DropExitEvent) => void;
  8695. /** Handler that is called when a valid drag is dropped on the drop target. */
  8696. onDrop?: (e: DropEvent) => void;
  8697. /**
  8698. * Whether the item has an explicit focusable drop affordance to initiate accessible drag and drop mode.
  8699. * If true, the dropProps will omit these event handlers, and they will be applied to dropButtonProps instead.
  8700. */
  8701. hasDropButton?: boolean;
  8702. }
  8703. interface DroppableCollectionOptions extends DroppableCollectionProps {
  8704. /** A delegate object that implements behavior for keyboard focus movement. */
  8705. keyboardDelegate: KeyboardDelegate;
  8706. /** A delegate object that provides drop targets for pointer coordinates within the collection. */
  8707. dropTargetDelegate: DropTargetDelegate;
  8708. }
  8709. interface DraggableCollectionOptions {
  8710. }
  8711. interface ClipboardProps {
  8712. /** A function that returns the items to copy. */
  8713. getItems?: () => DragItem[];
  8714. /** Handler that is called when the user triggers a copy interaction. */
  8715. onCopy?: () => void;
  8716. /** Handler that is called when the user triggers a cut interaction. */
  8717. onCut?: () => void;
  8718. /** Handler that is called when the user triggers a paste interaction. */
  8719. onPaste?: (items: DropItem[]) => void;
  8720. }
  8721. declare global {
  8722. namespace FormatjsIntl {
  8723. interface Message {
  8724. }
  8725. interface IntlConfig {
  8726. }
  8727. interface Formats {
  8728. }
  8729. }
  8730. }
  8731. type LocalizedStrings = {
  8732. [lang: string]: {
  8733. [key: string]: string;
  8734. };
  8735. };
  8736. interface NumberFormatOptions extends Intl.NumberFormatOptions {
  8737. /** Overrides default numbering system for the current locale. */
  8738. numberingSystem?: string;
  8739. }
  8740. interface Locale {
  8741. /** The [BCP47](https://www.ietf.org/rfc/bcp/bcp47.txt) language code for the locale. */
  8742. locale: string;
  8743. /** The writing direction for the locale. */
  8744. direction: Direction;
  8745. }
  8746. interface I18nProviderProps$1 {
  8747. /** Contents that should have the locale applied. */
  8748. children: ReactNode;
  8749. /** The locale to apply to the children. */
  8750. locale?: string;
  8751. }
  8752. interface DateFormatterOptions extends Intl.DateTimeFormatOptions {
  8753. calendar?: string;
  8754. }
  8755. /**
  8756. * Provides localized date formatting for the current locale. Automatically updates when the locale changes,
  8757. * and handles caching of the date formatter for performance.
  8758. * @param options - Formatting options.
  8759. */
  8760. declare function useDateFormatter(options?: DateFormatterOptions): DateFormatter;
  8761. /**
  8762. * Provides localized number formatting for the current locale. Automatically updates when the locale changes,
  8763. * and handles caching of the number formatter for performance.
  8764. * @param options - Formatting options.
  8765. */
  8766. declare function useNumberFormatter(options?: NumberFormatOptions): Intl.NumberFormat;
  8767. /**
  8768. * Provides localized string collation for the current locale. Automatically updates when the locale changes,
  8769. * and handles caching of the collator for performance.
  8770. * @param options - Collator options.
  8771. */
  8772. declare function useCollator(options?: Intl.CollatorOptions): Intl.Collator;
  8773. interface PressProps extends PressEvents {
  8774. /** Whether the target is in a controlled press state (e.g. an overlay it triggers is open). */
  8775. isPressed?: boolean;
  8776. /** Whether the press events should be disabled. */
  8777. isDisabled?: boolean;
  8778. /** Whether the target should not receive focus on press. */
  8779. preventFocusOnPress?: boolean;
  8780. /**
  8781. * Whether press events should be canceled when the pointer leaves the target while pressed.
  8782. * By default, this is `false`, which means if the pointer returns back over the target while
  8783. * still pressed, onPressStart will be fired again. If set to `true`, the press is canceled
  8784. * when the pointer leaves the target and onPressStart will not be fired if the pointer returns.
  8785. */
  8786. shouldCancelOnPointerExit?: boolean;
  8787. /** Whether text selection should be enabled on the pressable element. */
  8788. allowTextSelectionOnPress?: boolean;
  8789. }
  8790. interface AriaLinkOptions extends AriaLinkProps {
  8791. /** Whether the link is disabled. */
  8792. isDisabled?: boolean;
  8793. /**
  8794. * The HTML element used to render the link, e.g. 'a', or 'span'.
  8795. * @default 'a'
  8796. */
  8797. elementType?: string;
  8798. }
  8799. interface AriaPositionProps extends PositionProps {
  8800. /**
  8801. * Cross size of the overlay arrow in pixels.
  8802. * @default 0
  8803. */
  8804. arrowSize?: number;
  8805. /**
  8806. * Element that that serves as the positioning boundary.
  8807. * @default document.body
  8808. */
  8809. boundaryElement?: Element;
  8810. /**
  8811. * The ref for the element which the overlay positions itself with respect to.
  8812. */
  8813. targetRef: RefObject<Element>;
  8814. /**
  8815. * The ref for the overlay element.
  8816. */
  8817. overlayRef: RefObject<Element>;
  8818. /**
  8819. * A ref for the scrollable region within the overlay.
  8820. * @default overlayRef
  8821. */
  8822. scrollRef?: RefObject<Element>;
  8823. /**
  8824. * Whether the overlay should update its position automatically.
  8825. * @default true
  8826. */
  8827. shouldUpdatePosition?: boolean;
  8828. /** Handler that is called when the overlay should close. */
  8829. onClose?: () => void;
  8830. /**
  8831. * The maxHeight specified for the overlay element.
  8832. * By default, it will take all space up to the current viewport height.
  8833. */
  8834. maxHeight?: number;
  8835. /**
  8836. * The minimum distance the arrow's edge should be from the edge of the overlay element.
  8837. * @default 0
  8838. */
  8839. arrowBoundaryOffset?: number;
  8840. }
  8841. interface AriaOverlayProps {
  8842. /** Whether the overlay is currently open. */
  8843. isOpen?: boolean;
  8844. /** Handler that is called when the overlay should close. */
  8845. onClose?: () => void;
  8846. /**
  8847. * Whether to close the overlay when the user interacts outside it.
  8848. * @default false
  8849. */
  8850. isDismissable?: boolean;
  8851. /** Whether the overlay should close when focus is lost or moves outside it. */
  8852. shouldCloseOnBlur?: boolean;
  8853. /**
  8854. * Whether pressing the escape key to close the overlay should be disabled.
  8855. * @default false
  8856. */
  8857. isKeyboardDismissDisabled?: boolean;
  8858. /**
  8859. * When user interacts with the argument element outside of the overlay ref,
  8860. * return true if onClose should be called. This gives you a chance to filter
  8861. * out interaction with elements that should not dismiss the overlay.
  8862. * By default, onClose will always be called on interaction outside the overlay ref.
  8863. */
  8864. shouldCloseOnInteractOutside?: (element: Element) => boolean;
  8865. }
  8866. interface OverlayTriggerProps {
  8867. /** Type of overlay that is opened by the trigger. */
  8868. type: 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid';
  8869. }
  8870. interface OverlayTriggerAria {
  8871. /** Props for the trigger element. */
  8872. triggerProps: AriaButtonProps;
  8873. /** Props for the overlay container element. */
  8874. overlayProps: DOMProps;
  8875. }
  8876. /**
  8877. * Handles the behavior and accessibility for an overlay trigger, e.g. a button
  8878. * that opens a popover, menu, or other overlay that is positioned relative to the trigger.
  8879. */
  8880. declare function useOverlayTrigger(props: OverlayTriggerProps, state: OverlayTriggerState, ref?: RefObject<Element>): OverlayTriggerAria;
  8881. interface AriaPopoverProps extends Omit<AriaPositionProps, 'isOpen' | 'onClose' | 'targetRef' | 'overlayRef'> {
  8882. /**
  8883. * The ref for the element which the popover positions itself with respect to.
  8884. */
  8885. triggerRef: RefObject<Element>;
  8886. /**
  8887. * The ref for the popover element.
  8888. */
  8889. popoverRef: RefObject<Element>;
  8890. /**
  8891. * Whether the popover is non-modal, i.e. elements outside the popover may be
  8892. * interacted with by assistive technologies.
  8893. *
  8894. * Most popovers should not use this option as it may negatively impact the screen
  8895. * reader experience. Only use with components such as combobox, which are designed
  8896. * to handle this situation carefully.
  8897. */
  8898. isNonModal?: boolean;
  8899. /**
  8900. * Whether pressing the escape key to close the popover should be disabled.
  8901. *
  8902. * Most popovers should not use this option. When set to true, an alternative
  8903. * way to close the popover with a keyboard must be provided.
  8904. *
  8905. * @default false
  8906. */
  8907. isKeyboardDismissDisabled?: boolean;
  8908. /**
  8909. * When user interacts with the argument element outside of the popover ref,
  8910. * return true if onClose should be called. This gives you a chance to filter
  8911. * out interaction with elements that should not dismiss the popover.
  8912. * By default, onClose will always be called on interaction outside the popover ref.
  8913. */
  8914. shouldCloseOnInteractOutside?: (element: Element) => boolean;
  8915. }
  8916. interface OverlayProps {
  8917. /**
  8918. * The container element in which the overlay portal will be placed.
  8919. * @default document.body
  8920. */
  8921. portalContainer?: Element;
  8922. /** The overlay to render in the portal. */
  8923. children: ReactNode;
  8924. /**
  8925. * Disables default focus management for the overlay, including containment and restoration.
  8926. * This option should be used very carefully. When focus management is disabled, you must
  8927. * implement focus containment and restoration to ensure the overlay is keyboard accessible.
  8928. */
  8929. disableFocusManagement?: boolean;
  8930. /**
  8931. * Whether the overlay is currently performing an exit animation. When true,
  8932. * focus is allowed to move outside.
  8933. */
  8934. isExiting?: boolean;
  8935. }
  8936. interface AriaModalOverlayProps extends Pick<AriaOverlayProps, 'shouldCloseOnInteractOutside'> {
  8937. /**
  8938. * Whether to close the modal when the user interacts outside it.
  8939. * @default false
  8940. */
  8941. isDismissable?: boolean;
  8942. /**
  8943. * Whether pressing the escape key to close the modal should be disabled.
  8944. * @default false
  8945. */
  8946. isKeyboardDismissDisabled?: boolean;
  8947. }
  8948. interface AriaMenuTriggerProps {
  8949. /** The type of menu that the menu trigger opens. */
  8950. type?: 'menu' | 'listbox';
  8951. /** Whether menu trigger is disabled. */
  8952. isDisabled?: boolean;
  8953. /** How menu is triggered. */
  8954. trigger?: MenuTriggerType;
  8955. }
  8956. /*
  8957. * Copyright 2020 Adobe. All rights reserved.
  8958. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  8959. * you may not use this file except in compliance with the License. You may obtain a copy
  8960. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  8961. *
  8962. * Unless required by applicable law or agreed to in writing, software distributed under
  8963. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  8964. * OF ANY KIND, either express or implied. See the License for the specific language
  8965. * governing permissions and limitations under the License.
  8966. */
  8967. interface ProgressBaseProps {
  8968. /**
  8969. * The current value (controlled).
  8970. * @default 0
  8971. */
  8972. value?: number,
  8973. /**
  8974. * The smallest value allowed for the input.
  8975. * @default 0
  8976. */
  8977. minValue?: number,
  8978. /**
  8979. * The largest value allowed for the input.
  8980. * @default 100
  8981. */
  8982. maxValue?: number
  8983. }
  8984. interface ProgressBarBaseProps extends ProgressBaseProps {
  8985. /** The content to display as the label. */
  8986. label?: ReactNode,
  8987. /**
  8988. * The display format of the value label.
  8989. * @default {style: 'percent'}
  8990. */
  8991. formatOptions?: Intl.NumberFormatOptions,
  8992. /** The content to display as the value's label (e.g. 1 of 4). */
  8993. valueLabel?: ReactNode
  8994. }
  8995. interface ProgressBarProps$1 extends ProgressBarBaseProps {
  8996. /**
  8997. * Whether presentation is indeterminate when progress isn't known.
  8998. */
  8999. isIndeterminate?: boolean
  9000. }
  9001. interface AriaProgressBarProps extends ProgressBarProps$1, DOMProps, AriaLabelingProps$1 {}
  9002. interface AriaSelectOptions<T> extends Omit<AriaSelectProps<T>, 'children'> {
  9003. /**
  9004. * An optional keyboard delegate implementation for type to select,
  9005. * to override the default.
  9006. */
  9007. keyboardDelegate?: KeyboardDelegate;
  9008. }
  9009. interface SeparatorProps$1 extends DOMProps, AriaLabelingProps$1 {
  9010. /**
  9011. * The orientation of the separator.
  9012. * @default 'horizontal'
  9013. */
  9014. orientation?: Orientation;
  9015. /** The HTML element type that will be used to render the separator. */
  9016. elementType?: string;
  9017. }
  9018. /*
  9019. * Copyright 2020 Adobe. All rights reserved.
  9020. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  9021. * you may not use this file except in compliance with the License. You may obtain a copy
  9022. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  9023. *
  9024. * Unless required by applicable law or agreed to in writing, software distributed under
  9025. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  9026. * OF ANY KIND, either express or implied. See the License for the specific language
  9027. * governing permissions and limitations under the License.
  9028. */
  9029. interface SwitchBase extends InputBase, FocusableProps {
  9030. /**
  9031. * The content to render as the Switch's label.
  9032. */
  9033. children?: ReactNode,
  9034. /**
  9035. * Whether the Switch should be selected (uncontrolled).
  9036. */
  9037. defaultSelected?: boolean,
  9038. /**
  9039. * Whether the Switch should be selected (controlled).
  9040. */
  9041. isSelected?: boolean,
  9042. /**
  9043. * Handler that is called when the Switch's selection state changes.
  9044. */
  9045. onChange?: (isSelected: boolean) => void,
  9046. /**
  9047. * 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).
  9048. */
  9049. value?: string
  9050. }
  9051. interface SwitchProps$1 extends SwitchBase {}
  9052. interface AriaSwitchBase extends SwitchBase, FocusableDOMProps, InputDOMProps, AriaLabelingProps$1 {
  9053. /**
  9054. * Identifies the element (or elements) whose contents or presence are controlled by the current element.
  9055. */
  9056. 'aria-controls'?: string
  9057. }
  9058. interface AriaSwitchProps extends SwitchProps$1, AriaSwitchBase {}
  9059. interface AriaTagGroupProps<T> extends CollectionBase<T>, MultipleSelection, DOMProps, LabelableProps, AriaLabelingProps$1, Omit<HelpTextProps, 'errorMessage'> {
  9060. /** How multiple selection should behave in the collection. */
  9061. selectionBehavior?: SelectionBehavior;
  9062. /** Handler that is called when a user deletes a tag. */
  9063. onRemove?: (keys: Set<Key$1>) => void;
  9064. /** An error message for the field. */
  9065. errorMessage?: ReactNode;
  9066. }
  9067. /**
  9068. * A map of HTML element names and their interface types.
  9069. * For example `'a'` -> `HTMLAnchorElement`.
  9070. */
  9071. type IntrinsicHTMLElements = {
  9072. [K in keyof IntrinsicHTMLAttributes]: IntrinsicHTMLAttributes[K] extends HTMLAttributes<infer T> ? T : never;
  9073. };
  9074. /**
  9075. * A map of HTML element names and their attribute interface types.
  9076. * For example `'a'` -> `AnchorHTMLAttributes<HTMLAnchorElement>`.
  9077. */
  9078. type IntrinsicHTMLAttributes = {
  9079. [K in keyof ReactDOM]: ReactDOM[K] extends DOMFactory<infer T, any> ? T : never;
  9080. };
  9081. /**
  9082. * The intrinsic HTML element names that `useTextField` supports; e.g. `input`,
  9083. * `textarea`.
  9084. */
  9085. type TextFieldIntrinsicElements = keyof Pick<IntrinsicHTMLElements, 'input' | 'textarea'>;
  9086. interface AriaTextFieldOptions<T extends TextFieldIntrinsicElements> extends AriaTextFieldProps {
  9087. /**
  9088. * The HTML element used to render the input, e.g. 'input', or 'textarea'.
  9089. * It determines whether certain HTML attributes will be included in `inputProps`.
  9090. * For example, [`type`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-type).
  9091. * @default 'input'
  9092. */
  9093. inputElementType?: T;
  9094. /**
  9095. * Controls whether inputted text is automatically capitalized and, if so, in what manner.
  9096. * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize).
  9097. */
  9098. autoCapitalize?: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';
  9099. }
  9100. interface SVGRProps {
  9101. title?: string;
  9102. titleId?: string;
  9103. size?: CSSProperties["width"];
  9104. }
  9105. declare type IconProps = SVGRProps & SVGProps<SVGSVGElement>;
  9106. interface ResponsiveArray<Length extends number, Value> extends ReadonlyArray<Value> {
  9107. 0: Value;
  9108. length: Length;
  9109. }
  9110. declare const createLayerSprinkles: (layer: string) => ((props: {
  9111. paddingBlockStart?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9112. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9113. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9114. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9115. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9116. paddingInlineEnd?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9117. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9118. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9119. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9120. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9121. paddingBlockEnd?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9122. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9123. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9124. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9125. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9126. paddingInlineStart?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9127. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9128. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9129. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9130. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9131. marginBlockStart?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9132. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9133. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9134. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9135. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9136. marginInlineEnd?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9137. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9138. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9139. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9140. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9141. marginBlockEnd?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9142. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9143. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9144. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9145. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9146. marginInlineStart?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9147. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9148. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9149. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9150. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9151. gap?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9152. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9153. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9154. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9155. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9156. paddingLeft?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9157. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9158. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9159. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9160. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9161. paddingRight?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9162. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9163. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9164. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9165. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9166. paddingTop?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9167. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9168. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9169. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9170. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9171. paddingBottom?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9172. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9173. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9174. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9175. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9176. padding?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9177. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9178. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9179. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9180. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9181. paddingX?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9182. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9183. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9184. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9185. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9186. paddingY?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9187. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9188. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9189. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9190. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9191. marginLeft?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9192. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9193. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9194. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9195. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9196. marginRight?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9197. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9198. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9199. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9200. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9201. marginTop?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9202. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9203. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9204. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9205. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9206. marginBottom?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9207. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9208. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9209. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9210. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9211. margin?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9212. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9213. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9214. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9215. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9216. marginX?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9217. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9218. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9219. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9220. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9221. marginY?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | {
  9222. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9223. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9224. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | undefined;
  9225. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null>;
  9226. } & {
  9227. borderStartStartRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
  9228. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9229. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9230. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9231. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
  9232. borderStartEndRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
  9233. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9234. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9235. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9236. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
  9237. borderEndStartRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
  9238. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9239. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9240. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9241. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
  9242. borderEndEndRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
  9243. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9244. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9245. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9246. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
  9247. borderRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
  9248. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9249. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9250. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9251. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
  9252. borderTopRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
  9253. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9254. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9255. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9256. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
  9257. borderBottomRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
  9258. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9259. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9260. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9261. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
  9262. borderLeftRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
  9263. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9264. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9265. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9266. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
  9267. borderRightRadius?: ("none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | {
  9268. mobile?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9269. tablet?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9270. desktop?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | undefined;
  9271. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null>;
  9272. } & {
  9273. boxShadow?: "medium" | "low" | undefined;
  9274. } & {
  9275. opacity?: "none" | "medium" | "low" | "high" | undefined;
  9276. } & {
  9277. 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;
  9278. } & {
  9279. 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;
  9280. 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;
  9281. 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;
  9282. 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;
  9283. } & {
  9284. position?: ("fixed" | "absolute" | "relative" | {
  9285. mobile?: "fixed" | "absolute" | "relative" | undefined;
  9286. tablet?: "fixed" | "absolute" | "relative" | undefined;
  9287. desktop?: "fixed" | "absolute" | "relative" | undefined;
  9288. } | undefined) | ResponsiveArray<1 | 2 | 3, "fixed" | "absolute" | "relative" | null>;
  9289. display?: ("none" | "block" | "flex" | "grid" | "inline-flex" | {
  9290. mobile?: "none" | "block" | "flex" | "grid" | "inline-flex" | undefined;
  9291. tablet?: "none" | "block" | "flex" | "grid" | "inline-flex" | undefined;
  9292. desktop?: "none" | "block" | "flex" | "grid" | "inline-flex" | undefined;
  9293. } | undefined) | ResponsiveArray<1 | 2 | 3, "none" | "block" | "flex" | "grid" | "inline-flex" | null>;
  9294. flexDirection?: ("column" | "column-reverse" | "row" | "row-reverse" | {
  9295. mobile?: "column" | "column-reverse" | "row" | "row-reverse" | undefined;
  9296. tablet?: "column" | "column-reverse" | "row" | "row-reverse" | undefined;
  9297. desktop?: "column" | "column-reverse" | "row" | "row-reverse" | undefined;
  9298. } | undefined) | ResponsiveArray<1 | 2 | 3, "column" | "column-reverse" | "row" | "row-reverse" | null>;
  9299. alignItems?: ("stretch" | "center" | "flex-end" | "flex-start" | {
  9300. mobile?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
  9301. tablet?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
  9302. desktop?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
  9303. } | undefined) | ResponsiveArray<1 | 2 | 3, "stretch" | "center" | "flex-end" | "flex-start" | null>;
  9304. alignSelf?: ("stretch" | "center" | "flex-end" | "flex-start" | {
  9305. mobile?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
  9306. tablet?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
  9307. desktop?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
  9308. } | undefined) | ResponsiveArray<1 | 2 | 3, "stretch" | "center" | "flex-end" | "flex-start" | null>;
  9309. flex?: (number | {
  9310. mobile?: number | undefined;
  9311. tablet?: number | undefined;
  9312. desktop?: number | undefined;
  9313. } | undefined) | ResponsiveArray<1 | 2 | 3, number | null>;
  9314. justifyContent?: ("space-between" | "stretch" | "center" | "flex-end" | "flex-start" | {
  9315. mobile?: "space-between" | "stretch" | "center" | "flex-end" | "flex-start" | undefined;
  9316. tablet?: "space-between" | "stretch" | "center" | "flex-end" | "flex-start" | undefined;
  9317. desktop?: "space-between" | "stretch" | "center" | "flex-end" | "flex-start" | undefined;
  9318. } | undefined) | ResponsiveArray<1 | 2 | 3, "space-between" | "stretch" | "center" | "flex-end" | "flex-start" | null>;
  9319. justifySelf?: ("stretch" | "center" | "flex-end" | "flex-start" | {
  9320. mobile?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
  9321. tablet?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
  9322. desktop?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
  9323. } | undefined) | ResponsiveArray<1 | 2 | 3, "stretch" | "center" | "flex-end" | "flex-start" | null>;
  9324. placeItems?: ("stretch" | "center" | "flex-end" | "flex-start" | {
  9325. mobile?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
  9326. tablet?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
  9327. desktop?: "stretch" | "center" | "flex-end" | "flex-start" | undefined;
  9328. } | undefined) | ResponsiveArray<1 | 2 | 3, "stretch" | "center" | "flex-end" | "flex-start" | null>;
  9329. } & {
  9330. transition?: "transition.medium" | undefined;
  9331. transitionProperty?: "opacity" | "transform" | "background-color" | undefined;
  9332. } & {
  9333. readonly flexWrap?: "nowrap" | "wrap" | undefined;
  9334. readonly insetBlockStart?: 0 | undefined;
  9335. readonly insetBlockEnd?: 0 | undefined;
  9336. readonly insetInlineStart?: 0 | undefined;
  9337. readonly insetInlineEnd?: 0 | undefined;
  9338. readonly flexShrink?: 0 | undefined;
  9339. readonly flexGrow?: 0 | 1 | undefined;
  9340. readonly width?: "full" | undefined;
  9341. readonly height?: "full" | undefined;
  9342. readonly cursor?: "pointer" | undefined;
  9343. inset?: 0 | undefined;
  9344. } & {
  9345. outline?: "none" | undefined;
  9346. outlineStyle?: "solid" | undefined;
  9347. outlineWidth?: number | undefined;
  9348. outlineOffset?: number | undefined;
  9349. border?: "none" | undefined;
  9350. borderStyle?: "dashed" | "solid" | undefined;
  9351. borderWidth?: number | undefined;
  9352. }) => string) & {
  9353. 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">;
  9354. };
  9355. declare type BaseSprinkles = ReturnType<typeof createLayerSprinkles>;
  9356. interface Theme {
  9357. elevation: Elevation;
  9358. opacity: Opacity;
  9359. rounded: Rounded;
  9360. spacing: Spacing;
  9361. color: Color$1;
  9362. typography: Typography;
  9363. }
  9364. interface Typography {
  9365. heading: Heading;
  9366. label: Label;
  9367. body: Label;
  9368. }
  9369. interface Label {
  9370. sm: H6;
  9371. md: H6;
  9372. lg: H6;
  9373. }
  9374. interface Heading {
  9375. h6: H6;
  9376. h5: H6;
  9377. h4: H6;
  9378. h3: H6;
  9379. h2: H6;
  9380. h1: H6;
  9381. }
  9382. interface H6 {
  9383. regular: Regular;
  9384. medium: Regular;
  9385. semibold: Regular;
  9386. }
  9387. interface Regular {
  9388. font: string;
  9389. letterSpacing: string;
  9390. }
  9391. interface Color$1 {
  9392. support: Support;
  9393. focused: Focused;
  9394. background: Background;
  9395. text: Text$2;
  9396. icon: Icon;
  9397. border: Border;
  9398. interactive: Interactive;
  9399. positive: Positive;
  9400. }
  9401. interface Positive {
  9402. subtle: string;
  9403. medium: string;
  9404. strong: string;
  9405. interactive: string;
  9406. }
  9407. interface Interactive {
  9408. primary: string;
  9409. hovered: string;
  9410. active: string;
  9411. visited: string;
  9412. disabled: string;
  9413. }
  9414. interface Border {
  9415. subtle: string;
  9416. medium: string;
  9417. strong: string;
  9418. inverse: string;
  9419. interactive: string;
  9420. disabled: string;
  9421. }
  9422. interface Icon {
  9423. primary: string;
  9424. secondary: string;
  9425. inverse: string;
  9426. interactive: string;
  9427. disabled: string;
  9428. }
  9429. interface Text$2 {
  9430. primary: string;
  9431. secondary: string;
  9432. helper: string;
  9433. placeholder: string;
  9434. inverse: string;
  9435. disabled: string;
  9436. }
  9437. interface Background {
  9438. primary: Primary;
  9439. inverse: Primary;
  9440. secondary: Primary;
  9441. overlay: Overlay;
  9442. }
  9443. interface Overlay {
  9444. subtle: string;
  9445. medium: string;
  9446. interactive: string;
  9447. }
  9448. interface Primary {
  9449. subtle: string;
  9450. medium: string;
  9451. strong: string;
  9452. }
  9453. interface Focused {
  9454. primary: string;
  9455. inset: string;
  9456. }
  9457. interface Support {
  9458. error: Error$1;
  9459. success: Error$1;
  9460. warning: Error$1;
  9461. info: Error$1;
  9462. }
  9463. interface Error$1 {
  9464. subtler: string;
  9465. subtle: string;
  9466. medium: string;
  9467. strong: string;
  9468. }
  9469. interface Spacing {
  9470. xs: string;
  9471. sm: string;
  9472. md: string;
  9473. lg: string;
  9474. xl: string;
  9475. '2xl': string;
  9476. '3xl': string;
  9477. '4xl': string;
  9478. '5xl': string;
  9479. '6xl': string;
  9480. '7xl': string;
  9481. '8xl': string;
  9482. '9xl': string;
  9483. }
  9484. interface Rounded {
  9485. xs: string;
  9486. sm: string;
  9487. md: string;
  9488. lg: string;
  9489. xl: string;
  9490. '2xl': string;
  9491. full: string;
  9492. }
  9493. interface Opacity {
  9494. none: string;
  9495. low: string;
  9496. medium: string;
  9497. high: string;
  9498. }
  9499. interface Elevation {
  9500. low: string;
  9501. medium: string;
  9502. }
  9503. interface Sprinkles extends BaseSprinkles {
  9504. base: BaseSprinkles;
  9505. variants: BaseSprinkles;
  9506. compoundVariants: BaseSprinkles;
  9507. overrides: BaseSprinkles;
  9508. }
  9509. /*
  9510. * Copyright 2020 Adobe. All rights reserved.
  9511. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  9512. * you may not use this file except in compliance with the License. You may obtain a copy
  9513. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  9514. *
  9515. * Unless required by applicable law or agreed to in writing, software distributed under
  9516. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  9517. * OF ANY KIND, either express or implied. See the License for the specific language
  9518. * governing permissions and limitations under the License.
  9519. */
  9520. /** A list of supported color formats. */
  9521. type ColorFormat = 'hex' | 'hexa' | 'rgb' | 'rgba' | 'hsl' | 'hsla' | 'hsb' | 'hsba';
  9522. /** A list of color channels. */
  9523. type ColorChannel = 'hue' | 'saturation' | 'brightness' | 'lightness' | 'red' | 'green' | 'blue' | 'alpha';
  9524. type ColorAxes = {xChannel: ColorChannel, yChannel: ColorChannel, zChannel: ColorChannel};
  9525. interface ColorChannelRange {
  9526. /** The minimum value of the color channel. */
  9527. minValue: number,
  9528. /** The maximum value of the color channel. */
  9529. maxValue: number,
  9530. /** The step value of the color channel, used when incrementing and decrementing. */
  9531. step: number,
  9532. /** The page step value of the color channel, used when incrementing and decrementing. */
  9533. pageSize: number
  9534. }
  9535. /** Represents a color value. */
  9536. interface Color {
  9537. /** Converts the color to the given color format, and returns a new Color object. */
  9538. toFormat(format: ColorFormat): Color,
  9539. /** Converts the color to a string in the given format. */
  9540. toString(format: ColorFormat | 'css'): string,
  9541. /** Converts the color to hex, and returns an integer representation. */
  9542. toHexInt(): number,
  9543. /**
  9544. * Returns the numeric value for a given channel.
  9545. * Throws an error if the channel is unsupported in the current color format.
  9546. */
  9547. getChannelValue(channel: ColorChannel): number,
  9548. /**
  9549. * Sets the numeric value for a given channel, and returns a new Color object.
  9550. * Throws an error if the channel is unsupported in the current color format.
  9551. */
  9552. withChannelValue(channel: ColorChannel, value: number): Color,
  9553. /**
  9554. * Returns the minimum, maximum, and step values for a given channel.
  9555. */
  9556. getChannelRange(channel: ColorChannel): ColorChannelRange,
  9557. /**
  9558. * Returns a localized color channel name for a given channel and locale,
  9559. * for use in visual or accessibility labels.
  9560. */
  9561. getChannelName(channel: ColorChannel, locale: string): string,
  9562. /**
  9563. * Formats the numeric value for a given channel for display according to the provided locale.
  9564. */
  9565. formatChannelValue(channel: ColorChannel, locale: string): string,
  9566. /**
  9567. * Returns the color space, 'rgb', 'hsb' or 'hsl', for the current color.
  9568. */
  9569. getColorSpace(): ColorFormat,
  9570. /**
  9571. * Returns the color space axes, xChannel, yChannel, zChannel.
  9572. */
  9573. getColorSpaceAxes(xyChannels: {xChannel?: ColorChannel, yChannel?: ColorChannel}): ColorAxes,
  9574. /**
  9575. * Returns an array of the color channels within the current color space space.
  9576. */
  9577. getColorChannels(): [ColorChannel, ColorChannel, ColorChannel]
  9578. }
  9579. interface ColorFieldProps extends Omit<ValueBase<string | Color | null>, 'onChange'>, InputBase, Validation<Color | null>, FocusableProps, TextInputBase, LabelableProps, HelpTextProps {
  9580. /** Handler that is called when the value changes. */
  9581. onChange?: (color: Color | null) => void
  9582. }
  9583. interface IObject<T> {
  9584. [name: string]: T;
  9585. }
  9586. declare type TargetParam<Param> = Pick<Param, Exclude<keyof Param, keyof EmitterParam>> & Partial<EmitterParam>;
  9587. interface EmitterParam<Target = any> {
  9588. type: string;
  9589. currentTarget: Target;
  9590. stop(): void;
  9591. }
  9592. declare type OnEvent$1<Param, Target = any> = EmitterParam<Target> & Param;
  9593. declare type EventHash<Events, Target> = Partial<{
  9594. [Key in keyof Events]: EventListener<Events[Key], Target>;
  9595. }>;
  9596. declare type EventListener<Param, Target> = (e: OnEvent$1<Param, Target>) => any;
  9597. declare class EventEmitter<Events extends {} = {
  9598. [key: string]: {
  9599. [key: string]: any;
  9600. };
  9601. }> {
  9602. private _events;
  9603. on<Name extends keyof Events, Param = Events[Name]>(eventName: Name, listener: EventListener<Param, this>): this;
  9604. on(events: EventHash<Events, this>): this;
  9605. off<Name extends keyof Events, Param = Events[Name]>(eventName?: Name, listener?: EventListener<Param, this>): this;
  9606. off(events: EventHash<Events, this>): this;
  9607. once<Name extends keyof Events & string, Param = Events[Name]>(eventName: Name, listener?: EventListener<Param, this>): Promise<OnEvent$1<Param, this>>;
  9608. emit<Name extends keyof Events, Param = Events[Name]>(eventName: {} extends Param ? Name : never): boolean;
  9609. emit<Name extends keyof Events, Param = Events[Name]>(eventName: Name, param: TargetParam<Param>): boolean;
  9610. trigger<Name extends keyof Events, Param = Events[Name]>(eventName: {} extends TargetParam<Param> ? Name : never): boolean;
  9611. trigger<Name extends keyof Events, Param = Events[Name]>(eventName: Name, param: TargetParam<Param>): boolean;
  9612. private _addEvent;
  9613. }
  9614. /**
  9615. * @typedef
  9616. * @memberof Gesto
  9617. */
  9618. interface Client {
  9619. clientX: number;
  9620. clientY: number;
  9621. originalClientX?: number;
  9622. originalClientY?: number;
  9623. }
  9624. /**
  9625. * @typedef
  9626. * @memberof Gesto
  9627. */
  9628. interface Dist {
  9629. distX: number;
  9630. distY: number;
  9631. }
  9632. /**
  9633. * @typedef
  9634. * @memberof Gesto
  9635. */
  9636. interface Delta {
  9637. deltaX: number;
  9638. deltaY: number;
  9639. }
  9640. /**
  9641. * @typedef
  9642. * @memberof Gesto
  9643. * @extends Gesto.Client
  9644. * @extends Gesto.Dist
  9645. * @extends Gesto.Delta
  9646. */
  9647. interface Position extends Client, Dist, Delta {
  9648. }
  9649. /**
  9650. * @typedef
  9651. * @memberof Gesto
  9652. * @extends Gesto.Position
  9653. * @extends EventEmitter.EmitterParam
  9654. */
  9655. interface OnDragStart$1<T = Gesto> extends Position, EmitterParam<T> {
  9656. datas: IObject<any>;
  9657. data: IObject<any>;
  9658. inputEvent: any;
  9659. isTrusted: boolean;
  9660. isMouseEvent: boolean;
  9661. isSecondaryButton: boolean;
  9662. isDouble: boolean;
  9663. preventDefault: () => void;
  9664. preventDrag: () => void;
  9665. }
  9666. /**
  9667. * @typedef
  9668. * @memberof Gesto
  9669. * @extends Gesto.Position
  9670. * @extends EventEmitter.EmitterParam
  9671. */
  9672. interface OnDrag$1<T = Gesto> extends Position, EmitterParam<T> {
  9673. isDrag: boolean;
  9674. isMouseEvent: boolean;
  9675. isSecondaryButton: boolean;
  9676. isPinch: boolean;
  9677. movement: number;
  9678. datas: IObject<any>;
  9679. data: IObject<any>;
  9680. isScroll: boolean;
  9681. isFirstDrag: boolean;
  9682. inputEvent: any;
  9683. isTrusted: boolean;
  9684. }
  9685. /**
  9686. * @typedef
  9687. * @memberof Gesto
  9688. * @extends Gesto.Position
  9689. * @extends EventEmitter.EmitterParam
  9690. */
  9691. interface OnDragEnd$1<T = Gesto> extends Position, EmitterParam<T> {
  9692. isDrag: boolean;
  9693. isClick: boolean;
  9694. isMouseEvent: boolean;
  9695. isSecondaryButton: boolean;
  9696. isDouble: boolean;
  9697. datas: IObject<any>;
  9698. data: IObject<any>;
  9699. inputEvent: any;
  9700. isTrusted: boolean;
  9701. }
  9702. /**
  9703. * @typedef
  9704. * @memberof Gesto
  9705. * @extends Gesto.Position
  9706. * @extends EventEmitter.EmitterParam
  9707. */
  9708. interface OnPinchStart<T = Gesto> extends Position, EmitterParam<T> {
  9709. datas: IObject<any>;
  9710. data: IObject<any>;
  9711. touches: Position[];
  9712. angle: number;
  9713. inputEvent: any;
  9714. isTrusted: boolean;
  9715. preventDefault: () => void;
  9716. preventDrag: () => void;
  9717. }
  9718. /**
  9719. * @typedef
  9720. * @memberof Gesto
  9721. * @extends Gesto.Position
  9722. * @extends EventEmitter.EmitterParam
  9723. */
  9724. interface OnPinch<T = Gesto> extends Position, EmitterParam<T> {
  9725. datas: IObject<any>;
  9726. data: IObject<any>;
  9727. touches: Position[];
  9728. rotation: number;
  9729. angle: number;
  9730. scale: number;
  9731. distance: number;
  9732. movement: number;
  9733. inputEvent: any;
  9734. isTrusted: boolean;
  9735. }
  9736. /**
  9737. * @typedef
  9738. * @memberof Gesto
  9739. * @extends Gesto.Position
  9740. * @extends EventEmitter.EmitterParam
  9741. */
  9742. interface OnPinchEnd<T = Gesto> extends Position, EmitterParam<T> {
  9743. isPinch: boolean;
  9744. datas: IObject<any>;
  9745. data: IObject<any>;
  9746. touches: Position[];
  9747. inputEvent: any;
  9748. }
  9749. /**
  9750. * @typedef
  9751. * @memberof Gesto
  9752. */
  9753. interface GestoOptions {
  9754. container?: Window | Node | Element;
  9755. /**
  9756. * @default ["mouse", "touch"]
  9757. */
  9758. events?: Array<"drag" | "mouse" | "touch">;
  9759. /**
  9760. * Whether to prevent dragging of the right mouse button
  9761. * @default true
  9762. */
  9763. preventRightClick?: boolean;
  9764. /**
  9765. * @default true
  9766. */
  9767. preventWheelClick?: boolean;
  9768. preventDefault?: boolean;
  9769. /**
  9770. * Prevents pinching when the drag is moved more than a certain distance. That distance allowance is pinchThreshold.
  9771. * @default 0
  9772. */
  9773. pinchThreshold?: number;
  9774. /**
  9775. * Whether to keep dragging even when pinch ends
  9776. * @default false
  9777. */
  9778. keepDragging?: boolean;
  9779. /**
  9780. * Prevent click event on drag. (mousemove, touchmove)
  9781. * @default false
  9782. */
  9783. preventClickEventOnDrag?: boolean;
  9784. /**
  9785. * Prevent click event on dragStart. (mousedown, touchstart)
  9786. * @default false
  9787. */
  9788. preventClickEventOnDragStart?: boolean;
  9789. /**
  9790. * Prevent click event according to specific conditions.
  9791. * Returning true allows the click event, returning false prevents it.
  9792. * @default null
  9793. */
  9794. preventClickEventByCondition?: ((e: MouseEvent) => boolean) | null;
  9795. pinchOutside?: boolean;
  9796. /**
  9797. * Prevent dragging of `input`, `textarea`, and contenteditable.
  9798. * @default false
  9799. */
  9800. checkInput?: boolean;
  9801. /**
  9802. * Whether to drag the focused input
  9803. * If `checkInput` is true, this option is not applied.
  9804. * @default false
  9805. */
  9806. dragFocusedInput?: boolean;
  9807. checkWindowBlur?: boolean;
  9808. }
  9809. /**
  9810. * @typedef
  9811. * @memberof Gesto
  9812. */
  9813. type GestoEvents = {
  9814. "dragStart": OnDragStart$1;
  9815. "drag": OnDrag$1;
  9816. "dragEnd": OnDragEnd$1;
  9817. "pinchStart": OnPinchStart;
  9818. "pinch": OnPinch;
  9819. "pinchEnd": OnPinchEnd;
  9820. };
  9821. /**
  9822. * You can set up drag, pinch events in any browser.
  9823. */
  9824. declare class Gesto extends EventEmitter<GestoEvents> {
  9825. options: GestoOptions;
  9826. private flag;
  9827. private pinchFlag;
  9828. private data;
  9829. private isDrag;
  9830. private isPinch;
  9831. private clientStores;
  9832. private targets;
  9833. private prevTime;
  9834. private doubleFlag;
  9835. private _useMouse;
  9836. private _useTouch;
  9837. private _useDrag;
  9838. private _dragFlag;
  9839. private _isTrusted;
  9840. private _isMouseEvent;
  9841. private _isSecondaryButton;
  9842. private _preventMouseEvent;
  9843. private _prevInputEvent;
  9844. private _isDragAPI;
  9845. private _isIdle;
  9846. private _preventMouseEventId;
  9847. private _window;
  9848. /**
  9849. *
  9850. */
  9851. constructor(targets: Array<Element | Window> | Element | Window, options?: GestoOptions);
  9852. /**
  9853. * Stop Gesto's drag events.
  9854. */
  9855. stop(): void;
  9856. /**
  9857. * The total moved distance
  9858. */
  9859. getMovement(clients?: Client[]): number;
  9860. /**
  9861. * Whether to drag
  9862. */
  9863. isDragging(): boolean;
  9864. /**
  9865. * Whether the operation of gesto is finished and is in idle state
  9866. */
  9867. isIdle(): boolean;
  9868. /**
  9869. * Whether to start drag
  9870. */
  9871. isFlag(): boolean;
  9872. /**
  9873. * Whether to start pinch
  9874. */
  9875. isPinchFlag(): boolean;
  9876. /**
  9877. * Whether to start double click
  9878. */
  9879. isDoubleFlag(): boolean;
  9880. /**
  9881. * Whether to pinch
  9882. */
  9883. isPinching(): boolean;
  9884. /**
  9885. * If a scroll event occurs, it is corrected by the scroll distance.
  9886. */
  9887. scrollBy(deltaX: number, deltaY: number, e: any, isCallDrag?: boolean): void;
  9888. /**
  9889. * Create a virtual drag event.
  9890. */
  9891. move([deltaX, deltaY]: number[], inputEvent: any): TargetParam<OnDrag$1>;
  9892. /**
  9893. * The dragStart event is triggered by an external event.
  9894. */
  9895. triggerDragStart(e: any): void;
  9896. /**
  9897. * Set the event data while dragging.
  9898. */
  9899. setEventData(data: IObject<any>): this;
  9900. /**
  9901. * Set the event data while dragging.
  9902. * Use `setEventData`
  9903. * @deprecated
  9904. */
  9905. setEventDatas(data: IObject<any>): this;
  9906. /**
  9907. * Get the current event state while dragging.
  9908. */
  9909. getCurrentEvent(inputEvent?: any): {
  9910. movement: number;
  9911. isDrag: boolean;
  9912. isPinch: boolean;
  9913. isScroll: boolean;
  9914. inputEvent: any;
  9915. distX: number;
  9916. distY: number;
  9917. clientX: number;
  9918. clientY: number;
  9919. originalClientX?: number | undefined;
  9920. originalClientY?: number | undefined;
  9921. deltaX: number;
  9922. deltaY: number;
  9923. data: IObject<any>;
  9924. datas: IObject<any>;
  9925. };
  9926. /**
  9927. * Get & Set the event data while dragging.
  9928. */
  9929. getEventData(): IObject<any>;
  9930. /**
  9931. * Get & Set the event data while dragging.
  9932. * Use getEventData method
  9933. * @depreacated
  9934. */
  9935. getEventDatas(): IObject<any>;
  9936. /**
  9937. * Unset Gesto
  9938. */
  9939. unset(): void;
  9940. onDragStart: (e: any, isTrusted?: boolean) => false | undefined;
  9941. onDrag: (e: any, isScroll?: boolean) => void;
  9942. onDragEnd: (e?: any) => void;
  9943. onPinchStart(e: TouchEvent): void;
  9944. onPinch(e: TouchEvent, clients: Client[]): void;
  9945. onPinchEnd(e: TouchEvent): void;
  9946. private getCurrentStore;
  9947. private moveClients;
  9948. private onBlur;
  9949. private _addStore;
  9950. private _getPosition;
  9951. private _allowClickEvent;
  9952. private _attchDragEvent;
  9953. private _dettachDragEvent;
  9954. private _onClick;
  9955. private _onContextMenu;
  9956. private _allowMouseEvent;
  9957. private _passCallback;
  9958. }
  9959. declare class CustomGesto {
  9960. private ableName;
  9961. private prevX;
  9962. private prevY;
  9963. private startX;
  9964. private startY;
  9965. private isDrag;
  9966. private isFlag;
  9967. private datas;
  9968. constructor(ableName?: string);
  9969. dragStart(client: number[], e: any): {
  9970. type: string;
  9971. inputEvent: any;
  9972. isDrag: boolean;
  9973. isFirstDrag: boolean;
  9974. datas: IObject<any>;
  9975. originalDatas: IObject<any>;
  9976. parentEvent: boolean;
  9977. parentGesto: CustomGesto;
  9978. clientX: number;
  9979. clientY: number;
  9980. originalClientX?: number | undefined;
  9981. originalClientY?: number | undefined;
  9982. distX: number;
  9983. distY: number;
  9984. deltaX: number;
  9985. deltaY: number;
  9986. };
  9987. drag(client: number[], inputEvent: any): OnCustomDrag;
  9988. move(delta: number[], inputEvent: any): OnCustomDrag;
  9989. }
  9990. interface MoveableElementMatrixInfo {
  9991. hasZoom: boolean;
  9992. hasFixed: boolean;
  9993. originalRootMatrix: number[];
  9994. rootMatrix: number[];
  9995. beforeMatrix: number[];
  9996. offsetMatrix: number[];
  9997. allMatrix: number[];
  9998. targetMatrix: number[];
  9999. transformOrigin: number[];
  10000. targetOrigin: number[];
  10001. is3d: boolean;
  10002. targetTransform: string;
  10003. inlineTransform: string;
  10004. offsetContainer: HTMLElement | null;
  10005. offsetRootContainer: HTMLElement | null;
  10006. matrixes: MatrixInfo[];
  10007. }
  10008. interface MoveableElementInfo extends MoveableElementMatrixInfo, MoveablePosition, ElementSizes {
  10009. width: number;
  10010. height: number;
  10011. rotation: number;
  10012. }
  10013. interface MoveableTargetInfo extends MoveableElementInfo {
  10014. targetClientRect: MoveableClientRect;
  10015. containerClientRect: MoveableClientRect;
  10016. moveableClientRect: MoveableClientRect;
  10017. rootContainerClientRect: MoveableClientRect;
  10018. beforeDirection: 1 | -1;
  10019. beforeOrigin: number[];
  10020. offsetDelta: number[];
  10021. originalBeforeOrigin: number[];
  10022. target: HTMLElement | SVGElement | null | undefined;
  10023. style: Partial<Writable<CSSStyleDeclaration>>;
  10024. }
  10025. interface MoveableClientRect {
  10026. left: number;
  10027. top: number;
  10028. right: number;
  10029. bottom: number;
  10030. width: number;
  10031. height: number;
  10032. clientLeft?: number;
  10033. clientTop?: number;
  10034. clientWidth?: number;
  10035. clientHeight?: number;
  10036. scrollWidth?: number;
  10037. scrollHeight?: number;
  10038. overflow?: boolean;
  10039. }
  10040. declare type MoveableManagerProps<T = {}> = {
  10041. cssStyled: any;
  10042. customStyledMap: Record<string, any>;
  10043. wrapperMoveable?: MoveableManagerInterface | null;
  10044. isWrapperMounted?: boolean;
  10045. parentMoveable?: MoveableManagerInterface | null;
  10046. parentPosition?: number[] | null;
  10047. groupable?: boolean;
  10048. } & MoveableDefaultOptions & (unknown extends T ? IObject<any> : T);
  10049. /**
  10050. * @typedef
  10051. * @memberof Moveable
  10052. */
  10053. interface MoveablePosition {
  10054. left: number;
  10055. top: number;
  10056. right: number;
  10057. bottom: number;
  10058. origin: number[];
  10059. pos1: number[];
  10060. pos2: number[];
  10061. pos3: number[];
  10062. pos4: number[];
  10063. direction: 1 | -1;
  10064. }
  10065. /**
  10066. * @typedef
  10067. * @memberof Moveable
  10068. * @options
  10069. */
  10070. interface DefaultOptions {
  10071. /**
  10072. * The target(s) to indicate Moveable Control Box.
  10073. * @default null
  10074. */
  10075. target?: SVGElement | HTMLElement | null;
  10076. /**
  10077. * The external target(s) to drag Moveable target(s)
  10078. * @default target
  10079. */
  10080. dragTarget?: MoveableRefType | null;
  10081. /**
  10082. * If dragTarget is set directly, taget itself cannot be dragged.
  10083. * Whether to drag the target as well.
  10084. * @default false
  10085. */
  10086. dragTargetSelf?: boolean;
  10087. /**
  10088. * Container area where drag works
  10089. * @default window
  10090. */
  10091. dragContainer?: null | Window | MoveableRefType<HTMLElement>;
  10092. /**
  10093. * A container into which Moveables are inserted.
  10094. * Set it only when used within the slot of Web Components or when the container is different.
  10095. * @default parentElement
  10096. */
  10097. container?: SVGElement | HTMLElement | null;
  10098. /**
  10099. * Whether to warp itself to the container itself. Don't set it.
  10100. * @private
  10101. * @default false
  10102. */
  10103. warpSelf?: boolean;
  10104. /**
  10105. * Moveable Root Container (No Transformed Container)
  10106. * @default parentElement
  10107. * @story options--options-root-container
  10108. */
  10109. rootContainer?: MoveableRefType<HTMLElement>;
  10110. /**
  10111. * If you want to set the dragging information to the viewer, refer to the following.
  10112. * @default null
  10113. * @story options--options-view-container
  10114. */
  10115. viewContainer?: MoveableRefType<HTMLElement>;
  10116. /**
  10117. * Whether the target size is detected and updated whenever it changes.
  10118. * It is more effective when used together with `useMutationObserver`.
  10119. * @default false
  10120. * @story options--options-resize-observer
  10121. */
  10122. useResizeObserver?: boolean;
  10123. /**
  10124. * Whether the target size, pos in inline style is detected and updated whenever it changes.
  10125. * It is more effective when used together with `useResizeObserver`.
  10126. * @default false
  10127. * @story options--options-mutation-observer
  10128. */
  10129. useMutationObserver?: boolean;
  10130. /**
  10131. * Zooms in the elements of a moveable.
  10132. * @default 1
  10133. */
  10134. zoom?: number;
  10135. /**
  10136. * The default transformOrigin of the target can be set in advance.
  10137. * @default ""
  10138. */
  10139. transformOrigin?: Array<string | number> | string | "";
  10140. /**
  10141. * You can add your custom able.
  10142. * @default []
  10143. */
  10144. ables?: Able[];
  10145. /**
  10146. * You can specify the className of the moveable controlbox.
  10147. * @default ""
  10148. */
  10149. className?: string;
  10150. /**
  10151. * Minimum distance to pinch.
  10152. * @default 20
  10153. */
  10154. pinchThreshold?: number;
  10155. /**
  10156. * Whether the container containing the target becomes a pinch.
  10157. * @default true
  10158. */
  10159. pinchOutside?: boolean;
  10160. /**
  10161. * Lets generate events of ables at the same time. (like Resizable, Scalable)
  10162. * @default false
  10163. */
  10164. triggerAblesSimultaneously?: boolean;
  10165. /**
  10166. * Checks whether this is an element to input text or contentEditable, and prevents dragging.
  10167. * @default false
  10168. */
  10169. checkInput?: boolean;
  10170. /**
  10171. * add nonce property to style for CSP.
  10172. * @deprecated
  10173. * @default ""
  10174. */
  10175. cspNonce?: string;
  10176. /**
  10177. * You can set the translateZ value of moveable.
  10178. * @default 50
  10179. */
  10180. translateZ?: number | string;
  10181. /**
  10182. * Whether to hide the line corresponding to the rect of the target.
  10183. * @default false
  10184. */
  10185. hideDefaultLines?: boolean;
  10186. /**
  10187. * Whether to prevent bubbling of events like mousedown, touchstart, etc.
  10188. * @default false
  10189. */
  10190. stopPropagation?: boolean;
  10191. /**
  10192. * Whether to call preventDefault on touchstart or mousedown
  10193. * @since 0.44.0
  10194. * @default true
  10195. */
  10196. preventDefault?: boolean;
  10197. /**
  10198. * Whether to prevent dragging using the right mouse button
  10199. * @default true
  10200. */
  10201. preventRightClick?: boolean;
  10202. /**
  10203. * Whether to prevent dragging using the wheel (middle) mouse button
  10204. * @default true
  10205. */
  10206. preventWheelClick?: boolean;
  10207. /**
  10208. * Prevent click event on drag. (mousemove, touchmove)
  10209. * @default true
  10210. */
  10211. preventClickEventOnDrag?: boolean;
  10212. /**
  10213. * Whether to drag the focused input
  10214. * If `checkInput` is true, this option is not applied.
  10215. * @since 0.47.0
  10216. * @story options--options-drag-focused-input
  10217. * @default false
  10218. */
  10219. dragFocusedInput?: boolean;
  10220. /**
  10221. * Prevent click event on dragStart. (mousedown, touchstart)
  10222. * @default false
  10223. */
  10224. preventClickDefault?: boolean;
  10225. /**
  10226. * You can use props in object format or custom props.
  10227. * @default empty object
  10228. */
  10229. props?: Record<string, any>;
  10230. /**
  10231. * Data for first render
  10232. * @default null
  10233. */
  10234. persistData?: PersistRectData | null;
  10235. /**
  10236. * Whether to accurately show the position of a movable control box
  10237. * Because getBoundingClientRect is used, css zoom, transform: rotate between container and rootContainer cannot be used.
  10238. * group is not supported.
  10239. * @default false
  10240. */
  10241. useAccuratePosition?: boolean;
  10242. /**
  10243. * By adding padding to the line, you can increase the area of the line that can be clicked and dragged.
  10244. * @since 0.43.0
  10245. * @story options--options-line-padding
  10246. * @default 0
  10247. */
  10248. linePadding?: number;
  10249. /**
  10250. * By adding padding to the control, you can increase the area of the control that can be clicked and dragged.
  10251. * Either `rotateAroundControls` or `displayAroundControls` can be used.
  10252. * @since 0.44.0
  10253. * @story options--options-control-padding
  10254. * @default 0
  10255. */
  10256. controlPadding?: number;
  10257. /**
  10258. * @private
  10259. * single => group로 변환과정에 도형 유지를 위한 첫 렌더링 state
  10260. */
  10261. firstRenderState?: MoveableManagerState | null;
  10262. /**
  10263. * @private
  10264. */
  10265. requestStyles?: string[];
  10266. /**
  10267. * If you are using React 18's concurrent mode, use `flushSync` for UI sync.
  10268. * @default empty function
  10269. * @example
  10270. * ```jsx
  10271. * import { flushSync } from "react-dom";
  10272. *
  10273. * <Moveable flushSync={flushSync} />
  10274. * ```
  10275. */
  10276. flushSync?: (callback: () => void) => void;
  10277. }
  10278. /**
  10279. * @typedef
  10280. * @extends Moveable.DefaultOptions
  10281. * @extends Moveable.DragAreaOptions
  10282. * @extends Moveable.OriginOptions
  10283. * @extends Moveable.PaddingOptions
  10284. */
  10285. interface MoveableDefaultOptions extends DefaultOptions, DragAreaOptions, OriginOptions, PaddingOptions {
  10286. }
  10287. interface MatrixInfo {
  10288. type: "offset" | "target" | "zoom";
  10289. target: SVGElement | HTMLElement;
  10290. matrix?: number[];
  10291. origin?: number[];
  10292. zoom?: number;
  10293. }
  10294. declare type MoveableManagerState<T = {}> = {
  10295. container: SVGElement | HTMLElement | null | undefined;
  10296. disableNativeEvent: boolean;
  10297. gestos: Record<string, Gesto | CustomGesto | null>;
  10298. renderLines: number[][][];
  10299. renderPoses: number[][];
  10300. posDelta: number[];
  10301. style: Partial<Writable<CSSStyleDeclaration>>;
  10302. isPersisted?: boolean;
  10303. } & MoveableTargetInfo & T;
  10304. /**
  10305. * @typedef
  10306. * @memberof Moveable
  10307. */
  10308. interface ElementSizes {
  10309. svg: boolean;
  10310. offsetWidth: number;
  10311. offsetHeight: number;
  10312. clientWidth: number;
  10313. clientHeight: number;
  10314. inlineCSSWidth: number;
  10315. inlineCSSHeight: number;
  10316. cssWidth: number;
  10317. cssHeight: number;
  10318. contentWidth: number;
  10319. contentHeight: number;
  10320. minWidth: number;
  10321. minHeight: number;
  10322. maxWidth: number;
  10323. maxHeight: number;
  10324. minOffsetWidth: number;
  10325. minOffsetHeight: number;
  10326. maxOffsetWidth: number;
  10327. maxOffsetHeight: number;
  10328. }
  10329. /**
  10330. * @typedef
  10331. * @memberof Moveable
  10332. * @property - left padding
  10333. * @property - top padding
  10334. * @property - right padding
  10335. * @property - bottom padding
  10336. */
  10337. interface PaddingBox {
  10338. left?: number;
  10339. top?: number;
  10340. right?: number;
  10341. bottom?: number;
  10342. }
  10343. interface Renderer {
  10344. createElement(type: any, props?: any, ...children: any[]): any;
  10345. }
  10346. /**
  10347. * @typedef
  10348. * @memberof Moveable.Snappable
  10349. */
  10350. interface SnapGuideline {
  10351. type: "horizontal" | "vertical";
  10352. direction: string;
  10353. hide?: boolean;
  10354. element?: Element | null;
  10355. isStart?: boolean;
  10356. isEnd?: boolean;
  10357. isCenter?: boolean;
  10358. isInner?: boolean;
  10359. grid?: boolean;
  10360. pos: number[];
  10361. size: number;
  10362. className?: string;
  10363. sizes?: number[];
  10364. gap?: number;
  10365. elementDirection?: string;
  10366. elementRect?: SnapElementRect;
  10367. gapRects?: SnapElementRect[];
  10368. }
  10369. /**
  10370. * @memberof Moveable
  10371. * @typedef
  10372. */
  10373. declare type MoveableRefType<T extends Element = HTMLElement | SVGElement> = string | (() => T) | MoveableRefObject<T> | T | null | undefined;
  10374. /**
  10375. * @memberof Moveable
  10376. * @typedef
  10377. */
  10378. interface MoveableRefObject<T extends Element = HTMLElement | SVGElement> {
  10379. current: T | undefined | null;
  10380. }
  10381. /**
  10382. * You can make Able that can work in Moveable.
  10383. * @typedef
  10384. * In Able, you can manage drag events, props, state, fire event props, and render elements.
  10385. * @memberof Moveable
  10386. */
  10387. interface Able<Props extends IObject<any> = IObject<any>, Events extends IObject<any> = IObject<any>> {
  10388. name: string;
  10389. props?: readonly (keyof Props)[];
  10390. events?: readonly (keyof Events)[];
  10391. always?: boolean;
  10392. ableGroup?: string;
  10393. updateRect?: boolean;
  10394. canPinch?: boolean;
  10395. css?: string[];
  10396. /**
  10397. * You can request style. Specify the name of the style in camel case.
  10398. * You can check it with `moveable.state.style`
  10399. * @exmaple
  10400. * ["borderRadius", "top", "left"]
  10401. */
  10402. requestStyle?(): string[];
  10403. /**
  10404. * If you use group, you can request child style. Specify the name of the style in camel case.
  10405. * You can check it with `moveable.state.style`
  10406. * @exmaple
  10407. * ["borderRadius", "top", "left"]
  10408. */
  10409. requestChildStyle?(): string[];
  10410. /**
  10411. * You can specify the class name to be added to the Moveable control box.
  10412. */
  10413. className?(moveable: any): string;
  10414. /**
  10415. * You can specify the class name to be added to the Moveable View Container
  10416. */
  10417. viewClassName?(moveable: any): string;
  10418. /**
  10419. * Check how related to drag
  10420. */
  10421. dragRelation?: "strong" | "weak" | undefined | null | false;
  10422. /**
  10423. * Fired when the event is cleared
  10424. */
  10425. unset?(moveable: any): any;
  10426. /**
  10427. * Renders the React DOM structure for the able.
  10428. */
  10429. render?(moveable: any, renderer: Renderer): any;
  10430. dragStart?(moveable: any, e: any): any;
  10431. drag?(moveable: any, e: any): any;
  10432. dragEnd?(moveable: any, e: any): any;
  10433. dragAfter?(moveable: any, e: any): any;
  10434. pinchStart?(moveable: any, e: OnPinchStart): any;
  10435. pinch?(moveable: any, e: OnPinch): any;
  10436. pinchEnd?(moveable: any, e: OnPinchEnd): any;
  10437. dragControlCondition?(moveable: any, e: any): boolean;
  10438. dragControlStart?(moveable: any, e: any): any;
  10439. dragControl?(moveable: any, e: any): any;
  10440. dragControlEnd?(moveable: any, e: any): any;
  10441. dragControlAfter?(moveable: any, e: any): any;
  10442. dragGroupCondition?(moveable: any, e: any): boolean;
  10443. dragGroupStart?(moveable: any, e: any): any;
  10444. dragGroup?(moveable: any, e: any): any;
  10445. dragGroupEnd?(moveable: any, e: any): any;
  10446. pinchGroupStart?(moveable: any, e: OnPinchStart): any;
  10447. pinchGroup?(moveable: any, e: OnPinch): any;
  10448. pinchGroupEnd?(moveable: any, e: OnPinchEnd): any;
  10449. dragGroupControlCondition?(moveable: any, e: any): boolean;
  10450. dragGroupControlStart?(moveable: any, e: any): any;
  10451. dragGroupControl?(moveable: any, e: any): any;
  10452. dragGroupControlEnd?(moveable: any, e: any): any;
  10453. mouseEnter?(moveable: any, e: any): any;
  10454. mouseLeave?(moveable: any, e: any): any;
  10455. mouseGroupEnter?(moveable: any, e: any): any;
  10456. mouseGroupLeave?(moveable: any, e: any): any;
  10457. request?(moveable: any): AbleRequester;
  10458. }
  10459. /**
  10460. * @typedef
  10461. * @memberof Moveable
  10462. */
  10463. interface OnEvent {
  10464. /**
  10465. * The Moveable instance
  10466. */
  10467. currentTarget: MoveableManagerInterface<Record<string, any>, Record<string, any>>;
  10468. /**
  10469. * The Moveable instance
  10470. */
  10471. moveable: MoveableManagerInterface<Record<string, any>, Record<string, any>>;
  10472. /**
  10473. * The Moveable's target
  10474. */
  10475. target: HTMLElement | SVGElement;
  10476. /**
  10477. * The horizontal coordinate within the application's client area at which the event occurred.
  10478. */
  10479. clientX: number;
  10480. /**
  10481. * The vertical coordinate within the application's client area at which the event occurred.
  10482. */
  10483. clientY: number;
  10484. /**
  10485. * Whether this is the first drag in the drag event
  10486. */
  10487. isFirstDrag: number;
  10488. /**
  10489. * Objects that can send information to the following events.
  10490. */
  10491. datas: IObject<any>;
  10492. /**
  10493. * The mouse or touch input event that is invoking the moveable event
  10494. */
  10495. inputEvent: any;
  10496. /**
  10497. * Stop the currently working able.
  10498. */
  10499. stopAble(): void;
  10500. /**
  10501. * Calling `stopDrag` in a drag-related event ends the drag.
  10502. */
  10503. stopDrag(): void;
  10504. /**
  10505. * Whether the event did not occur externally
  10506. */
  10507. isTrusted: boolean;
  10508. }
  10509. /**
  10510. * @typedef
  10511. * @memberof Moveable
  10512. * @extends Moveable.OnEvent
  10513. * @property - This is the last dragged event. No, if you haven't dragged.
  10514. * @property - Whether this moved
  10515. * @property - Whether it is double-click
  10516. */
  10517. interface OnEndEvent extends OnEvent {
  10518. lastEvent: any | undefined;
  10519. isDrag: boolean;
  10520. isDouble: boolean;
  10521. }
  10522. /**
  10523. * @typedef
  10524. * @memberof Moveable
  10525. */
  10526. interface OnTransformStartEvent {
  10527. /**
  10528. * Set your original transform.
  10529. * `transformIndex` is the sequence of functions used in the event.
  10530. * If you use `setTransform`, you don't need to use `set` function.
  10531. * @default transform of target's inline style
  10532. */
  10533. setTransform(transform: string | string[], transformIndex?: number): void;
  10534. /**
  10535. * `transformIndex` is the sequence of functions used in the event.
  10536. * @default index with that property in transform or last
  10537. */
  10538. setTransformIndex(transformIndex: number): void;
  10539. }
  10540. /**
  10541. * @typedef
  10542. * @memberof Moveable
  10543. * @extends Moveable.CSSObject
  10544. */
  10545. interface TransformObject extends CSSObject {
  10546. /**
  10547. * a target's next transform string value.
  10548. */
  10549. transform: string;
  10550. /**
  10551. * A transform obtained by the simultaneous occurrence of other events in the current event
  10552. */
  10553. afterTransform: string;
  10554. }
  10555. /**
  10556. * @typedef
  10557. * @memberof Moveable
  10558. * @extends Moveable.TransformObject
  10559. */
  10560. interface OnTransformEvent extends TransformObject {
  10561. /**
  10562. * transform events causes a `drag` event. In some events, there may be no value.
  10563. */
  10564. drag: OnDrag;
  10565. }
  10566. /**
  10567. * @typedef
  10568. * @memberof Moveable
  10569. */
  10570. interface AbleRequestParam {
  10571. /**
  10572. * Run the request instantly. (requestStart, request, requestEnd happen at the same time)
  10573. */
  10574. isInstant?: boolean;
  10575. [key: string]: any;
  10576. }
  10577. /**
  10578. * @typedef
  10579. * @memberof Moveable
  10580. * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.html#request|Request Method}
  10581. * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Draggable.html#request|Draggable Requester}
  10582. * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Resizable.html#request|Resizable Requester}
  10583. * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Scalable.html#request|Scalable Requester}
  10584. * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Rotatable.html#request|Rotatable Requester}
  10585. * @property - Continue executing the request.
  10586. * @property - End the request.
  10587. */
  10588. interface Requester<RequestParam extends {} = AbleRequestParam> {
  10589. request(param: RequestParam): this;
  10590. requestEnd(): this;
  10591. }
  10592. interface AbleRequester {
  10593. isControl: boolean;
  10594. requestStart(param: IObject<any>): IObject<any>;
  10595. request(param: IObject<any>): IObject<any>;
  10596. requestEnd(): IObject<any>;
  10597. }
  10598. /**
  10599. * When the drag starts, the dragStart event is called.
  10600. * @typedef
  10601. * @memberof Moveable.Draggable
  10602. * @extends Moveable.OnEvent
  10603. * @extends Moveable.OnTransformStartEvent
  10604. */
  10605. interface OnDragStart extends OnEvent, OnTransformStartEvent {
  10606. /**
  10607. * You can set the start translate value.
  10608. */
  10609. set: (translate: number[]) => void;
  10610. }
  10611. /**
  10612. * @typedef
  10613. * @memberof Moveable.Draggable
  10614. * @extends Moveable.OnEvent
  10615. * @extends Moveable.CSSObject
  10616. * @property - The delta of [left, top]
  10617. * @property - The distance of [left, top]
  10618. * @property - The position of [left, top]
  10619. * @property - The delta of [translateX, translateY]
  10620. * @property - The distance of [translateX, translateY]
  10621. * @property - The position of [translateX, translateY]
  10622. * @property - a target's transform
  10623. * @property - a target's left
  10624. * @property - a target's top
  10625. * @property - a target's bottom
  10626. * @property - a target's offset width
  10627. * @property - a target's offset height
  10628. * @property - a target's right
  10629. * @property - Whether or not it is being pinched.
  10630. */
  10631. interface OnDrag extends OnEvent, CSSObject {
  10632. beforeDelta: number[];
  10633. beforeDist: number[];
  10634. beforeTranslate: number[];
  10635. delta: number[];
  10636. dist: number[];
  10637. translate: number[];
  10638. transform: string;
  10639. left: number;
  10640. top: number;
  10641. bottom: number;
  10642. width: number;
  10643. height: number;
  10644. right: number;
  10645. isPinch: boolean;
  10646. }
  10647. /**
  10648. * @typedef
  10649. * @memberof Moveable.Draggable
  10650. * @extends Moveable.OnEndEvent
  10651. */
  10652. interface OnDragEnd extends OnEndEvent {
  10653. }
  10654. /**
  10655. * @typedef
  10656. * @memberof Moveable.Resizable
  10657. * @extends Moveable.OnEvent
  10658. * @property - The direction of resize.
  10659. * @property - resize causes a `dragStart` event.
  10660. * @property - You can set the css width, height value.
  10661. * @property - You can set the css min width, min height value. (default: min-width)
  10662. * @property - You can set the css max width, max height value. (default: max-width)
  10663. * @property - You can set the css origin (default: % %)
  10664. * @property - Set a fixed direction to resize. (default: Opposite direction)
  10665. * @property - Set the ratio of width and height. (default: offsetWidth / offsetHeight)
  10666. */
  10667. interface OnResizeStart extends OnEvent {
  10668. /**
  10669. * The direction of resize.
  10670. */
  10671. direction: number[];
  10672. /**
  10673. * First set (boundingWidth / boundingHeight) value
  10674. */
  10675. startRatio: number;
  10676. /**
  10677. * resize causes a `dragStart` event.
  10678. */
  10679. dragStart: OnDragStart | false;
  10680. /**
  10681. * You can set the css width, height value.
  10682. */
  10683. set: (size: number[]) => any;
  10684. /**
  10685. * You can set the css min offset width, min offset height value.
  10686. * @default [minOffsetWidth, minOffsetHeight])
  10687. */
  10688. setMin: (minSize: Array<string | number>) => any;
  10689. /**
  10690. * You can set the css max offset width, max offset height value.
  10691. * @default [maxOffsetWidth, maxOffsetHeight])
  10692. */
  10693. setMax: (maxSize: Array<string | number>) => any;
  10694. /**
  10695. * You can set the css origin
  10696. * @default transformOrigin
  10697. */
  10698. setOrigin: (origin: Array<string | number>) => any;
  10699. /**
  10700. * Set a fixed direction to resize.
  10701. * @default Opposite direction
  10702. */
  10703. setFixedDirection: (startDirecition: number[]) => any;
  10704. /**
  10705. * Set a fixed direction to resize.
  10706. * @default Opposite position
  10707. * @private
  10708. */
  10709. setFixedPosition: (startPosition: number[]) => any;
  10710. /**
  10711. * Set the ratio of width and height.
  10712. * @default offsetWidth / offsetHeight
  10713. */
  10714. setRatio: (ratio: number) => any;
  10715. }
  10716. /**
  10717. * @typedef
  10718. * @memberof Moveable
  10719. */
  10720. interface CSSObject {
  10721. /**
  10722. * You can get the style you can get from the event.
  10723. */
  10724. style: Record<string, string>;
  10725. /**
  10726. * You can get it as a cssText that you can get from that event.
  10727. */
  10728. cssText: string;
  10729. }
  10730. /**
  10731. * @typedef
  10732. * @memberof Moveable.Resizable
  10733. * @extends Moveable.OnEvent
  10734. * @extends Moveable.OnTransformEvent
  10735. */
  10736. interface OnResize extends OnEvent, OnTransformEvent {
  10737. /**
  10738. * The direction of resize.
  10739. */
  10740. direction: number[];
  10741. /**
  10742. * a target's cssWidth
  10743. */
  10744. width: number;
  10745. /**
  10746. * a target's cssHeight
  10747. */
  10748. height: number;
  10749. /**
  10750. * a target's offset width as an integer with bounding width
  10751. */
  10752. offsetWidth: number;
  10753. /**
  10754. * a target's offset height as an integer with bounding height
  10755. */
  10756. offsetHeight: number;
  10757. /**
  10758. * a target's bounding width
  10759. */
  10760. boundingWidth: number;
  10761. /**
  10762. * a target's bounding height
  10763. */
  10764. boundingHeight: number;
  10765. /**
  10766. * The distance of [boundingWidth, boundingHeight]
  10767. */
  10768. dist: number[];
  10769. /**
  10770. * The delta of [boundingWidth, boundingHeight]
  10771. */
  10772. delta: number[];
  10773. /**
  10774. * First set (boundingWidth / boundingHeight) value
  10775. */
  10776. startRatio: number;
  10777. /**
  10778. * Whether or not it is being pinched.
  10779. */
  10780. isPinch: boolean;
  10781. }
  10782. /**
  10783. * @typedef
  10784. * @memberof Moveable.Resizable
  10785. * @extends Moveable.OnEndEvent
  10786. */
  10787. interface OnResizeEnd extends OnEndEvent {
  10788. }
  10789. /**
  10790. * @typedef
  10791. * @memberof Moveable.Rotatable
  10792. * @extends Moveable.OnEvent
  10793. * @extends Moveable.OnTransformStartEvent
  10794. */
  10795. interface OnRotateStart extends OnEvent, OnTransformStartEvent {
  10796. /**
  10797. * You can set the start rotate value.
  10798. */
  10799. set: (rotate: number) => void;
  10800. /**
  10801. * Set a fixed direction to rotate.
  10802. * @default target's transformOrigin
  10803. */
  10804. setFixedDirection: (fixedDirection: number[]) => void;
  10805. /**
  10806. * Set a fixed position to rotate.
  10807. * @default target's transformOrigin
  10808. */
  10809. setFixedPosition: (fixedPosition: number[]) => void;
  10810. /**
  10811. * rotate causes a `dragStart` event.
  10812. */
  10813. dragStart: OnDragStart | false;
  10814. /**
  10815. * rotate causes a `resizeStart` event.
  10816. */
  10817. resizeStart: OnResizeStart | false;
  10818. }
  10819. /**
  10820. * @typedef
  10821. * @description Parameters for the `rotate` event
  10822. * @memberof Moveable.Rotatable
  10823. * @extends Moveable.OnEvent
  10824. * @extends Moveable.OnTransformEvent
  10825. */
  10826. interface OnRotate extends OnEvent, OnTransformEvent {
  10827. /**
  10828. * The distance of rotation degree before transform is applied
  10829. */
  10830. beforeDist: number;
  10831. /**
  10832. * The delta of rotation degree before transform is applied
  10833. */
  10834. beforeDelta: number;
  10835. /**
  10836. * The now rotation degree before transform is applied
  10837. * @deprecated
  10838. */
  10839. beforeRotate: number;
  10840. /**
  10841. * The now rotation degree before transform is applied
  10842. */
  10843. beforeRotation: number;
  10844. /**
  10845. * The distance of rotation degree
  10846. */
  10847. dist: number;
  10848. /**
  10849. * The delta of rotation degree
  10850. */
  10851. delta: number;
  10852. /**
  10853. * The now rotation degree
  10854. * @deprecated
  10855. */
  10856. rotate: number;
  10857. /**
  10858. * The now rotation degree
  10859. */
  10860. rotation: number;
  10861. /**
  10862. * The distance of client rotation degree
  10863. */
  10864. absoluteDist: number;
  10865. /**
  10866. * The delta of client rotation degree
  10867. */
  10868. absoluteDelta: number;
  10869. /**
  10870. * The now client rotation degree
  10871. * @deprecated
  10872. */
  10873. absoluteRotate: number;
  10874. /**
  10875. * The now client rotation degree
  10876. */
  10877. absoluteRotation: number;
  10878. /**
  10879. * Whether or not it is being pinched.
  10880. */
  10881. isPinch: boolean;
  10882. /**
  10883. * rotate causes a `resize` event.
  10884. */
  10885. resize?: OnResize;
  10886. }
  10887. /**
  10888. * @typedef
  10889. * @memberof Moveable.Rotatable
  10890. * @extends Moveable.OnEndEvent
  10891. */
  10892. interface OnRotateEnd extends OnEndEvent {
  10893. }
  10894. /**
  10895. * `renderStart` event occurs at the first start of all events.
  10896. * @typedef
  10897. * @memberof Moveable
  10898. * @extends Moveable.OnEvent
  10899. * @property - Whether or not it is being pinched.
  10900. */
  10901. interface OnRenderStart extends OnEvent {
  10902. isPinch: boolean;
  10903. }
  10904. /**
  10905. * `render` event occurs before the target is drawn on the screen.
  10906. * @typedef
  10907. * @memberof Moveable
  10908. * @extends Moveable.OnEvent
  10909. * @extends Moveable.CSSObject
  10910. */
  10911. interface OnRender extends OnEvent, CSSObject {
  10912. /**
  10913. * a target's next transform string value.
  10914. */
  10915. transform: string;
  10916. /**
  10917. * Whether or not it is being pinched.
  10918. */
  10919. isPinch: boolean;
  10920. /**
  10921. * Return transform as a transform object.
  10922. * `rotate` is a number and everything else is an array of numbers.
  10923. */
  10924. transformObject: Record<string, any>;
  10925. }
  10926. /**
  10927. * @typedef
  10928. * @memberof Moveable
  10929. */
  10930. interface PaddingOptions {
  10931. /**
  10932. * Add padding around the target to increase the drag area.
  10933. * @default null
  10934. */
  10935. padding?: PaddingBox | number;
  10936. }
  10937. /**
  10938. * @typedef
  10939. * @memberof Moveable
  10940. */
  10941. interface OriginOptions {
  10942. /**
  10943. * Whether or not the origin control box will be visible or not.
  10944. * @default true
  10945. */
  10946. origin?: boolean;
  10947. /**
  10948. * 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.
  10949. * @since 0.47.0
  10950. * @default ""
  10951. */
  10952. svgOrigin?: string;
  10953. }
  10954. /**
  10955. * @typedef
  10956. * @memberof Moveable
  10957. * @extends Moveable.AbleRequestParam
  10958. * @description the Resizable's request parameter
  10959. */
  10960. interface AbleRequesters {
  10961. draggable: DraggableRequestParam;
  10962. resizable: ResizableRequestParam;
  10963. scalable: ScalableRequestParam;
  10964. rotatable: RotatableRequestParam;
  10965. [key: string]: AbleRequestParam;
  10966. }
  10967. /**
  10968. * @typedef
  10969. * @memberof Moveable.Draggable
  10970. * @extends Moveable.AbleRequestParam
  10971. * @description the Draggable's request parameter
  10972. */
  10973. interface DraggableRequestParam extends AbleRequestParam {
  10974. /**
  10975. * x position
  10976. */
  10977. x?: number;
  10978. /**
  10979. * y position
  10980. */
  10981. y?: number;
  10982. /**
  10983. * X number to move
  10984. */
  10985. deltaX?: number;
  10986. /**
  10987. * Y number to move
  10988. */
  10989. deltaY?: number;
  10990. /**
  10991. * whether to use with `snappable`
  10992. */
  10993. useSnap?: boolean;
  10994. }
  10995. /**
  10996. * @typedef
  10997. * @memberof Moveable.Resizable
  10998. * @extends Moveable.AbleRequestParam
  10999. * @description the Resizable's request parameter
  11000. */
  11001. interface ResizableRequestParam extends AbleRequestParam {
  11002. /**
  11003. * Direction to resize
  11004. * @default [1, 1]
  11005. */
  11006. direction?: number[];
  11007. /**
  11008. * Whether to force keepRatio to resize
  11009. */
  11010. keepRatio?: boolean;
  11011. /**
  11012. * delta number of width
  11013. */
  11014. deltaWidth?: number;
  11015. /**
  11016. * delta number of height
  11017. */
  11018. deltaHeight?: number;
  11019. /**
  11020. * offset number of width
  11021. */
  11022. offsetWidth?: number;
  11023. /**
  11024. * offset number of height
  11025. */
  11026. offsetHeight?: number;
  11027. /**
  11028. *
  11029. */
  11030. horizontal?: boolean;
  11031. /**
  11032. * whether to use with `snappable`
  11033. */
  11034. useSnap?: boolean;
  11035. }
  11036. /**
  11037. * @typedef
  11038. * @memberof Moveable.Scalable
  11039. * @extends Moveable.AbleRequestParam
  11040. * @description the Scalable's request parameter
  11041. */
  11042. interface ScalableRequestParam extends AbleRequestParam {
  11043. /**
  11044. * Direction to scale
  11045. * @default [1, 1]
  11046. */
  11047. direction?: number[];
  11048. /**
  11049. * Whether to force keepRatio to resize
  11050. */
  11051. keepRatio?: boolean;
  11052. /**
  11053. * delta number of width
  11054. */
  11055. deltaWidth?: number;
  11056. /**
  11057. * delta number of height
  11058. */
  11059. deltaHeight?: number;
  11060. /**
  11061. * whether to use with `snappable`
  11062. */
  11063. useSnap?: boolean;
  11064. }
  11065. /**
  11066. * @typedef
  11067. * @memberof Moveable.Rotatable
  11068. * @extends Moveable.AbleRequestParam
  11069. * @description the Rotatable's request parameter
  11070. */
  11071. interface RotatableRequestParam extends AbleRequestParam {
  11072. /**
  11073. * delta number of rotation
  11074. */
  11075. deltaRotate?: number;
  11076. /**
  11077. * absolute number of moveable's rotation
  11078. */
  11079. rotate?: number;
  11080. }
  11081. declare type RotationPosition = "top" | "bottom" | "left" | "right" | "top-right" | "top-left" | "bottom-right" | "bottom-left" | "left-top" | "left-bottom" | "right-top" | "right-bottom" | "none";
  11082. /**
  11083. * @typedef
  11084. * @memberof Moveable.Snappable
  11085. */
  11086. interface SnapDirections {
  11087. /**
  11088. * Whether to snap the top of the element
  11089. * @default true
  11090. */
  11091. left?: boolean;
  11092. /**
  11093. * Whether to snap the left of the element
  11094. * @default true
  11095. */
  11096. top?: boolean;
  11097. /**
  11098. * Whether to snap the right of the element
  11099. * @default true
  11100. */
  11101. right?: boolean;
  11102. /**
  11103. * Whether to snap the bottom of the element
  11104. * @default true
  11105. */
  11106. bottom?: boolean;
  11107. /**
  11108. * Whether to snap the center((left + right) / 2) of the element
  11109. * @default false
  11110. */
  11111. center?: boolean;
  11112. /**
  11113. * Whether to snap the middle((top + bottom) / 2) of the element
  11114. * @default false
  11115. */
  11116. middle?: boolean;
  11117. }
  11118. /**
  11119. * @typedef
  11120. * @memberof Moveable.Snappable
  11121. * @extends Moveable.Snappable.SnapDirections
  11122. */
  11123. interface ElementGuidelineValue extends SnapDirections {
  11124. /**
  11125. * guideline element
  11126. */
  11127. element: Element;
  11128. /**
  11129. * class names to add to guideline
  11130. * @default ""
  11131. * @example
  11132. *
  11133. * ```css
  11134. * .moveable-gap.red {
  11135. * background: red!important;
  11136. * }
  11137. * ```
  11138. * ```css
  11139. * .moveable-bold.red {
  11140. * background: red!important;
  11141. * }
  11142. * ```
  11143. * ```css
  11144. * .moveable-dashed.red {
  11145. * border-top-color: red!important;
  11146. * }
  11147. * ```
  11148. */
  11149. className?: string;
  11150. /**
  11151. * Whether to update the element size at every render
  11152. * @default false
  11153. */
  11154. refresh?: boolean;
  11155. }
  11156. /**
  11157. * @typedef
  11158. * @memberof Moveable.Snappable
  11159. * @extends Moveable.Snappable.SnapDirections
  11160. */
  11161. interface ElementGuidelineValue extends SnapDirections {
  11162. /**
  11163. * guideline element
  11164. */
  11165. element: Element;
  11166. /**
  11167. * class names to add to guideline
  11168. * @default ""
  11169. */
  11170. className?: string;
  11171. /**
  11172. * Whether to update the element size at every render
  11173. * @default false
  11174. */
  11175. refresh?: boolean;
  11176. }
  11177. /**
  11178. * @typedef
  11179. * @memberof Moveable.Snappable
  11180. */
  11181. interface OnSnap {
  11182. /**
  11183. * snapped verticalGuidelines, horizontalGuidelines,
  11184. */
  11185. guidelines: SnapGuideline[];
  11186. /**
  11187. * snapped elements (group by element)
  11188. */
  11189. elements: SnapGuideline[];
  11190. /**
  11191. * gaps is snapped guidelines that became gap snap between elements.
  11192. */
  11193. gaps: SnapGuideline[];
  11194. }
  11195. interface SnapDirectionPoses {
  11196. left?: number;
  11197. top?: number;
  11198. right?: number;
  11199. bottom?: number;
  11200. center?: number;
  11201. middle?: number;
  11202. }
  11203. interface SnapElementRect extends ElementGuidelineValue {
  11204. rect: SnapDirectionPoses;
  11205. }
  11206. /**
  11207. * @typedef
  11208. * @memberof Moveable
  11209. */
  11210. interface DragAreaOptions {
  11211. /**
  11212. * Instead of firing an event on the target, we add it to the moveable control element. You can use click and clickGroup events.
  11213. * @default if group, true, else fals
  11214. */
  11215. dragArea?: boolean;
  11216. /**
  11217. * Set `pointerEvents: none;` css to pass events in dragArea.
  11218. * @default false
  11219. */
  11220. passDragArea?: boolean;
  11221. }
  11222. interface OnCustomDrag extends Position {
  11223. type: string;
  11224. inputEvent: any;
  11225. isDrag: boolean;
  11226. isFirstDrag: boolean;
  11227. datas: IObject<any>;
  11228. originalDatas: IObject<any>;
  11229. parentEvent: boolean;
  11230. parentGesto: CustomGesto;
  11231. }
  11232. /**
  11233. * @typedef
  11234. * @memberof Moveable
  11235. */
  11236. declare type PersistRectData = Omit<Partial<RectInfo>, "children"> & {
  11237. children?: Array<Partial<RectInfo>>;
  11238. };
  11239. /**
  11240. * @typedef
  11241. * @memberof Moveable
  11242. */
  11243. interface RectInfo {
  11244. /**
  11245. * The coordinates of the vertex 1
  11246. */
  11247. pos1: number[];
  11248. /**
  11249. * The coordinates of the vertex 2
  11250. */
  11251. pos2: number[];
  11252. /**
  11253. * The coordinates of the vertex 3
  11254. */
  11255. pos3: number[];
  11256. /**
  11257. * The coordinates of the vertex 4
  11258. */
  11259. pos4: number[];
  11260. /**
  11261. * left position of the target relative to the container
  11262. */
  11263. left: number;
  11264. /**
  11265. * top position of the target relative to the container
  11266. */
  11267. top: number;
  11268. /**
  11269. * The width of moveable element
  11270. */
  11271. width: number;
  11272. /**
  11273. * The height of moveable element
  11274. */
  11275. height: number;
  11276. /**
  11277. * The offset width of the target
  11278. */
  11279. offsetWidth: number;
  11280. /**
  11281. * The offset height of the target
  11282. */
  11283. offsetHeight: number;
  11284. /**
  11285. * The absolute transform origin
  11286. */
  11287. origin: number[];
  11288. /**
  11289. * The absolute transform origin before transformation
  11290. */
  11291. beforeOrigin: number[];
  11292. /**
  11293. * The target transform origin
  11294. */
  11295. transformOrigin: number[];
  11296. /**
  11297. * you can get the absolute rotation value
  11298. */
  11299. rotation: number;
  11300. /**
  11301. * If you use a group, you can get child moveables' rect info
  11302. */
  11303. children?: RectInfo[];
  11304. }
  11305. /**
  11306. * @typedef
  11307. * @memberof Moveable
  11308. * @property - top position
  11309. * @property - left position
  11310. * @property - target's width
  11311. * @property - target's height
  11312. */
  11313. interface HitRect {
  11314. top: number;
  11315. left: number;
  11316. width?: number;
  11317. height?: number;
  11318. }
  11319. /**
  11320. * @typedef
  11321. * @memberof Moveable
  11322. * @extends Moveable.MoveableInterface
  11323. */
  11324. interface MoveableManagerInterface<T = {}, U = {}> extends MoveableInterface {
  11325. moveables?: MoveableManagerInterface[];
  11326. props: MoveableManagerProps<T>;
  11327. state: MoveableManagerState<U>;
  11328. renderState: Record<string, any>;
  11329. rotation: number;
  11330. scale: number[];
  11331. controlGesto: Gesto;
  11332. targetGesto: Gesto;
  11333. enabledAbles: Able[];
  11334. controlAbles: Able[];
  11335. targetAbles: Able[];
  11336. areaElement: HTMLElement;
  11337. controlBox: HTMLElement;
  11338. isUnmounted: boolean;
  11339. useCSS(tag: string, css: string): any;
  11340. getContainer(): HTMLElement | SVGElement;
  11341. getRotation(): number;
  11342. getState(): MoveableManagerState<U>;
  11343. triggerEvent(name: string, params: IObject<any>, isManager?: boolean): any;
  11344. }
  11345. /**
  11346. * @typedef
  11347. * @memberof Moveable
  11348. */
  11349. interface MoveableInterface {
  11350. getManager(): MoveableManagerInterface<any, any>;
  11351. getRect(): RectInfo;
  11352. getAble<T extends Able>(ableName: string): T | undefined;
  11353. isMoveableElement(target: Element): boolean;
  11354. /**
  11355. * If the location or size of the target is changed, call the `.updateRect()` method.
  11356. * Use the `useResizeObserver` and `useMutationObserver` props to update automatically.
  11357. */
  11358. updateRect(type?: "Start" | "" | "End", isTarget?: boolean, isSetState?: boolean): void;
  11359. /**
  11360. * @deprecated
  11361. * Use `.updateRect()` method
  11362. */
  11363. updateTarget(): void;
  11364. /**
  11365. * Request able through a method rather than an event.
  11366. * At the moment of execution, requestStart is executed,
  11367. * and then request and requestEnd can be executed through Requester.
  11368. * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Draggable.html#request Draggable Requester}
  11369. * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Resizable.html#request Resizable Requester}
  11370. * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Scalable.html#request Scalable Requester}
  11371. * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Rotatable.html#request Rotatable Requester}
  11372. * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.OriginDraggable.html#request OriginDraggable Requester}
  11373. * @param - ableName
  11374. * @param - request to be able params.
  11375. * @param - If isInstant is true, request and requestEnd are executed immediately.
  11376. * @return - Able Requester. If there is no request in able, nothing will work.
  11377. * @example
  11378. * import Moveable from "moveable";
  11379. *
  11380. * const moveable = new Moveable(document.body);
  11381. *
  11382. * // Instantly Request (requestStart - request - requestEnd)
  11383. * moveable.request("draggable", { deltaX: 10, deltaY: 10 }, true);
  11384. *
  11385. * // Start move
  11386. * const requester = moveable.request("draggable");
  11387. * requester.request({ deltaX: 10, deltaY: 10 });
  11388. * requester.request({ deltaX: 10, deltaY: 10 });
  11389. * requester.request({ deltaX: 10, deltaY: 10 });
  11390. * requester.requestEnd();
  11391. */
  11392. request<RequestParam extends AbleRequesters[Name], Name extends string = string>(ableName: Name, params?: RequestParam, isInstant?: boolean): Requester<RequestParam>;
  11393. /**
  11394. * moveable is the top level that manages targets
  11395. * `Single`: MoveableManager instance
  11396. * `Group`: MoveableGroup instance
  11397. * `IndividualGroup`: MoveableIndividaulGroup instance
  11398. * Returns leaf target MoveableManagers.
  11399. */
  11400. getMoveables(): MoveableManagerInterface[];
  11401. /**
  11402. * Returns the element of the control box.
  11403. */
  11404. getControlBoxElement(): HTMLElement;
  11405. /**
  11406. * Target element to be dragged in moveable
  11407. */
  11408. getDragElement(): HTMLElement | SVGElement | null | undefined;
  11409. destroy(): void;
  11410. dragStart(e: MouseEvent | TouchEvent, target?: EventTarget | null): void;
  11411. isInside(clientX: number, clientY: number): boolean;
  11412. isDragging(ableName?: string): boolean;
  11413. hitTest(el: Element | HitRect): number;
  11414. setState(state: any, callback?: () => any): any;
  11415. waitToChangeTarget(): Promise<void>;
  11416. forceUpdate(callback?: () => any): any;
  11417. updateSelectors(): void;
  11418. getTargets(): Array<HTMLElement | SVGElement>;
  11419. stopDrag(type?: "target" | "control"): void;
  11420. }
  11421. declare type Writable<T> = {
  11422. -readonly [key in keyof T]: T[key];
  11423. };
  11424. interface AriaToolbarProps extends AriaLabelingProps$1 {
  11425. /**
  11426. * The orientation of the entire toolbar.
  11427. * @default 'horizontal'
  11428. */
  11429. orientation?: Orientation;
  11430. }
  11431. /** These types can be animated */
  11432. 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> : {
  11433. [P in keyof T]: Animatable<T[P]>;
  11434. } : never;
  11435. /**
  11436. * MIT License
  11437. * Copyright (c) Alec Larson
  11438. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11439. * of this software and associated documentation files (the "Software"), to deal
  11440. * in the Software without restriction, including without limitation the rights
  11441. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11442. * copies of the Software, and to permit persons to whom the Software is
  11443. * furnished to do so, subject to the following conditions:
  11444. *
  11445. * The above copyright notice and this permission notice shall be included in all
  11446. * copies or substantial portions of the Software.
  11447. *
  11448. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11449. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11450. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11451. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11452. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11453. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  11454. * SOFTWARE.
  11455. */
  11456. /** Ensure each type of `T` is an array */
  11457. 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;
  11458. /** Override the property types of `A` with `B` and merge any new properties */
  11459. type Merge<A, B> = Remap<{
  11460. [P in keyof A]: P extends keyof B ? B[P] : A[P];
  11461. } & Omit$1<B, keyof A>>;
  11462. /** Better type errors for overloads with generic types */
  11463. type Constrain<T, U> = [T] extends [Any$2] ? U : [T] extends [U] ? T : U;
  11464. /** Try to simplify `&` out of an object type */
  11465. type Remap<T> = {} & {
  11466. [P in keyof T]: T[P];
  11467. };
  11468. type Pick$1<T, K extends keyof T> = {} & {
  11469. [P in K]: T[P];
  11470. };
  11471. type Omit$1<T, K> = Pick$1<T, Exclude<keyof T, K>>;
  11472. type OneOrMore<T> = T | readonly T[];
  11473. type Falsy = false | null | undefined;
  11474. interface Lookup<T = any> {
  11475. [key: string]: T;
  11476. }
  11477. /** Intersected with other object types to allow for unknown properties */
  11478. interface UnknownProps extends Lookup<unknown> {
  11479. }
  11480. /** Use `[T] extends [Any]` to know if a type parameter is `any` */
  11481. declare class Any$2 {
  11482. private _;
  11483. }
  11484. type EasingFunction = (t: number) => number;
  11485. type ExtrapolateType = 'identity' | 'clamp' | 'extend';
  11486. type InterpolatorArgs<Input = any, Output = any> = [InterpolatorFn<Arrify<Input>, Output>] | [InterpolatorConfig<Output>] | [
  11487. readonly number[],
  11488. readonly Constrain<Output, Animatable>[],
  11489. (ExtrapolateType | undefined)?
  11490. ];
  11491. type InterpolatorFn<Input, Output> = (...inputs: Arrify<Input>) => Output;
  11492. type InterpolatorConfig<Output = Animatable> = {
  11493. /**
  11494. * What happens when the spring goes below its target value.
  11495. *
  11496. * - `extend` continues the interpolation past the target value
  11497. * - `clamp` limits the interpolation at the max value
  11498. * - `identity` sets the value to the interpolation input as soon as it hits the boundary
  11499. *
  11500. * @default 'extend'
  11501. */
  11502. extrapolateLeft?: ExtrapolateType;
  11503. /**
  11504. * What happens when the spring exceeds its target value.
  11505. *
  11506. * - `extend` continues the interpolation past the target value
  11507. * - `clamp` limits the interpolation at the max value
  11508. * - `identity` sets the value to the interpolation input as soon as it hits the boundary
  11509. *
  11510. * @default 'extend'
  11511. */
  11512. extrapolateRight?: ExtrapolateType;
  11513. /**
  11514. * What happens when the spring exceeds its target value.
  11515. * Shortcut to set `extrapolateLeft` and `extrapolateRight`.
  11516. *
  11517. * - `extend` continues the interpolation past the target value
  11518. * - `clamp` limits the interpolation at the max value
  11519. * - `identity` sets the value to the interpolation input as soon as it hits the boundary
  11520. *
  11521. * @default 'extend'
  11522. */
  11523. extrapolate?: ExtrapolateType;
  11524. /**
  11525. * Input ranges mapping the interpolation to the output values.
  11526. *
  11527. * @example
  11528. *
  11529. * range: [0, 0.5, 1], output: ['yellow', 'orange', 'red']
  11530. *
  11531. * @default [0,1]
  11532. */
  11533. range?: readonly number[];
  11534. /**
  11535. * Output values from the interpolation function. Should match the length of the `range` array.
  11536. */
  11537. output: readonly Constrain<Output, Animatable>[];
  11538. /**
  11539. * Transformation to apply to the value before interpolation.
  11540. */
  11541. map?: (value: number) => number;
  11542. /**
  11543. * Custom easing to apply in interpolator.
  11544. */
  11545. easing?: EasingFunction;
  11546. };
  11547. interface Timeout {
  11548. time: number;
  11549. handler: () => void;
  11550. cancel: () => void;
  11551. }
  11552. /**
  11553. * MIT License
  11554. * Copyright (c) Alec Larson
  11555. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11556. * of this software and associated documentation files (the "Software"), to deal
  11557. * in the Software without restriction, including without limitation the rights
  11558. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11559. * copies of the Software, and to permit persons to whom the Software is
  11560. * furnished to do so, subject to the following conditions:
  11561. *
  11562. * The above copyright notice and this permission notice shall be included in all
  11563. * copies or substantial portions of the Software.
  11564. *
  11565. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11566. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11567. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11568. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11569. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11570. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  11571. * SOFTWARE.
  11572. */
  11573. declare const $get: unique symbol;
  11574. declare const $observers: unique symbol;
  11575. /** An event sent to `FluidObserver` objects. */
  11576. interface FluidEvent<T = any> {
  11577. type: string;
  11578. parent: FluidValue<T>;
  11579. }
  11580. /**
  11581. * Extend this class for automatic TypeScript support when passing this
  11582. * value to `fluids`-compatible libraries.
  11583. */
  11584. declare abstract class FluidValue<T = any, E extends FluidEvent<T> = any> {
  11585. private [$get];
  11586. private [$observers]?;
  11587. constructor(get?: () => T);
  11588. /** Get the current value. */
  11589. protected get?(): T;
  11590. /** Called after an observer is added. */
  11591. protected observerAdded?(count: number, observer: FluidObserver<E>): void;
  11592. /** Called after an observer is removed. */
  11593. protected observerRemoved?(count: number, observer: FluidObserver<E>): void;
  11594. }
  11595. /** An observer of `FluidValue` objects. */
  11596. type FluidObserver<E extends FluidEvent = any> = {
  11597. eventObserved(event: E): void;
  11598. } | {
  11599. (event: E): void;
  11600. };
  11601. /** Add the `FluidValue` type to every property. */
  11602. type FluidProps<T> = T extends object ? {
  11603. [P in keyof T]: T[P] | FluidValue<Exclude<T[P], void>>;
  11604. } : unknown;
  11605. /** An animated number or a native attribute value */
  11606. declare class AnimatedValue<T = any> extends Animated {
  11607. protected _value: T;
  11608. done: boolean;
  11609. elapsedTime: number;
  11610. lastPosition: number;
  11611. lastVelocity?: number | null;
  11612. v0?: number | null;
  11613. durationProgress: number;
  11614. constructor(_value: T);
  11615. /** @internal */
  11616. static create(value: any): AnimatedValue<any>;
  11617. getPayload(): Payload;
  11618. getValue(): T;
  11619. setValue(value: T, step?: number): boolean;
  11620. reset(): void;
  11621. }
  11622. declare abstract class Animated<T = any> {
  11623. /** The cache of animated values */
  11624. protected payload?: Payload;
  11625. constructor();
  11626. /** Get the current value. Pass `true` for only animated values. */
  11627. abstract getValue(animated?: boolean): T;
  11628. /** Set the current value. Returns `true` if the value changed. */
  11629. abstract setValue(value: T): boolean | void;
  11630. /** Reset any animation state. */
  11631. abstract reset(goal?: T): void;
  11632. /** Get every `AnimatedValue` used by this node. */
  11633. getPayload(): Payload;
  11634. }
  11635. type Payload = readonly AnimatedValue[];
  11636. /**
  11637. * An `Interpolation` is a memoized value that's computed whenever one of its
  11638. * `FluidValue` dependencies has its value changed.
  11639. *
  11640. * Other `FrameValue` objects can depend on this. For example, passing an
  11641. * `Interpolation` as the `to` prop of a `useSpring` call will trigger an
  11642. * animation toward the memoized value.
  11643. */
  11644. declare class Interpolation<Input = any, Output = any> extends FrameValue<Output> {
  11645. /** The source of input values */
  11646. readonly source: unknown;
  11647. /** Useful for debugging. */
  11648. key?: string;
  11649. /** Equals false when in the frameloop */
  11650. idle: boolean;
  11651. /** The function that maps inputs values to output */
  11652. readonly calc: InterpolatorFn<Input, Output>;
  11653. /** The inputs which are currently animating */
  11654. protected _active: Set<FluidValue<any, any>>;
  11655. constructor(
  11656. /** The source of input values */
  11657. source: unknown, args: InterpolatorArgs<Input, Output>);
  11658. advance(_dt?: number): void;
  11659. protected _get(): Output;
  11660. protected _start(): void;
  11661. protected _attach(): void;
  11662. protected _detach(): void;
  11663. /** @internal */
  11664. eventObserved(event: FrameValue.Event): void;
  11665. }
  11666. /**
  11667. * A kind of `FluidValue` that manages an `AnimatedValue` node.
  11668. *
  11669. * Its underlying value can be accessed and even observed.
  11670. */
  11671. declare abstract class FrameValue<T = any> extends FluidValue<T, FrameValue.Event<T>> {
  11672. readonly id: number;
  11673. abstract key?: string;
  11674. abstract get idle(): boolean;
  11675. protected _priority: number;
  11676. get priority(): number;
  11677. set priority(priority: number);
  11678. /** Get the current value */
  11679. get(): T;
  11680. /** Create a spring that maps our value to another value */
  11681. to<Out>(...args: InterpolatorArgs<T, Out>): Interpolation<T, Out>;
  11682. /** @deprecated Use the `to` method instead. */
  11683. interpolate<Out>(...args: InterpolatorArgs<T, Out>): Interpolation<T, Out>;
  11684. toJSON(): T;
  11685. protected observerAdded(count: number): void;
  11686. protected observerRemoved(count: number): void;
  11687. /** @internal */
  11688. abstract advance(dt: number): void;
  11689. /** @internal */
  11690. abstract eventObserved(_event: FrameValue.Event): void;
  11691. /** Called when the first child is added. */
  11692. protected _attach(): void;
  11693. /** Called when the last child is removed. */
  11694. protected _detach(): void;
  11695. /** Tell our children about our new value */
  11696. protected _onChange(value: T, idle?: boolean): void;
  11697. /** Tell our children about our new priority */
  11698. protected _onPriorityChange(priority: number): void;
  11699. }
  11700. declare namespace FrameValue {
  11701. /** A parent changed its value */
  11702. interface ChangeEvent<T = any> {
  11703. parent: FrameValue<T>;
  11704. type: 'change';
  11705. value: T;
  11706. idle: boolean;
  11707. }
  11708. /** A parent changed its priority */
  11709. interface PriorityEvent<T = any> {
  11710. parent: FrameValue<T>;
  11711. type: 'priority';
  11712. priority: number;
  11713. }
  11714. /** A parent is done animating */
  11715. interface IdleEvent<T = any> {
  11716. parent: FrameValue<T>;
  11717. type: 'idle';
  11718. }
  11719. /** Events sent to children of `FrameValue` objects */
  11720. type Event<T = any> = ChangeEvent<T> | PriorityEvent<T> | IdleEvent<T>;
  11721. }
  11722. declare class AnimationConfig {
  11723. /**
  11724. * With higher tension, the spring will resist bouncing and try harder to stop at its end value.
  11725. *
  11726. * When tension is zero, no animation occurs.
  11727. *
  11728. * @default 170
  11729. */
  11730. tension: number;
  11731. /**
  11732. * The damping ratio coefficient, or just the damping ratio when `speed` is defined.
  11733. *
  11734. * When `speed` is defined, this value should be between 0 and 1.
  11735. *
  11736. * Higher friction means the spring will slow down faster.
  11737. *
  11738. * @default 26
  11739. */
  11740. friction: number;
  11741. /**
  11742. * The natural frequency (in seconds), which dictates the number of bounces
  11743. * per second when no damping exists.
  11744. *
  11745. * When defined, `tension` is derived from this, and `friction` is derived
  11746. * from `tension` and `damping`.
  11747. */
  11748. frequency?: number;
  11749. /**
  11750. * The damping ratio, which dictates how the spring slows down.
  11751. *
  11752. * Set to `0` to never slow down. Set to `1` to slow down without bouncing.
  11753. * Between `0` and `1` is for you to explore.
  11754. *
  11755. * Only works when `frequency` is defined.
  11756. *
  11757. * @default 1
  11758. */
  11759. damping: number;
  11760. /**
  11761. * Higher mass means more friction is required to slow down.
  11762. *
  11763. * Defaults to 1, which works fine most of the time.
  11764. *
  11765. * @default 1
  11766. */
  11767. mass: number;
  11768. /**
  11769. * The initial velocity of one or more values.
  11770. *
  11771. * @default 0
  11772. */
  11773. velocity: number | number[];
  11774. /**
  11775. * The smallest velocity before the animation is considered "not moving".
  11776. *
  11777. * When undefined, `precision` is used instead.
  11778. */
  11779. restVelocity?: number;
  11780. /**
  11781. * The smallest distance from a value before that distance is essentially zero.
  11782. *
  11783. * This helps in deciding when a spring is "at rest". The spring must be within
  11784. * this distance from its final value, and its velocity must be lower than this
  11785. * value too (unless `restVelocity` is defined).
  11786. *
  11787. * @default 0.01
  11788. */
  11789. precision?: number;
  11790. /**
  11791. * For `duration` animations only. Note: The `duration` is not affected
  11792. * by this property.
  11793. *
  11794. * Defaults to `0`, which means "start from the beginning".
  11795. *
  11796. * Setting to `1+` makes an immediate animation.
  11797. *
  11798. * Setting to `0.5` means "start from the middle of the easing function".
  11799. *
  11800. * Any number `>= 0` and `<= 1` makes sense here.
  11801. */
  11802. progress?: number;
  11803. /**
  11804. * Animation length in number of milliseconds.
  11805. */
  11806. duration?: number;
  11807. /**
  11808. * The animation curve. Only used when `duration` is defined.
  11809. *
  11810. * Defaults to quadratic ease-in-out.
  11811. */
  11812. easing: EasingFunction;
  11813. /**
  11814. * Avoid overshooting by ending abruptly at the goal value.
  11815. *
  11816. * @default false
  11817. */
  11818. clamp: boolean;
  11819. /**
  11820. * When above zero, the spring will bounce instead of overshooting when
  11821. * exceeding its goal value. Its velocity is multiplied by `-1 + bounce`
  11822. * whenever its current value equals or exceeds its goal. For example,
  11823. * setting `bounce` to `0.5` chops the velocity in half on each bounce,
  11824. * in addition to any friction.
  11825. */
  11826. bounce?: number;
  11827. /**
  11828. * "Decay animations" decelerate without an explicit goal value.
  11829. * Useful for scrolling animations.
  11830. *
  11831. * Use `true` for the default exponential decay factor (`0.998`).
  11832. *
  11833. * When a `number` between `0` and `1` is given, a lower number makes the
  11834. * animation slow down faster. And setting to `1` would make an unending
  11835. * animation.
  11836. *
  11837. * @default false
  11838. */
  11839. decay?: boolean | number;
  11840. /**
  11841. * While animating, round to the nearest multiple of this number.
  11842. * The `from` and `to` values are never rounded, as well as any value
  11843. * passed to the `set` method of an animated value.
  11844. */
  11845. round?: number;
  11846. constructor();
  11847. }
  11848. /** The object type of the `config` prop. */
  11849. type SpringConfig = Partial<AnimationConfig>;
  11850. /** The object given to the `onRest` prop and `start` promise. */
  11851. interface AnimationResult<T extends Readable = any> {
  11852. value: T extends Readable<infer U> ? U : never;
  11853. /** When true, no animation ever started. */
  11854. noop?: boolean;
  11855. /** When true, the animation was neither cancelled nor stopped prematurely. */
  11856. finished?: boolean;
  11857. /** When true, the animation was cancelled before it could finish. */
  11858. cancelled?: boolean;
  11859. }
  11860. /** The promised result of an animation. */
  11861. type AsyncResult<T extends Readable = any> = Promise<AnimationResult<T>>;
  11862. /**
  11863. * The set of `SpringValue` objects returned by a `useSpring` call (or similar).
  11864. */
  11865. type SpringValues<T extends Lookup = any> = [T] extends [Any$2] ? Lookup<SpringValue<unknown> | undefined> : {
  11866. [P in keyof T]: SpringWrap<T[P]>;
  11867. };
  11868. type SpringWrap<T> = [
  11869. Exclude<T, FluidValue>,
  11870. Extract<T, readonly any[]>
  11871. ] extends [object | void, never] ? never : SpringValue<Exclude<T, FluidValue | void>> | Extract<T, void>;
  11872. /** @internal */
  11873. interface Readable<T = any> {
  11874. get(): T;
  11875. }
  11876. /** @internal */
  11877. type InferState<T extends Readable> = T extends Controller<infer State> ? State : T extends SpringValue<infer U> ? U : unknown;
  11878. /** @internal */
  11879. type InferProps<T extends Readable> = T extends Controller<infer State> ? ControllerUpdate<State> : T extends SpringValue<infer U> ? SpringUpdate<U> : Lookup;
  11880. /** @internal */
  11881. type InferTarget<T> = T extends object ? T extends ReadonlyArray<number | string> ? SpringValue<T> : Controller<T> : SpringValue<T>;
  11882. /** @internal */
  11883. interface AnimationTarget<T = any> extends Readable<T> {
  11884. start(props: any): AsyncResult<this>;
  11885. stop: Function;
  11886. item?: unknown;
  11887. }
  11888. /** @internal */
  11889. interface AnimationRange<T> {
  11890. to: T | FluidValue<T> | undefined;
  11891. from: T | FluidValue<T> | undefined;
  11892. }
  11893. /** @internal */
  11894. type AnimationResolver<T extends Readable> = (result: AnimationResult<T> | AsyncResult<T>) => void;
  11895. /** @internal */
  11896. type EventKey = Exclude<keyof ReservedEventProps, 'onResolve' | 'onDestroyed'>;
  11897. /** @internal */
  11898. type PickEventFns<T> = {
  11899. [P in Extract<keyof T, EventKey>]?: Extract<T[P], Function>;
  11900. };
  11901. /** An animation being executed by the frameloop */
  11902. declare class Animation<T = any> {
  11903. changed: boolean;
  11904. values: readonly AnimatedValue[];
  11905. toValues: readonly number[] | null;
  11906. fromValues: readonly number[];
  11907. to: T | FluidValue<T>;
  11908. from: T | FluidValue<T>;
  11909. config: AnimationConfig;
  11910. immediate: boolean;
  11911. }
  11912. interface Animation<T> extends PickEventFns<SpringProps<T>> {
  11913. }
  11914. type AsyncTo<T> = SpringChain<T> | SpringToFn<T>;
  11915. /** @internal */
  11916. type RunAsyncProps<T extends AnimationTarget = any> = InferProps<T> & {
  11917. callId: number;
  11918. parentId?: number;
  11919. cancel: boolean;
  11920. to?: any;
  11921. };
  11922. /** @internal */
  11923. interface RunAsyncState<T extends AnimationTarget = any> {
  11924. paused: boolean;
  11925. pauseQueue: Set<() => void>;
  11926. resumeQueue: Set<() => void>;
  11927. timeouts: Set<Timeout>;
  11928. delayed?: boolean;
  11929. asyncId?: number;
  11930. asyncTo?: AsyncTo<InferState<T>>;
  11931. promise?: AsyncResult<T>;
  11932. cancelId?: number;
  11933. }
  11934. interface DefaultSpringProps<T> extends Pick<SpringProps<T>, 'pause' | 'cancel' | 'immediate' | 'config'>, PickEventFns<SpringProps<T>> {
  11935. }
  11936. /**
  11937. * Only numbers, strings, and arrays of numbers/strings are supported.
  11938. * Non-animatable strings are also supported.
  11939. */
  11940. declare class SpringValue<T = any> extends FrameValue<T> {
  11941. /** The property name used when `to` or `from` is an object. Useful when debugging too. */
  11942. key?: string;
  11943. /** The animation state */
  11944. animation: Animation<T>;
  11945. /** The queue of pending props */
  11946. queue?: SpringUpdate<T>[];
  11947. /** Some props have customizable default values */
  11948. defaultProps: DefaultSpringProps<T>;
  11949. /** The state for `runAsync` calls */
  11950. protected _state: RunAsyncState<SpringValue<T>>;
  11951. /** The promise resolvers of pending `start` calls */
  11952. protected _pendingCalls: Set<AnimationResolver<this>>;
  11953. /** The counter for tracking `scheduleProps` calls */
  11954. protected _lastCallId: number;
  11955. /** The last `scheduleProps` call that changed the `to` prop */
  11956. protected _lastToId: number;
  11957. protected _memoizedDuration: number;
  11958. constructor(from: Exclude<T, object>, props?: SpringUpdate<T>);
  11959. constructor(props?: SpringUpdate<T>);
  11960. /** Equals true when not advancing on each frame. */
  11961. get idle(): boolean;
  11962. get goal(): T;
  11963. get velocity(): VelocityProp<T>;
  11964. /**
  11965. * When true, this value has been animated at least once.
  11966. */
  11967. get hasAnimated(): boolean;
  11968. /**
  11969. * When true, this value has an unfinished animation,
  11970. * which is either active or paused.
  11971. */
  11972. get isAnimating(): boolean;
  11973. /**
  11974. * When true, all current and future animations are paused.
  11975. */
  11976. get isPaused(): boolean;
  11977. /**
  11978. *
  11979. *
  11980. */
  11981. get isDelayed(): boolean | undefined;
  11982. /** Advance the current animation by a number of milliseconds */
  11983. advance(dt: number): void;
  11984. /** Set the current value, while stopping the current animation */
  11985. set(value: T | FluidValue<T>): this;
  11986. /**
  11987. * Freeze the active animation in time, as well as any updates merged
  11988. * before `resume` is called.
  11989. */
  11990. pause(): void;
  11991. /** Resume the animation if paused. */
  11992. resume(): void;
  11993. /** Skip to the end of the current animation. */
  11994. finish(): this;
  11995. /** Push props into the pending queue. */
  11996. update(props: SpringUpdate<T>): this;
  11997. /**
  11998. * Update this value's animation using the queue of pending props,
  11999. * and unpause the current animation (if one is frozen).
  12000. *
  12001. * When arguments are passed, a new animation is created, and the
  12002. * queued animations are left alone.
  12003. */
  12004. start(): AsyncResult<this>;
  12005. start(props: SpringUpdate<T>): AsyncResult<this>;
  12006. start(to: T, props?: SpringProps<T>): AsyncResult<this>;
  12007. /**
  12008. * Stop the current animation, and cancel any delayed updates.
  12009. *
  12010. * Pass `true` to call `onRest` with `cancelled: true`.
  12011. */
  12012. stop(cancel?: boolean): this;
  12013. /** Restart the animation. */
  12014. reset(): void;
  12015. /** @internal */
  12016. eventObserved(event: FrameValue.Event): void;
  12017. /**
  12018. * Parse the `to` and `from` range from the given `props` object.
  12019. *
  12020. * This also ensures the initial value is available to animated components
  12021. * during the render phase.
  12022. */
  12023. protected _prepareNode(props: {
  12024. to?: any;
  12025. from?: any;
  12026. reverse?: boolean;
  12027. default?: any;
  12028. }): {
  12029. to: any;
  12030. from: any;
  12031. };
  12032. /** Every update is processed by this method before merging. */
  12033. protected _update({ ...props }: SpringProps<T>, isLoop?: boolean): AsyncResult<SpringValue<T>>;
  12034. /** Merge props into the current animation */
  12035. protected _merge(range: AnimationRange<T>, props: RunAsyncProps<SpringValue<T>>, resolve: AnimationResolver<SpringValue<T>>): void;
  12036. /** Update the `animation.to` value, which might be a `FluidValue` */
  12037. protected _focus(value: T | FluidValue<T>): void;
  12038. protected _attach(): void;
  12039. protected _detach(): void;
  12040. /**
  12041. * Update the current value from outside the frameloop,
  12042. * and return the `Animated` node.
  12043. */
  12044. protected _set(arg: T | FluidValue<T>, idle?: boolean): Animated | undefined;
  12045. protected _onStart(): void;
  12046. protected _onChange(value: T, idle?: boolean): void;
  12047. protected _start(): void;
  12048. protected _resume(): void;
  12049. /**
  12050. * Exit the frameloop and notify `onRest` listeners.
  12051. *
  12052. * Always wrap `_stop` calls with `batchedUpdates`.
  12053. */
  12054. protected _stop(goal?: any, cancel?: boolean): void;
  12055. }
  12056. /** Queue of pending updates for a `Controller` instance. */
  12057. interface ControllerQueue<State extends Lookup = Lookup> extends Array<ControllerUpdate<State, any> & {
  12058. /** The keys affected by this update. When null, all keys are affected. */
  12059. keys: string[] | null;
  12060. }> {
  12061. }
  12062. declare class Controller<State extends Lookup = Lookup> {
  12063. readonly id: number;
  12064. /** The animated values */
  12065. springs: SpringValues<State>;
  12066. /** The queue of props passed to the `update` method. */
  12067. queue: ControllerQueue<State>;
  12068. /**
  12069. * The injected ref. When defined, render-based updates are pushed
  12070. * onto the `queue` instead of being auto-started.
  12071. */
  12072. ref?: SpringRef<State>;
  12073. /** Custom handler for flushing update queues */
  12074. protected _flush?: ControllerFlushFn<this>;
  12075. /** These props are used by all future spring values */
  12076. protected _initialProps?: Lookup;
  12077. /** The counter for tracking `scheduleProps` calls */
  12078. protected _lastAsyncId: number;
  12079. /** The values currently being animated */
  12080. protected _active: Set<FrameValue<any>>;
  12081. /** The values that changed recently */
  12082. protected _changed: Set<FrameValue<any>>;
  12083. /** Equals false when `onStart` listeners can be called */
  12084. protected _started: boolean;
  12085. private _item?;
  12086. /** State used by the `runAsync` function */
  12087. protected _state: RunAsyncState<this>;
  12088. /** The event queues that are flushed once per frame maximum */
  12089. protected _events: {
  12090. onStart: Map<((result: AnimationResult<SpringValue<State>>, ctrl: Controller<State>, item?: any) => void) | ((result: AnimationResult<SpringValue<State>>, ctrl: Controller<State>, item: any) => void), AnimationResult<any>>;
  12091. onChange: Map<((result: AnimationResult<SpringValue<State>>, ctrl: Controller<State>, item?: any) => void) | ((result: AnimationResult<SpringValue<State>>, ctrl: Controller<State>, item: any) => void), AnimationResult<any>>;
  12092. onRest: Map<((result: AnimationResult<SpringValue<State>>, ctrl: Controller<State>, item?: any) => void) | ((result: AnimationResult<SpringValue<State>>, ctrl: Controller<State>, item: any) => void), AnimationResult<any>>;
  12093. };
  12094. constructor(props?: ControllerUpdate<State> | null, flush?: ControllerFlushFn<any>);
  12095. /**
  12096. * Equals `true` when no spring values are in the frameloop, and
  12097. * no async animation is currently active.
  12098. */
  12099. get idle(): boolean;
  12100. get item(): any;
  12101. set item(item: any);
  12102. /** Get the current values of our springs */
  12103. get(): State & UnknownProps;
  12104. /** Set the current values without animating. */
  12105. set(values: Partial<State>): void;
  12106. /** Push an update onto the queue of each value. */
  12107. update(props: ControllerUpdate<State> | Falsy): this;
  12108. /**
  12109. * Start the queued animations for every spring, and resolve the returned
  12110. * promise once all queued animations have finished or been cancelled.
  12111. *
  12112. * When you pass a queue (instead of nothing), that queue is used instead of
  12113. * the queued animations added with the `update` method, which are left alone.
  12114. */
  12115. start(props?: OneOrMore<ControllerUpdate<State>> | null): AsyncResult<this>;
  12116. /** Stop all animations. */
  12117. stop(): this;
  12118. /** Stop animations for the given keys. */
  12119. stop(keys: OneOrMore<string>): this;
  12120. /** Cancel all animations. */
  12121. stop(cancel: boolean): this;
  12122. /** Cancel animations for the given keys. */
  12123. stop(cancel: boolean, keys: OneOrMore<string>): this;
  12124. /** Stop some or all animations. */
  12125. stop(keys?: OneOrMore<string>): this;
  12126. /** Cancel some or all animations. */
  12127. stop(cancel: boolean, keys?: OneOrMore<string>): this;
  12128. /** Freeze the active animation in time */
  12129. pause(keys?: OneOrMore<string>): this;
  12130. /** Resume the animation if paused. */
  12131. resume(keys?: OneOrMore<string>): this;
  12132. /** Call a function once per spring value */
  12133. each(iterator: (spring: SpringValue, key: string) => void): void;
  12134. /** @internal Called at the end of every animation frame */
  12135. protected _onFrame(): void;
  12136. /** @internal */
  12137. eventObserved(event: FrameValue.Event): void;
  12138. }
  12139. /**
  12140. * For testing whether a type is an object but not an array.
  12141. *
  12142. * T extends IsPlainObject<T> ? true : false
  12143. *
  12144. * When `any` is passed, the resolved type is `true | false`.
  12145. */
  12146. type IsPlainObject<T> = T extends ReadonlyArray<any> ? Any$2 : T extends object ? object : Any$2;
  12147. type StringKeys<T> = T extends IsPlainObject<T> ? string & keyof T : string;
  12148. /** The flush function that handles `start` calls */
  12149. type ControllerFlushFn<T extends Controller<any> = Controller> = (ctrl: T, queue: ControllerQueue<InferState<T>>) => AsyncResult<T>;
  12150. /**
  12151. * An async function that can update or stop the animations of a spring.
  12152. * Typically defined as the `to` prop.
  12153. *
  12154. * The `T` parameter can be a set of animated values (as an object type)
  12155. * or a primitive type for a single animated value.
  12156. */
  12157. interface SpringToFn<T = any> {
  12158. (start: StartFn<T>, stop: StopFn<T>): Promise<any> | void;
  12159. }
  12160. type StartFn<T> = InferTarget<T> extends {
  12161. start: infer T;
  12162. } ? T : never;
  12163. type StopFn<T> = InferTarget<T> extends {
  12164. stop: infer T;
  12165. } ? T : never;
  12166. 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;
  12167. /**
  12168. * Called before the first frame of every animation.
  12169. * From inside the `requestAnimationFrame` callback.
  12170. */
  12171. type OnStart<TResult extends Readable, TSource, Item = undefined> = EventHandler<TResult, TSource, Item>;
  12172. /** Called when a `SpringValue` changes */
  12173. type OnChange<TResult extends Readable, TSource, Item = undefined> = EventHandler<TResult, TSource, Item>;
  12174. type OnPause<TResult extends Readable, TSource, Item = undefined> = EventHandler<TResult, TSource, Item>;
  12175. type OnResume<TResult extends Readable, TSource, Item = undefined> = EventHandler<TResult, TSource, Item>;
  12176. /** Called once the animation comes to a halt */
  12177. type OnRest<TResult extends Readable, TSource, Item = undefined> = EventHandler<TResult, TSource, Item>;
  12178. type OnResolve<TResult extends Readable, TSource, Item = undefined> = EventHandler<TResult, TSource, Item>;
  12179. /**
  12180. * Called after an animation is updated by new props,
  12181. * even if the animation remains idle.
  12182. */
  12183. type OnProps<T = unknown> = (props: Readonly<SpringProps<T>>, spring: SpringValue<T>) => void;
  12184. declare enum TransitionPhase {
  12185. /** This transition is being mounted */
  12186. MOUNT = "mount",
  12187. /** This transition is entering or has entered */
  12188. ENTER = "enter",
  12189. /** This transition had its animations updated */
  12190. UPDATE = "update",
  12191. /** This transition will expire after animating */
  12192. LEAVE = "leave"
  12193. }
  12194. type UseTransitionProps<Item = any> = Merge<Omit<ControllerProps<UnknownProps, Item>, 'onResolve'>, {
  12195. from?: TransitionFrom<Item>;
  12196. initial?: TransitionFrom<Item>;
  12197. enter?: TransitionTo<Item>;
  12198. update?: TransitionTo<Item>;
  12199. leave?: TransitionTo<Item>;
  12200. keys?: ItemKeys<Item>;
  12201. sort?: (a: Item, b: Item) => number;
  12202. trail?: number;
  12203. exitBeforeEnter?: boolean;
  12204. /**
  12205. * When `true` or `<= 0`, each item is unmounted immediately after its
  12206. * `leave` animation is finished.
  12207. *
  12208. * When `false`, items are never unmounted.
  12209. *
  12210. * When `> 0`, this prop is used in a `setTimeout` call that forces a
  12211. * rerender if the component that called `useTransition` doesn't rerender
  12212. * on its own after an item's `leave` animation is finished.
  12213. */
  12214. expires?: boolean | number | ((item: Item) => boolean | number);
  12215. config?: SpringConfig | ((item: Item, index: number, state: TransitionPhase) => AnimationProps['config']);
  12216. /**
  12217. * Called after a transition item is unmounted.
  12218. */
  12219. onDestroyed?: (item: Item, key: Key) => void;
  12220. /**
  12221. * Used to access the imperative API.
  12222. *
  12223. * Animations never auto-start when `ref` is defined.
  12224. */
  12225. ref?: SpringRef;
  12226. }>;
  12227. type Key = string | number;
  12228. type ItemKeys<T = any> = OneOrMore<Key> | ((item: T) => Key) | null;
  12229. type TransitionFrom<Item> = Falsy | GoalProp<UnknownProps> | ((item: Item, index: number) => GoalProp<UnknownProps> | Falsy);
  12230. 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);
  12231. /**
  12232. * The props of a `useSpring` call or its async `update` function.
  12233. *
  12234. * The `T` parameter can be a set of animated values (as an object type)
  12235. * or a primitive type for a single animated value.
  12236. */
  12237. type SpringUpdate<T = any> = ToProps<T> & SpringProps<T>;
  12238. /**
  12239. * Use the `SpringUpdate` type if you need the `to` prop to exist.
  12240. * For function types, prefer one overload per possible `to` prop
  12241. * type (for better type inference).
  12242. *
  12243. * The `T` parameter can be a set of animated values (as an object type)
  12244. * or a primitive type for a single animated value.
  12245. */
  12246. interface SpringProps<T = any> extends AnimationProps<T> {
  12247. from?: GoalValue<T>;
  12248. loop?: LoopProp<SpringUpdate>;
  12249. /**
  12250. * Called after an animation is updated by new props,
  12251. * even if the animation remains idle.
  12252. */
  12253. onProps?: EventProp<OnProps<T>>;
  12254. /**
  12255. * Called when an animation moves for the first time.
  12256. */
  12257. onStart?: EventProp<OnStart<SpringValue<T>, SpringValue<T>>>;
  12258. /**
  12259. * Called when a spring has its value changed.
  12260. */
  12261. onChange?: EventProp<OnChange<SpringValue<T>, SpringValue<T>>>;
  12262. onPause?: EventProp<OnPause<SpringValue<T>, SpringValue<T>>>;
  12263. onResume?: EventProp<OnResume<SpringValue<T>, SpringValue<T>>>;
  12264. /**
  12265. * Called when all animations come to a stand-still.
  12266. */
  12267. onRest?: EventProp<OnRest<SpringValue<T>, SpringValue<T>>>;
  12268. }
  12269. /**
  12270. * A union type of all possible `to` prop values.
  12271. *
  12272. * This is not recommended for function types. Instead, you should declare
  12273. * an overload for each `to` type. See `SpringUpdateFn` for an example.
  12274. *
  12275. * The `T` parameter can be a set of animated values (as an object type)
  12276. * or a primitive type for a single animated value.
  12277. */
  12278. type ToProps<T = any> = {
  12279. to?: GoalProp<T> | SpringToFn<T> | SpringChain<T>;
  12280. } | ([T] extends [IsPlainObject<T>] ? InlineToProps<T> : never);
  12281. /**
  12282. * A value or set of values that can be animated from/to.
  12283. *
  12284. * The `T` parameter can be a set of animated values (as an object type)
  12285. * or a primitive type for a single animated value.
  12286. */
  12287. type GoalProp<T> = [T] extends [IsPlainObject<T>] ? GoalValues<T> | Falsy : GoalValue<T>;
  12288. /** A set of values for a `Controller` to animate from/to. */
  12289. type GoalValues<T> = FluidProps<T> extends infer Props ? {
  12290. [P in keyof Props]?: Props[P] | null;
  12291. } : never;
  12292. /**
  12293. * A value that `SpringValue` objects can animate from/to.
  12294. *
  12295. * The `UnknownProps` type lets you pass in { a: 1 } if the `key`
  12296. * property of `SpringValue` equals "a".
  12297. */
  12298. type GoalValue<T> = T | FluidValue<T> | UnknownProps | null | undefined;
  12299. /**
  12300. * Where `to` is inferred from non-reserved props
  12301. *
  12302. * The `T` parameter can be a set of animated values (as an object type)
  12303. * or a primitive type for a single animated value.
  12304. */
  12305. type InlineToProps<T = any> = Remap<GoalValues<T> & {
  12306. to?: undefined;
  12307. }>;
  12308. /** A serial queue of spring updates. */
  12309. interface SpringChain<T = any> extends Array<[
  12310. T
  12311. ] extends [IsPlainObject<T>] ? ControllerUpdate<T> : SpringTo<T> | SpringUpdate<T>> {
  12312. }
  12313. /** A value that any `SpringValue` or `Controller` can animate to. */
  12314. type SpringTo<T = any> = ([T] extends [IsPlainObject<T>] ? never : T | FluidValue<T>) | SpringChain<T> | SpringToFn<T> | Falsy;
  12315. type ControllerUpdate<State extends Lookup = Lookup, Item = undefined> = unknown & ToProps<State> & ControllerProps<State, Item>;
  12316. /**
  12317. * Props for `Controller` methods and constructor.
  12318. */
  12319. interface ControllerProps<State extends Lookup = Lookup, Item = undefined> extends AnimationProps<State> {
  12320. ref?: SpringRef<State>;
  12321. from?: GoalValues<State> | Falsy;
  12322. loop?: LoopProp<ControllerUpdate>;
  12323. /**
  12324. * Called when the # of animating values exceeds 0
  12325. *
  12326. * Also accepts an object for per-key events
  12327. */
  12328. onStart?: OnStart<SpringValue<State>, Controller<State>, Item> | {
  12329. [P in keyof State]?: OnStart<SpringValue<State[P]>, Controller<State>, Item>;
  12330. };
  12331. /**
  12332. * Called when the # of animating values hits 0
  12333. *
  12334. * Also accepts an object for per-key events
  12335. */
  12336. onRest?: OnRest<SpringValue<State>, Controller<State>, Item> | {
  12337. [P in keyof State]?: OnRest<SpringValue<State[P]>, Controller<State>, Item>;
  12338. };
  12339. /**
  12340. * Called once per frame when animations are active
  12341. *
  12342. * Also accepts an object for per-key events
  12343. */
  12344. onChange?: OnChange<SpringValue<State>, Controller<State>, Item> | {
  12345. [P in keyof State]?: OnChange<SpringValue<State[P]>, Controller<State>, Item>;
  12346. };
  12347. onPause?: OnPause<SpringValue<State>, Controller<State>, Item> | {
  12348. [P in keyof State]?: OnPause<SpringValue<State[P]>, Controller<State>, Item>;
  12349. };
  12350. onResume?: OnResume<SpringValue<State>, Controller<State>, Item> | {
  12351. [P in keyof State]?: OnResume<SpringValue<State[P]>, Controller<State>, Item>;
  12352. };
  12353. /**
  12354. * Called after an animation is updated by new props.
  12355. * Useful for manipulation
  12356. *
  12357. * Also accepts an object for per-key events
  12358. */
  12359. onProps?: OnProps<State> | {
  12360. [P in keyof State]?: OnProps<State[P]>;
  12361. };
  12362. /**
  12363. * Called when the promise for this update is resolved.
  12364. */
  12365. onResolve?: OnResolve<SpringValue<State>, Controller<State>, Item>;
  12366. }
  12367. type LoopProp<T extends object> = boolean | T | (() => boolean | T);
  12368. type VelocityProp<T = any> = T extends ReadonlyArray<number | string> ? number[] : number;
  12369. /** For props that can be set on a per-key basis. */
  12370. type MatchProp<T> = boolean | OneOrMore<StringKeys<T>> | ((key: StringKeys<T>) => boolean);
  12371. /** Event props can be customized per-key. */
  12372. type EventProp<T> = T | Lookup<T | undefined>;
  12373. /**
  12374. * Most of the reserved animation props, except `to`, `from`, `loop`,
  12375. * and the event props.
  12376. */
  12377. interface AnimationProps<T = any> {
  12378. /**
  12379. * Configure the spring behavior for each key.
  12380. */
  12381. config?: SpringConfig | ((key: StringKeys<T>) => SpringConfig);
  12382. /**
  12383. * Milliseconds to wait before applying the other props.
  12384. */
  12385. delay?: number | ((key: StringKeys<T>) => number);
  12386. /**
  12387. * When true, props jump to their goal values instead of animating.
  12388. */
  12389. immediate?: MatchProp<T>;
  12390. /**
  12391. * Cancel all animations by using `true`, or some animations by using a key
  12392. * or an array of keys.
  12393. */
  12394. cancel?: MatchProp<T>;
  12395. /**
  12396. * Pause all animations by using `true`, or some animations by using a key
  12397. * or an array of keys.
  12398. */
  12399. pause?: MatchProp<T>;
  12400. /**
  12401. * Start the next animations at their values in the `from` prop.
  12402. */
  12403. reset?: MatchProp<T>;
  12404. /**
  12405. * Swap the `to` and `from` props.
  12406. */
  12407. reverse?: boolean;
  12408. /**
  12409. * Override the default props with this update.
  12410. */
  12411. default?: boolean | SpringProps<T>;
  12412. }
  12413. interface ReservedEventProps {
  12414. onProps?: any;
  12415. onStart?: any;
  12416. onChange?: any;
  12417. onPause?: any;
  12418. onResume?: any;
  12419. onRest?: any;
  12420. onResolve?: any;
  12421. onDestroyed?: any;
  12422. }
  12423. interface ControllerUpdateFn<State extends Lookup = Lookup> {
  12424. (i: number, ctrl: Controller<State>): ControllerUpdate<State> | Falsy;
  12425. }
  12426. interface SpringRef<State extends Lookup = Lookup> {
  12427. (props?: ControllerUpdate<State> | ControllerUpdateFn<State>): AsyncResult<Controller<State>>[];
  12428. current: Controller<State>[];
  12429. /** Add a controller to this ref */
  12430. add(ctrl: Controller<State>): void;
  12431. /** Remove a controller from this ref */
  12432. delete(ctrl: Controller<State>): void;
  12433. /** Pause all animations. */
  12434. pause(): this;
  12435. /** Pause animations for the given keys. */
  12436. pause(keys: OneOrMore<string>): this;
  12437. /** Pause some or all animations. */
  12438. pause(keys?: OneOrMore<string>): this;
  12439. /** Resume all animations. */
  12440. resume(): this;
  12441. /** Resume animations for the given keys. */
  12442. resume(keys: OneOrMore<string>): this;
  12443. /** Resume some or all animations. */
  12444. resume(keys?: OneOrMore<string>): this;
  12445. /** Update the state of each controller without animating. */
  12446. set(values: Partial<State>): void;
  12447. /** Update the state of each controller without animating based on their passed state. */
  12448. set(values: (index: number, ctrl: Controller<State>) => Partial<State>): void;
  12449. /** Start the queued animations of each controller. */
  12450. start(): AsyncResult<Controller<State>>[];
  12451. /** Update every controller with the same props. */
  12452. start(props: ControllerUpdate<State>): AsyncResult<Controller<State>>[];
  12453. /** Update controllers based on their state. */
  12454. start(props: ControllerUpdateFn<State>): AsyncResult<Controller<State>>[];
  12455. /** Start animating each controller. */
  12456. start(props?: ControllerUpdate<State> | ControllerUpdateFn<State>): AsyncResult<Controller<State>>[];
  12457. /** Stop all animations. */
  12458. stop(): this;
  12459. /** Stop animations for the given keys. */
  12460. stop(keys: OneOrMore<string>): this;
  12461. /** Cancel all animations. */
  12462. stop(cancel: boolean): this;
  12463. /** Cancel animations for the given keys. */
  12464. stop(cancel: boolean, keys: OneOrMore<string>): this;
  12465. /** Stop some or all animations. */
  12466. stop(keys?: OneOrMore<string>): this;
  12467. /** Cancel some or all animations. */
  12468. stop(cancel: boolean, keys?: OneOrMore<string>): this;
  12469. /** Add the same props to each controller's update queue. */
  12470. update(props: ControllerUpdate<State>): this;
  12471. /** Generate separate props for each controller's update queue. */
  12472. update(props: ControllerUpdateFn<State>): this;
  12473. /** Add props to each controller's update queue. */
  12474. update(props: ControllerUpdate<State> | ControllerUpdateFn<State>): this;
  12475. _getProps(arg: ControllerUpdate<State> | ControllerUpdateFn<State>, ctrl: Controller<State>, index: number): ControllerUpdate<State> | Falsy;
  12476. }
  12477. declare const SpringRef: <State extends Lookup<any> = Lookup<any>>() => SpringRef<State>;
  12478. 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">> & {
  12479. /**
  12480. * Indicates whether reordering is enabled.
  12481. *
  12482. * @default false
  12483. */
  12484. enableReorder: boolean;
  12485. /**
  12486. * Whether the items are arranged in a stack or grid.
  12487. *
  12488. * @default stack
  12489. */
  12490. layout: "grid" | "stack";
  12491. /**
  12492. * The primary orientation of the items. Usually this is the direction that
  12493. * the collection scrolls.
  12494. *
  12495. * @default vertical
  12496. */
  12497. orientation: Orientation;
  12498. };
  12499. interface BlockProps {
  12500. /**
  12501. * The unique identifier for the block. This is used to identify the block in
  12502. * the DOM and in the block map. It is added as a data attribute
  12503. * `data-block-id` to the root element of the block if a DOM node is
  12504. * rendered.
  12505. */
  12506. "data-block-id"?: Key$2;
  12507. }
  12508. interface StylingProps extends BlockProps {
  12509. /** The className applied to the root element of the component. */
  12510. className?: string;
  12511. /** The style applied to the root element of the component. */
  12512. style?: React__default.CSSProperties;
  12513. }
  12514. /**
  12515. * Check if the selector is inside an overlay content
  12516. *
  12517. * @param selector
  12518. */
  12519. declare function isInsideOverlayContent(selector: HTMLElement): Element | null;
  12520. interface ListOption {
  12521. id: string;
  12522. label: string;
  12523. description?: string;
  12524. icon?: React__default.FC<IconProps>;
  12525. data?: Record<string, any>;
  12526. /**
  12527. * The type of item.
  12528. *
  12529. * @default item
  12530. */
  12531. type?: "option";
  12532. }
  12533. interface ListSection {
  12534. id: string;
  12535. title?: string;
  12536. type: "section";
  12537. children: ListOption[];
  12538. }
  12539. declare type ListItem = ListOption | ListSection;
  12540. 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">> {
  12541. /**
  12542. * The items to render in the listbox. Items have the following shape:
  12543. *
  12544. * ```ts
  12545. * export type ListOption = {
  12546. * id: string;
  12547. * label: string;
  12548. * description?: string;
  12549. * icon?: React.FC<IconProps>;
  12550. * };
  12551. *
  12552. * export type ListSection = {
  12553. * id: string;
  12554. * title?: string;
  12555. * type: "section";
  12556. * children: ListOption[];
  12557. * };
  12558. *
  12559. * type ListItem = ListOption | ListSection;
  12560. * ```
  12561. */
  12562. items: ListItem[];
  12563. /**
  12564. * The custom render function for the listbox options.
  12565. *
  12566. * @param item Node<ListItem>
  12567. * @param options [OptionAria]()
  12568. * @param ref React.RefObject<HTMLLIElement>
  12569. */
  12570. renderOption?: (item: Node$1<ListItem>, options: OptionAria & {
  12571. showSelectedIcon?: boolean;
  12572. _state: ListState<ListItem>;
  12573. }, ref: React__default.Ref<HTMLLIElement>) => React__default.ReactNode;
  12574. /** Renders the drop indicator component. */
  12575. renderDropIndicator?: (options: {
  12576. dropIndicatorProps: React__default.HTMLAttributes<HTMLLIElement>;
  12577. isDropTarget: boolean;
  12578. isHidden: boolean;
  12579. orientation: Orientation;
  12580. }, ref: React__default.RefObject<HTMLLIElement>) => React__default.ReactNode;
  12581. /**
  12582. * The custom render function for the drag preview. This can be used to render
  12583. * a custom drag preview when dragging items.
  12584. */
  12585. renderDragPreview?: (items: DragItem[]) => React__default.ReactNode;
  12586. /** Whether to show the selected checkmark icon. */
  12587. showSelectedIcon?: boolean;
  12588. /** The label for the listbox. */
  12589. label?: React__default.ReactNode;
  12590. /** The CSS class name for the drop indicator. */
  12591. dropIndicatorClassName?: string;
  12592. /** The style of the drop indicator used in a component. */
  12593. dropIndicatorStyle?: React__default.CSSProperties;
  12594. /** The CSS class name for the option. */
  12595. optionClassName?: string | ((item: ListOption) => string);
  12596. /** The CSS class name for the section. */
  12597. sectionClassName?: string | ((item: ListSection) => string);
  12598. /** The style of the option. */
  12599. optionStyle?: React__default.CSSProperties | ((item: ListOption) => React__default.CSSProperties);
  12600. /** The style of the section. */
  12601. sectionStyle?: React__default.CSSProperties | ((item: ListSection) => React__default.CSSProperties);
  12602. }
  12603. declare const ListBox: React__default.ForwardRefExoticComponent<ListBoxProps & React__default.RefAttributes<HTMLUListElement>>;
  12604. interface ActionButtonSharedProps extends Omit<AriaButtonProps<"button" | "div">, "rel" | "href" | "target" | "children">, StylingProps {
  12605. }
  12606. interface ActionButtonProps extends ActionButtonSharedProps {
  12607. /**
  12608. * The button's variant.
  12609. *
  12610. * @default primary
  12611. */
  12612. variant?: "primary" | "secondary" | "tertiary" | "ghost" | "popover";
  12613. /** The button's label. */
  12614. label: React__default.ReactNode;
  12615. /** The button's icon before the label. */
  12616. iconStart?: React__default.FC<IconProps>;
  12617. /** The button's icon after the label. */
  12618. iconEnd?: React__default.FC<IconProps>;
  12619. /**
  12620. * The button's size.
  12621. *
  12622. * @default sm
  12623. */
  12624. size?: "sm" | "md";
  12625. /** Indicates whether focusing should be prevented on press. */
  12626. preventFocusOnPress?: boolean;
  12627. }
  12628. declare const ActionButton: React__default.ForwardRefExoticComponent<ActionButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
  12629. interface DomNodeRendererProps {
  12630. /** The class name applied to the wrapper `div` component. */
  12631. className?: string;
  12632. /**
  12633. * The DOM node to render inside the component. If this is not provided, the
  12634. * component will render nothing. If this is provided, the component will
  12635. * render the DOM node inside a `div` component with `display` set to
  12636. * `contents`.
  12637. */
  12638. node: Node;
  12639. }
  12640. declare const DomNodeRenderer: React__default.ForwardRefExoticComponent<DomNodeRendererProps & React__default.RefAttributes<HTMLDivElement>>;
  12641. interface SliderProps extends Omit<AriaSliderProps<number> & SliderStateOptions<number>, "orientation" | "numberFormatter">, StylingProps {
  12642. /**
  12643. * Whether the slider is read only.
  12644. *
  12645. * @default false
  12646. */
  12647. isReadOnly?: boolean;
  12648. /** The format options passed to `Intl.NumberFormat`. */
  12649. numberFormatOptions?: Intl.NumberFormatOptions & {
  12650. numberingSystem?: string;
  12651. };
  12652. /** The label for the slider. */
  12653. label?: React__default.ReactNode;
  12654. /**
  12655. * Whether to include a number input for the slider.
  12656. *
  12657. * @default false
  12658. */
  12659. includeNumberInput?: boolean;
  12660. }
  12661. declare const Slider: React__default.ForwardRefExoticComponent<SliderProps & React__default.RefAttributes<HTMLDivElement>>;
  12662. interface SwitchProps extends Omit<AriaSwitchProps, "children">, Omit<ToggleProps, "children" | "isRequired" | "validate" | "validationBehavior" | "validationState" | "isInvalid">, StylingProps {
  12663. /** The label to display next to the switch. */
  12664. label?: React__default.ReactNode;
  12665. /** The position of the label. */
  12666. labelPosition?: "top" | "left";
  12667. /** The status label to display next to the switch. */
  12668. statusLabel?: {
  12669. on: string;
  12670. off: string;
  12671. };
  12672. }
  12673. declare const Switch: React__default.ForwardRefExoticComponent<SwitchProps & React__default.RefAttributes<HTMLLabelElement>>;
  12674. interface SearchInputProps extends Omit<AriaSearchFieldProps, "validationState" | "label" | "aria-autocomplete" | "autoComplete" | "isRequired" | "aria-haspopup" | "isReadOnly" | "aria-activedescendant" | "type" | "validationBehavior" | "validate" | "isInvalid">, StylingProps {
  12675. /**
  12676. * The size of the search input.
  12677. *
  12678. * @default "md"
  12679. */
  12680. size?: "sm" | "md" | "lg";
  12681. /**
  12682. * The variant of the search input.
  12683. *
  12684. * @default "primary"
  12685. */
  12686. variant?: "primary" | "ghost";
  12687. /** Defines a string value that labels the current element. */
  12688. "aria-label": string;
  12689. }
  12690. declare const SearchInput: React__default.ForwardRefExoticComponent<SearchInputProps & React__default.RefAttributes<HTMLDivElement>>;
  12691. interface ThemeProviderProps extends StylingProps {
  12692. /**
  12693. * The theme to use. If not provided, the theme will be inherited from the
  12694. * parent ThemeProvider. If there is no parent ThemeProvider, the default
  12695. * theme will be used.
  12696. *
  12697. * @default "system"
  12698. */
  12699. theme?: Theme | "light" | "dark" | "system";
  12700. /** The children to render. */
  12701. children: React__default.ReactNode;
  12702. /**
  12703. * A function that will be called when the theme changes from any of the child
  12704. * components.
  12705. */
  12706. setTheme?: (theme: Theme | "light" | "dark" | "system") => void;
  12707. }
  12708. declare const ThemeProvider: React__default.ForwardRefExoticComponent<ThemeProviderProps & React__default.RefAttributes<HTMLDivElement>>;
  12709. /**
  12710. * A hook that returns the user preferences for color scheme, contrast, reduced
  12711. * motion, transparency and reduced data. The values are updated when the user
  12712. * changes their preferences.
  12713. *
  12714. * @example
  12715. * const { colorScheme, highContrast, reducedMotion, transparency } =
  12716. * useUserPreferences();
  12717. *
  12718. * @param ownerWindow - The window object to use. Defaults to the global window
  12719. * object.
  12720. * @returns The user preferences.
  12721. */
  12722. declare function useUserPreferences(ownerWindow?: Window & typeof globalThis): {
  12723. colorScheme: "dark" | "light";
  12724. highContrast: boolean;
  12725. reducedMotion: boolean;
  12726. transparency: boolean;
  12727. };
  12728. interface PortalContainerProviderProps {
  12729. /**
  12730. * The container element for the popover. By default, the modal is rendered as
  12731. * a child of the body element.
  12732. *
  12733. * @default undefined
  12734. */
  12735. portalContainer: HTMLElement | undefined;
  12736. /** The children to render. */
  12737. children: React__default.ReactNode;
  12738. }
  12739. declare const PortalContainerProvider: React__default.FC<PortalContainerProviderProps>;
  12740. declare type OverlayTriggerProps_ = Parameters<typeof useOverlayTrigger>[0];
  12741. interface PopoverProps extends OverlayTriggerProps$1, OverlayTriggerProps_ {
  12742. /** The children of the popover. */
  12743. children: React__default.ReactNode | ((state: OverlayTriggerState) => React__default.ReactNode);
  12744. }
  12745. interface PopoverContentProps extends Omit<AriaPopoverProps, "popoverRef" | "triggerRef" | "arrowSize" | "arrowBoundaryOffset">, StylingProps {
  12746. /**
  12747. * The reference element for the popover position. By default, the popover is
  12748. * positioned relative to the trigger element.
  12749. */
  12750. triggerRef?: React__default.RefObject<HTMLElement>;
  12751. /** The class name for the underlay element. */
  12752. underlayClassName?: string;
  12753. /** The contents of the popover. */
  12754. children: React__default.ReactNode;
  12755. /**
  12756. * The container element for the popover. By default, the modal is rendered as
  12757. * a child of the body element.
  12758. *
  12759. * @default document.body
  12760. */
  12761. portalContainer?: HTMLElement;
  12762. /**
  12763. * Whether to include an arrow on the popover.
  12764. *
  12765. * @default false
  12766. */
  12767. includeArrow?: boolean;
  12768. /** The class name for the content container element. */
  12769. contentContainerClassName?: string;
  12770. /** The style for the content container element. */
  12771. contentContainerStyle?: React__default.CSSProperties;
  12772. }
  12773. interface PopoverTriggerProps {
  12774. /** The contents of the popover trigger. */
  12775. children: React__default.ReactNode | (({ isOpen, triggerProps, triggerRef, }: {
  12776. isOpen: boolean;
  12777. triggerProps: AriaButtonProps<"button">;
  12778. triggerRef: React__default.RefObject<HTMLElement>;
  12779. }) => React__default.ReactNode);
  12780. }
  12781. declare const PopoverContent: React__default.ForwardRefExoticComponent<PopoverContentProps & React__default.RefAttributes<HTMLDivElement>>;
  12782. declare const PopoverTrigger: React__default.FC;
  12783. declare const Popover: React__default.FC<PopoverProps>;
  12784. declare type MenuOption = Omit<ListOption, "description"> & {
  12785. keyboardShortcut?: string;
  12786. };
  12787. declare type MenuSection = Omit<ListSection, "children"> & {
  12788. children: MenuOption[];
  12789. };
  12790. declare type MenuItem = MenuOption | MenuSection;
  12791. declare type MenuPopoverProps = Pick<PopoverContentProps, "isNonModal" | "placement" | "shouldUpdatePosition" | "shouldFlip" | "boundaryElement" | "crossOffset" | "offset" | "portalContainer">;
  12792. interface MenuProps extends MenuPopoverProps, MenuTriggerProps, Omit<AriaMenuProps<MenuItem>, "children">, Omit<AriaMenuTriggerProps, "type"> {
  12793. /** The `className` property assigned to the root element of the component. */
  12794. className?: string;
  12795. /** The `className` property assigned to the content element of the component. */
  12796. contentClassName?: string;
  12797. /** The `className` property assigned to the item element of the component. */
  12798. itemClassName?: string;
  12799. /**
  12800. * A list of items to render in the menu. Items have the following shape:
  12801. *
  12802. * ```ts
  12803. * export type MenuOption = {
  12804. * id: string;
  12805. * label: string;
  12806. * keyboardShortcut?: string;
  12807. * icon?: React.FC<IconProps>;
  12808. * };
  12809. *
  12810. * export type MenuSection = {
  12811. * id: string;
  12812. * title?: string;
  12813. * type: "section";
  12814. * children: MenuOption[];
  12815. * };
  12816. *
  12817. * export type MenuItem = MenuOption | MenuSection;
  12818. * ```
  12819. */
  12820. items: MenuItem[];
  12821. /**
  12822. * The `children` property is used to render the trigger element of the
  12823. * component.
  12824. *
  12825. * ```tsx
  12826. * <Menu>
  12827. * <ActionButton label="Label">
  12828. * </Menu>
  12829. * ```
  12830. */
  12831. children?: React__default.ReactNode;
  12832. }
  12833. declare const Menu: React__default.ForwardRefExoticComponent<MenuProps & React__default.RefAttributes<HTMLUListElement>>;
  12834. interface LinkProps extends AriaLinkOptions, StylingProps {
  12835. /** The link's style variant. */
  12836. variant?: "default" | "inline";
  12837. /** The children to render. */
  12838. children: React__default.ReactNode;
  12839. /** The size of the link. */
  12840. size?: "sm" | "md" | "lg";
  12841. /**
  12842. * The type of the link.
  12843. *
  12844. * @default "body"
  12845. */
  12846. type?: "body" | "label";
  12847. /** The title of the link, for providing additional information. */
  12848. title?: string;
  12849. }
  12850. declare const Link: React__default.ForwardRefExoticComponent<LinkProps & React__default.RefAttributes<HTMLElement>>;
  12851. interface SharedFileUploadProps extends StylingProps {
  12852. /** Whether the component is inlined. */
  12853. variant?: "default" | "inline";
  12854. /** Whether the component is disabled. */
  12855. isDisabled?: boolean;
  12856. /** The label to display. */
  12857. label: string;
  12858. /** The description to display. */
  12859. description?: string;
  12860. /**
  12861. * The pattern to match the file name against. This is a regular expression,
  12862. * and will be matched against the entire file name.
  12863. */
  12864. accept?: string;
  12865. /** The name of the input. */
  12866. name?: string;
  12867. /** The callback function that is fired when the value changes. */
  12868. onChange?: (event: React__default.ChangeEvent<HTMLInputElement>) => void;
  12869. /**
  12870. * The callback function that is fired when the value changes and the value is
  12871. * valid.
  12872. */
  12873. onValueChange?: (files: File[]) => void;
  12874. /**
  12875. * Identifies the element (or elements) that provide a detailed, extended
  12876. * description for the object.
  12877. */
  12878. "aria-describedby"?: string;
  12879. }
  12880. interface FileUploadProps extends SharedFileUploadProps {
  12881. /** The Icon to display. */
  12882. icon?: React__default.FC<IconProps>;
  12883. /** Whether to allow multiple files to be uploaded. */
  12884. multiple?: boolean;
  12885. }
  12886. declare const FileUpload: React__default.ForwardRefExoticComponent<FileUploadProps & React__default.RefAttributes<HTMLLabelElement>>;
  12887. interface SeparatorProps extends SeparatorProps$1, StylingProps {
  12888. /**
  12889. * The variant of the separator.
  12890. *
  12891. * @default "primary"
  12892. */
  12893. variant?: "primary" | "secondary";
  12894. }
  12895. declare const Separator: React__default.ForwardRefExoticComponent<SeparatorProps & React__default.RefAttributes<HTMLDivElement>>;
  12896. interface ProgressBarProps extends Omit<AriaProgressBarProps, "isIndeterminate"> {
  12897. /** The `className` property assigned to the root element of the component. */
  12898. className?: string;
  12899. /**
  12900. * The variant of the progress bar.
  12901. *
  12902. * @default active
  12903. */
  12904. variant?: "active" | "success" | "error";
  12905. /** The description of the progress bar. */
  12906. description?: string;
  12907. /**
  12908. * Whether the progress bar value should be displayed.
  12909. *
  12910. * @default false
  12911. */
  12912. showValue?: boolean;
  12913. /** The error message of the progress bar. */
  12914. errorMessage?: string;
  12915. }
  12916. declare const ProgressBar: React__default.ForwardRefExoticComponent<ProgressBarProps & React__default.RefAttributes<HTMLDivElement>>;
  12917. interface InputMessage {
  12918. /** The description to display below the input. */
  12919. description?: string;
  12920. /** The error message to display when the input is in an error state. */
  12921. errorMessage?: string;
  12922. /** The warning message to display when the input is in a warning state. */
  12923. warningMessage?: string;
  12924. }
  12925. interface TextInputProps extends Omit<AriaTextFieldProps, "validationState" | "isInvalid" | "description" | "errorMessage">, StylingProps, InputMessage {
  12926. /** The state of the input. */
  12927. validationState?: "valid" | "error" | "warning";
  12928. /**
  12929. * The variant of the text input.
  12930. *
  12931. * @default primary
  12932. */
  12933. variant?: "primary" | "ghost";
  12934. /**
  12935. * The position of the label relative to the input.
  12936. *
  12937. * @default top
  12938. */
  12939. labelPosition?: "top" | "start";
  12940. /** Whether the input is read only. */
  12941. readOnly?: boolean;
  12942. /** The style object to apply to the input element */
  12943. inputStyle?: React__default.CSSProperties;
  12944. /** The class name to apply to the input element */
  12945. inputClassName?: string;
  12946. }
  12947. declare const TextInput: React__default.ForwardRefExoticComponent<TextInputProps & React__default.RefAttributes<HTMLInputElement>>;
  12948. interface ReactionProps extends Omit<AriaSwitchProps & ToggleProps, "validationState" | "isRequired" | "children" | "isInvalid" | "validationBehavior" | "validate">, StylingProps {
  12949. /** The size of the reaction. */
  12950. size?: "sm" | "md";
  12951. /** The number of reactions. */
  12952. count: number;
  12953. /** The icon to render. */
  12954. icon?: React__default.FC<IconProps>;
  12955. }
  12956. declare const Reaction: React__default.ForwardRefExoticComponent<ReactionProps & React__default.RefAttributes<HTMLLabelElement>>;
  12957. interface TooltipProps extends TooltipTriggerProps, AriaTooltipProps, Omit<AriaPositionProps, "overlayRef" | "targetRef" | "maxHeight" | "isOpen" | "arrowSize"> {
  12958. /** The content of the tooltip. */
  12959. text?: string;
  12960. /** The tooltip trigger element. */
  12961. children: React__default.ReactNode;
  12962. /**
  12963. * The delay time for the tooltip to show up.
  12964. *
  12965. * @default 1000
  12966. */
  12967. delay?: number;
  12968. /**
  12969. * The delay time for the tooltip to hide.
  12970. *
  12971. * @default 500
  12972. */
  12973. closeDelay?: number;
  12974. /**
  12975. * Represents the size of an element.
  12976. *
  12977. * @default md
  12978. */
  12979. size?: "sm" | "md";
  12980. /**
  12981. * The variant that can be applied to an element.
  12982. *
  12983. * @default default
  12984. */
  12985. variant?: "default" | "inverse";
  12986. /**
  12987. * Indicates whether to include an arrow in the output.
  12988. *
  12989. * @default true
  12990. */
  12991. includeArrow?: boolean;
  12992. /**
  12993. * The container element for the modal. By default, the modal is rendered as a
  12994. * child of the body element.
  12995. *
  12996. * @default document.body
  12997. */
  12998. portalContainer?: HTMLElement;
  12999. }
  13000. declare const Tooltip: React__default.ForwardRefExoticComponent<TooltipProps & React__default.RefAttributes<HTMLDivElement>>;
  13001. interface PortalProps extends OverlayProps {
  13002. /** The `className` property assigned to the root element of the component. */
  13003. className?: string;
  13004. /** The `style` property assigned to the root element of the component. */
  13005. style?: React__default.CSSProperties;
  13006. }
  13007. declare const Portal: React__default.ForwardRefExoticComponent<PortalProps & React__default.RefAttributes<HTMLDivElement>>;
  13008. interface ProgressSpinnerProps extends Omit<AriaProgressBarProps, "value" | "isIndeterminate" | "formatOptions" | "maxValue" | "minValue" | "valueLabel">, StylingProps {
  13009. /**
  13010. * The size of the progress circle.
  13011. *
  13012. * @default md
  13013. */
  13014. size?: "sm" | "md";
  13015. /**
  13016. * The progress circle's variant.
  13017. *
  13018. * @default active
  13019. */
  13020. variant?: "active" | "inactive" | "success" | "error";
  13021. }
  13022. declare const ProgressSpinner: React__default.ForwardRefExoticComponent<ProgressSpinnerProps & React__default.RefAttributes<HTMLDivElement>>;
  13023. interface ActionIconButtonProps extends ActionButtonSharedProps {
  13024. /** The icon to display */
  13025. icon: React__default.FC<IconProps>;
  13026. /**
  13027. * The size of the icon button.
  13028. *
  13029. * @default "md"
  13030. */
  13031. size?: "xxs" | "xs" | "sm" | "md" | "lg";
  13032. /**
  13033. * The variant of the icon button.
  13034. *
  13035. * @default "primary"
  13036. */
  13037. variant?: "primary" | "secondary" | "tertiary" | "ghost" | "toolbar" | "popover";
  13038. /** Indicates whether focusing should be prevented on press. */
  13039. preventFocusOnPress?: boolean;
  13040. }
  13041. declare const ActionIconButton: React__default.ForwardRefExoticComponent<ActionIconButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
  13042. interface ToggleButtonProps extends StylingProps, Omit<AriaToggleButtonProps, "children"> {
  13043. /** The text content of the button. */
  13044. label: React__default.ReactNode;
  13045. /** The icon to display before the label. */
  13046. iconStart?: React__default.FC<SVGRProps>;
  13047. /**
  13048. * The size of the button.
  13049. *
  13050. * @default "md"
  13051. */
  13052. size?: "md" | "lg";
  13053. /** Indicates whether focusing should be prevented on press. */
  13054. preventFocusOnPress?: boolean;
  13055. }
  13056. declare const ToggleButton: React__default.ForwardRefExoticComponent<ToggleButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
  13057. interface CheckboxProps extends Omit<AriaCheckboxProps, "children" | "validationBehavior" | "validationState" | "validate">, StylingProps {
  13058. /** The checkbox's label. */
  13059. label?: string;
  13060. /**
  13061. * The position of the label
  13062. *
  13063. * @default end
  13064. */
  13065. labelPosition?: "start" | "end";
  13066. }
  13067. declare const Checkbox: React__default.ForwardRefExoticComponent<CheckboxProps & React__default.RefAttributes<HTMLLabelElement>>;
  13068. declare type Excluded = "isDisabled" | "isReadOnly" | "isRequired" | "locale" | "validationState" | "label" | "formatOptions" | "isInvalid" | "validationBehaviour" | "validate" | "description" | "errorMessage";
  13069. interface PaginationProps extends Omit<AriaNumberFieldProps, Excluded>, Omit<NumberFieldStateOptions, Excluded>, StylingProps {
  13070. /** The largest value allowed for the input. */
  13071. maxValue: number;
  13072. /** The label for the pagination component. */
  13073. "aria-label": string;
  13074. /**
  13075. * The variant of the pagination component.
  13076. *
  13077. * @default floating
  13078. */
  13079. variant?: "floating" | "pinned";
  13080. /**
  13081. * The size of the pagination component.
  13082. *
  13083. * @default md
  13084. */
  13085. size?: "xs" | "sm" | "md" | "lg";
  13086. }
  13087. declare const Pagination: React__default.ForwardRefExoticComponent<PaginationProps & React__default.RefAttributes<HTMLDivElement>>;
  13088. interface I18nProviderProps extends I18nProviderProps$1 {
  13089. /** The messages to use for internationalization. */
  13090. messages?: LocalizedStrings;
  13091. }
  13092. declare const I18nProvider: React__default.FC<I18nProviderProps>;
  13093. declare type NumberFormatProps = Parameters<typeof useNumberFormatter>[0] & {
  13094. /** The number to format. */
  13095. value: number;
  13096. };
  13097. declare const NumberFormat: React__default.FC<NumberFormatProps>;
  13098. declare type DateFormatProps = Parameters<typeof useDateFormatter>[0] & {
  13099. /** The date to format. */
  13100. date: Date;
  13101. };
  13102. declare const DateFormat: React__default.FC<DateFormatProps>;
  13103. interface Item {
  13104. id: string;
  13105. label: string;
  13106. variant?: "neutral" | "red" | "green" | "blue" | "high-contrast";
  13107. icon?: React__default.FC<SVGRProps>;
  13108. }
  13109. interface TagGroupProps extends StylingProps, Omit<AriaTagGroupProps<Item>, "children" | "errorMessage" | "description">, Omit<ListProps<Item>, "children" | "collection" | "filter"> {
  13110. /**
  13111. * The items to display in the tag group.
  13112. *
  13113. * Type Item = { id: string; label: string; variant?: "neutral" | "red" |
  13114. * "green" | "blue" | "high-contrast"; icon?: React.FC<SVGRProps>; }
  13115. */
  13116. items: Item[];
  13117. /**
  13118. * The variant of the tag group.
  13119. *
  13120. * @default "neutral"
  13121. */
  13122. variant?: Item["variant"];
  13123. /** The label for the tag group. */
  13124. "aria-label": string;
  13125. }
  13126. declare const TagGroup: React__default.ForwardRefExoticComponent<TagGroupProps & React__default.RefAttributes<HTMLDivElement>>;
  13127. interface AccordionProps extends StylingProps {
  13128. /**
  13129. * This prop controls the expansion mode of the accordion. If set to `single`,
  13130. * only one item can be expanded at a time. If set to `multiple`, multiple
  13131. * items can be expanded at the same time.
  13132. *
  13133. * @default single
  13134. */
  13135. expansionMode?: "single" | "multiple";
  13136. /** This callback is called when the expanded state of the accordion changes. */
  13137. onChange?: (value: Set<Key$2>) => void;
  13138. /** The children of the accordion. Each child should be an `AccordionItem`. */
  13139. children: React__default.ReactNode;
  13140. /** The keys of the items that should be expanded by default. */
  13141. defaultExpandedKeys?: Set<Key$2>;
  13142. /**
  13143. * The keys of the items that should be expanded. If this prop is provided,
  13144. * the accordion will be a controlled component. This means that the expanded
  13145. * state of the accordion will not change unless you update this prop.
  13146. */
  13147. expandedKeys?: Set<Key$2>;
  13148. /**
  13149. * The keys of the items that should be disabled. Disabled items cannot be
  13150. * expanded or collapsed.
  13151. */
  13152. disabledKeys?: Set<Key$2>;
  13153. }
  13154. interface AccordionItemProps extends StylingProps {
  13155. /** The title of the accordion item. */
  13156. title: string;
  13157. /**
  13158. * The buttons that should be rendered in the accordion item. These buttons
  13159. * will be rendered in the top right corner of the accordion item. They will
  13160. * be rendered in the order they are provided. The buttons will be rendered as
  13161. * `ActionIconButton`s, so you can pass any props that you would pass to an
  13162. * `ActionIconButton`.
  13163. *
  13164. * @example
  13165. * ```jsx
  13166. * <AccordionItem
  13167. * title="Accordion Item"
  13168. * actions={[{
  13169. * icon: EditIcon,
  13170. * label: "Edit",
  13171. * onPress: () => alert("Edit"),
  13172. * }]}>Content</AccordionItem>
  13173. * ```;
  13174. */
  13175. actions?: Omit<ActionIconButtonProps, "size" | "variant" | "excludeFromTabOrder">[];
  13176. /**
  13177. * The action buttons should only be shown when the user hovers over or
  13178. * focuses the accordion item.
  13179. *
  13180. * @default false
  13181. */
  13182. showActionsOnTriggerOnly?: boolean;
  13183. /** The content of the accordion item. */
  13184. children: React__default.ReactNode;
  13185. /** The key of the accordion item. */
  13186. value: Key$2;
  13187. /**
  13188. * The description of the accordion item. This will be rendered at the end of
  13189. * the accordion header.
  13190. */
  13191. subLabel?: string;
  13192. }
  13193. declare const Accordion: React__default.ForwardRefExoticComponent<AccordionProps & React__default.RefAttributes<HTMLDivElement>>;
  13194. declare const AccordionItem: React__default.ForwardRefExoticComponent<AccordionItemProps & React__default.RefAttributes<HTMLHeadingElement>>;
  13195. 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 {
  13196. /**
  13197. * The position of the label.
  13198. *
  13199. * @default "top"
  13200. */
  13201. labelPosition?: "top" | "start";
  13202. /** The description of the select component. */
  13203. description?: string;
  13204. /** The error message of the select component. */
  13205. errorMessage?: string;
  13206. /** The warning message of the select component. */
  13207. warningMessage?: string;
  13208. /** The label of the select component. */
  13209. label?: React__default.ReactNode;
  13210. /** The variant of the select component. */
  13211. variant?: "primary" | "ghost";
  13212. /** The state of the select component. */
  13213. validationState?: "valid" | "error" | "warning";
  13214. /** Whether the select component is read only. */
  13215. isReadOnly?: boolean;
  13216. }
  13217. declare const Select: React__default.ForwardRefExoticComponent<SelectProps & React__default.RefAttributes<HTMLDivElement>>;
  13218. interface AvatarProps extends StylingProps {
  13219. /**
  13220. * The size of the component.
  13221. *
  13222. * @default "md"
  13223. */
  13224. size?: "md" | "sm";
  13225. /**
  13226. * The icon to display. This icon has to be imported from the
  13227. * `@baseline-ui/icons` package.
  13228. */
  13229. icon?: React__default.FC<SVGRProps>;
  13230. /** The name of the user. */
  13231. name: string;
  13232. /** The URL of the image to display. */
  13233. imgSrc?: string;
  13234. /**
  13235. * The image loading strategy to use. See
  13236. * [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes:~:text=a%20fallback%20destination.-,loading,-Indicates%20how%20the)
  13237. */
  13238. imgLoading?: "lazy" | "eager";
  13239. /** Whether to show the initials of the user if no image is provided. */
  13240. showInitials?: boolean;
  13241. /** Whether the component is disabled. */
  13242. isDisabled?: boolean;
  13243. /** Whether the user has a notification. */
  13244. hasNotifications?: boolean;
  13245. }
  13246. declare const Avatar: React__default.ForwardRefExoticComponent<AvatarProps & React__default.RefAttributes<HTMLSpanElement>>;
  13247. declare type ItemProps = React__default.ComponentProps<typeof Item$1> & StylingProps & {
  13248. key?: Key$2;
  13249. icon?: React__default.FC<SVGRProps>;
  13250. value?: string;
  13251. title?: string;
  13252. titleClassName?: string;
  13253. titleStyle?: React__default.CSSProperties;
  13254. };
  13255. declare type TabsProps = Omit<StylingProps & AriaTabListProps<ItemProps>, "orientation" | "children" | "items" | "selectedKey" | "defaultSelectedKey" | "disabledKeys"> & {
  13256. /**
  13257. * The `TabItem` components to render inside the `Tabs` component.
  13258. *
  13259. * ```jsx
  13260. * <Tabs>
  13261. * <TabItem key="tab1" title="Tab 1">
  13262. * <div>Tab 1 content</div>
  13263. * </TabItem>
  13264. * <TabItem key="tab2" title="Tab 2">
  13265. * <div>Tab 2 content</div>
  13266. * </TabItem>
  13267. * </Tabs>;
  13268. * ```
  13269. */
  13270. children: React__default.ReactNode;
  13271. /**
  13272. * The key of the tab that needs to be removed.
  13273. *
  13274. * @param key
  13275. */
  13276. onRemove?: (key: Key$2) => void;
  13277. /** The value of the tab that needs to be selected. */
  13278. selectedValue?: string;
  13279. /** The default value of the tab that needs to be selected. */
  13280. defaultSelectedValue?: string;
  13281. /** The values of the tabs that need to be disabled. */
  13282. disabledValues?: Set<Key$2>;
  13283. /** A list of action buttons to render beside the tab items. */
  13284. actions?: Omit<ActionIconButtonProps, "variant" | "size">[];
  13285. /** The variant of the tabs */
  13286. variant?: "primary" | "ghost";
  13287. /** The className to apply to the tab header container. */
  13288. tabHeaderClassName?: string;
  13289. /** The style to apply to the tab header container. */
  13290. tabHeaderStyle?: React__default.CSSProperties;
  13291. };
  13292. declare type TabItemProps = StylingProps & {
  13293. /** The title of the tab. This will be displayed in the tab button. */
  13294. title: string;
  13295. /** The icon to display in front of the title. */
  13296. icon?: React__default.FC<SVGRProps>;
  13297. /** The value of the tab. This will be used to identify the tab. */
  13298. value: string;
  13299. /** The className to apply to the tab item. */
  13300. titleClassName?: string;
  13301. /** The style to apply to the tab item. */
  13302. titleStyle?: React__default.CSSProperties;
  13303. };
  13304. declare const Tabs: React__default.ForwardRefExoticComponent<Omit<StylingProps & AriaTabListProps<ItemProps>, "children" | "items" | "disabledKeys" | "orientation" | "selectedKey" | "defaultSelectedKey"> & {
  13305. children: React__default.ReactNode;
  13306. onRemove?: ((key: React__default.Key) => void) | undefined;
  13307. selectedValue?: string | undefined;
  13308. defaultSelectedValue?: string | undefined;
  13309. disabledValues?: Set<React__default.Key> | undefined;
  13310. actions?: Omit<ActionIconButtonProps, "size" | "variant">[] | undefined;
  13311. variant?: "primary" | "ghost" | undefined;
  13312. tabHeaderClassName?: string | undefined;
  13313. tabHeaderStyle?: React__default.CSSProperties | undefined;
  13314. } & React__default.RefAttributes<HTMLDivElement>>;
  13315. declare const TabItem: React__default.FC<TabItemProps>;
  13316. interface InlineAlertProps extends StylingProps {
  13317. /**
  13318. * The variant of the alert.
  13319. *
  13320. * @default "info"
  13321. */
  13322. variant?: "info" | "warning" | "error" | "success";
  13323. /** The title of the alert. */
  13324. title: string;
  13325. /** The description of the alert. */
  13326. description: string;
  13327. /**
  13328. * The label of the action button. When provided, the action button will be
  13329. * rendered.
  13330. */
  13331. actionLabel?: string;
  13332. /** The callback fired when the action button is clicked. */
  13333. onAction?: () => void;
  13334. /**
  13335. * The callback fired when the close button is clicked. When provided, the
  13336. * close button will be rendered.
  13337. */
  13338. onClose?: () => void;
  13339. /**
  13340. * The arrangement of the variable.
  13341. *
  13342. * @default "single"
  13343. * @typedef {"single" | "multi" | "compact"} Arrangement
  13344. */
  13345. arrangement?: "single" | "multi" | "compact";
  13346. /**
  13347. * The size of the alert.
  13348. *
  13349. * @default "md"
  13350. */
  13351. size?: "sm" | "md";
  13352. }
  13353. declare const InlineAlert: React__default.ForwardRefExoticComponent<InlineAlertProps & React__default.RefAttributes<HTMLDivElement>>;
  13354. interface NumberInputProps extends StylingProps, Omit<AriaNumberFieldProps, "validationState" | "isRequired" | "validate" | "validationBehavior"> {
  13355. /**
  13356. * The position of the label relative to the input.
  13357. *
  13358. * @default top
  13359. */
  13360. labelPosition?: "top" | "start";
  13361. /**
  13362. * The variant of the number input.
  13363. *
  13364. * @default primary
  13365. */
  13366. variant?: "primary" | "ghost";
  13367. /**
  13368. * Whether to show the stepper buttons.
  13369. *
  13370. * @default true
  13371. */
  13372. showStepper?: boolean;
  13373. /** The description to display below the input. */
  13374. description?: string;
  13375. /** The error message to display when the input is in an error state. */
  13376. errorMessage?: string;
  13377. }
  13378. declare const NumberInput: React__default.ForwardRefExoticComponent<NumberInputProps & React__default.RefAttributes<HTMLDivElement>>;
  13379. interface DrawerProps extends StylingProps, AriaDialogProps {
  13380. /** The children to render. */
  13381. children: React__default.ReactNode;
  13382. /**
  13383. * The valid values for the background type are "medium" and "subtle".
  13384. *
  13385. * @default "medium"
  13386. */
  13387. background?: "medium" | "subtle";
  13388. /** The title to display in the drawer. */
  13389. title: string;
  13390. /** The props of additional `ActionIconButton` to display in the drawer header. */
  13391. action?: ActionIconButtonProps;
  13392. /** The callback to call when the drawer is requested to be closed. */
  13393. onCloseRequest?: () => void;
  13394. }
  13395. declare const Drawer: React__default.ForwardRefExoticComponent<DrawerProps & React__default.RefAttributes<HTMLDivElement>>;
  13396. interface DialogProps extends AriaDialogProps, StylingProps {
  13397. /** The children to render. */
  13398. children: React__default.ReactNode;
  13399. /**
  13400. * The size of the dialog. This defines the max width of the dialog.
  13401. *
  13402. * @default "sm"
  13403. */
  13404. size?: "sm" | "md" | "lg" | "content";
  13405. /**
  13406. * The variant of the dialog.
  13407. *
  13408. * @default "primary"
  13409. */
  13410. variant?: "primary" | "ghost";
  13411. /**
  13412. * The background color of the drawer.
  13413. *
  13414. * @default "medium"
  13415. */
  13416. drawerBackground?: DrawerProps["background"];
  13417. /**
  13418. * When used inside a modal, this prop will decide whether the dialog should
  13419. * inherit the drawer styles.
  13420. *
  13421. * @default false
  13422. */
  13423. inheritDrawer?: boolean;
  13424. }
  13425. interface DialogTitleProps extends StylingProps {
  13426. /** The children to render. */
  13427. children: React__default.ReactNode;
  13428. }
  13429. declare const Dialog: React__default.ForwardRefExoticComponent<DialogProps & React__default.RefAttributes<HTMLDivElement>>;
  13430. declare const DialogTitle: React__default.ForwardRefExoticComponent<DialogTitleProps & React__default.RefAttributes<HTMLDivElement>>;
  13431. interface ColorPreset$1 {
  13432. label: string;
  13433. color: string;
  13434. }
  13435. 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"> {
  13436. /**
  13437. * The list of color presets to show in the color picker. The signature of the
  13438. * color presets is:
  13439. *
  13440. * ```ts
  13441. * export interface ColorPreset {
  13442. * label: string;
  13443. * color: string;
  13444. * }
  13445. * ```
  13446. *
  13447. * The color can be a hex or hexa value.
  13448. */
  13449. presets?: ColorPreset$1[];
  13450. /**
  13451. * Whether to include the custom color picker. If `false`, the color picker
  13452. * will only show the color presets. The custom color picker allows the user
  13453. * to pick any color. You can set the `allowAlpha` prop to `false` to disable
  13454. * the alpha channel.
  13455. *
  13456. * @default true
  13457. */
  13458. includePicker?: boolean;
  13459. /**
  13460. * Whether to show the color label. The color label is the name of the color
  13461. * that is currently selected. If boolean, the label will be shown only when
  13462. * the color is not `null`. If a function, the function will be called with
  13463. * the current color and should return a string. If `false`, the label will
  13464. * not be shown.
  13465. *
  13466. * @default true
  13467. */
  13468. colorLabel?: boolean | ((color: Color | null) => string);
  13469. /**
  13470. * Whether to allow alpha values in the custom color picker.
  13471. *
  13472. * @default true
  13473. */
  13474. allowAlpha?: boolean;
  13475. /**
  13476. * Whether to allow the removal of the color.
  13477. *
  13478. * @default false
  13479. */
  13480. allowRemoval?: boolean;
  13481. /** The label position of the color input. */
  13482. labelPosition?: "top" | "start";
  13483. /**
  13484. * Whether to show the color picker in active or lazy mode. In active mode,
  13485. * the color picker will be rendered when the color input popover is open and
  13486. * the value of the color input will be updated when the user picks a color.
  13487. * In lazy mode, the color picker will be rendered only when the user clicks
  13488. * on the "Add color" button and the selected color will be added to custom
  13489. * colors when the user clicks on the "Add color" button.
  13490. *
  13491. * @default active
  13492. */
  13493. pickerMode?: "active" | "lazy";
  13494. /**
  13495. * The key to use to store the picked color in the local storage.
  13496. *
  13497. * @default baselinePickedColor
  13498. */
  13499. storePickedColorKey?: string;
  13500. /**
  13501. * The label to show on the add color button.
  13502. *
  13503. * @default Add color
  13504. */
  13505. addColorButtonLabel?: string;
  13506. /**
  13507. * The label to show on the remove color button.
  13508. *
  13509. * @default Remove color
  13510. */
  13511. removeColorButtonLabel?: string;
  13512. /**
  13513. * The label to show on the custom colors section.
  13514. *
  13515. * @default Custom colors
  13516. */
  13517. customColorsLabel?: string;
  13518. /**
  13519. * An optional function to render the custom trigger button.
  13520. *
  13521. * @param options
  13522. */
  13523. renderTriggerButton?: (options: {
  13524. isOpen: boolean;
  13525. color: Color | null;
  13526. ref: React__default.RefObject<HTMLButtonElement>;
  13527. colorName?: string | boolean;
  13528. triggerProps: AriaButtonProps<"button">;
  13529. }) => React__default.ReactElement;
  13530. }
  13531. declare const ColorInput: React__default.ForwardRefExoticComponent<ColorInputProps & React__default.RefAttributes<HTMLDivElement>>;
  13532. declare const ColorSwatch: React__default.FC<ColorSwatchProps>;
  13533. interface ColorSwatchProps {
  13534. color?: string;
  13535. isFocusVisible?: boolean;
  13536. isDisabled?: boolean;
  13537. isSelected?: boolean;
  13538. isPresentational?: boolean;
  13539. }
  13540. declare const IconColorInputButton: React__default.ForwardRefExoticComponent<Omit<ColorInputButtonProps, "children" | "labelPosition"> & {
  13541. icon: React__default.FC<IconProps>;
  13542. color?: string | undefined;
  13543. } & React__default.RefAttributes<HTMLButtonElement>>;
  13544. interface ColorInputButtonProps extends Omit<ActionButtonProps, "label"> {
  13545. isOpen: boolean;
  13546. "aria-label"?: string;
  13547. labelPosition: "top" | "start";
  13548. children: React__default.ReactNode;
  13549. }
  13550. interface FreehandCanvasProps extends StylingProps, AriaLabelingProps$1 {
  13551. /** The className applicable to the SVG canvas. */
  13552. canvasClassName?: string;
  13553. /** The style applicable to the SVG canvas. */
  13554. canvasStyle?: React__default.CSSProperties;
  13555. /** The ref for the canvas. */
  13556. canvasRef?: React__default.RefObject<HTMLDivElement>;
  13557. /** The className applicable to the footer. */
  13558. footerClassName?: string;
  13559. /** The style applicable to the footer. */
  13560. footerStyle?: React__default.CSSProperties;
  13561. /**
  13562. * How much to soften the stroke's edges.
  13563. *
  13564. * @default 0
  13565. */
  13566. smoothing?: number;
  13567. /**
  13568. * How much to streamline the stroke.
  13569. *
  13570. * @default 0
  13571. */
  13572. streamline?: number;
  13573. /** An easing function to apply to each point's pressure. */
  13574. easing?: (pressure: number) => number;
  13575. /**
  13576. * Whether to simulate pressure based on velocity.
  13577. *
  13578. * @default false
  13579. */
  13580. simulatePressure?: boolean;
  13581. /** Cap, taper and easing for the start of the line. */
  13582. start?: {
  13583. cap?: boolean;
  13584. taper?: number | boolean;
  13585. easing?: (distance: number) => number;
  13586. };
  13587. /** Cap, taper and easing for the end of the line. */
  13588. end?: {
  13589. cap?: boolean;
  13590. taper?: number | boolean;
  13591. easing?: (distance: number) => number;
  13592. };
  13593. /**
  13594. * The width of the stroke.
  13595. *
  13596. * @default 2
  13597. */
  13598. strokeWidth?: number;
  13599. /**
  13600. * The color of the stroke.
  13601. *
  13602. * @default #3A87FD
  13603. */
  13604. strokeColor?: string;
  13605. /**
  13606. * Whether to keep the points within the canvas.
  13607. *
  13608. * @default true
  13609. */
  13610. isBound?: boolean;
  13611. /**
  13612. * Callback for when the points change. This is called on every point change.
  13613. *
  13614. * @param points
  13615. */
  13616. onChange?: (points: number[][][]) => void;
  13617. /**
  13618. * Callback for when the points change has ended. This is called once after
  13619. * the pointerup event. It is recommended to use this callback for performance
  13620. * reasons.
  13621. *
  13622. * @param points
  13623. */
  13624. onChangeEnd?: (points: number[][][]) => void;
  13625. /** The default points to render. */
  13626. defaultValue?: number[][][];
  13627. /**
  13628. * The value of the canvas. This can be used to make the canvas a controlled
  13629. * component.
  13630. */
  13631. value?: number[][][];
  13632. /** The label for the canvas. */
  13633. label?: string;
  13634. /**
  13635. * Whether to enable history for undo/redo.
  13636. *
  13637. * @default false
  13638. */
  13639. enableHistory?: boolean;
  13640. /**
  13641. * Whether the canvas is inline.
  13642. *
  13643. * @default true
  13644. */
  13645. isInline?: boolean;
  13646. /** Whether the canvas is disabled. */
  13647. isDisabled?: boolean;
  13648. /** The placeholder for the canvas. */
  13649. placeholder?: string;
  13650. /** The label for the clear button. */
  13651. clearLabel?: string;
  13652. /** The label for the undo button. */
  13653. undoLabel?: string;
  13654. /** The label for the redo button. */
  13655. redoLabel?: string;
  13656. /** Description for the canvas. */
  13657. description?: string;
  13658. }
  13659. declare const FreehandCanvas: React__default.ForwardRefExoticComponent<FreehandCanvasProps & React__default.RefAttributes<HTMLDivElement>>;
  13660. declare type TextProps<T extends keyof React__default.JSX.IntrinsicElements = "span"> = StylingProps & React__default.ComponentProps<T> & {
  13661. /**
  13662. * The type of text to render.
  13663. *
  13664. * @default "title"
  13665. */
  13666. type?: "subtitle" | "title" | "label" | "value" | "helper" | "body";
  13667. /**
  13668. * The size of the text.
  13669. *
  13670. * @default "md"
  13671. */
  13672. size?: "sm" | "md" | "lg";
  13673. /** The text to render. Can be a string or a number. */
  13674. children: React__default.ReactNode;
  13675. /**
  13676. * The HTML element to render.
  13677. *
  13678. * @default "span"
  13679. */
  13680. elementType?: React__default.ElementType;
  13681. };
  13682. 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>>;
  13683. interface TransformProps {
  13684. /** The `className` property assigned to the root element of the component. */
  13685. className?: string;
  13686. /** The `style` property assigned to the root element of the component. */
  13687. style?: React__default.CSSProperties;
  13688. /** The children to render. */
  13689. children: (options: {
  13690. style: React__default.CSSProperties;
  13691. }) => React__default.ReactNode;
  13692. /** Whether the transform is draggable. */
  13693. isDraggable?: boolean;
  13694. /** Whether the transform is resizable. */
  13695. isResizable?: boolean;
  13696. /** Whether the transform is rotatable. */
  13697. isRotatable?: boolean;
  13698. /** Whether the transform is snappable. */
  13699. isSnappable?: boolean;
  13700. /** A callback that will be called when the transform changes. */
  13701. onTransform?: (transform: OnRender) => void;
  13702. /** A callback that will be called when the transform starts. */
  13703. onTransformStart?: (transform: OnRenderStart) => void;
  13704. /** A callback that will be called when the transform ends. */
  13705. onTransformEnd?: (transform: OnRender) => void;
  13706. /** A callback that will be called when the target drag starts. */
  13707. onDragStart?: (e: OnDragStart) => void;
  13708. /** A callback that will be called when the target is dragged. */
  13709. onDrag?: (e: OnDrag) => void;
  13710. /** A callback that will be called when the target drag ends. */
  13711. onDragEnd?: (e: OnDragEnd) => void;
  13712. /** A callback that will be called when the target resize starts. */
  13713. onResizeStart?: (e: OnResizeStart) => void;
  13714. /** A callback that will be called when the target is resized. */
  13715. onResize?: (e: OnResize) => void;
  13716. /** A callback that will be called when the target resize ends. */
  13717. onResizeEnd?: (e: OnResizeEnd) => void;
  13718. /** A callback that will be called when the target rotation starts. */
  13719. onRotateStart?: (e: OnRotateStart) => void;
  13720. /** A callback that will be called when the target is rotated. */
  13721. onRotate?: (e: OnRotate) => void;
  13722. /** A callback that will be called when the target rotation ends. */
  13723. onRotateEnd?: (e: OnRotateEnd) => void;
  13724. /** A callback that will be called when the target is snapped. */
  13725. onSnap?: (e: OnSnap) => void;
  13726. /** A callback that will be called when the child is double clicked. */
  13727. onDoubleClick?: (e: React__default.MouseEvent<HTMLDivElement, MouseEvent>) => void;
  13728. /** A list of selectors relative to which the guidelines will be rendered. */
  13729. elementGuidelines?: string[];
  13730. /**
  13731. * Set directions to show the control box.
  13732. *
  13733. * @default false if rotatable, ["n", "nw", "ne", "s", "se", "sw", "e", "w"] otherwise
  13734. */
  13735. renderDirections?: boolean | ("n" | "nw" | "ne" | "s" | "se" | "sw" | "e" | "w")[];
  13736. /**
  13737. * Whether the anchor should be hidden when dragging.
  13738. *
  13739. * @default true
  13740. */
  13741. hideAnchorOnDrag?: boolean;
  13742. /** The `title` property assigned to the root element of the component. */
  13743. title: string;
  13744. /** The position of the rotation anchor. */
  13745. rotationPosition?: RotationPosition;
  13746. /**
  13747. * Degree angles to snap to rotation
  13748. *
  13749. * @default [ ]
  13750. */
  13751. snapRotationDegrees?: number[];
  13752. /**
  13753. * Snap works if `abs(current rotation - snapRotationDegrees) <
  13754. * snapRotationThreshold`.
  13755. *
  13756. * @default 5
  13757. */
  13758. snapRotationThreshold?: number;
  13759. /** Whether the transform should be updated automatically. */
  13760. autoUpdate?: boolean;
  13761. /** The element ref, selector or element to which the transform will be bound. */
  13762. bound?: React__default.RefObject<HTMLElement> | string | HTMLElement;
  13763. /** The element ref, selector or element that is it's scrollable ancestor. */
  13764. scrollableAncestor?: React__default.RefObject<HTMLElement> | string | HTMLElement;
  13765. /**
  13766. * Whether to prevent bubbling of events like mousedown, touchstart, etc.
  13767. *
  13768. * @default false
  13769. */
  13770. stopPropagation?: boolean;
  13771. /**
  13772. * Whether to call preventDefault on touchstart or mousedown
  13773. *
  13774. * @default true
  13775. */
  13776. preventDefault?: boolean;
  13777. /**
  13778. * The default transformOrigin of the target can be set in advance.
  13779. *
  13780. * @default ""
  13781. */
  13782. transformOrigin?: (string | number)[] | string;
  13783. }
  13784. declare const Transform: React__default.ForwardRefExoticComponent<TransformProps & React__default.RefAttributes<HTMLDivElement>>;
  13785. 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 {
  13786. /**
  13787. * The initial image to display. This will be used as the `src` attribute of
  13788. * the `<img>` element. You will be able to choose a new image.
  13789. */
  13790. defaultImageSrc?: string | File;
  13791. /**
  13792. * The image to display. This will be used as the `src` attribute of the
  13793. * `<img>` element and will not be able to be changed from within the
  13794. * component. Basically, this makes the component controlled.
  13795. */
  13796. imageSrc?: string | File;
  13797. /**
  13798. * The alt text to display for the image. This will be used as the `alt`
  13799. * attribute of the `<img>`. element. If no `imageAlt` is provided, the
  13800. * `label` will be used.
  13801. */
  13802. imageAlt?: string;
  13803. /** The label to display for the picker button. */
  13804. pickerButtonLabel?: string;
  13805. /**
  13806. * Whether to show the checkered background behind the image. This is useful
  13807. * when the image has transparency.
  13808. *
  13809. * @default true
  13810. */
  13811. includeCheckeredBackground?: boolean;
  13812. /** Whether the component is inlined. */
  13813. isInline?: boolean;
  13814. /** The class name to apply to the picker button. */
  13815. pickerButtonClassName?: string;
  13816. /** The style to apply to the picker button. */
  13817. pickerButtonStyle?: React__default.CSSProperties;
  13818. /** The class name to apply to the label. */
  13819. labelClassName?: string;
  13820. /** The style to apply to the label. */
  13821. labelStyle?: React__default.CSSProperties;
  13822. }
  13823. declare const ImageDropZone: React__default.ForwardRefExoticComponent<ImageDropZoneProps & React__default.RefAttributes<HTMLDivElement>>;
  13824. interface PreviewProps extends StylingProps, AriaLabelingProps$1 {
  13825. /**
  13826. * Whether the preview should be displayed inline or not. This is just a
  13827. * visual change, the component will still behave the same.
  13828. *
  13829. * @default true
  13830. */
  13831. isInline?: boolean;
  13832. /**
  13833. * The image to display in the preview. This can be a URL or a base64 encoded
  13834. * string.
  13835. */
  13836. imageSrc?: string;
  13837. /** The alt text for the image. */
  13838. imageAlt?: string;
  13839. /** The SVG to display in the preview. This can be a React element or a string. */
  13840. svgSrc?: string | React__default.ReactElement;
  13841. /** Whether the preview should be disabled or not. */
  13842. isDisabled?: boolean;
  13843. /** The text to display in the preview. */
  13844. textValue?: string;
  13845. /** The style of the text. */
  13846. textStyle?: React__default.CSSProperties;
  13847. /**
  13848. * This is fired when the `actionButtons` are not passed and you trigger a
  13849. * `click` event on the preview. In case you have passed `actionButtons`, this
  13850. * is not fired as focus shifts to the action buttons.
  13851. */
  13852. onPress?: PressProps["onPress"];
  13853. /**
  13854. * The callback to be called when the delete button is clicked. When passed,
  13855. * the delete button is displayed.
  13856. */
  13857. onDelete?: ActionButtonProps["onPress"];
  13858. /**
  13859. * The label to be used for the delete button. This is used for accessibility
  13860. * purposes.
  13861. */
  13862. deleteAriaLabel?: string;
  13863. /** The callback to be called when the preview is clicked. */
  13864. addAriaLabel?: string;
  13865. /**
  13866. * The accent variable represents the type of accent color used in the
  13867. * application. It can have one of the following values:
  13868. *
  13869. * - "theme": Represents the accent color defined by the current application
  13870. * theme.
  13871. * - "positive": Represents a positive accent color that doesn't change with
  13872. * theme.
  13873. *
  13874. * @default "theme"
  13875. */
  13876. accent?: "theme" | "positive";
  13877. }
  13878. declare const Preview: React__default.ForwardRefExoticComponent<PreviewProps & React__default.RefAttributes<HTMLDivElement>>;
  13879. interface RadioGroupProps extends StylingProps, Omit<AriaRadioGroupProps, "description" | "errorMessage" | "isRequired" | "isInvalid" | "validate" | "validationBehavior" | "validationState"> {
  13880. /**
  13881. * The position of the label relative to the input.
  13882. *
  13883. * @default top
  13884. */
  13885. labelPosition?: "top" | "start";
  13886. /**
  13887. * The list of items to render in the radio group. Items have the following
  13888. * shape:
  13889. *
  13890. * ```ts
  13891. * export type ListOption = {
  13892. * id: string;
  13893. * label: string;
  13894. * description?: string;
  13895. * icon?: React.FC<IconProps>;
  13896. * };
  13897. * ```
  13898. */
  13899. items: ListOption[];
  13900. /**
  13901. * Render item option
  13902. *
  13903. * @typedef {Object} RenderItemOptions
  13904. * @property {boolean} isFocusVisible - Whether the focus ring is visible.
  13905. * @property {boolean} isFocused - Whether the option is focused.
  13906. * @property {boolean} isSelected - Whether the option is selected.
  13907. * @property {boolean} isHovered - Whether the option is hovered.
  13908. * @property {boolean} isDisabled - Whether the option is disabled.
  13909. */
  13910. /**
  13911. * The custom render function for the radio group options.
  13912. *
  13913. * @param {ListOption} item The item to render.
  13914. * @param {RenderItemOptions} options The options for rendering the item.
  13915. */
  13916. renderOption?: (item: ListOption, options: {
  13917. isFocusVisible: boolean;
  13918. isFocused: boolean;
  13919. isSelected: boolean;
  13920. isHovered: boolean;
  13921. isDisabled: boolean;
  13922. optionLabelPosition: "start" | "end";
  13923. isReadOnly?: boolean;
  13924. }) => React__default.ReactNode;
  13925. /** The class name for the group container. */
  13926. optionsContainerClassName?: string;
  13927. /** The style for the group container. */
  13928. optionsContainerStyle?: React__default.CSSProperties;
  13929. /** The ids of the items that are disabled. */
  13930. disabledValues?: string[];
  13931. /**
  13932. * The position of the label of individual radio buttons.
  13933. *
  13934. * @default end
  13935. */
  13936. optionLabelPosition?: "start" | "end";
  13937. /** The className applicable to the label. */
  13938. optionClassName?: string;
  13939. /** The style applicable to the label. */
  13940. optionStyle?: React__default.CSSProperties;
  13941. }
  13942. declare const RadioGroup: React__default.ForwardRefExoticComponent<RadioGroupProps & React__default.RefAttributes<HTMLDivElement>>;
  13943. interface ModalProps extends OverlayTriggerProps$1 {
  13944. }
  13945. interface ModalContentProps extends Omit<AriaModalOverlayProps, "isDismissable" | "isKeyboardDismissDisabled">, StylingProps {
  13946. /**
  13947. * The contents of the modal. Can be a React node or a function that returns a
  13948. * React node.
  13949. */
  13950. children: React__default.ReactNode | ((props: {
  13951. close: () => void;
  13952. }) => React__default.ReactNode);
  13953. /**
  13954. * The container element for the modal. By default, the modal is rendered as a
  13955. * child of the body element.
  13956. *
  13957. * @default document.body
  13958. */
  13959. portalContainer?: HTMLElement;
  13960. /**
  13961. * Whether to disable the animation for the modal. This is useful when you
  13962. * want to render one modal after another without the animation.
  13963. *
  13964. * @default false
  13965. */
  13966. disableAnimation?: boolean;
  13967. /**
  13968. * Whether the modal should be rendered as a drawer. This will render the
  13969. * modal with a transparent background and no border at the bottom. The `auto`
  13970. * value will render the modal as a drawer on mobile and as a dialog on
  13971. * desktop and tablet.
  13972. *
  13973. * @default false
  13974. */
  13975. enableDrawer?: boolean | "auto";
  13976. /**
  13977. * Specifies if the component is dismissable or not. If the value is a
  13978. * function, it will be called with a boolean indicating if the modal is
  13979. * rendered as a drawer or not.
  13980. *
  13981. * @default true
  13982. */
  13983. isDismissable?: boolean | ((isDrawer: boolean) => boolean);
  13984. /**
  13985. * Determines if keyboard dismissal is disabled. If the value is a function,
  13986. * it will be called with a boolean indicating if the modal is rendered as a
  13987. * drawer or not.
  13988. *
  13989. * @default false
  13990. */
  13991. isKeyboardDismissDisabled?: boolean | ((isDrawer: boolean) => boolean);
  13992. }
  13993. declare const Modal: React__default.FC<ModalProps>;
  13994. declare const ModalContent: React__default.FC<ModalContentProps>;
  13995. declare const ModalTrigger: React__default.FC;
  13996. declare const ModalClose: React__default.FC;
  13997. interface MessageFormatProps {
  13998. /**
  13999. * By default `<MessageFormat>` will render the formatted string into a
  14000. * `<React.Fragment>`. If you need to customize rendering, you can either wrap
  14001. * it with another React element (recommended), specify a different tagName
  14002. * (e.g., 'div')
  14003. */
  14004. elementType?: React__default.ElementType | "div" | "span";
  14005. /** The id of the message to format. */
  14006. id: string;
  14007. /** The default message to use if the message id is not found. */
  14008. defaultMessage?: string;
  14009. }
  14010. declare const MessageFormat: React__default.FC<MessageFormatProps>;
  14011. interface GroupProps extends StylingProps, AriaLabelingProps$1 {
  14012. /**
  14013. * The `role` property specifies the accessibility `role` for the group. By
  14014. * default, it is set to 'group'. If the contents of the group are important
  14015. * enough to be included in the page table of contents, use 'region'. If the
  14016. * group is visual only and does not represent a semantic grouping of
  14017. * controls, use 'presentation'.
  14018. *
  14019. * @default group
  14020. */
  14021. role?: "group" | "region" | "presentation";
  14022. /** Whether the group is disabled. */
  14023. isDisabled?: boolean;
  14024. /** The children to render. */
  14025. children: React__default.ReactNode;
  14026. }
  14027. declare const Group: React__default.ForwardRefExoticComponent<GroupProps & React__default.RefAttributes<HTMLDivElement>>;
  14028. declare type SprinkleProps = Parameters<Sprinkles>[0];
  14029. interface BoxProps extends Pick<StylingProps, "data-block-id">, Omit<React__default.ComponentPropsWithoutRef<"div">, "color">, SprinkleProps {
  14030. /**
  14031. * The HTML element to use for the box.
  14032. *
  14033. * @default "div"
  14034. */
  14035. elementType?: string;
  14036. }
  14037. declare const Box: React__default.ForwardRefExoticComponent<BoxProps & React__default.RefAttributes<HTMLDivElement>>;
  14038. interface ColorPresetInlineInputProps extends Omit<RadioGroupProps, "items" | "disabledValues"> {
  14039. items: ColorPreset$1[];
  14040. }
  14041. declare const ColorPresetInlineInput: React__default.ForwardRefExoticComponent<ColorPresetInlineInputProps & React__default.RefAttributes<HTMLDivElement>>;
  14042. interface ToolbarProps extends StylingProps, AriaToolbarProps {
  14043. children: React__default.ReactNode;
  14044. /**
  14045. * Identifies the element (or elements) whose contents or presence are
  14046. * controlled by the current element.
  14047. */
  14048. "aria-controls"?: string;
  14049. }
  14050. declare const Toolbar: React__default.ForwardRefExoticComponent<ToolbarProps & React__default.RefAttributes<HTMLDivElement>>;
  14051. interface ToggleIconButtonProps extends StylingProps, Omit<ToggleProps, "children">, Omit<ToggleButtonProps, "size" | "iconStart" | "label"> {
  14052. /**
  14053. * The available sizes for a variable.
  14054. *
  14055. * @default "md"
  14056. */
  14057. size?: "xxs" | "xs" | "sm" | "md" | "lg";
  14058. /** Represents the variant of a component. */
  14059. variant?: "primary" | "secondary" | "tertiary" | "toolbar";
  14060. /**
  14061. * The icon to be displayed on the button. You can pass an object with
  14062. * `selected` and `unselected` keys to display different icons based on the
  14063. * state of the button.
  14064. */
  14065. icon: React__default.FC<IconProps> | {
  14066. selected: React__default.FC<IconProps>;
  14067. unselected: React__default.FC<IconProps>;
  14068. };
  14069. /** Indicates whether focusing should be prevented on press. */
  14070. preventFocusOnPress?: boolean;
  14071. }
  14072. declare const ToggleIconButton: React__default.ForwardRefExoticComponent<ToggleIconButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
  14073. interface MentionableUser {
  14074. id: string;
  14075. name: string;
  14076. displayName: string;
  14077. avatar?: AvatarProps;
  14078. description?: string;
  14079. }
  14080. interface EditorHandle {
  14081. setCaretPosition: (index: number) => void;
  14082. }
  14083. interface EditorProps extends StylingProps, AriaLabelingProps$1 {
  14084. /**
  14085. * The function to be called when `Enter` key is pressed or Save button is
  14086. * clicked.
  14087. */
  14088. onSave?: (value: string) => void;
  14089. /**
  14090. * The function to be called when Cancel button is clicked. If not provided,
  14091. * the Cancel button will not be rendered.
  14092. */
  14093. onCancel?: () => void;
  14094. /** The default value of the editor. */
  14095. defaultValue?: string;
  14096. /** The value of the editor. */
  14097. value?: string;
  14098. /**
  14099. * The function to be called when the value of the editor changes.
  14100. *
  14101. * @param value
  14102. */
  14103. onChange?: (value: string) => void;
  14104. /** Whether the editor is disabled. This includes both input and save button. */
  14105. isDisabled?: boolean;
  14106. /** Whether saving it disabled. Ths disables only save button. */
  14107. isSaveDisabled?: boolean;
  14108. /**
  14109. * Indicates whether rich text is enabled or not.
  14110. *
  14111. * @default true
  14112. */
  14113. enableRichText?: boolean;
  14114. /** The placeholder text to be displayed when the editor is empty. */
  14115. placeholder?: string;
  14116. /**
  14117. * The variant of the editor.
  14118. *
  14119. * @default default
  14120. */
  14121. variant?: "default" | "minimal";
  14122. /** Whether the editor is inline or not. */
  14123. isInline?: boolean;
  14124. /** Specifies whether spell checking is enabled or disabled. */
  14125. spellCheck?: boolean;
  14126. /**
  14127. * Optional property that represents the ARIA label for the submit button.
  14128. * This property is used to provide an accessible label for the button, which
  14129. * is read by screen readers to assist visually impaired users.
  14130. *
  14131. * @default Save
  14132. */
  14133. submitButtonAriaLabel?: string;
  14134. /**
  14135. * The React node representing the icon to be displayed on the submit button.
  14136. *
  14137. * @default ArrowUpCircleFilledIcon
  14138. */
  14139. submitButtonIcon?: React__default.FC<IconProps>;
  14140. /**
  14141. * Optional property that represents the ARIA label for the cancel button.
  14142. *
  14143. * @default Cancel
  14144. */
  14145. cancelButtonAriaLabel?: string;
  14146. /**
  14147. * The name of the avatar. The avatar is visible when `variant` is set to
  14148. * `minimal` and `enableRichText` is set to `false`.
  14149. */
  14150. avatarName?: string;
  14151. /**
  14152. * The ARIA label for the editable content. In case of rich text, this label
  14153. * is used to provide an accessible label for the contenteditable element,
  14154. * which is read by screen readers to assist visually impaired users. In case
  14155. * of plain text, this label is used to provide an accessible label for the
  14156. * textarea element.
  14157. *
  14158. * @default Editing Area
  14159. */
  14160. editableContentAriaLabel?: string;
  14161. /**
  14162. * An optional array of mentionable users. Mention feature is only available
  14163. * when `enableRichText` is set to `true` and this prop is provided.
  14164. *
  14165. * ```tsx
  14166. * type MentionableUser = {
  14167. * id: string;
  14168. * name: string;
  14169. * displayName: string;
  14170. * avatar?: AvatarProps;
  14171. * description?: string;
  14172. * };
  14173. * ```
  14174. */
  14175. mentionableUsers?: MentionableUser[];
  14176. /**
  14177. * The maximum number of mentionable users to be displayed in the suggestions.
  14178. * This prop is only used when `mentionableUsers` is provided.
  14179. *
  14180. * @default 10
  14181. */
  14182. maxMentionableUsersSuggestions?: number;
  14183. /** Footer button represents the buttons that are displayed in the footer. */
  14184. footerButtons?: ({
  14185. type: "action";
  14186. props: Omit<ActionIconButtonProps, "size" | "variant">;
  14187. } | {
  14188. type: "toggle";
  14189. props: Omit<ToggleIconButtonProps, "size" | "variant">;
  14190. })[];
  14191. /** The imperative handle for manipulating editor. */
  14192. editorHandle?: React__default.RefObject<EditorHandle>;
  14193. /**
  14194. * Whether to clear the editor value when the editor is saved.
  14195. *
  14196. * @default false
  14197. */
  14198. clearOnSave?: boolean;
  14199. /**
  14200. * Whether to clear the editor value when the cancel button is clicked.
  14201. *
  14202. * @default false
  14203. */
  14204. clearOnCancel?: boolean;
  14205. /**
  14206. * Whether to autofocus the editor when it is mounted.
  14207. *
  14208. * @default false
  14209. */
  14210. autoFocus?: boolean;
  14211. }
  14212. declare const Editor: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<EditorProps & React__default.RefAttributes<HTMLDivElement>>>;
  14213. interface ScrollControlButtonProps extends StylingProps, Pick<ActionButtonProps, "label"> {
  14214. /**
  14215. * The ref to the scrollable element.
  14216. *
  14217. * @default document.body
  14218. */
  14219. scrollRef?: React__default.RefObject<HTMLElement>;
  14220. /**
  14221. * Indicates whether the button should be hidden when the keyboard is being
  14222. * used.
  14223. *
  14224. * @default false
  14225. */
  14226. hideForKeyboard?: boolean;
  14227. /**
  14228. * The delay in milliseconds before the button is hidden when the scrolling
  14229. * stops.
  14230. *
  14231. * @default 1500
  14232. */
  14233. delay?: number;
  14234. /**
  14235. * Indicates whether the scroll should be smooth.
  14236. *
  14237. * @default true
  14238. */
  14239. smoothScroll?: boolean;
  14240. }
  14241. declare const ScrollControlButton: React__default.ForwardRefExoticComponent<ScrollControlButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
  14242. interface TransitionProps extends StylingProps {
  14243. isMounted: boolean;
  14244. transitions: UseTransitionProps;
  14245. elementType?: keyof React__default.ReactHTML;
  14246. children: React__default.ReactNode;
  14247. }
  14248. declare const Transition: React__default.ForwardRefExoticComponent<TransitionProps & React__default.RefAttributes<HTMLElement>>;
  14249. interface AlertDialogProps extends StylingProps {
  14250. /**
  14251. * The title of the dialog. This is the main heading of the dialog and is
  14252. * displayed at the top of the dialog.
  14253. */
  14254. title: string;
  14255. /**
  14256. * The message of the dialog. This is the main content of the dialog and is
  14257. * displayed below the title.
  14258. */
  14259. message?: React__default.ReactNode;
  14260. /**
  14261. * The label for the cancel button. This is the text that is displayed on the
  14262. * button that allows the user to cancel the dialog.
  14263. */
  14264. cancelLabel?: string;
  14265. /**
  14266. * The label for the confirm button. This is the text that is displayed on the
  14267. * button that allows the user to confirm the dialog.
  14268. */
  14269. primaryActionLabel?: string;
  14270. /**
  14271. * The function that is called when the user confirms the dialog. This is
  14272. * called when the user clicks the primary action button.
  14273. */
  14274. onPrimaryAction?: () => void;
  14275. /**
  14276. * The function that is called when the user cancels the dialog. This is
  14277. * called when the user clicks the cancel button or the close button.
  14278. */
  14279. onCancel?: () => void;
  14280. /** The button that should be focused when the dialog is opened. */
  14281. autoFocusButton?: "primary" | "cancel";
  14282. /** Whether the primary action button should be disabled. */
  14283. isPrimaryActionDisabled?: boolean;
  14284. /**
  14285. * The props that are passed to the text input. If this is provided, a text
  14286. * input will be displayed at the bottom of the dialog.
  14287. */
  14288. textInputProps?: TextInputProps;
  14289. /**
  14290. * The icon that is displayed at the top of the dialog. This is typically used
  14291. * to display an icon that represents the type of alert that is being shown.
  14292. */
  14293. icon?: React__default.FC<IconProps>;
  14294. /** The color of the icon. This is the color that is used to fill the icon. */
  14295. iconColor?: string;
  14296. /**
  14297. * Whether the close button should be displayed in the top end corner of the
  14298. * dialog. If this is `true`, a close button will be displayed. If this is
  14299. * `false`, no close button will be displayed.
  14300. *
  14301. * @default true
  14302. */
  14303. showCloseButton?: boolean;
  14304. }
  14305. declare const AlertDialog: React__default.ForwardRefExoticComponent<AlertDialogProps & React__default.RefAttributes<HTMLDivElement>>;
  14306. interface MarkdownProps extends StylingProps {
  14307. /** The markdown to render. */
  14308. children: string;
  14309. /** The flag to show the caret at the end */
  14310. showCaret?: boolean;
  14311. }
  14312. declare const Markdown: React__default.ForwardRefExoticComponent<MarkdownProps & React__default.RefAttributes<HTMLDivElement>>;
  14313. interface AudioPlayerProps extends StylingProps, AriaLabelingProps$1 {
  14314. /**
  14315. * The sources of the audio file. The `url` is the URL of the audio file, and
  14316. * the `type` is the MIME type of the audio file.
  14317. *
  14318. * ```tsx
  14319. * <AudioPlayer
  14320. * sources={[
  14321. * { url: "/sound.mp3", type: "audio/mpeg" },
  14322. * { url: "/sound.ogg", type: "audio/ogg" },
  14323. * ]}
  14324. * />
  14325. * ```
  14326. */
  14327. sources: {
  14328. url: string;
  14329. type: string;
  14330. }[];
  14331. /**
  14332. * The size of the audio player.
  14333. *
  14334. * @default "lg"
  14335. */
  14336. size?: "sm" | "lg";
  14337. }
  14338. declare const AudioPlayer: React__default.ForwardRefExoticComponent<AudioPlayerProps & React__default.RefAttributes<HTMLDivElement>>;
  14339. /**
  14340. * A hook that creates an IntersectionObserver and observes a target element.
  14341. *
  14342. * @example
  14343. * ```tsx
  14344. * import { useIntersectionObserver } from "@baseline-ui/core";
  14345. *
  14346. * const MyComponent = () => {
  14347. * const ref = useRef(null);
  14348. *
  14349. * const onIntersect = (entry) => {
  14350. * console.log(entry);
  14351. * };
  14352. *
  14353. * useIntersectionObserver({ ref, onIntersect });
  14354. *
  14355. * return <div ref={ref}>Hello world</div>;
  14356. * };
  14357. * ```;
  14358. *
  14359. * @param {IntersectionObserverOptions} options - The options for the
  14360. * IntersectionObserver.
  14361. * @param {React.RefObject<HTMLElement>} options.ref - The ref of the target
  14362. * element to observe.
  14363. * @param {(entry: IntersectionObserverEntry) => void} options.onIntersect - The
  14364. * function to call when the target element intersects the root element.
  14365. * @param {boolean} options.isDisabled - Whether the IntersectionObserver should
  14366. * be disabled.
  14367. * @param {number | number[]} options.threshold - The threshold(s) at which to
  14368. * trigger the onIntersect function.
  14369. * @param {string} options.rootMargin - The margin around the root element.
  14370. * @param {React.RefObject<HTMLElement>} options.root - The ref of the root
  14371. * element to observe.
  14372. */
  14373. declare function useIntersectionObserver({ ref, onIntersect, isDisabled, threshold, rootMargin, root, }: IntersectionObserverOptions): void;
  14374. interface IntersectionObserverOptions {
  14375. ref: React__default.RefObject<HTMLElement>;
  14376. onIntersect: (entry: IntersectionObserverEntry) => void;
  14377. root?: React__default.RefObject<HTMLElement>;
  14378. rootMargin?: string;
  14379. threshold?: number;
  14380. isDisabled?: boolean;
  14381. }
  14382. /**
  14383. * A hook that observes the size changes of a DOM element using the
  14384. * ResizeObserver API.
  14385. *
  14386. * @example
  14387. * ```tsx
  14388. * const ref = useRef<HTMLDivElement>(null);
  14389. *
  14390. * const { size } = useResizeObserver({
  14391. * ref,
  14392. * onResize: (entry) => {
  14393. * // do something
  14394. * },
  14395. * isDisabled: false,
  14396. * });
  14397. * ```;
  14398. *
  14399. * @param {Object} options - The options object.
  14400. * @param {React.RefObject<HTMLElement>} options.ref - The ref object that
  14401. * points to the observed element.
  14402. * @param {Function} options.onResize - The callback function that is called
  14403. * when the element is resized.
  14404. * @param {boolean} options.isDisabled - A flag that indicates whether the
  14405. * observer is disabled.
  14406. * @returns {Object} An object that contains the size of the observed element.
  14407. */
  14408. declare function useResizeObserver({ ref, onResize, isDisabled, }: ResizeObserverOptions): {
  14409. size: {
  14410. width: number;
  14411. height: number;
  14412. } | undefined;
  14413. };
  14414. interface ResizeObserverOptions {
  14415. ref: React__default.RefObject<HTMLElement>;
  14416. onResize?: (entry: ResizeObserverEntry) => void;
  14417. isDisabled?: boolean;
  14418. }
  14419. /**
  14420. * A custom hook that loads an image and returns its loading state and props.
  14421. *
  14422. * @example
  14423. * ```tsx
  14424. * const { isLoaded, hasError, isLoading, imgProps } = useImage({
  14425. * src: "https://via.placeholder.com/150",
  14426. * alt: "Placeholder image",
  14427. * });
  14428. * ```;
  14429. *
  14430. * @param {Object} options - The options object.
  14431. * @param {string} options.src - The image source URL.
  14432. * @param {string} options.alt - The image alt text.
  14433. * @returns {Object} An object containing the image loading state and props.
  14434. * @returns {boolean} IsLoaded - Whether the image has loaded.
  14435. * @returns {boolean} HasError - Whether there was an error loading the image.
  14436. * @returns {boolean} IsLoading - Whether the image is currently loading.
  14437. * @returns {Object} ImgProps - The image props to be passed to the `img`
  14438. * element.
  14439. * @returns {string} ImgProps.src - The image source URL, or `undefined` if the
  14440. * image hasn't loaded yet.
  14441. * @returns {string} ImgProps.alt - The image alt text.
  14442. */
  14443. declare function useImage({ src, alt }: {
  14444. src?: string;
  14445. alt: string;
  14446. }): {
  14447. isLoaded: boolean;
  14448. hasError: boolean;
  14449. isLoading: boolean;
  14450. imgProps: {
  14451. src?: string;
  14452. alt: string;
  14453. };
  14454. };
  14455. /**
  14456. * A hook that provides undo and redo functionality for a given state.
  14457. *
  14458. * @example
  14459. * ```tsx
  14460. * const { state, push, undo, redo, pastStates, futureStates, canUndo, canRedo } = useUndoRedo({
  14461. * onAction: (state, action) => {
  14462. * // do something
  14463. * },
  14464. * });
  14465. *
  14466. * // push a new state
  14467. * push({ foo: "bar" });
  14468. *
  14469. * // undo the last state
  14470. * undo();
  14471. *
  14472. * // redo the last state
  14473. * redo();
  14474. * ```;
  14475. *
  14476. * @template T The type of the state object.
  14477. * @param initialState The initial state object.
  14478. * @param options Additional options for the hook.
  14479. * @param options.isDisabled Whether the undo/redo functionality should be
  14480. * disabled.
  14481. * @param options.onAction A callback function that is called whenever an undo
  14482. * or redo action is performed.
  14483. * @returns An object containing the current state, undo and redo functions, and
  14484. * other related properties.
  14485. */
  14486. declare const useUndoRedo: <T>(initialState: T | undefined, { isDisabled, onAction, }: {
  14487. isDisabled?: boolean | undefined;
  14488. onAction?: ((state: T, action: "UNDO" | "REDO") => void) | undefined;
  14489. }) => {
  14490. state: T;
  14491. push: (newState: T) => void;
  14492. undo: () => void;
  14493. redo: () => void;
  14494. pastStates: T[];
  14495. futureStates: T[];
  14496. canUndo: boolean;
  14497. canRedo: boolean;
  14498. };
  14499. /**
  14500. * This hook returns true if the component is being rendered for the first time.
  14501. * This is useful for avoiding side effects on the first render inside of
  14502. * useEffect.
  14503. *
  14504. * @example
  14505. * ```tsx
  14506. * const isFirstRender = useIsFirstRender();
  14507. *
  14508. * useEffect(() => {
  14509. * if (isFirstRender) return;
  14510. * // do something
  14511. * return () => {
  14512. * // do something on unmount
  14513. * };
  14514. * }, [isFirstRender]);
  14515. * ```;
  14516. *
  14517. * @returns Whether or not the component is being rendered for the first time
  14518. */
  14519. declare function useIsFirstRender(): boolean;
  14520. /**
  14521. * A hook that provides internationalization functionality. It returns a
  14522. * function to format messages and the current locale. The hook can be used with
  14523. * or without a messages object. If no messages object is provided, the hook
  14524. * will use the messages provided by the `I18nProvider`. If a messages object is
  14525. * provided, the hook will use those messages instead of the ones provided by
  14526. * the `I18nProvider`.
  14527. *
  14528. * @example
  14529. * ```tsx
  14530. * import { useI18n } from "@baseline-ui/core";
  14531. *
  14532. * const messages = {
  14533. * en: { hello: "Hello" },
  14534. * fr: { hello: "Bonjour" },
  14535. * };
  14536. *
  14537. * const MyComponent = () => {
  14538. * const { formatMessage, locale } = useI18n(messages);
  14539. *
  14540. * return (
  14541. * <div>
  14542. * <p>{formatMessage("hello")}</p>
  14543. * <p>{locale}</p>
  14544. * </div>
  14545. * )};
  14546. * ```;
  14547. *
  14548. * @template T - A type that represents the shape of the translation messages.
  14549. * @param {Object<string, T>} [messages] - An optional object containing
  14550. * translation messages for different languages.
  14551. * @returns {I18nResult<T>} An object containing a function to format messages
  14552. * and the current locale.
  14553. */
  14554. declare function useI18n<T extends Record<string, string>>(messages?: Record<string, T>): I18nResult<T>;
  14555. interface I18nResult<T extends LocalizedStrings[keyof LocalizedStrings]> {
  14556. formatMessage: (id: keyof T | MessageDescriptor, values?: Record<string, any>) => string;
  14557. locale: Locale;
  14558. }
  14559. interface MessageDescriptor {
  14560. id: string;
  14561. defaultMessage?: string;
  14562. }
  14563. /**
  14564. * Defines a set of messages for use with the `useI18n` hook.
  14565. *
  14566. * @param messages An object containing message descriptors.
  14567. * @returns An object containing the message descriptors with their keys as
  14568. * property names.
  14569. */
  14570. declare const defineMessages: <T extends Record<string, {
  14571. id: string;
  14572. }>>(messages: T) => T;
  14573. /**
  14574. * A hook that uses a MutationObserver to watch for changes to the DOM.
  14575. *
  14576. * @example
  14577. * ```tsx
  14578. * const targetRef = React.useRef<HTMLDivElement>(null);
  14579. *
  14580. * useMutationObserver(targetRef.current, { attributes: true }, (mutations) => {
  14581. * console.log(mutations);
  14582. * // do something with the mutations
  14583. * // ...
  14584. * });
  14585. * ```;
  14586. *
  14587. * @param target The element to observe for changes.
  14588. * @param options The options to pass to the MutationObserver.
  14589. * @param callback The callback to call when a mutation occurs.
  14590. * @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
  14591. */
  14592. declare function useMutationObserver(target: Element | null, options: MutationObserverInit, callback: MutationCallback): MutationObserver | null;
  14593. declare type SetValue<T> = Dispatch<SetStateAction<T>>;
  14594. /**
  14595. * A hook to persist a value to localStorage.
  14596. *
  14597. * @example
  14598. * ```tsx
  14599. * function MyComponent() {
  14600. * const [value, setValue] = useLocalStorage("my-value", "default-value");
  14601. * return (
  14602. * <input value={value} onChange={e => setValue(e.target.value)} />
  14603. * );
  14604. * }
  14605. * ```;
  14606. *
  14607. * @param key The localStorage key to use
  14608. * @param initialValue The initial value to use if the key is not found in
  14609. * localStorage
  14610. */
  14611. declare function useLocalStorage<T>(key: string, initialValue: T): [T, SetValue<T>];
  14612. /**
  14613. * A hook that provides text selection functionality for a given HTML element.
  14614. *
  14615. * ```jsx
  14616. * function MyComponent() {
  14617. * const ref = useRef();
  14618. * const [selection, setSelection] = useState();
  14619. *
  14620. * useTextSelection({
  14621. * ref,
  14622. * onSelectionChange: setSelection,
  14623. * });
  14624. *
  14625. * return (
  14626. * <div ref={ref}>
  14627. * <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
  14628. * </div>
  14629. * );
  14630. * }
  14631. * ```
  14632. */
  14633. declare function useTextSelection({ ref, onSelectionChange, onSelectionEnd, isDisabled, }: TextSelectionProps): void;
  14634. interface TextSelectionProps {
  14635. ref: React__default.RefObject<HTMLElement>;
  14636. onSelectionChange: (selection: Selection) => void;
  14637. onSelectionEnd?: (selection: Selection) => void;
  14638. isDisabled?: boolean;
  14639. }
  14640. /**
  14641. * Returns the current device type based on the window width.
  14642. *
  14643. * ```jsx
  14644. * const device = useDevice();
  14645. *
  14646. * if (device === "mobile") {
  14647. * return <MobileComponent />;
  14648. * } else if (device === "tablet") {
  14649. * return <TabletComponent />;
  14650. * } else {
  14651. * return <DesktopComponent />;
  14652. * }
  14653. * ```
  14654. *
  14655. * @param element - The element to use to get the owner window. Defaults to
  14656. * `document.body`.
  14657. */
  14658. declare function useDevice(element?: Element | null | undefined): "tablet" | "desktop" | "mobile";
  14659. /**
  14660. * Custom hook for accessing PortalContainerProviderContext. This hook allows
  14661. * components to either use a specified portal container or fallback to a
  14662. * default provided via context.
  14663. *
  14664. * @param _portalContainer - An optional HTML element that can be specified as
  14665. * an override.
  14666. * @returns The portal container element where components should be rendered,
  14667. * either the overridden container, one from context or undefined.
  14668. */
  14669. declare function usePortalContainer(_portalContainer?: HTMLElement): HTMLElement | undefined;
  14670. declare const Core_Accordion: typeof Accordion;
  14671. declare const Core_AccordionItem: typeof AccordionItem;
  14672. type Core_AccordionItemProps = AccordionItemProps;
  14673. type Core_AccordionProps = AccordionProps;
  14674. declare const Core_ActionButton: typeof ActionButton;
  14675. type Core_ActionButtonProps = ActionButtonProps;
  14676. declare const Core_ActionIconButton: typeof ActionIconButton;
  14677. type Core_ActionIconButtonProps = ActionIconButtonProps;
  14678. declare const Core_AlertDialog: typeof AlertDialog;
  14679. type Core_AlertDialogProps = AlertDialogProps;
  14680. declare const Core_AudioPlayer: typeof AudioPlayer;
  14681. type Core_AudioPlayerProps = AudioPlayerProps;
  14682. declare const Core_Avatar: typeof Avatar;
  14683. type Core_AvatarProps = AvatarProps;
  14684. type Core_BlockProps = BlockProps;
  14685. declare const Core_Box: typeof Box;
  14686. type Core_BoxProps = BoxProps;
  14687. declare const Core_Checkbox: typeof Checkbox;
  14688. type Core_CheckboxProps = CheckboxProps;
  14689. declare const Core_ColorInput: typeof ColorInput;
  14690. type Core_ColorInputProps = ColorInputProps;
  14691. declare const Core_ColorPresetInlineInput: typeof ColorPresetInlineInput;
  14692. type Core_ColorPresetInlineInputProps = ColorPresetInlineInputProps;
  14693. declare const Core_ColorSwatch: typeof ColorSwatch;
  14694. type Core_ColorSwatchProps = ColorSwatchProps;
  14695. declare const Core_DateFormat: typeof DateFormat;
  14696. type Core_DateFormatProps = DateFormatProps;
  14697. declare const Core_Dialog: typeof Dialog;
  14698. type Core_DialogProps = DialogProps;
  14699. declare const Core_DialogTitle: typeof DialogTitle;
  14700. type Core_DialogTitleProps = DialogTitleProps;
  14701. declare const Core_DomNodeRenderer: typeof DomNodeRenderer;
  14702. type Core_DomNodeRendererProps = DomNodeRendererProps;
  14703. declare const Core_Drawer: typeof Drawer;
  14704. type Core_DrawerProps = DrawerProps;
  14705. declare const Core_Editor: typeof Editor;
  14706. type Core_EditorHandle = EditorHandle;
  14707. type Core_EditorProps = EditorProps;
  14708. declare const Core_FileUpload: typeof FileUpload;
  14709. type Core_FileUploadProps = FileUploadProps;
  14710. declare const Core_FreehandCanvas: typeof FreehandCanvas;
  14711. type Core_FreehandCanvasProps = FreehandCanvasProps;
  14712. declare const Core_Group: typeof Group;
  14713. type Core_GroupProps = GroupProps;
  14714. declare const Core_I18nProvider: typeof I18nProvider;
  14715. type Core_I18nResult<T extends LocalizedStrings[keyof LocalizedStrings]> = I18nResult<T>;
  14716. declare const Core_IconColorInputButton: typeof IconColorInputButton;
  14717. declare const Core_ImageDropZone: typeof ImageDropZone;
  14718. type Core_ImageDropZoneProps = ImageDropZoneProps;
  14719. declare const Core_InlineAlert: typeof InlineAlert;
  14720. type Core_InlineAlertProps = InlineAlertProps;
  14721. declare const Core_Link: typeof Link;
  14722. type Core_LinkProps = LinkProps;
  14723. declare const Core_ListBox: typeof ListBox;
  14724. type Core_ListBoxProps = ListBoxProps;
  14725. type Core_ListOption = ListOption;
  14726. declare const Core_Markdown: typeof Markdown;
  14727. type Core_MarkdownProps = MarkdownProps;
  14728. declare const Core_Menu: typeof Menu;
  14729. type Core_MenuItem = MenuItem;
  14730. type Core_MenuProps = MenuProps;
  14731. type Core_MessageDescriptor = MessageDescriptor;
  14732. declare const Core_MessageFormat: typeof MessageFormat;
  14733. type Core_MessageFormatProps = MessageFormatProps;
  14734. declare const Core_Modal: typeof Modal;
  14735. declare const Core_ModalClose: typeof ModalClose;
  14736. declare const Core_ModalContent: typeof ModalContent;
  14737. type Core_ModalContentProps = ModalContentProps;
  14738. type Core_ModalProps = ModalProps;
  14739. declare const Core_ModalTrigger: typeof ModalTrigger;
  14740. declare const Core_NumberFormat: typeof NumberFormat;
  14741. type Core_NumberFormatProps = NumberFormatProps;
  14742. declare const Core_NumberInput: typeof NumberInput;
  14743. type Core_NumberInputProps = NumberInputProps;
  14744. declare const Core_Pagination: typeof Pagination;
  14745. type Core_PaginationProps = PaginationProps;
  14746. declare const Core_Popover: typeof Popover;
  14747. declare const Core_PopoverContent: typeof PopoverContent;
  14748. type Core_PopoverContentProps = PopoverContentProps;
  14749. type Core_PopoverProps = PopoverProps;
  14750. declare const Core_PopoverTrigger: typeof PopoverTrigger;
  14751. type Core_PopoverTriggerProps = PopoverTriggerProps;
  14752. declare const Core_Portal: typeof Portal;
  14753. declare const Core_PortalContainerProvider: typeof PortalContainerProvider;
  14754. type Core_PortalProps = PortalProps;
  14755. declare const Core_Preview: typeof Preview;
  14756. type Core_PreviewProps = PreviewProps;
  14757. declare const Core_ProgressBar: typeof ProgressBar;
  14758. type Core_ProgressBarProps = ProgressBarProps;
  14759. declare const Core_ProgressSpinner: typeof ProgressSpinner;
  14760. type Core_ProgressSpinnerProps = ProgressSpinnerProps;
  14761. declare const Core_RadioGroup: typeof RadioGroup;
  14762. type Core_RadioGroupProps = RadioGroupProps;
  14763. declare const Core_Reaction: typeof Reaction;
  14764. type Core_ReactionProps = ReactionProps;
  14765. declare const Core_ScrollControlButton: typeof ScrollControlButton;
  14766. type Core_ScrollControlButtonProps = ScrollControlButtonProps;
  14767. declare const Core_SearchInput: typeof SearchInput;
  14768. type Core_SearchInputProps = SearchInputProps;
  14769. declare const Core_Select: typeof Select;
  14770. type Core_SelectProps = SelectProps;
  14771. declare const Core_Separator: typeof Separator;
  14772. type Core_SeparatorProps = SeparatorProps;
  14773. declare const Core_Slider: typeof Slider;
  14774. type Core_SliderProps = SliderProps;
  14775. type Core_StylingProps = StylingProps;
  14776. declare const Core_Switch: typeof Switch;
  14777. type Core_SwitchProps = SwitchProps;
  14778. declare const Core_TabItem: typeof TabItem;
  14779. type Core_TabItemProps = TabItemProps;
  14780. declare const Core_Tabs: typeof Tabs;
  14781. type Core_TabsProps = TabsProps;
  14782. declare const Core_TagGroup: typeof TagGroup;
  14783. type Core_TagGroupProps = TagGroupProps;
  14784. declare const Core_TextInput: typeof TextInput;
  14785. type Core_TextInputProps = TextInputProps;
  14786. type Core_TextProps<T extends keyof React__default.JSX.IntrinsicElements = "span"> = TextProps<T>;
  14787. declare const Core_ThemeProvider: typeof ThemeProvider;
  14788. type Core_ThemeProviderProps = ThemeProviderProps;
  14789. declare const Core_ToggleButton: typeof ToggleButton;
  14790. type Core_ToggleButtonProps = ToggleButtonProps;
  14791. declare const Core_ToggleIconButton: typeof ToggleIconButton;
  14792. type Core_ToggleIconButtonProps = ToggleIconButtonProps;
  14793. declare const Core_Toolbar: typeof Toolbar;
  14794. type Core_ToolbarProps = ToolbarProps;
  14795. declare const Core_Tooltip: typeof Tooltip;
  14796. type Core_TooltipProps = TooltipProps;
  14797. declare const Core_Transform: typeof Transform;
  14798. type Core_TransformProps = TransformProps;
  14799. declare const Core_Transition: typeof Transition;
  14800. type Core_TransitionProps = TransitionProps;
  14801. declare const Core_defineMessages: typeof defineMessages;
  14802. declare const Core_isInsideOverlayContent: typeof isInsideOverlayContent;
  14803. declare const Core_useCollator: typeof useCollator;
  14804. declare const Core_useDateFormatter: typeof useDateFormatter;
  14805. declare const Core_useDevice: typeof useDevice;
  14806. declare const Core_useI18n: typeof useI18n;
  14807. declare const Core_useImage: typeof useImage;
  14808. declare const Core_useIntersectionObserver: typeof useIntersectionObserver;
  14809. declare const Core_useIsFirstRender: typeof useIsFirstRender;
  14810. declare const Core_useLocalStorage: typeof useLocalStorage;
  14811. declare const Core_useMutationObserver: typeof useMutationObserver;
  14812. declare const Core_useNumberFormatter: typeof useNumberFormatter;
  14813. declare const Core_usePortalContainer: typeof usePortalContainer;
  14814. declare const Core_useResizeObserver: typeof useResizeObserver;
  14815. declare const Core_useTextSelection: typeof useTextSelection;
  14816. declare const Core_useUndoRedo: typeof useUndoRedo;
  14817. declare const Core_useUserPreferences: typeof useUserPreferences;
  14818. declare namespace Core {
  14819. 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 };
  14820. }
  14821. declare type Any$1 = any;
  14822. declare type IRecord$1 = Record<Any$1, Any$1>;
  14823. declare type AnyComponent = React__default.ComponentType<Any$1> | keyof ReactHTML;
  14824. declare type Child = Block | string | number | ((...args: Any$1[]) => React__default.ReactElement);
  14825. declare type Props<T extends AnyComponent> = Omit<React__default.ComponentPropsWithRef<T>, "children"> & {
  14826. "data-block-id"?: string;
  14827. children?: Child[];
  14828. };
  14829. declare type PropsWithoutChildren<T extends AnyComponent> = Omit<Props<T>, "children">;
  14830. /**
  14831. * The Block class is a wrapper around React components. It is used to create a
  14832. * virtual DOM tree that can be rendered to the DOM.
  14833. */
  14834. declare class Block<T extends AnyComponent = AnyComponent> {
  14835. id: string;
  14836. private readonly _container;
  14837. private readonly _component;
  14838. private _props;
  14839. private _children;
  14840. private parent?;
  14841. constructor(component: AnyComponent, props: Props<T>, options?: {
  14842. container?: HTMLElement;
  14843. ownerDocument?: Document;
  14844. });
  14845. private _setParent;
  14846. /**
  14847. * This getter returns the props of the block.
  14848. *
  14849. * ```tsx
  14850. * const block = new Block("div", { className: "test" });
  14851. *
  14852. * block.props; // { className: "test" }
  14853. * ```
  14854. */
  14855. get props(): PropsWithoutChildren<T>;
  14856. /**
  14857. * This setter sets the props of the block. This method will replace the
  14858. * existing props with the new props. Do not pass children in the props. Use
  14859. * the `children` setter instead.
  14860. *
  14861. * ```tsx
  14862. * const block = new Block("div", { className: "test" });
  14863. *
  14864. * block.props = { className: "test2" };
  14865. * ```
  14866. *
  14867. * @param props
  14868. */
  14869. set props(props: PropsWithoutChildren<T>);
  14870. /**
  14871. * This method will create a React element from the block and all of its
  14872. * children.
  14873. *
  14874. * ```ts
  14875. * const App = () => {
  14876. * const block = new Block("div", { className: "test" });
  14877. * return block.createComponent();
  14878. * // <div className="test" />
  14879. * };
  14880. * ```
  14881. *
  14882. * @param key The key to use for the component.
  14883. * @returns A React element.
  14884. */
  14885. createComponent(key?: Key$2): React__default.ReactElement;
  14886. /**
  14887. * This getter returns a list of the children of the block.
  14888. *
  14889. * ```ts
  14890. * const block = new Block("div", { className: "test" });
  14891. *
  14892. * block.children = ["test"];
  14893. * block.children; // ["test"]
  14894. * ```
  14895. */
  14896. get children(): Child[];
  14897. /**
  14898. * This setter sets the children of the block. This method will replace the
  14899. * existing children with the new children.
  14900. *
  14901. * ```ts
  14902. * const block = new Block("div", { className: "test" });
  14903. *
  14904. * block.children = ["test"];
  14905. * block.children; // ["test"]
  14906. * ```
  14907. *
  14908. * @param children The new children to use.
  14909. */
  14910. set children(children: Child[]);
  14911. /**
  14912. * Prepends children to the block. This method will prepend the children to
  14913. * the beginning of the existing children.
  14914. *
  14915. * ```ts
  14916. * const child1 = new Block("div", { className: "test1", data-block-id: "test1" });
  14917. * const child2 = new Block("div", { className: "test2", data-block-id: "test2" });
  14918. * const block = new Block("div", { className: "test", children: [
  14919. * child1,
  14920. * child2,
  14921. * ]});
  14922. *
  14923. * const child3 = new Block("div", { className: "test3", data-block-id: "test3" });
  14924. * block.prependChildren(child3);
  14925. * block.children; // [child3, child1, child2]
  14926. * ```
  14927. *
  14928. * @param children The children to prepend.
  14929. * @returns The Block instance.
  14930. */
  14931. prependChildren(...children: Child[]): this;
  14932. /**
  14933. * Appends children to the block. This method will append the children to the
  14934. * end of the existing children.
  14935. *
  14936. * ```ts
  14937. * const child1 = new Block("div", { className: "test1", data-block-id: "test1" });
  14938. * const child2 = new Block("div", { className: "test2", data-block-id: "test2" });
  14939. * const block = new Block("div", { className: "test", children: [
  14940. * child1,
  14941. * child2,
  14942. * ]});
  14943. *
  14944. * const child3 = new Block("div", { className: "test3", data-block-id: "test3" });
  14945. *
  14946. * block.appendChildren(child3);
  14947. * block.children; // [child1, child2, child3]
  14948. * ```
  14949. *
  14950. * @param children
  14951. * @returns The Block instance.
  14952. */
  14953. appendChildren(...children: Child[]): this;
  14954. /**
  14955. * This method will search the entire tree of children and then inserts
  14956. * children after the child with the given id. This method will insert the
  14957. * children after the first child with the given id. If the child is not
  14958. * found, the children will not be inserted.
  14959. *
  14960. * ```ts
  14961. * const child1 = new Block("div", { className: "test1", data-block-id: "test1" });
  14962. * const child2 = new Block("div", { className: "test2", data-block-id: "test2" });
  14963. *
  14964. * const block = new Block("div", { className: "test", children: [
  14965. * child1,
  14966. * child2,
  14967. * ]});
  14968. *
  14969. * const child3 = new Block("div", { className: "test3", data-block-id: "test3" });
  14970. * block.insertAfter(child2.id, child3);
  14971. * block.children; // [child1, child2, child3]
  14972. * ```
  14973. *
  14974. * @param block The id of the child block or the block to insert the children
  14975. * after.
  14976. * @param children The children to insert.
  14977. * @returns The Block instance.
  14978. */
  14979. insertBefore(block: string | Block, ...children: Child[]): this;
  14980. /**
  14981. * This method will search the entire tree of children and then inserts
  14982. * children after the child with the given id. This method will insert the
  14983. * children after the first child with the given id. If the child is not
  14984. * found, the children will not be inserted.
  14985. *
  14986. * ```ts
  14987. * const child1 = new Block("div", { className: "test1", data-block-id: "test1" });
  14988. * const child2 = new Block("div", { className: "test2", data-block-id: "test2" });
  14989. * const block = new Block("div", { className: "test", children: [child1, child2] });
  14990. *
  14991. * const child3 = new Block("div", { className: "test3", data-block-id: "test3" });
  14992. *
  14993. * block.insertAfter(child1.id, child3);
  14994. * block.children; // [child1, child3, child2]
  14995. * ```
  14996. *
  14997. * @param block
  14998. * @param children The children to insert.
  14999. * @returns The Block instance.
  15000. */
  15001. insertAfter(block: string | Block, ...children: Child[]): this;
  15002. /**
  15003. * This method will search the entire tree of children and then replaces the
  15004. * child with the given id with the new children. This method will replace the
  15005. * first child with the given id. If the child is not found, the children will
  15006. * not be inserted.
  15007. *
  15008. * ```ts
  15009. * const child1 = new Block("div", { className: "test1", data-block-id: "test1" });
  15010. * const child2 = new Block("div", { className: "test2", data-block-id: "test2" });
  15011. * const block = new Block("div", { className: "test", children: [child1, child2] });
  15012. *
  15013. * const child3 = new Block("div", { className: "test3", data-block-id: "test3" });
  15014. *
  15015. * block.replace(child1.id, child3);
  15016. * block.children; // [child3, child2]
  15017. * ```
  15018. *
  15019. * @param block The id of the child block or the block to replace.
  15020. * @param children The children to insert.
  15021. * @returns The Block instance.
  15022. */
  15023. replace(block: string | Block, ...children: Child[]): this;
  15024. /**
  15025. * Finds a child block by its id. This method will search the entire tree of
  15026. * children. If the child is not found, undefined is returned.
  15027. *
  15028. * ```ts
  15029. * const child1 = new Block("div", {
  15030. * className: "test1",
  15031. * "data-block-id": "test1",
  15032. * });
  15033. * const child2 = new Block("div", {
  15034. * className: "test2",
  15035. * "data-block-id": "test2",
  15036. * });
  15037. * const block = new Block("div", { className: "test" }, child1, child2);
  15038. *
  15039. * block.getBlockById(child2.id); // child2
  15040. * ```
  15041. *
  15042. * @param id The id of the child to find.
  15043. * @returns The child block or undefined.
  15044. */
  15045. getBlockById<T extends AnyComponent>(id: string): Block<T> | undefined;
  15046. /**
  15047. * Finds the blocks by the component. This method will search the entire tree
  15048. * of children. If the child is not found, undefined is returned.
  15049. *
  15050. * ```ts
  15051. * const child1 = new Block("div", {
  15052. * className: "test1",
  15053. * "data-block-id": "test1",
  15054. * });
  15055. * const child2 = new Block("div", {
  15056. * className: "test2",
  15057. * "data-block-id": "test2",
  15058. * });
  15059. * const slider = new Block(Slider, {
  15060. * className: "test",
  15061. * "data-block-id": "test",
  15062. * });
  15063. *
  15064. * const block = new Block(
  15065. * "div",
  15066. * { className: "test" },
  15067. * child1,
  15068. * child2,
  15069. * slider,
  15070. * );
  15071. *
  15072. * block.getBlocksByComponent(Slider); // [slider]
  15073. * ```
  15074. *
  15075. * @param component
  15076. * @returns An array of blocks.
  15077. */
  15078. getBlocksByComponent<T extends AnyComponent>(component: T): Block<T>[];
  15079. private _getChild;
  15080. private _removeChild;
  15081. /**
  15082. * Removes a child block by its id. This method will search the entire tree of
  15083. * children. If the child is not found, undefined is returned.
  15084. *
  15085. * ```ts
  15086. * const child1 = new Block("div", { className: "test1", data-block-id: "test1" });
  15087. * const child2 = new Block("div", { className: "test2", data-block-id: "test2" });
  15088. *
  15089. * const block = new Block("div", { className: "test", children: [child1, child2] });
  15090. *
  15091. * block.removeChildById(child2.id);
  15092. * block.children; // [child1]
  15093. * ```
  15094. *
  15095. * @param id
  15096. */
  15097. removeChildById(id: string): void;
  15098. /**
  15099. * Returns a DOM Node that can be added directly to the DOM. This method will
  15100. * create a DOM Node from the block and all of its children.
  15101. */
  15102. createDOMNode(container?: HTMLElement): HTMLElement;
  15103. /**
  15104. * This method will merge the props of the block with the new props.
  15105. *
  15106. * ```ts
  15107. * const block = new Block("div", { className: "test", id: "testid" });
  15108. *
  15109. * block.mergeProps({ className: "test2" });
  15110. * block.props; // { className: "test2", id: "testid" }
  15111. * ```
  15112. *
  15113. * @param props The new props to use.
  15114. * @returns The Block instance.
  15115. */
  15116. mergeProps(props: Partial<Props<T>>): this;
  15117. /**
  15118. * Sets a single prop on the component. This method will not re-render the
  15119. * component.
  15120. *
  15121. * ```ts
  15122. * const block = new Block("div", { className: "test", id: "testid" });
  15123. *
  15124. * block.setProp("className", "test2");
  15125. * block.props; // { className: "test2", id: "testid" }
  15126. * ```
  15127. *
  15128. * @param key
  15129. * @param value
  15130. * @returns The Block instance.
  15131. */
  15132. setProp<U extends keyof Props<T>>(key: U, value: Props<T>[U]): this;
  15133. /**
  15134. * This method will return a JSON representation of the block and all of its
  15135. * children.
  15136. */
  15137. toJS(): IJSON;
  15138. }
  15139. interface IJSON {
  15140. id?: string;
  15141. component: string;
  15142. props: IRecord$1;
  15143. children: (IJSON | {
  15144. value: string | number | ((...args: Any$1[]) => React__default.ReactElement);
  15145. })[];
  15146. }
  15147. declare type Any = any;
  15148. interface BlockId {
  15149. "data-block-id"?: string;
  15150. }
  15151. /**
  15152. * Creates a new Block instance.
  15153. *
  15154. * @param component The component to render.
  15155. * @param props The props to pass to the component.
  15156. * @param children
  15157. */
  15158. declare function createBlock<T extends keyof React__default.ReactHTML>(component: T, props?: Omit<React__default.ComponentPropsWithRef<T>, "children"> & BlockId, ...children: Child[]): Block<T>;
  15159. declare function createBlock<T extends React__default.ForwardRefExoticComponent<Any>>(component: T, props?: Omit<React__default.ComponentPropsWithRef<T>, "children"> & BlockId, ...children: Child[]): Block<T>;
  15160. declare function createBlock<T extends (...args: Any[]) => Any>(component: T, props?: Omit<Parameters<T>[0], "children"> & BlockId, ...children: Child[]): Block<T>;
  15161. declare type Messages = {
  15162. action: string;
  15163. addLink: string;
  15164. addSignature: string;
  15165. anonymous: string;
  15166. backgroundColor: string;
  15167. black: string;
  15168. blue: string;
  15169. bold: string;
  15170. cancel: string;
  15171. chat: string;
  15172. chooseColor: string;
  15173. clearSignature: string;
  15174. close: string;
  15175. color: string;
  15176. comment: string;
  15177. commentAction: string;
  15178. commentEditorLabel: string;
  15179. commentOptions: string;
  15180. comments: string;
  15181. commentsCount: string;
  15182. commentThread: string;
  15183. copy: string;
  15184. createStamp: string;
  15185. customStamp: string;
  15186. cut: string;
  15187. darkBlue: string;
  15188. date: string;
  15189. delete: string;
  15190. deleteComment: string;
  15191. deleteCommentConfirmMessage: string;
  15192. discardChanges: string;
  15193. done: string;
  15194. draw: string;
  15195. edit: string;
  15196. editContent: string;
  15197. editLink: string;
  15198. fontColor: string;
  15199. fonts: string;
  15200. help: string;
  15201. image: string;
  15202. italic: string;
  15203. linkAnnotation: string;
  15204. loading: string;
  15205. nMoreComments: string;
  15206. openHelpDialog: string;
  15207. paste: string;
  15208. pause: string;
  15209. play: string;
  15210. preview: string;
  15211. readMore: string;
  15212. redo: string;
  15213. removeLink: string;
  15214. save: string;
  15215. saveSignature: string;
  15216. selectAll: string;
  15217. selectDragImage: string;
  15218. shortcut: string;
  15219. showMore: string;
  15220. signature: string;
  15221. signatures: string;
  15222. signHere: string;
  15223. stampAnnotationTemplatesDialog: string;
  15224. stampText: string;
  15225. storeSignature: string;
  15226. time: string;
  15227. toolbarFocus: string;
  15228. type: string;
  15229. typeSomething: string;
  15230. underline: string;
  15231. undo: string;
  15232. useAnExistingStampDesign: string;
  15233. viewMoreResults: string;
  15234. };
  15235. interface SignatureTextInputProps extends StylingProps, Omit<AriaTextFieldOptions<"input">, "isRequired" | "isReadOnly" | "inputElementType" | "validationState" | "isInvalid" | "description" | "errorMessage" | keyof AriaLabelingProps$1> {
  15236. /** The style object to apply to the input element. */
  15237. inputStyle?: React__default.CSSProperties;
  15238. /** The class name to apply to the input element. */
  15239. inputClassName?: string;
  15240. /** The clear button label. */
  15241. clearLabel: string;
  15242. /**
  15243. * Whether the input is inline. This affects the styling of the input.
  15244. *
  15245. * @default true
  15246. */
  15247. isInline?: boolean;
  15248. /** The label for the input. */
  15249. label: string;
  15250. /** The class name to apply to the footer element. */
  15251. footerClassName?: string;
  15252. /** The style object to apply to the footer element. */
  15253. footerStyle?: React__default.CSSProperties;
  15254. }
  15255. declare const SignatureTextInput: React__default.ForwardRefExoticComponent<SignatureTextInputProps & React__default.RefAttributes<HTMLDivElement>>;
  15256. interface DevtoolsProps extends StylingProps {
  15257. /** The children to render. */
  15258. children: React__default.ReactNode;
  15259. /**
  15260. * The stating string for the class name.
  15261. *
  15262. * @default "BaselineUI"
  15263. */
  15264. classStartsWith?: string;
  15265. }
  15266. declare const Devtools: React__default.ForwardRefExoticComponent<DevtoolsProps & React__default.RefAttributes<HTMLDivElement>>;
  15267. interface StampProps extends StylingProps, AriaLabelingProps$1 {
  15268. /** The height of the stamp. */
  15269. height?: number;
  15270. /** The minimum width of the stamp. */
  15271. minWidth?: number;
  15272. /** The maximum width of the stamp. */
  15273. maxWidth?: number;
  15274. /** The width of the stamp's stroke. */
  15275. strokeWidth?: number;
  15276. /** The color of the stamp's stroke. */
  15277. strokeColor?: string;
  15278. /** The fill color of the stamp. */
  15279. fillColor?: string;
  15280. /** The color of the stamp's font. */
  15281. fontColor?: string;
  15282. /** The font family of the stamp. */
  15283. fontFamily?: string;
  15284. /** The description of the stamp. This is displayed below the `text`. */
  15285. subText?: string;
  15286. /**
  15287. * The main text of the stamp. This is displayed at the center of the stamp if
  15288. * no `subText` is provided. Otherwise, it is displayed above the `subText`.
  15289. */
  15290. text?: string;
  15291. /**
  15292. * The label of the stamp. This is used as the title of the SVG element. It is
  15293. * not visible to the user.
  15294. */
  15295. label?: string | React__default.ReactNode;
  15296. /**
  15297. * The callback function that is called when the dimensions of the stamp
  15298. * change.
  15299. */
  15300. onDimensionsChange?: (dimensions: {
  15301. width: number;
  15302. height: number;
  15303. }) => void;
  15304. }
  15305. declare const Stamp: React__default.ForwardRefExoticComponent<StampProps & React__default.RefAttributes<SVGSVGElement>>;
  15306. interface CommentProps extends StylingProps {
  15307. /**
  15308. * The list of reactions to show in the comment. If this is not provided, the
  15309. * reactions will not be shown.
  15310. */
  15311. reactions?: ReactionProps[];
  15312. /** The name shown in the comment header. */
  15313. name?: React__default.ReactNode;
  15314. /**
  15315. * The description shown in the comment header. This can be a string or a
  15316. * React node.
  15317. */
  15318. description?: React__default.ReactNode;
  15319. /** The content of the comment. This can be a string or a React node. */
  15320. content: React__default.ReactNode;
  15321. /**
  15322. * The type of the content string. If this is set to "html", the content will
  15323. * be rendered as HTML. If this is set to "plain", the content will be
  15324. * rendered as plain text. This prop is only used when the `content` prop is a
  15325. * string.
  15326. *
  15327. * @default "plain"
  15328. */
  15329. contentStringType?: "plain" | "html";
  15330. /**
  15331. * Indicates whether the element is displayed inline.
  15332. *
  15333. * @default true
  15334. */
  15335. isInline?: boolean;
  15336. /**
  15337. * The avatar properties to be passed to the `Avatar` component. If this is
  15338. * not provided, the avatar will not be shown.
  15339. */
  15340. avatarProps?: Omit<AvatarProps, "size">;
  15341. /**
  15342. * The `aria-label` property assigned to the menu trigger element of the
  15343. * component.
  15344. */
  15345. menuProps?: MenuProps;
  15346. /**
  15347. * The `children` property is an optional prop that accepts a JSX element or
  15348. * an array of JSX elements. The children is displayed at the bottom of the
  15349. * comment.
  15350. */
  15351. children?: React__default.ReactNode;
  15352. /** Represents the unique identifier of a comment in the data. */
  15353. "data-comment-id"?: string;
  15354. }
  15355. declare const Comment: React__default.ForwardRefExoticComponent<CommentProps & React__default.RefAttributes<HTMLDivElement>>;
  15356. declare const App_Comment: typeof Comment;
  15357. type App_CommentProps = CommentProps;
  15358. declare const App_Devtools: typeof Devtools;
  15359. type App_DevtoolsProps = DevtoolsProps;
  15360. declare const App_SignatureTextInput: typeof SignatureTextInput;
  15361. type App_SignatureTextInputProps = SignatureTextInputProps;
  15362. declare const App_Stamp: typeof Stamp;
  15363. type App_StampProps = StampProps;
  15364. declare namespace App {
  15365. 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 };
  15366. }
  15367. /*
  15368. * Copyright 2020 Adobe. All rights reserved.
  15369. * This file is licensed to you under the Apache License, Version 2.0 (the "License");
  15370. * you may not use this file except in compliance with the License. You may obtain a copy
  15371. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  15372. *
  15373. * Unless required by applicable law or agreed to in writing, software distributed under
  15374. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
  15375. * OF ANY KIND, either express or implied. See the License for the specific language
  15376. * governing permissions and limitations under the License.
  15377. */
  15378. interface AriaLabelingProps {
  15379. /**
  15380. * Defines a string value that labels the current element.
  15381. */
  15382. 'aria-label'?: string,
  15383. /**
  15384. * Identifies the element (or elements) that labels the current element.
  15385. */
  15386. 'aria-labelledby'?: string,
  15387. /**
  15388. * Identifies the element (or elements) that describes the object.
  15389. */
  15390. 'aria-describedby'?: string,
  15391. /**
  15392. * Identifies the element (or elements) that provide a detailed, extended description for the object.
  15393. */
  15394. 'aria-details'?: string
  15395. }
  15396. interface State<T> {
  15397. get: <K extends keyof T>(key: K) => T[K];
  15398. set: <K extends keyof T>(key: K, value: T[K]) => void;
  15399. toJS: () => T;
  15400. }
  15401. interface RecipeResult<T> {
  15402. intl: I18nResult<Messages>;
  15403. state: State<T>;
  15404. device: "mobile" | "tablet" | "desktop";
  15405. }
  15406. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  15407. type IRecord = Record<string, any>;
  15408. interface BaseChildrenArgs<T = Record<string, never>>
  15409. extends RecipeResult<T> {
  15410. /** The block component that can be modified */
  15411. ui: Block;
  15412. /** The ref of the block component */
  15413. ref: ForwardedRef<HTMLDivElement>;
  15414. }
  15415. interface BaseRecipeProps<
  15416. State extends IRecord,
  15417. ChildArgs extends IRecord,
  15418. > {
  15419. /**
  15420. * The initial state of the component. This is useful for controlling the
  15421. * component.
  15422. */
  15423. initialState?: Partial<State>;
  15424. /**
  15425. * The state of the component. This is useful for controlling the component.
  15426. * If this is provided, the property with non-defined values will be
  15427. * controlled.
  15428. */
  15429. state?: Partial<State>;
  15430. /** The function that is called when the state of the component changes. */
  15431. onStateChange?: (changes: Partial<State>) => void;
  15432. /** Optional prop for rendering child components. */
  15433. children?: (props: ChildArgs) => React__default.ReactElement;
  15434. }
  15435. interface SharedProps$5 extends StylingProps {
  15436. /**
  15437. * The items to display in the list. Each item can be an image, svg, or text.
  15438. * Each item must have a unique id. The signature list will display the items
  15439. * in the order they are provided.
  15440. */
  15441. items: (PreviewProps & {
  15442. id: Key$2;
  15443. })[];
  15444. /**
  15445. * Callback fired when the user clicks the button to add a signature to the
  15446. * list.
  15447. */
  15448. onAdd?: () => void;
  15449. /**
  15450. * Callback fired when the user clicks the add button on a preview. The delete
  15451. * button is only displayed when this callback is provided.
  15452. *
  15453. * @param id
  15454. */
  15455. onAddFromPreview?: (id: Key$2) => void;
  15456. /**
  15457. * Callback fired when the user clicks the remove button on a preview.
  15458. *
  15459. * @param id
  15460. */
  15461. onRemoveFromPreview?: (id: Key$2) => void;
  15462. /** Callback fired when the user clicks the cancel button. */
  15463. onCancel?: () => void;
  15464. /** The id of the title element. */
  15465. titleId?: string;
  15466. /**
  15467. * The variant of the component. This changes the styling of the component.
  15468. *
  15469. * @default "wide"
  15470. */
  15471. variant?: "wide" | "narrow";
  15472. }
  15473. declare type ChildrenArgs$5 = SharedProps$5 & BaseChildrenArgs<IRecord>;
  15474. interface SignaturesListProps extends SharedProps$5, BaseRecipeProps<IRecord, ChildrenArgs$5> {
  15475. }
  15476. declare enum CREATE_SIGNATURE_ALLOWED_TABS {
  15477. DRAW = "DRAW",
  15478. TYPE = "TYPE",
  15479. IMAGE = "IMAGE"
  15480. }
  15481. interface InternalState$3 extends IRecord {
  15482. /**
  15483. * The color of an object. This is a hex value that is applied to the points
  15484. * in `FreehandCanvas` or `SignatureTextInput`
  15485. */
  15486. color: string;
  15487. /**
  15488. * The image that is uploaded. This is a `File` object that is uploaded to the
  15489. * in the Image tab.
  15490. */
  15491. image?: File;
  15492. /**
  15493. * The ink variable represents the ink that is drawn on the canvas. The ink is
  15494. * represented as an array of arrays of points. Each point is represented as
  15495. * an array of two numbers, the x and y coordinates of the point.
  15496. */
  15497. ink?: number[][][];
  15498. /**
  15499. * The text variable represents the text that is input in the text input. The
  15500. * text is represented as a string.
  15501. */
  15502. text?: string;
  15503. /**
  15504. * The current tab that is selected. The tab can be one of the following
  15505. * values: "DRAW", "TYPE", or "IMAGE".
  15506. */
  15507. currentTab: keyof typeof CREATE_SIGNATURE_ALLOWED_TABS;
  15508. /**
  15509. * The selectedFont variable represents the currently selected font for text
  15510. * input.
  15511. */
  15512. selectedFont: string;
  15513. /**
  15514. * Indicates whether the signature should be stored or not.
  15515. *
  15516. * @default false
  15517. */
  15518. shouldStoreSignature: boolean;
  15519. }
  15520. interface SharedProps$4 extends StylingProps {
  15521. /**
  15522. * Indicates whether it is possible to store the signature or not.
  15523. *
  15524. * @default true
  15525. */
  15526. allowStoringSignature?: boolean;
  15527. /**
  15528. * An array of color presets. If not provided, the default color presets will
  15529. * be used.
  15530. *
  15531. * ```js
  15532. * [
  15533. * { color: "#000000", label: "Black" },
  15534. * { color: "#2293fb", label: "Blue" },
  15535. * { color: "#4636e3", label: "Dark Blue" },
  15536. * ];
  15537. * ```
  15538. */
  15539. colorPresets: ColorPreset$1[];
  15540. /**
  15541. * The tabs that should be shown in the signature dialog. The tabs are
  15542. * represented as a string of the tab names. The following tabs are available:
  15543. * "DRAW", "TYPE", and "IMAGE".
  15544. *
  15545. * @default ["DRAW", "TYPE", "IMAGE"]
  15546. */
  15547. allowedTabs?: (keyof typeof CREATE_SIGNATURE_ALLOWED_TABS)[];
  15548. /**
  15549. * An array of font names. Make sure those fonts are available in the
  15550. * application. The names should be the same as the ones used in the
  15551. * application.
  15552. */
  15553. fonts: string[];
  15554. /** The title ID of the component. This is used for accessibility purposes. */
  15555. titleId?: string;
  15556. /** Callback function that is called when a close event is triggered. */
  15557. onCloseRequest: () => void;
  15558. /** Callback function that is called when a signature is added. */
  15559. onAdd: (state: Omit<InternalState$3, "image" | "text" | "ink"> & {
  15560. canvasSize: {
  15561. height: number;
  15562. width: number;
  15563. } | undefined;
  15564. signature?: {
  15565. type: CREATE_SIGNATURE_ALLOWED_TABS.TYPE;
  15566. value?: string;
  15567. } | {
  15568. type: CREATE_SIGNATURE_ALLOWED_TABS.DRAW;
  15569. value?: number[][][];
  15570. } | {
  15571. type: CREATE_SIGNATURE_ALLOWED_TABS.IMAGE;
  15572. value?: File;
  15573. };
  15574. }) => void;
  15575. /**
  15576. * The variant of the variable.
  15577. *
  15578. * @typedef {"narrow" | "wide"} Variant
  15579. */
  15580. variant?: "narrow" | "wide";
  15581. }
  15582. interface ChildrenArgs$4 extends SharedProps$4, BaseChildrenArgs<InternalState$3> {
  15583. }
  15584. interface CreateSignatureProps extends SharedProps$4, BaseRecipeProps<InternalState$3, ChildrenArgs$4> {
  15585. }
  15586. interface InternalState$2 extends IRecord {
  15587. text?: string;
  15588. includeDate: boolean;
  15589. includeTime: boolean;
  15590. color: string;
  15591. }
  15592. interface SharedProps$3 extends StylingProps {
  15593. /**
  15594. * The `id` of the title of the component. This is useful for accessibility
  15595. * when the component is used in a dialog.
  15596. */
  15597. titleId?: string;
  15598. /** Callback function that is called when a close event is triggered. */
  15599. onCloseRequest?: () => void;
  15600. /**
  15601. * Callback function that is called when a stamp is added.
  15602. *
  15603. * @param options
  15604. */
  15605. onCreate: (options: {
  15606. text?: string;
  15607. subText?: string;
  15608. color: string;
  15609. width: number;
  15610. }) => void;
  15611. /** An optional array of color presets. */
  15612. colorPresets: {
  15613. color: string;
  15614. label: string;
  15615. }[];
  15616. /**
  15617. * An optional function that returns a lighter variant of the color provided.
  15618. * By default, the color is lightened by 80%.
  15619. *
  15620. * @param color
  15621. */
  15622. getLighterVariant?: (color: string) => string;
  15623. /**
  15624. * A callback function that is called when the user clicks on the "Use
  15625. * existing stamp" button.
  15626. */
  15627. onExistingStampPress?: () => void;
  15628. }
  15629. declare type ChildrenArgs$3 = SharedProps$3 & BaseChildrenArgs<InternalState$2>;
  15630. interface CreateStampProps extends SharedProps$3, BaseRecipeProps<InternalState$2, ChildrenArgs$3> {
  15631. }
  15632. interface InternalState$1 extends IRecord {
  15633. }
  15634. interface SharedProps$2 extends StylingProps, Omit<SignaturesListProps, "children" | "onRemoveFromPreview" | "variant" | "initialState" | "onAddFromPreview" | "disabledActions" | "onAdd"> {
  15635. /**
  15636. * Callback fired when the user clicks the preview
  15637. *
  15638. * @param id
  15639. */
  15640. onAdd?: (id: Key$2) => void;
  15641. /** Callback fired when the user clicks the custom stamp button */
  15642. onCustomStampPress?: () => void;
  15643. }
  15644. declare type ChildrenArgs$2 = SharedProps$2 & BaseChildrenArgs<InternalState$1>;
  15645. interface StampsListProps extends SharedProps$2, BaseRecipeProps<InternalState$1, ChildrenArgs$2> {
  15646. }
  15647. declare const MessageType: {
  15648. readonly PLAIN: "PLAIN";
  15649. readonly ACTIONS: "ACTIONS";
  15650. readonly ERROR: "ERROR";
  15651. readonly SUGGESTIONS: "SUGGESTIONS";
  15652. readonly ADDITIONAL_CONTEXT: "ADDITIONAL_CONTEXT";
  15653. readonly QUERY_RESULT: "QUERY_RESULT";
  15654. };
  15655. interface MessageAction {
  15656. text: string;
  15657. onPress: () => void;
  15658. }
  15659. interface ErrorMessageType {
  15660. title: string;
  15661. description: string;
  15662. action?: MessageAction;
  15663. }
  15664. interface LinkAction {
  15665. text: string;
  15666. onPress: () => void;
  15667. }
  15668. interface Suggestion {
  15669. text: string;
  15670. onPress: () => void;
  15671. }
  15672. interface IBaseMessage {
  15673. id: string;
  15674. type: keyof typeof MessageType;
  15675. text: string;
  15676. sender: string;
  15677. isComplete: boolean;
  15678. canCopy?: boolean;
  15679. }
  15680. interface PlainMessage extends IBaseMessage {
  15681. type: typeof MessageType.PLAIN;
  15682. }
  15683. interface MessageWithActions extends IBaseMessage {
  15684. type: typeof MessageType.ACTIONS;
  15685. actions: MessageAction[];
  15686. }
  15687. interface MessageWithError extends IBaseMessage {
  15688. type: typeof MessageType.ERROR;
  15689. error: ErrorMessageType;
  15690. }
  15691. interface MessageWithSuggestions extends IBaseMessage {
  15692. type: typeof MessageType.SUGGESTIONS;
  15693. suggestions: Suggestion[];
  15694. }
  15695. interface MessageWithAdditionalContext extends IBaseMessage {
  15696. type: typeof MessageType.ADDITIONAL_CONTEXT;
  15697. additionalContext: string;
  15698. actions: MessageAction[];
  15699. linkToAdditionalContext: LinkAction;
  15700. }
  15701. interface MessageWithQueryResult extends IBaseMessage {
  15702. type: typeof MessageType.QUERY_RESULT;
  15703. links: LinkAction[];
  15704. actionsText: string;
  15705. actions: MessageAction[];
  15706. }
  15707. declare type Message = PlainMessage | MessageWithActions | MessageWithError | MessageWithSuggestions | MessageWithAdditionalContext | MessageWithQueryResult;
  15708. interface SharedProps$1 extends StylingProps {
  15709. /** Callback function that is called when a message is submitted. */
  15710. onMessageSubmit: (message: string) => void;
  15711. /** Callback function that is called when input value changes. */
  15712. onInputChanged: (value: string) => void;
  15713. /** The list of messages to show in the chat window. */
  15714. messages: Message[];
  15715. /**
  15716. * Variant of the dialog
  15717. *
  15718. * @default "default"
  15719. */
  15720. variant?: "default" | "full-width";
  15721. /** Whether to show the loading indicator */
  15722. isLoading?: boolean;
  15723. /** Whether to disable the content */
  15724. isDisabled?: boolean;
  15725. /** Whether to disable message submitting */
  15726. isSubmitDisabled?: boolean;
  15727. /** The value of the input field */
  15728. inputValue?: string;
  15729. /** The title ID of the component. This is used for accessibility purposes. */
  15730. titleId?: string;
  15731. /** The imperative handle for manipulating editor. */
  15732. editorHandle?: React__default.RefObject<EditorHandle>;
  15733. }
  15734. declare type ChildrenArgs$1 = SharedProps$1 & BaseChildrenArgs<IRecord>;
  15735. interface ChatDialogProps extends SharedProps$1, BaseRecipeProps<IRecord, ChildrenArgs$1> {
  15736. }
  15737. interface InternalState extends IRecord {
  15738. isExpanded: boolean;
  15739. toDelete: string | null;
  15740. }
  15741. interface SharedProps extends StylingProps, AriaLabelingProps, Pick<EditorProps, "mentionableUsers" | "maxMentionableUsersSuggestions">, Pick<PopoverContentProps, "portalContainer">, Pick<AriaButtonProps, "onPress"> {
  15742. /**
  15743. * The comments to display in the thread. Each comment should have a unique
  15744. * `commentId`.
  15745. */
  15746. comments: (Omit<CommentProps, "data-comment-id" | "menuProps" | "children" | "isInline" | "reactions"> & {
  15747. id: string;
  15748. canDelete?: boolean;
  15749. canEdit?: boolean;
  15750. canBeAnonymous?: boolean;
  15751. isAnonymous?: boolean;
  15752. content?: string;
  15753. })[];
  15754. /** The title of the thread. This is used for accessibility purposes. */
  15755. titleId?: string;
  15756. /** A callback function that is triggered when the editor value changes. */
  15757. onEditorValueChange?: (value: string, id?: string) => void;
  15758. /**
  15759. * The variant of a component specifying its appearance.
  15760. *
  15761. * @default "sidebar"
  15762. */
  15763. variant?: "sidebar" | "popover";
  15764. /** A callback function that is triggered when a comment is added. */
  15765. onCommentAdd?: (content: string) => void;
  15766. /**
  15767. * A callback function that is triggered when a comment is updated. The
  15768. * function receives the `commentId` and the new `content` as arguments.
  15769. */
  15770. onCommentUpdate?: (id: string, content: string) => void;
  15771. /**
  15772. * A callback function that is triggered when a comment is deleted. The
  15773. * function receives the `commentId` as an argument.
  15774. */
  15775. onDelete?: (id: string) => void;
  15776. /** Callback function triggered when the anonymous toggle is changed. */
  15777. onAnonymousToggle?: (id: string, value: boolean) => void;
  15778. /**
  15779. * An array of buttons to display in the editor footer. Each button should
  15780. * have an `aria-label`, an `icon`, and an `onPress` callback.
  15781. */
  15782. editorFooterButtons?: EditorProps["footerButtons"];
  15783. /**
  15784. * Whether to allow the creation of new comments. If set to `false`, the
  15785. * editor will be hidden.
  15786. *
  15787. * @default true
  15788. */
  15789. allowCommentCreation?: boolean;
  15790. /** The default value for the editor. This is used when creating a new comment. */
  15791. defaultEditorValue?: string;
  15792. }
  15793. declare type ChildrenArgs = SharedProps & BaseChildrenArgs<InternalState>;
  15794. interface CommentThreadProps extends SharedProps, BaseRecipeProps<InternalState, ChildrenArgs> {
  15795. }
  15796. declare const Recipes: {
  15797. readonly SignaturesList: React.ForwardRefExoticComponent<SignaturesListProps & React.RefAttributes<HTMLDivElement>>;
  15798. readonly CreateSignature: React.ForwardRefExoticComponent<CreateSignatureProps & React.RefAttributes<HTMLDivElement>>;
  15799. readonly StampsList: React.ForwardRefExoticComponent<StampsListProps & React.RefAttributes<HTMLDivElement>>;
  15800. readonly CreateStamp: React.ForwardRefExoticComponent<CreateStampProps & React.RefAttributes<HTMLDivElement>>;
  15801. readonly ChatDialog: React.ForwardRefExoticComponent<ChatDialogProps & React.RefAttributes<HTMLDivElement>>;
  15802. readonly CommentThread: React.ForwardRefExoticComponent<CommentThreadProps & React.RefAttributes<HTMLDivElement>>;
  15803. };
  15804. type InterfacesType = {
  15805. [K in keyof typeof Recipes]: K;
  15806. };
  15807. declare const Interfaces: InterfacesType;
  15808. type UI = {
  15809. [K in keyof typeof Interfaces]: (options: {
  15810. props: React__default.ComponentProps<(typeof Recipes)[K]>;
  15811. instance: Instance | null;
  15812. }) => {
  15813. content?: React__default.ReactElement | Node | null;
  15814. decorator?: (props: any) => React__default.ReactElement | Node | null;
  15815. };
  15816. };
  15817. type documentEditorUIConfig = {
  15818. thumbnailMinSize: number;
  15819. thumbnailMaxSize: number;
  15820. thumbnailDefaultSize: number;
  15821. };
  15822. declare const AutoSaveMode: {
  15823. readonly IMMEDIATE: "IMMEDIATE";
  15824. readonly INTELLIGENT: "INTELLIGENT";
  15825. readonly DISABLED: "DISABLED";
  15826. };
  15827. type IAutoSaveMode = (typeof AutoSaveMode)[keyof typeof AutoSaveMode];
  15828. declare const PrintQuality: {
  15829. readonly LOW: "LOW";
  15830. readonly MEDIUM: "MEDIUM";
  15831. readonly HIGH: "HIGH";
  15832. };
  15833. type IPrintQuality = (typeof PrintQuality)[keyof typeof PrintQuality];
  15834. declare const ToolbarPlacement: {
  15835. readonly TOP: "TOP";
  15836. readonly BOTTOM: "BOTTOM";
  15837. };
  15838. type IToolbarPlacement = (typeof ToolbarPlacement)[keyof typeof ToolbarPlacement];
  15839. declare const ModificationType: {
  15840. readonly CREATED: "CREATED";
  15841. readonly UPDATED: "UPDATED";
  15842. readonly DELETED: "DELETED";
  15843. };
  15844. type IModificationType = (typeof ModificationType)[keyof typeof ModificationType];
  15845. type SaveErrorReason = {
  15846. error: any;
  15847. object: any;
  15848. modificationType: IModificationType;
  15849. };
  15850. declare function PSPDFKitSaveError(messageOrError: string | Error, reason: Array<SaveErrorReason>): Error;
  15851. declare namespace PSPDFKitSaveError {
  15852. var prototype: any;
  15853. }
  15854. type AnnotationTooltipCallback = (annotation: AnnotationsUnion) => Array<ToolItem>;
  15855. declare const FormFieldValue_base: Record$1.Factory<{
  15856. name?: string | undefined;
  15857. value?: string | number | List<string> | null | undefined;
  15858. optionIndexes?: List<number> | undefined;
  15859. isFitting?: boolean | undefined;
  15860. }>;
  15861. declare class FormFieldValue extends FormFieldValue_base {
  15862. name: string;
  15863. value: string | List<string> | null;
  15864. optionIndexes?: List<number>;
  15865. isFitting?: boolean;
  15866. static defaultValues: IObject$1;
  15867. constructor(args?: IObject$1);
  15868. }
  15869. type RenderPageCallback = (context: CanvasRenderingContext2D, pageIndex: number, pageSize: Size) => unknown;
  15870. type ColorPreset = {
  15871. color: Color$2 | null;
  15872. localization: {
  15873. id: string;
  15874. defaultMessage?: string;
  15875. description?: string;
  15876. };
  15877. };
  15878. type FontCallback = (arg0: string) => Promise<Blob>;
  15879. interface IFont {
  15880. name: string | null;
  15881. callback: FontCallback | null;
  15882. }
  15883. declare const Font_base: Record$1.Factory<IFont>;
  15884. declare class Font extends Font_base {
  15885. constructor(args: {
  15886. name: string;
  15887. callback?: FontCallback;
  15888. });
  15889. }
  15890. declare const ElectronicSignatureCreationMode: {
  15891. readonly DRAW: "DRAW";
  15892. readonly IMAGE: "IMAGE";
  15893. readonly TYPE: "TYPE";
  15894. };
  15895. type IElectronicSignatureCreationMode = (typeof ElectronicSignatureCreationMode)[keyof typeof ElectronicSignatureCreationMode];
  15896. type OnOpenUriCallback = (uri: string, isUserInitiated: boolean) => boolean;
  15897. declare const UIDateTimeElement: {
  15898. readonly COMMENT_THREAD: "COMMENT_THREAD";
  15899. readonly ANNOTATIONS_SIDEBAR: "ANNOTATIONS_SIDEBAR";
  15900. };
  15901. type IUIDateTimeElement = (typeof UIDateTimeElement)[keyof typeof UIDateTimeElement];
  15902. type DateTimeStringCallback = (args: {
  15903. dateTime: Date;
  15904. element: IUIDateTimeElement;
  15905. object: AnnotationsUnion | Comment$1;
  15906. }) => string;
  15907. declare const InkEraserMode: {
  15908. readonly POINT: "POINT";
  15909. readonly STROKE: "STROKE";
  15910. };
  15911. type IInkEraserMode = (typeof InkEraserMode)[keyof typeof InkEraserMode];
  15912. type BuiltInColorProperty = 'color' | 'stroke-color' | 'fill-color' | 'background-color' | 'font-color' | 'outline-color';
  15913. type AnnotationToolbarColorPresetConfig = {
  15914. presets: ColorPreset[];
  15915. showColorPicker?: boolean;
  15916. };
  15917. type AnnotationToolbarColorPresetsCallback = (options: {
  15918. propertyName: BuiltInColorProperty;
  15919. defaultAnnotationToolbarColorPresets: ColorPreset[];
  15920. }) => AnnotationToolbarColorPresetConfig | undefined;
  15921. type EnableRichTextCallback = (annotation: TextAnnotation) => boolean;
  15922. type ElectronicSignaturesConfiguration = {
  15923. creationModes?: Readonly<IElectronicSignatureCreationMode[]>;
  15924. fonts?: Readonly<Font[]>;
  15925. setDefaultTypeText?: ElectronicSignatureDefaultTextCallback | string;
  15926. colorPresets?: Readonly<ColorPreset[]>;
  15927. };
  15928. type ElectronicSignatureDefaultTextCallback = () => string | undefined | void;
  15929. declare const ProcessorEngine: {
  15930. smallerSize: string;
  15931. fasterProcessing: string;
  15932. };
  15933. type IProcessorEngine = (typeof ProcessorEngine)[keyof typeof ProcessorEngine];
  15934. type TrustedCAsCallback = () => Promise<Array<ArrayBuffer | string>>;
  15935. declare const Conformance: {
  15936. readonly PDFA_1A: "pdfa-1a";
  15937. readonly PDFA_1B: "pdfa-1b";
  15938. readonly PDFA_2A: "pdfa-2a";
  15939. readonly PDFA_2U: "pdfa-2u";
  15940. readonly PDFA_2B: "pdfa-2b";
  15941. readonly PDFA_3A: "pdfa-3a";
  15942. readonly PDFA_3U: "pdfa-3u";
  15943. readonly PDFA_3B: "pdfa-3b";
  15944. readonly PDFA_4: "pdfa-4";
  15945. readonly PDFA_4E: "pdfa-4e";
  15946. readonly PDFA_4F: "pdfa-4f";
  15947. };
  15948. type IConformance = (typeof Conformance)[keyof typeof Conformance];
  15949. type TemplateDataToPopulateDocument = {
  15950. config: DelimiterConfig;
  15951. model: Array<Record<string, unknown>>;
  15952. };
  15953. type DelimiterConfig = {
  15954. delimiter: DelimiterSettings;
  15955. };
  15956. type DelimiterSettings = {
  15957. start: string;
  15958. end: string;
  15959. };
  15960. declare const OfficeDocumentFormat: {
  15961. docx: string;
  15962. xlsx: string;
  15963. pptx: string;
  15964. };
  15965. type IDocumentOfficeFormat = (typeof OfficeDocumentFormat)[keyof typeof OfficeDocumentFormat];
  15966. type SharedConfiguration = {
  15967. container: string | HTMLElement;
  15968. initialViewState?: ViewState;
  15969. baseUrl?: string;
  15970. serverUrl?: string;
  15971. styleSheets?: Array<string>;
  15972. toolbarItems?: Array<ToolbarItem>;
  15973. annotationPresets?: Record<AnnotationPresetID$1, AnnotationPreset$1>;
  15974. stampAnnotationTemplates?: Array<StampAnnotation | ImageAnnotation>;
  15975. autoSaveMode?: IAutoSaveMode;
  15976. disableHighQualityPrinting?: boolean;
  15977. printMode?: IPrintMode;
  15978. printOptions?: {
  15979. mode?: IPrintMode;
  15980. quality?: IPrintQuality;
  15981. };
  15982. disableTextSelection?: boolean;
  15983. disableForms?: boolean;
  15984. headless?: boolean;
  15985. locale?: string;
  15986. populateInkSignatures?: () => Promise<List<InkAnnotation | ImageAnnotation>>;
  15987. populateStoredSignatures?: () => Promise<List<InkAnnotation | ImageAnnotation>>;
  15988. formFieldsNotSavingSignatures?: Array<string>;
  15989. password?: string;
  15990. disableOpenParameters?: boolean;
  15991. maxPasswordRetries?: number;
  15992. enableServiceWorkerSupport?: boolean;
  15993. preventTextCopy?: boolean;
  15994. renderPageCallback?: RenderPageCallback;
  15995. annotationTooltipCallback?: AnnotationTooltipCallback;
  15996. editableAnnotationTypes?: Array<Class<AnnotationsUnion>>;
  15997. isEditableAnnotation?: IsEditableAnnotationCallback;
  15998. onAnnotationResizeStart?: AnnotationResizeStartCallback;
  15999. customRenderers?: CustomRenderers;
  16000. customUI?: CustomUI;
  16001. theme?: ITheme;
  16002. toolbarPlacement?: IToolbarPlacement;
  16003. minDefaultZoomLevel?: number;
  16004. maxDefaultZoomLevel?: number;
  16005. isEditableComment?: IsEditableCommentCallback;
  16006. restrictAnnotationToPageBounds?: boolean;
  16007. electronicSignatures?: ElectronicSignaturesConfiguration;
  16008. documentEditorFooterItems?: DocumentEditorFooterItem[];
  16009. documentEditorToolbarItems?: DocumentEditorToolbarItem[];
  16010. enableHistory?: boolean;
  16011. onOpenURI?: OnOpenUriCallback;
  16012. dateTimeString?: DateTimeStringCallback;
  16013. annotationToolbarColorPresets?: AnnotationToolbarColorPresetsCallback;
  16014. annotationToolbarItems?: AnnotationToolbarItemsCallback;
  16015. enableClipboardActions?: boolean;
  16016. renderPagePreview?: boolean;
  16017. unstable_inkEraserMode?: IInkEraserMode;
  16018. onWidgetAnnotationCreationStart?: OnWidgetAnnotationCreationStartCallback;
  16019. inlineTextSelectionToolbarItems?: InlineTextSelectionToolbarItemsCallback;
  16020. measurementSnapping?: boolean;
  16021. measurementPrecision?: IMeasurementPrecision;
  16022. measurementScale?: MeasurementScale;
  16023. measurementValueConfiguration?: MeasurementValueConfigurationCallback;
  16024. enableRichText?: EnableRichTextCallback;
  16025. disableMultiSelection?: boolean;
  16026. autoCloseThreshold?: number;
  16027. useIframe?: boolean;
  16028. fontSubstitutions?: FontSubstitution[];
  16029. onCommentCreationStart?: OnCommentCreationStartCallback;
  16030. documentEditorConfiguration?: documentEditorUIConfig;
  16031. ui?: UI;
  16032. };
  16033. type Instant = {
  16034. public: boolean;
  16035. };
  16036. type ServerConfiguration = SharedConfiguration & {
  16037. documentId: string;
  16038. authPayload: {
  16039. jwt: string;
  16040. };
  16041. instant: Instant[keyof Instant];
  16042. anonymousComments?: boolean;
  16043. mentionableUsers?: Array<MentionableUser$1>;
  16044. maxMentionSuggestions?: number;
  16045. };
  16046. type StandaloneConfiguration = SharedConfiguration & {
  16047. document: string | ArrayBuffer;
  16048. baseCoreUrl?: string;
  16049. baseProcessorEngineUrl?: string;
  16050. licenseKey?: string;
  16051. instantJSON?: InstantJSON;
  16052. XFDF?: string;
  16053. XFDFKeepCurrentAnnotations?: boolean;
  16054. XFDFIgnorePageRotation?: boolean;
  16055. disableWebAssemblyStreaming?: boolean;
  16056. disableIndexedDBCaching?: boolean;
  16057. enableAutomaticLinkExtraction?: boolean;
  16058. standaloneInstancesPoolSize?: number;
  16059. overrideMemoryLimit?: number;
  16060. trustedCAsCallback?: TrustedCAsCallback;
  16061. customFonts?: Array<Font>;
  16062. electronAppName?: string;
  16063. appName?: string;
  16064. isSharePoint?: boolean;
  16065. isSalesforce?: boolean;
  16066. productId?: IProductId;
  16067. processorEngine?: IProcessorEngine;
  16068. dynamicFonts?: string;
  16069. inlineWorkers?: boolean;
  16070. };
  16071. type Configuration = ServerConfiguration | StandaloneConfiguration;
  16072. type FormFieldFlags = Array<'readOnly' | 'required' | 'noExport'>;
  16073. type FormOptionJSON = {
  16074. label: string;
  16075. value: string;
  16076. };
  16077. type ExportPDFFlags = {
  16078. flatten?: boolean;
  16079. incremental?: boolean;
  16080. includeComments?: boolean;
  16081. saveForPrinting?: boolean;
  16082. excludeAnnotations?: boolean;
  16083. permissions?: {
  16084. userPassword: string;
  16085. ownerPassword: string;
  16086. documentPermissions: Array<IDocumentPermissions>;
  16087. };
  16088. outputFormat?: boolean | PDFAFlags;
  16089. optimize?: boolean | OptimizationFlags;
  16090. flattenElectronicSignatures?: boolean;
  16091. };
  16092. type ExportOfficeFlags = {
  16093. format: IDocumentOfficeFormat;
  16094. };
  16095. type PDFAFlags = {
  16096. conformance?: IConformance;
  16097. vectorization?: boolean;
  16098. rasterization?: boolean;
  16099. };
  16100. type OptimizationFlags = {
  16101. documentFormat?: 'pdf' | 'pdfa';
  16102. grayscaleText?: boolean;
  16103. grayscaleGraphics?: boolean;
  16104. grayscaleFormFields?: boolean;
  16105. grayscaleAnnotations?: boolean;
  16106. grayscaleImages?: boolean;
  16107. disableImages?: boolean;
  16108. mrcCompression?: boolean;
  16109. imageOptimizationQuality?: 1 | 2 | 3 | 4;
  16110. linearize?: boolean;
  16111. };
  16112. type FormFieldAdditionalActionsType = {
  16113. onChange?: Action;
  16114. onCalculate?: Action;
  16115. };
  16116. type FormFieldEventTriggerType = keyof FormFieldAdditionalActionsType;
  16117. type FormFieldInputAdditionalActionsType = FormFieldAdditionalActionsType & {
  16118. onInput?: Action;
  16119. onFormat?: Action;
  16120. };
  16121. type FormFieldInputEventTriggerType = keyof FormFieldInputAdditionalActionsType;
  16122. type FormFieldName = string;
  16123. interface IFormField {
  16124. id?: ID;
  16125. pdfObjectId?: number | null;
  16126. annotationIds?: List<string>;
  16127. name?: FormFieldName;
  16128. label?: string;
  16129. readOnly?: boolean;
  16130. required?: boolean;
  16131. noExport?: boolean;
  16132. additionalActions?: any;
  16133. group?: string | null;
  16134. isEditable?: boolean;
  16135. isFillable?: boolean;
  16136. isDeletable?: boolean;
  16137. canSetGroup?: boolean;
  16138. [key: string]: any;
  16139. }
  16140. declare const FormField_base: Record$1.Factory<IFormField>;
  16141. declare class FormField extends FormField_base {
  16142. id: ID;
  16143. name: FormFieldName;
  16144. pdfObjectId: number;
  16145. annotationIds: List<string>;
  16146. label: string;
  16147. readOnly: boolean;
  16148. required: boolean;
  16149. noExport: boolean;
  16150. additionalActions: any;
  16151. group?: string | null;
  16152. isEditable?: boolean;
  16153. isFillable?: boolean;
  16154. isDeletable?: boolean;
  16155. canSetGroup?: boolean;
  16156. static defaultValues: IObject$1;
  16157. constructor(args?: IFormField);
  16158. }
  16159. declare class ButtonFormField extends FormField {
  16160. buttonLabel: string | null;
  16161. static defaultValues: IObject$1;
  16162. }
  16163. declare const FormOption_base: Record$1.Factory<{
  16164. label: string;
  16165. value: string;
  16166. }>;
  16167. declare class FormOption extends FormOption_base {
  16168. }
  16169. declare class CheckBoxFormField extends FormField {
  16170. values: List<string>;
  16171. defaultValues: List<string>;
  16172. options: List<FormOption>;
  16173. optionIndexes?: List<number>;
  16174. static defaultValues: IObject$1;
  16175. }
  16176. declare class ChoiceFormField extends FormField {
  16177. options: List<FormOption>;
  16178. values: List<string>;
  16179. defaultValues: List<string>;
  16180. multiSelect: boolean;
  16181. commitOnChange: boolean;
  16182. static defaultValues: IObject$1;
  16183. }
  16184. declare class ComboBoxFormField extends ChoiceFormField {
  16185. edit: boolean;
  16186. doNotSpellCheck: boolean;
  16187. static defaultValues: IObject$1;
  16188. }
  16189. declare class ListBoxFormField extends ChoiceFormField {
  16190. additionalActions: FormFieldInputAdditionalActionsType | null | undefined;
  16191. }
  16192. declare class RadioButtonFormField extends FormField {
  16193. noToggleToOff: boolean;
  16194. radiosInUnison: boolean;
  16195. value: string;
  16196. defaultValue: string;
  16197. options: List<FormOption>;
  16198. optionIndexes?: List<number>;
  16199. static defaultValues: IObject$1;
  16200. }
  16201. declare class TextFormField extends FormField {
  16202. value: string;
  16203. defaultValue: string;
  16204. password: boolean;
  16205. maxLength?: number | null;
  16206. doNotSpellCheck: boolean;
  16207. doNotScroll: boolean;
  16208. multiLine: boolean;
  16209. comb: boolean;
  16210. additionalActions: FormFieldInputAdditionalActionsType | null | undefined;
  16211. static defaultValues: IObject$1;
  16212. }
  16213. declare class SignatureFormField extends FormField {
  16214. }
  16215. interface IComparisonOperation {
  16216. type: IComparisonOperationType;
  16217. options?: {
  16218. numberOfContextWords?: number;
  16219. };
  16220. }
  16221. declare const ComparisonOperation_base: Record$1.Factory<IComparisonOperation>;
  16222. declare class ComparisonOperation extends ComparisonOperation_base {
  16223. constructor(type: IComparisonOperationType, options?: {
  16224. numberOfContextWords?: number;
  16225. });
  16226. }
  16227. interface IDocumentDescriptor {
  16228. filePath?: string | ArrayBuffer;
  16229. password?: string;
  16230. pageIndexes: Array<number | [number, number]>;
  16231. jwt?: string;
  16232. }
  16233. declare const DocumentDescriptor_base: Record$1.Factory<IDocumentDescriptor>;
  16234. declare class DocumentDescriptor extends DocumentDescriptor_base {
  16235. constructor(documentDescriptorOptions: IDocumentDescriptor);
  16236. }
  16237. type AnnotationPreset = AnnotationPreset$1;
  16238. type AnnotationPresetID = AnnotationPresetID$1;
  16239. declare class __dangerousImmutableRecordFactory<TProps extends Record<string, unknown>> {
  16240. has(key: unknown): boolean;
  16241. get<K extends keyof TProps>(key: K): TProps[K];
  16242. set<K extends keyof TProps>(key: K, value: TProps[K]): this;
  16243. delete<K extends keyof TProps>(key: K): this;
  16244. clear(): this;
  16245. update<K extends keyof TProps>(key: K, updater: (value: TProps[K]) => TProps[K]): this;
  16246. merge(...collections: Array<Partial<TProps>>): this;
  16247. mergeWith(merger: (previous?: unknown, next?: unknown, key?: string) => unknown, ...collections: Array<Partial<TProps> | Iterable<[string, unknown]>>): this;
  16248. mergeDeep(...collections: Array<Partial<TProps> | Iterable<[string, unknown]>>): this;
  16249. mergeDeepWith(merger: (previous?: unknown, next?: unknown, key?: string) => unknown, ...collections: Array<Partial<TProps> | Iterable<[string, unknown]>>): this;
  16250. setIn(keyPath: Iterable<unknown>, value: unknown): this;
  16251. deleteIn(keyPath: Iterable<unknown>): this;
  16252. removeIn(keyPath: Iterable<unknown>): this;
  16253. updateIn(keyPath: Iterable<unknown>, notSetValue: unknown, updater: (value: unknown) => unknown): this;
  16254. updateIn(keyPath: Iterable<unknown>, updater: (value: unknown) => unknown): this;
  16255. mergeIn(keyPath: Iterable<unknown>, ...collections: Array<Partial<TProps> | Iterable<[string, unknown]>>): this;
  16256. mergeDeepIn(keyPath: Iterable<unknown>, ...collections: Array<Partial<TProps> | Iterable<[string, unknown]>>): this;
  16257. withMutations(mutator: (mutable: this) => unknown): this;
  16258. asMutable(): this;
  16259. asImmutable(): this;
  16260. getIn(keyPath: Iterable<unknown>, notSetValue?: unknown): unknown;
  16261. toJS(): TProps;
  16262. toJSON(): TProps;
  16263. equals(other: unknown): boolean;
  16264. toSeq(): Seq.Keyed<string, unknown>;
  16265. }
  16266. declare const InheritableImmutableRecord_base: any;
  16267. declare class InheritableImmutableRecord<T extends Record<string, unknown>> extends InheritableImmutableRecord_base {
  16268. constructor(values?: Partial<T> | Iterable<[string, unknown]>);
  16269. }
  16270. interface InheritableImmutableRecord<T extends Record<string, unknown>> extends __dangerousImmutableRecordFactory<T> {
  16271. }
  16272. type ID = string;
  16273. type AnnotationProperties = {
  16274. id: string | null;
  16275. name: string | null;
  16276. subject: string | null;
  16277. pdfObjectId: number | null;
  16278. pageIndex: number | null;
  16279. boundingBox: Rect | null;
  16280. opacity: number | null;
  16281. note: string | null;
  16282. creatorName: string | null;
  16283. createdAt: Date | null;
  16284. updatedAt: Date | null;
  16285. customData: Record<string, unknown> | null;
  16286. noView: boolean | null;
  16287. noPrint: boolean | null;
  16288. locked: boolean | null;
  16289. lockedContents: boolean | null;
  16290. readOnly: boolean | null;
  16291. hidden: boolean | null;
  16292. group: string | null | undefined;
  16293. isEditable: boolean | undefined;
  16294. isDeletable: boolean | undefined;
  16295. canSetGroup: boolean | undefined;
  16296. canReply: boolean | undefined;
  16297. rotation: number;
  16298. additionalActions: any;
  16299. noZoom: boolean;
  16300. noRotate: boolean;
  16301. isCommentThreadRoot: boolean;
  16302. isAnonymous: boolean;
  16303. APStreamCache: {
  16304. cache: string;
  16305. } | {
  16306. attach: string;
  16307. } | undefined;
  16308. blendMode: IBlendMode;
  16309. action: any;
  16310. [key: string]: unknown;
  16311. };
  16312. declare class Annotation<T extends AnnotationProperties = AnnotationProperties> extends InheritableImmutableRecord<T> {
  16313. id: ID;
  16314. name: null | string;
  16315. subject: null | string;
  16316. pdfObjectId: null | number;
  16317. pageIndex: number;
  16318. boundingBox: Rect;
  16319. opacity: number;
  16320. note: null | string;
  16321. creatorName: null | string;
  16322. createdAt: Date;
  16323. updatedAt: Date;
  16324. noView: boolean;
  16325. noPrint: boolean;
  16326. locked: boolean;
  16327. lockedContents: boolean;
  16328. readOnly: boolean;
  16329. hidden: boolean;
  16330. customData: null | Record<string, unknown>;
  16331. noZoom: boolean;
  16332. noRotate: boolean;
  16333. additionalActions: any;
  16334. rotation: number;
  16335. blendMode: IBlendMode;
  16336. isCommentThreadRoot: boolean;
  16337. isAnonymous: boolean;
  16338. group?: string | null;
  16339. isEditable?: boolean;
  16340. isDeletable?: boolean;
  16341. canSetGroup?: boolean;
  16342. canReply?: boolean;
  16343. APStreamCache?: {
  16344. cache: string;
  16345. } | {
  16346. attach: string;
  16347. };
  16348. action: any;
  16349. static defaultValues: IObject$1;
  16350. constructor(record?: Partial<T>);
  16351. }
  16352. 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';
  16353. interface IStampAnnotation extends AnnotationProperties {
  16354. stampType: string | StampKind | null;
  16355. title: string | null;
  16356. subtitle: string | null;
  16357. color: Color$2 | null;
  16358. xfdfAppearanceStream: string | null;
  16359. xfdfAppearanceStreamOriginalPageRotation: number | null;
  16360. }
  16361. declare class StampAnnotation<T extends IStampAnnotation = IStampAnnotation> extends Annotation<T> {
  16362. stampType: StampKind;
  16363. title: null | string;
  16364. subtitle: null | string;
  16365. color: null | Color$2;
  16366. xfdfAppearanceStream: null | string;
  16367. xfdfAppearanceStreamOriginalPageRotation: null | number;
  16368. static defaultValues: IObject$1;
  16369. static readableName: string;
  16370. }
  16371. declare function preloadWorker(configuration: StandaloneConfiguration): Promise<void>;
  16372. declare function load(configuration: Configuration): Promise<Instance>;
  16373. declare function convertToPDF(configuration: StandaloneConfiguration, conformance?: IConformance): Promise<ArrayBuffer>;
  16374. declare function convertToOffice(configuration: StandaloneConfiguration, format: IDocumentOfficeFormat): Promise<ArrayBuffer>;
  16375. declare function populateDocumentTemplate(configuration: StandaloneConfiguration, templateData: TemplateDataToPopulateDocument): Promise<ArrayBuffer>;
  16376. declare function serializeAnnotation(annotation: InkAnnotation): AnnotationBackendJSON<InkAnnotationJSON>;
  16377. declare function serializeAnnotation(annotation: LineAnnotation): AnnotationBackendJSON<LineAnnotationJSON>;
  16378. declare function serializeAnnotation(annotation: RectangleAnnotation): AnnotationBackendJSON<RectangleAnnotationJSON>;
  16379. declare function serializeAnnotation(annotation: EllipseAnnotation): AnnotationBackendJSON<EllipseAnnotationJSON>;
  16380. declare function serializeAnnotation(annotation: PolygonAnnotation): AnnotationBackendJSON<PolygonAnnotationJSON>;
  16381. declare function serializeAnnotation(annotation: PolylineAnnotation): AnnotationBackendJSON<PolylineAnnotationJSON>;
  16382. declare function serializeAnnotation(annotation: TextAnnotation): AnnotationBackendJSON<TextAnnotationJSON>;
  16383. declare function serializeAnnotation(annotation: NoteAnnotation): AnnotationBackendJSON<NoteAnnotationJSON>;
  16384. declare function serializeAnnotation(annotation: StampAnnotation): AnnotationBackendJSON<StampAnnotationJSON, 'color'>;
  16385. declare function serializeAnnotation(annotation: ImageAnnotation): AnnotationBackendJSON<ImageAnnotationJSON>;
  16386. declare function serializeAnnotation(annotation: MediaAnnotation): AnnotationBackendJSON<MediaAnnotationJSON>;
  16387. declare function serializeAnnotation(annotation: LinkAnnotation): AnnotationBackendJSON<LinkAnnotationJSON>;
  16388. declare function serializeAnnotation(annotation: WidgetAnnotation): AnnotationBackendJSON<WidgetAnnotationJSON>;
  16389. declare function serializeAnnotation(annotation: TextMarkupAnnotation): AnnotationBackendJSON<TextMarkupAnnotationJSON>;
  16390. declare function serializeAnnotation(annotation: RedactionAnnotation): AnnotationBackendJSON<RedactionAnnotationJSON>;
  16391. declare function serializeAnnotation(annotation: CommentMarkerAnnotation): AnnotationBackendJSON<CommentMarkerAnnotationJSON>;
  16392. declare function serializeAnnotation(annotation: UnknownAnnotation): AnnotationBackendJSON<UnknownAnnotationJSON>;
  16393. declare function serializeAnnotation(annotation: AnnotationsUnion): AnnotationsBackendJSONUnion;
  16394. declare function serializeFormField(formField: FormField): FormFieldJSON;
  16395. declare function serializePreset(preset: AnnotationPreset$1): Record<string, any>;
  16396. declare function unserializePreset(presetJSON: Record<string, any>): AnnotationPreset$1;
  16397. type TargetType = string | HTMLElement | Instance | null;
  16398. declare function unload(target: TargetType): boolean;
  16399. declare function viewStateFromOpenParameters(viewState: ViewState, hash?: string | null | undefined): ViewState;
  16400. type RotatableAnnotation = TextAnnotation | StampAnnotation;
  16401. declare const PSPDFKit: {
  16402. UI: {
  16403. Core: typeof Core;
  16404. createBlock: typeof createBlock;
  16405. Recipes: {
  16406. readonly SignaturesList: React.ForwardRefExoticComponent<SignaturesListProps & React.RefAttributes<HTMLDivElement>>;
  16407. readonly CreateSignature: React.ForwardRefExoticComponent<CreateSignatureProps & React.RefAttributes<HTMLDivElement>>;
  16408. readonly StampsList: React.ForwardRefExoticComponent<StampsListProps & React.RefAttributes<HTMLDivElement>>;
  16409. readonly CreateStamp: React.ForwardRefExoticComponent<CreateStampProps & React.RefAttributes<HTMLDivElement>>;
  16410. readonly ChatDialog: React.ForwardRefExoticComponent<ChatDialogProps & React.RefAttributes<HTMLDivElement>>;
  16411. readonly CommentThread: React.ForwardRefExoticComponent<CommentThreadProps & React.RefAttributes<HTMLDivElement>>;
  16412. };
  16413. Interfaces: InterfacesType;
  16414. App: typeof App;
  16415. };
  16416. Immutable: {
  16417. List: typeof List;
  16418. };
  16419. version: string;
  16420. Geometry: {
  16421. Point: typeof Point;
  16422. DrawingPoint: typeof DrawingPoint;
  16423. Rect: typeof Rect;
  16424. Size: typeof Size;
  16425. Inset: typeof Inset;
  16426. };
  16427. Actions: {
  16428. Action: typeof Action;
  16429. GoToAction: typeof GoToAction;
  16430. GoToEmbeddedAction: typeof GoToEmbeddedAction;
  16431. GoToRemoteAction: typeof GoToRemoteAction;
  16432. HideAction: typeof HideAction;
  16433. JavaScriptAction: typeof JavaScriptAction;
  16434. LaunchAction: typeof LaunchAction;
  16435. NamedAction: typeof NamedAction;
  16436. ResetFormAction: typeof ResetFormAction;
  16437. SubmitFormAction: typeof SubmitFormAction;
  16438. URIAction: typeof URIAction;
  16439. };
  16440. Annotations: {
  16441. Annotation: typeof Annotation;
  16442. CommentMarkerAnnotation: typeof CommentMarkerAnnotation;
  16443. HighlightAnnotation: typeof HighlightAnnotation;
  16444. InkAnnotation: typeof InkAnnotation;
  16445. ShapeAnnotation: typeof ShapeAnnotation;
  16446. LineAnnotation: typeof LineAnnotation;
  16447. RectangleAnnotation: typeof RectangleAnnotation;
  16448. EllipseAnnotation: typeof EllipseAnnotation;
  16449. PolygonAnnotation: typeof PolygonAnnotation;
  16450. PolylineAnnotation: typeof PolylineAnnotation;
  16451. LinkAnnotation: typeof LinkAnnotation;
  16452. NoteAnnotation: typeof NoteAnnotation;
  16453. MarkupAnnotation: typeof TextMarkupAnnotation;
  16454. RedactionAnnotation: typeof RedactionAnnotation;
  16455. SquiggleAnnotation: typeof SquiggleAnnotation;
  16456. StampAnnotation: typeof StampAnnotation;
  16457. StrikeOutAnnotation: typeof StrikeOutAnnotation;
  16458. TextAnnotation: typeof TextAnnotation;
  16459. UnderlineAnnotation: typeof UnderlineAnnotation;
  16460. ImageAnnotation: typeof ImageAnnotation;
  16461. UnknownAnnotation: typeof UnknownAnnotation;
  16462. WidgetAnnotation: typeof WidgetAnnotation;
  16463. MediaAnnotation: typeof MediaAnnotation;
  16464. toSerializableObject: typeof serializeAnnotation;
  16465. fromSerializableObject: <K extends AnnotationJSONUnion>(annotation: K) => AnnotationJSONToAnnotation<K>;
  16466. rotate: (annotation: RotatableAnnotation, rotation: number, contentSize?: Size) => RotatableAnnotation;
  16467. };
  16468. AnnotationPresets: {
  16469. toSerializableObject: typeof serializePreset;
  16470. fromSerializableObject: typeof unserializePreset;
  16471. };
  16472. Comment: typeof Comment$1;
  16473. Bookmark: typeof Bookmark;
  16474. CustomOverlayItem: typeof CustomOverlayItem;
  16475. OutlineElement: typeof OutlineElement;
  16476. FormFields: {
  16477. FormField: typeof FormField;
  16478. ButtonFormField: typeof ButtonFormField;
  16479. CheckBoxFormField: typeof CheckBoxFormField;
  16480. ChoiceFormField: typeof ChoiceFormField;
  16481. ComboBoxFormField: typeof ComboBoxFormField;
  16482. ListBoxFormField: typeof ListBoxFormField;
  16483. RadioButtonFormField: typeof RadioButtonFormField;
  16484. TextFormField: typeof TextFormField;
  16485. SignatureFormField: typeof SignatureFormField;
  16486. toSerializableObject: typeof serializeFormField;
  16487. fromSerializableObject: (formField: FormFieldJSON) => FormField;
  16488. };
  16489. FormFieldValue: typeof FormFieldValue;
  16490. FormOption: typeof FormOption;
  16491. Callout: typeof Callout;
  16492. Color: typeof Color$2;
  16493. Instance: typeof Instance;
  16494. preloadWorker: typeof preloadWorker;
  16495. load: typeof load;
  16496. unload: typeof unload;
  16497. convertToOffice: typeof convertToOffice;
  16498. convertToPDF: typeof convertToPDF;
  16499. populateDocumentTemplate: typeof populateDocumentTemplate;
  16500. Error: any;
  16501. SaveError: typeof PSPDFKitSaveError;
  16502. ViewState: typeof ViewState;
  16503. PageInfo: typeof PageInfo;
  16504. TextLine: typeof TextLine;
  16505. InstantClient: typeof InstantClient;
  16506. TextSelection: typeof PublicTextSelection;
  16507. SearchResult: typeof SearchResult;
  16508. SearchState: typeof SearchState;
  16509. AutoSaveMode: {
  16510. readonly IMMEDIATE: "IMMEDIATE";
  16511. readonly INTELLIGENT: "INTELLIGENT";
  16512. readonly DISABLED: "DISABLED";
  16513. };
  16514. SignatureSaveMode: {
  16515. readonly ALWAYS: "ALWAYS";
  16516. readonly NEVER: "NEVER";
  16517. readonly USING_UI: "USING_UI";
  16518. };
  16519. LayoutMode: {
  16520. readonly SINGLE: "SINGLE";
  16521. readonly DOUBLE: "DOUBLE";
  16522. readonly AUTO: "AUTO";
  16523. };
  16524. PrintMode: {
  16525. readonly DOM: "DOM";
  16526. readonly EXPORT_PDF: "EXPORT_PDF";
  16527. };
  16528. PrintQuality: {
  16529. readonly LOW: "LOW";
  16530. readonly MEDIUM: "MEDIUM";
  16531. readonly HIGH: "HIGH";
  16532. };
  16533. ScrollMode: {
  16534. readonly CONTINUOUS: "CONTINUOUS";
  16535. readonly PER_SPREAD: "PER_SPREAD";
  16536. readonly DISABLED: "DISABLED";
  16537. };
  16538. ZoomMode: {
  16539. readonly AUTO: "AUTO";
  16540. readonly FIT_TO_WIDTH: "FIT_TO_WIDTH";
  16541. readonly FIT_TO_VIEWPORT: "FIT_TO_VIEWPORT";
  16542. readonly CUSTOM: "CUSTOM";
  16543. };
  16544. InteractionMode: {
  16545. readonly TEXT_HIGHLIGHTER: "TEXT_HIGHLIGHTER";
  16546. readonly INK: "INK";
  16547. readonly INK_SIGNATURE: "INK_SIGNATURE";
  16548. readonly SIGNATURE: "SIGNATURE";
  16549. readonly STAMP_PICKER: "STAMP_PICKER";
  16550. readonly STAMP_CUSTOM: "STAMP_CUSTOM";
  16551. readonly SHAPE_LINE: "SHAPE_LINE";
  16552. readonly SHAPE_RECTANGLE: "SHAPE_RECTANGLE";
  16553. readonly SHAPE_ELLIPSE: "SHAPE_ELLIPSE";
  16554. readonly SHAPE_POLYGON: "SHAPE_POLYGON";
  16555. readonly SHAPE_POLYLINE: "SHAPE_POLYLINE";
  16556. readonly INK_ERASER: "INK_ERASER";
  16557. readonly NOTE: "NOTE";
  16558. readonly COMMENT_MARKER: "COMMENT_MARKER";
  16559. readonly TEXT: "TEXT";
  16560. readonly CALLOUT: "CALLOUT";
  16561. readonly PAN: "PAN";
  16562. readonly SEARCH: "SEARCH";
  16563. readonly DOCUMENT_EDITOR: "DOCUMENT_EDITOR";
  16564. readonly MARQUEE_ZOOM: "MARQUEE_ZOOM";
  16565. readonly REDACT_TEXT_HIGHLIGHTER: "REDACT_TEXT_HIGHLIGHTER";
  16566. readonly REDACT_SHAPE_RECTANGLE: "REDACT_SHAPE_RECTANGLE";
  16567. readonly DOCUMENT_CROP: "DOCUMENT_CROP";
  16568. readonly BUTTON_WIDGET: "BUTTON_WIDGET";
  16569. readonly TEXT_WIDGET: "TEXT_WIDGET";
  16570. readonly RADIO_BUTTON_WIDGET: "RADIO_BUTTON_WIDGET";
  16571. readonly CHECKBOX_WIDGET: "CHECKBOX_WIDGET";
  16572. readonly COMBO_BOX_WIDGET: "COMBO_BOX_WIDGET";
  16573. readonly LIST_BOX_WIDGET: "LIST_BOX_WIDGET";
  16574. readonly SIGNATURE_WIDGET: "SIGNATURE_WIDGET";
  16575. readonly DATE_WIDGET: "DATE_WIDGET";
  16576. readonly FORM_CREATOR: "FORM_CREATOR";
  16577. readonly LINK: "LINK";
  16578. readonly DISTANCE: "DISTANCE";
  16579. readonly PERIMETER: "PERIMETER";
  16580. readonly RECTANGLE_AREA: "RECTANGLE_AREA";
  16581. readonly ELLIPSE_AREA: "ELLIPSE_AREA";
  16582. readonly POLYGON_AREA: "POLYGON_AREA";
  16583. readonly CONTENT_EDITOR: "CONTENT_EDITOR";
  16584. readonly MULTI_ANNOTATIONS_SELECTION: "MULTI_ANNOTATIONS_SELECTION";
  16585. readonly MEASUREMENT: "MEASUREMENT";
  16586. readonly MEASUREMENT_SETTINGS: "MEASUREMENT_SETTINGS";
  16587. };
  16588. unstable_InkEraserMode: {
  16589. readonly POINT: "POINT";
  16590. readonly STROKE: "STROKE";
  16591. };
  16592. SidebarMode: {
  16593. readonly ANNOTATIONS: "ANNOTATIONS";
  16594. readonly BOOKMARKS: "BOOKMARKS";
  16595. readonly DOCUMENT_OUTLINE: "DOCUMENT_OUTLINE";
  16596. readonly THUMBNAILS: "THUMBNAILS";
  16597. readonly SIGNATURES: "SIGNATURES";
  16598. readonly LAYERS: "LAYERS";
  16599. readonly CUSTOM: "CUSTOM";
  16600. };
  16601. UIElement: {
  16602. readonly Sidebar: "Sidebar";
  16603. };
  16604. Alignment: {
  16605. readonly START: "START";
  16606. readonly END: "END";
  16607. };
  16608. BlendMode: {
  16609. readonly normal: "normal";
  16610. readonly multiply: "multiply";
  16611. readonly screen: "screen";
  16612. readonly overlay: "overlay";
  16613. readonly darken: "darken";
  16614. readonly lighten: "lighten";
  16615. readonly colorDodge: "colorDodge";
  16616. readonly colorBurn: "colorBurn";
  16617. readonly hardLight: "hardLight";
  16618. readonly softLight: "softLight";
  16619. readonly difference: "difference";
  16620. readonly exclusion: "exclusion";
  16621. };
  16622. BorderStyle: {
  16623. readonly solid: "solid";
  16624. readonly dashed: "dashed";
  16625. readonly beveled: "beveled";
  16626. readonly inset: "inset";
  16627. readonly underline: "underline";
  16628. };
  16629. LineCap: {
  16630. readonly square: "square";
  16631. readonly circle: "circle";
  16632. readonly diamond: "diamond";
  16633. readonly openArrow: "openArrow";
  16634. readonly closedArrow: "closedArrow";
  16635. readonly butt: "butt";
  16636. readonly reverseOpenArrow: "reverseOpenArrow";
  16637. readonly reverseClosedArrow: "reverseClosedArrow";
  16638. readonly slash: "slash";
  16639. };
  16640. SidebarPlacement: {
  16641. readonly START: "START";
  16642. readonly END: "END";
  16643. };
  16644. SignatureAppearanceMode: {
  16645. readonly signatureOnly: "signatureOnly";
  16646. readonly signatureAndDescription: "signatureAndDescription";
  16647. readonly descriptionOnly: "descriptionOnly";
  16648. };
  16649. ShowSignatureValidationStatusMode: {
  16650. readonly IF_SIGNED: "IF_SIGNED";
  16651. readonly HAS_WARNINGS: "HAS_WARNINGS";
  16652. readonly HAS_ERRORS: "HAS_ERRORS";
  16653. readonly NEVER: "NEVER";
  16654. };
  16655. NoteIcon: {
  16656. readonly COMMENT: "COMMENT";
  16657. readonly RIGHT_POINTER: "RIGHT_POINTER";
  16658. readonly RIGHT_ARROW: "RIGHT_ARROW";
  16659. readonly CHECK: "CHECK";
  16660. readonly CIRCLE: "CIRCLE";
  16661. readonly CROSS: "CROSS";
  16662. readonly INSERT: "INSERT";
  16663. readonly NEW_PARAGRAPH: "NEW_PARAGRAPH";
  16664. readonly NOTE: "NOTE";
  16665. readonly PARAGRAPH: "PARAGRAPH";
  16666. readonly HELP: "HELP";
  16667. readonly STAR: "STAR";
  16668. readonly KEY: "KEY";
  16669. };
  16670. Theme: {
  16671. readonly LIGHT: "LIGHT";
  16672. readonly DARK: "DARK";
  16673. readonly AUTO: "AUTO";
  16674. };
  16675. ToolbarPlacement: {
  16676. readonly TOP: "TOP";
  16677. readonly BOTTOM: "BOTTOM";
  16678. };
  16679. ElectronicSignatureCreationMode: {
  16680. readonly DRAW: "DRAW";
  16681. readonly IMAGE: "IMAGE";
  16682. readonly TYPE: "TYPE";
  16683. };
  16684. I18n: {
  16685. locales: any;
  16686. messages: {};
  16687. preloadLocalizationData: (locale: string, options?: {
  16688. baseUrl?: string | undefined;
  16689. }) => Promise<void>;
  16690. };
  16691. baseUrl: string | undefined;
  16692. DocumentIntegrityStatus: {
  16693. readonly ok: "ok";
  16694. readonly tampered_document: "tampered_document";
  16695. readonly failed_to_retrieve_signature_contents: "failed_to_retrieve_signature_contents";
  16696. readonly failed_to_retrieve_byterange: "failed_to_retrieve_byterange";
  16697. readonly failed_to_compute_digest: "failed_to_compute_digest";
  16698. readonly failed_retrieve_signing_certificate: "failed_retrieve_signing_certificate";
  16699. readonly failed_retrieve_public_key: "failed_retrieve_public_key";
  16700. readonly failed_encryption_padding: "failed_encryption_padding";
  16701. readonly tampered_or_invalid_timestamp: "tampered_or_invalid_timestamp";
  16702. readonly general_failure: "general_failure";
  16703. };
  16704. SignatureValidationStatus: {
  16705. readonly valid: "valid";
  16706. readonly warning: "warning";
  16707. readonly error: "error";
  16708. };
  16709. SignatureType: {
  16710. CMS: string;
  16711. CAdES: string;
  16712. };
  16713. SignatureContainerType: {
  16714. raw: string;
  16715. pkcs7: string;
  16716. };
  16717. PAdESLevel: {
  16718. readonly b_b: "b-b";
  16719. readonly b_t: "b-t";
  16720. readonly b_lt: "b-lt";
  16721. };
  16722. CertificateChainValidationStatus: {
  16723. readonly ok: "ok";
  16724. readonly ok_but_self_signed: "ok_but_self_signed";
  16725. readonly ok_but_could_not_check_revocation: "ok_but_could_not_check_revocation";
  16726. readonly untrusted: "untrusted";
  16727. readonly expired: "expired";
  16728. readonly not_yet_valid: "not_yet_valid";
  16729. readonly invalid: "invalid";
  16730. readonly revoked: "revoked";
  16731. readonly failed_to_retrieve_signature_contents: "failed_to_retrieve_signature_contents";
  16732. readonly general_validation_problem: "general_validation_problem";
  16733. };
  16734. DocumentValidationStatus: {
  16735. valid: string;
  16736. warning: string;
  16737. error: string;
  16738. not_signed: string;
  16739. };
  16740. AnnotationsWillChangeReason: typeof AnnotationsWillChangeReason;
  16741. DocumentComparisonSourceType: {
  16742. readonly USE_OPEN_DOCUMENT: "USE_OPEN_DOCUMENT";
  16743. readonly USE_FILE_DIALOG: "USE_FILE_DIALOG";
  16744. };
  16745. MeasurementScaleUnitFrom: {
  16746. readonly INCHES: "in";
  16747. readonly MILLIMETERS: "mm";
  16748. readonly CENTIMETERS: "cm";
  16749. readonly POINTS: "pt";
  16750. };
  16751. MeasurementScaleUnitTo: {
  16752. readonly INCHES: "in";
  16753. readonly MILLIMETERS: "mm";
  16754. readonly CENTIMETERS: "cm";
  16755. readonly POINTS: "pt";
  16756. readonly FEET: "ft";
  16757. readonly METERS: "m";
  16758. readonly YARDS: "yd";
  16759. readonly KILOMETERS: "km";
  16760. readonly MILES: "mi";
  16761. };
  16762. MeasurementPrecision: {
  16763. readonly WHOLE: "whole";
  16764. readonly ONE: "oneDp";
  16765. readonly TWO: "twoDp";
  16766. readonly THREE: "threeDp";
  16767. readonly FOUR: "fourDp";
  16768. readonly HALVES: "1/2";
  16769. readonly QUARTERS: "1/4";
  16770. readonly EIGHTHS: "1/8";
  16771. readonly SIXTEENTHS: "1/16";
  16772. };
  16773. MeasurementScale: typeof MeasurementScale;
  16774. ProductId: {
  16775. SharePoint: string;
  16776. Salesforce: string;
  16777. Maui_Android: string;
  16778. Maui_iOS: string;
  16779. Maui_MacCatalyst: string;
  16780. Maui_Windows: string;
  16781. FlutterForWeb: string;
  16782. Electron: string;
  16783. };
  16784. ProcessorEngine: {
  16785. smallerSize: string;
  16786. fasterProcessing: string;
  16787. };
  16788. Conformance: {
  16789. readonly PDFA_1A: "pdfa-1a";
  16790. readonly PDFA_1B: "pdfa-1b";
  16791. readonly PDFA_2A: "pdfa-2a";
  16792. readonly PDFA_2U: "pdfa-2u";
  16793. readonly PDFA_2B: "pdfa-2b";
  16794. readonly PDFA_3A: "pdfa-3a";
  16795. readonly PDFA_3U: "pdfa-3u";
  16796. readonly PDFA_3B: "pdfa-3b";
  16797. readonly PDFA_4: "pdfa-4";
  16798. readonly PDFA_4E: "pdfa-4e";
  16799. readonly PDFA_4F: "pdfa-4f";
  16800. };
  16801. DocumentPermissions: {
  16802. readonly annotationsAndForms: "annotationsAndForms";
  16803. readonly assemble: "assemble";
  16804. readonly extract: "extract";
  16805. readonly extractAccessibility: "extractAccessibility";
  16806. readonly fillForms: "fillForms";
  16807. readonly modification: "modification";
  16808. readonly printHighQuality: "printHighQuality";
  16809. readonly printing: "printing";
  16810. };
  16811. ComparisonOperation: typeof ComparisonOperation;
  16812. DocumentDescriptor: typeof DocumentDescriptor;
  16813. ComparisonOperationType: {
  16814. readonly TEXT: "text";
  16815. };
  16816. OfficeDocumentFormat: {
  16817. docx: string;
  16818. xlsx: string;
  16819. pptx: string;
  16820. };
  16821. viewStateFromOpenParameters: typeof viewStateFromOpenParameters;
  16822. readonly defaultElectronicSignatureColorPresets: ColorPreset[];
  16823. readonly defaultToolbarItems: readonly [{
  16824. readonly type: "sidebar-thumbnails";
  16825. }, {
  16826. readonly type: "sidebar-document-outline";
  16827. }, {
  16828. readonly type: "sidebar-annotations";
  16829. }, {
  16830. readonly type: "sidebar-bookmarks";
  16831. }, {
  16832. readonly type: "sidebar-signatures";
  16833. }, {
  16834. readonly type: "sidebar-layers";
  16835. }, {
  16836. readonly type: "pager";
  16837. }, {
  16838. readonly type: "multi-annotations-selection";
  16839. }, {
  16840. readonly type: "pan";
  16841. }, {
  16842. readonly type: "zoom-out";
  16843. }, {
  16844. readonly type: "zoom-in";
  16845. }, {
  16846. readonly type: "zoom-mode";
  16847. }, {
  16848. readonly type: "spacer";
  16849. }, {
  16850. readonly type: "annotate";
  16851. }, {
  16852. readonly type: "ink";
  16853. }, {
  16854. readonly type: "highlighter";
  16855. }, {
  16856. readonly type: "text-highlighter";
  16857. }, {
  16858. readonly type: "ink-eraser";
  16859. }, {
  16860. readonly type: "signature";
  16861. }, {
  16862. readonly type: "image";
  16863. }, {
  16864. readonly type: "stamp";
  16865. }, {
  16866. readonly type: "note";
  16867. }, {
  16868. readonly type: "text";
  16869. }, {
  16870. readonly type: "callout";
  16871. }, {
  16872. readonly type: "line";
  16873. }, {
  16874. readonly type: "link";
  16875. }, {
  16876. readonly type: "arrow";
  16877. }, {
  16878. readonly type: "rectangle";
  16879. }, {
  16880. readonly type: "ellipse";
  16881. }, {
  16882. readonly type: "polygon";
  16883. }, {
  16884. readonly type: "cloudy-polygon";
  16885. }, {
  16886. readonly type: "polyline";
  16887. }, {
  16888. readonly type: "print";
  16889. }, {
  16890. readonly type: "document-editor";
  16891. }, {
  16892. readonly type: "document-crop";
  16893. }, {
  16894. readonly type: "search";
  16895. }, {
  16896. readonly type: "export-pdf";
  16897. }, {
  16898. readonly type: "debug";
  16899. }];
  16900. readonly defaultDocumentEditorFooterItems: {
  16901. type: BuiltInDocumentEditorFooterItem;
  16902. }[];
  16903. readonly defaultDocumentEditorToolbarItems: {
  16904. type: BuiltInDocumentEditorToolbarItem;
  16905. }[];
  16906. readonly defaultAnnotationPresets: {
  16907. [key: string]: Record<string, unknown>;
  16908. };
  16909. readonly defaultStampAnnotationTemplates: StampAnnotation<IStampAnnotation>[];
  16910. 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];
  16911. defaultEditableAnnotationTypes: readonly (typeof TextAnnotation | typeof CommentMarkerAnnotation)[];
  16912. defaultElectronicSignatureCreationModes: readonly ("DRAW" | "IMAGE" | "TYPE")[];
  16913. defaultSigningFonts: readonly Font[];
  16914. Options: {
  16915. MIN_TEXT_ANNOTATION_SIZE: number;
  16916. MIN_INK_ANNOTATION_SIZE: number;
  16917. MIN_SHAPE_ANNOTATION_SIZE: number;
  16918. MIN_IMAGE_ANNOTATION_SIZE: number;
  16919. MIN_STAMP_ANNOTATION_SIZE: number;
  16920. MIN_WIDGET_ANNOTATION_SIZE: number;
  16921. ENABLE_INK_SMOOTH_LINES: boolean;
  16922. INK_EPSILON_RANGE_OPTIMIZATION: number;
  16923. SIGNATURE_SAVE_MODE: ISignatureSaveMode;
  16924. INITIAL_DESKTOP_SIDEBAR_WIDTH: number;
  16925. IGNORE_DOCUMENT_PERMISSIONS: boolean;
  16926. SELECTION_OUTLINE_PADDING: (viewportSize: Size) => number;
  16927. RESIZE_ANCHOR_RADIUS: (viewportSize: Size) => number;
  16928. SELECTION_STROKE_WIDTH: number;
  16929. TEXT_ANNOTATION_AUTOFIT_TEXT_ON_EXPORT: boolean;
  16930. TEXT_ANNOTATION_AUTOFIT_BOUNDING_BOX_ON_EDIT: boolean;
  16931. DISABLE_KEYBOARD_SHORTCUTS: boolean;
  16932. DEFAULT_INK_ERASER_CURSOR_WIDTH: number;
  16933. COLOR_PRESETS: ColorPreset[];
  16934. LINE_CAP_PRESETS: string[];
  16935. LINE_WIDTH_PRESETS: number[] | null | undefined;
  16936. HIGHLIGHT_COLOR_PRESETS: ColorPreset[];
  16937. TEXT_MARKUP_COLOR_PRESETS: ColorPreset[];
  16938. NOTE_COLOR_PRESETS: ColorPreset[];
  16939. PDF_JAVASCRIPT: boolean;
  16940. BREAKPOINT_MD_TOOLBAR: number;
  16941. BREAKPOINT_SM_TOOLBAR: number;
  16942. };
  16943. SearchPattern: {
  16944. readonly CREDIT_CARD_NUMBER: "credit_card_number";
  16945. readonly DATE: "date";
  16946. readonly TIME: "time";
  16947. readonly EMAIL_ADDRESS: "email_address";
  16948. readonly INTERNATIONAL_PHONE_NUMBER: "international_phone_number";
  16949. readonly IP_V4: "ipv4";
  16950. readonly IP_V6: "ipv6";
  16951. readonly MAC_ADDRESS: "mac_address";
  16952. readonly NORTH_AMERICAN_PHONE_NUMBER: "north_american_phone_number";
  16953. readonly SOCIAL_SECURITY_NUMBER: "social_security_number";
  16954. readonly URL: "url";
  16955. readonly US_ZIP_CODE: "us_zip_code";
  16956. readonly VIN: "vin";
  16957. };
  16958. SearchType: {
  16959. readonly TEXT: "text";
  16960. readonly PRESET: "preset";
  16961. readonly REGEX: "regex";
  16962. };
  16963. UIDateTimeElement: {
  16964. readonly COMMENT_THREAD: "COMMENT_THREAD";
  16965. readonly ANNOTATIONS_SIDEBAR: "ANNOTATIONS_SIDEBAR";
  16966. };
  16967. generateInstantId: typeof generateInstantId;
  16968. Font: typeof Font;
  16969. };
  16970. 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 };