chrome_extensions.js 286 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270
  1. // SSSSSSSSSSSSSSS TTTTTTTTTTTTTTTTTTTTTTT OOOOOOOOO PPPPPPPPPPPPPPPPP
  2. // SS:::::::::::::::ST:::::::::::::::::::::T OO:::::::::OO P::::::::::::::::P
  3. // S:::::SSSSSS::::::ST:::::::::::::::::::::T OO:::::::::::::OO P::::::PPPPPP:::::P
  4. // S:::::S SSSSSSST:::::TT:::::::TT:::::TO:::::::OOO:::::::OPP:::::P P:::::P
  5. // S:::::S TTTTTT T:::::T TTTTTTO::::::O O::::::O P::::P P:::::P
  6. // S:::::S T:::::T O:::::O O:::::O P::::P P:::::P
  7. // S::::SSSS P::::PPPPPP:::::P
  8. // SS::::::SSSSS This file is generated. To update it, P:::::::::::::PP
  9. // SSS::::::::SS run roll_closure_compiler. P::::PPPPPPPPP
  10. // SSSSSS::::S P::::P
  11. // S:::::S T:::::T O:::::O O:::::O P::::P
  12. // S:::::S T:::::T O::::::O O::::::O P::::P
  13. // SSSSSSS S:::::S TT:::::::TT O:::::::OOO:::::::OPP::::::PP
  14. // S::::::SSSSSS:::::S T:::::::::T OO:::::::::::::OO P::::::::P
  15. // S:::::::::::::::SS T:::::::::T OO:::::::::OO P::::::::P
  16. // SSSSSSSSSSSSSSS TTTTTTTTTTT OOOOOOOOO PPPPPPPPPP
  17. /*
  18. * Copyright 2009 The Closure Compiler Authors
  19. *
  20. * Licensed under the Apache License, Version 2.0 (the "License");
  21. * you may not use this file except in compliance with the License.
  22. * You may obtain a copy of the License at
  23. *
  24. * http://www.apache.org/licenses/LICENSE-2.0
  25. *
  26. * Unless required by applicable law or agreed to in writing, software
  27. * distributed under the License is distributed on an "AS IS" BASIS,
  28. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  29. * See the License for the specific language governing permissions and
  30. * limitations under the License.
  31. */
  32. /**
  33. * @fileoverview Definitions for the Chromium extensions API.
  34. *
  35. * This is the externs file for the Chrome Extensions API.
  36. * See http://developer.chrome.com/extensions/
  37. *
  38. * There are several problematic issues regarding Chrome extension APIs and
  39. * this externs files, including:
  40. * A. When to add packages to this file
  41. * B. Optional parameters
  42. * C. Pseudo-types
  43. * D. Events
  44. * E. Nullability
  45. * F. Private APIs
  46. * G. Enums
  47. *
  48. * The best practices for each are described in more detail below. It should be
  49. * noted that, due to historical reasons, and the evolutionary nature of this
  50. * file, much this file currently violates the best practices described below.
  51. * As changes are made, the changes should adhere to the best practices.
  52. *
  53. * A. When to Add Packages to this File?
  54. * Packages in chrome.experimental.* should *not* be added to this file. The
  55. * experimental APIs change very quickly, so rather than add them here, make a
  56. * separate externs file for your project, then move the API here when it moves
  57. * out of experimental.
  58. *
  59. * Some non-experimental APIs are still evolving or are not full documented. It
  60. * is still advantageous to include these in this file as doing so avoids a
  61. * proliferation of project-private externs files containing duplicated info. In
  62. * these cases, use comments to describe the situation.
  63. *
  64. * B. Optional Parameters
  65. * The Chrome extension APIs make extensive use of interior optional parameters
  66. * that are not at the end of the parameter list, while the JS Compiler's type
  67. * system requires optional parameters to be at the end. This creates a bit of
  68. * tension:
  69. *
  70. * 1. If a method has N required params, then the parameter declarations
  71. * should have N required params.
  72. * 2. If, due to interior optional params, a parameter can be of more than
  73. * one type, its at-param should:
  74. * a. be named to indicate both possibilities, eg, extensionIdOrRequest,
  75. * or getInfoOrCallback.
  76. * b. the type should include both types, in the same order as the parts
  77. * of the name, even when one type subsumes the other, eg, {string|*}
  78. * or {Object|function(string)}.
  79. * See chrome.runtime.sendMessage for a complex example as sendMessage takes
  80. * three params with the first and third being optional.
  81. *
  82. * C. Pseudo-types
  83. * The Chrome APIs define many types that are actually pseudo-types, that
  84. * is, they can't be instantiated by name. The extension APIs also pass untyped
  85. * objects (a bag of properties) to callbacks.
  86. *
  87. * The Chrome extension APIs include at least three different situations:
  88. *
  89. * 1. an object that must be created by an extension developer and passed
  90. * into a Chrome extension API and for which there is no constructor.
  91. * 2. an instance of a type that is created inside the extension libraries
  92. * and passed out to a callback/listener or returned by an extension API
  93. * (the constructor implicity lives within the library).
  94. * 3. like #2, but a bag-of-properties object that is passed out to a
  95. * callback/listener or returned by an extension API so there is no
  96. * defined type.
  97. *
  98. * For #1, use a record type so object literals and objects created via
  99. * goog.object are acceptable. (Note: a named record type may be declared using
  100. * the at-record syntax; an anonymous record type may be described using the
  101. * {foo: !Foo, ...} syntax. Anonymous record types may be named using an
  102. * at-typedef annotation. See
  103. * https://github.com/google/closure-compiler/wiki/Types-in-the-Closure-Type-System
  104. * for more information.) For example, the Permissions type defined at
  105. * http://developer.chrome.com/extensions/permissions.html#type-Permissions
  106. * could be:
  107. *
  108. * / **
  109. * * at-typedef {?{
  110. * * permissions: (!Array<string>|undefined),
  111. * * origins: (!Array<string>|undefined),
  112. * * }}
  113. * * /
  114. * chrome.permissions.Permissions;
  115. *
  116. * Using record types provides type-safety for the fields that are defined in
  117. * the object literal and also defined in the record type. Note that record
  118. * types define a minimal interface and will not complain about extraneous
  119. * (often misspelled) fields.
  120. *
  121. * Also, record types are non-nullable by default. The "{?{"
  122. * creates a nullable record-type typedef so ! has the same meaning in usages
  123. * as it does for real types.
  124. *
  125. * For #2, use a standard constructor, even though no constructor is provided
  126. * and extension writers will never instantiate an instance, as using a first
  127. * class type provides the strongest type checking. For example, see the Port
  128. * type defined at http://developer.chrome.com/apps/runtime.html#type-Port.
  129. * Always qualify the type name to reduce top-level pollution in this file:
  130. *
  131. * Do:
  132. * chrome.runtime.Port = function() {}
  133. * Don't:
  134. * function Port() {}
  135. *
  136. * Note that, unfortunately, the actual Port class definition in this file
  137. * does not follow this recommendation.
  138. *
  139. * For #3, the introduction of arrow functions that are frequently used for
  140. * callbacks has changed things. Prior to arrow functions, the Best Practices
  141. * recommended using !Object since that's what in the docs. It was tempting to
  142. * define a real type within this file and treat this situation as identical to
  143. * #2, but that meant a new type was being defined in this file and developers
  144. * did not expect to find required new types in extension files.
  145. *
  146. * Arrow functions change things. The common use of them does not include
  147. * specifying a type for the callback's param, so the compiler infers the type
  148. * from the externs file. This is good and happens automatically with no actions
  149. * required of the developer. Futhermore, since the param has a type, field
  150. * references can use dot access, obj.someField, vs bracket access,
  151. * obj['someField'] as required for !Object.
  152. *
  153. * So, for #3, the best practice is to define a record type for the parameter.
  154. * See chrome.proxy.settings.GetResponse for an example. As mentioned above in
  155. * the section for #1, there are three common ways to introduce a record type
  156. * and any of them are acceptable. Of course, if a type is going to be used more
  157. * than once, it should be named.
  158. *
  159. * While the externs file will define an undocumented record type for a
  160. * callback's param, using !Object as specified in the docs will continue to
  161. * work. This is crucial when a callback is a regular function, as opposed to an
  162. * arrow function (whose parameter's type can be inferred).
  163. *
  164. * D. Events
  165. * Most packages define a set of events with the standard set of methods:
  166. * addListener, removeListener, hasListener and hasListeners. ChromeVoidEvent
  167. * is the appropriate type when an event's listeners do not take any
  168. * parameters, however, many events take parameters specific to that event.
  169. *
  170. * For those cases, create a record type for the event that extends
  171. * ChromeBaseEvent with the correct listener function type filled in.
  172. * See any of the Event type definitions below that extend ChromeBaseEvent for
  173. * an example.
  174. *
  175. * In some cases the addListener method takes more than one argument, so
  176. * inheritance from ChromeBaseEvent will not work. In those cases extend
  177. * ChromeBaseEventNoListeners instead and add the listener interfaces
  178. * explicitly. See any of the Event type definitions below that extend
  179. * ChromeBaseEventNoListeners for an example.
  180. *
  181. * E. Nullability
  182. * We treat the Chrome Extension API pages as "the truth". Not-null types should
  183. * be used in the following situations:
  184. *
  185. * 1. Parameters and return values that are not explicitly declared to handle
  186. * null.
  187. * 2. Static event instances, for example, chrome.runtime.onConnect's type
  188. * should be: !chrome.runtime.PortEvent.
  189. * 3. Optional params as there is little value to passing null when the
  190. * parameter can be omitted, of course, if null is explicitly declared
  191. * to be meaningful, then a nullable type should be used.
  192. *
  193. * F. Private APIs
  194. * Private Chrome APIs (such as those that end in "Private") should go at the
  195. * bottom of this file.
  196. *
  197. * G. Enums
  198. * An enum's type name and the name of its members must be included in an
  199. * externs file, but the values of its members are ignored by the compiler.
  200. * To make it clear enums are not being *defined* in this file, we set
  201. * string enum values to the empty string (at this time, there are no
  202. * known enums of other types).
  203. *
  204. * As of Mar 2016, the chrome extension docs are incomplete wrt to enums
  205. * as they don't list the member names, only their string values. This means
  206. * extension authors will tend to use string literals. Therefore, whereever
  207. * an enum type should be used, we support either the enum or a string. Once
  208. * the docs are complete, new uses of enums will no longer need the "or string"
  209. * portion of the type.
  210. *
  211. * Finally, most places in this file where enums should be used are using only
  212. * string. This is historical and is no longer the recommended practice.
  213. *
  214. * See enum chrome.wallpaper.WallpaperLayout and chrome.wallpaper.setWallpaper's
  215. * param for examples.
  216. *
  217. * @externs
  218. *
  219. */
  220. /*
  221. * Ensure projects don't execute this file.
  222. * The throw is to catch executions of this file, however, without the guard,
  223. * the compiler's flow analysis stops at the throw, even for an externs file.
  224. * Therefore, the Math.random() guard fools the compiler during externs
  225. * processing.
  226. */
  227. if (Math.random() < 1) { // always true but the compiler doesn't know that
  228. throw 'Externs file "chrome_extensions.js" should not be executed';
  229. }
  230. /**
  231. * @const
  232. * @see http://developer.chrome.com/apps/app.runtime.html
  233. */
  234. chrome.app.runtime = {};
  235. /**
  236. * @constructor
  237. * @see http://developer.chrome.com/apps/app_runtime.html
  238. */
  239. chrome.app.runtime.LaunchItem = function() {};
  240. /** @type {!FileEntry} */
  241. chrome.app.runtime.LaunchItem.prototype.entry;
  242. /** @type {string} */
  243. chrome.app.runtime.LaunchItem.prototype.type;
  244. /** @type {!ChromeObjectEvent} */
  245. chrome.app.runtime.onEmbedRequested;
  246. /**
  247. * @constructor
  248. * @see https://developer.chrome.com/apps/app_runtime#event-onLaunched
  249. */
  250. chrome.app.runtime.LaunchData = function() {};
  251. /** @type {!Array<{entry: !FileEntry, type: (string|undefined)}>|undefined} */
  252. chrome.app.runtime.LaunchData.prototype.items;
  253. /** @type {boolean|undefined} */
  254. chrome.app.runtime.LaunchData.prototype.isKioskSession;
  255. /** @type {string|undefined} */
  256. chrome.app.runtime.LaunchData.prototype.source;
  257. /** @type {!ChromeBaseEvent<function(!chrome.app.runtime.LaunchData)>} */
  258. chrome.app.runtime.onLaunched;
  259. /**
  260. * @type {!ChromeEvent}
  261. * @see http://developer.chrome.com/apps/app.runtime.html#event-onRestarted
  262. */
  263. chrome.app.runtime.onRestarted;
  264. /**
  265. * @const
  266. * @see http://developer.chrome.com/apps/app.window.html
  267. */
  268. chrome.app.window = {};
  269. /**
  270. * @see https://developer.chrome.com/apps/app_window#method-getAll
  271. * @return {!Array<!chrome.app.window.AppWindow>}
  272. */
  273. chrome.app.window.getAll = function() {};
  274. /**
  275. * @see https://developer.chrome.com/apps/app_window#method-get
  276. * @param {string} id
  277. * @return {chrome.app.window.AppWindow}
  278. */
  279. chrome.app.window.get = function(id) {};
  280. /**
  281. * @constructor
  282. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  283. */
  284. chrome.app.window.AppWindow = function() {};
  285. /**
  286. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  287. * @return {undefined}
  288. */
  289. chrome.app.window.AppWindow.prototype.focus = function() {};
  290. /**
  291. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  292. * @return {undefined}
  293. */
  294. chrome.app.window.AppWindow.prototype.fullscreen = function() {};
  295. /**
  296. * @return {boolean}
  297. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  298. */
  299. chrome.app.window.AppWindow.prototype.isFullscreen = function() {};
  300. /**
  301. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  302. * @return {undefined}
  303. */
  304. chrome.app.window.AppWindow.prototype.minimize = function() {};
  305. /**
  306. * @return {boolean}
  307. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  308. */
  309. chrome.app.window.AppWindow.prototype.isMinimized = function() {};
  310. /**
  311. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  312. * @return {undefined}
  313. */
  314. chrome.app.window.AppWindow.prototype.maximize = function() {};
  315. /**
  316. * @return {boolean}
  317. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  318. */
  319. chrome.app.window.AppWindow.prototype.isMaximized = function() {};
  320. /**
  321. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  322. * @return {undefined}
  323. */
  324. chrome.app.window.AppWindow.prototype.restore = function() {};
  325. /**
  326. * @param {number} left The new left position, in pixels.
  327. * @param {number} top The new top position, in pixels.
  328. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  329. * @return {undefined}
  330. */
  331. chrome.app.window.AppWindow.prototype.moveTo = function(left, top) {};
  332. /**
  333. * @param {number} width The new width, in pixels.
  334. * @param {number} height The new height, in pixels.
  335. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  336. * @return {undefined}
  337. */
  338. chrome.app.window.AppWindow.prototype.resizeTo = function(width, height) {};
  339. /**
  340. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  341. * @return {undefined}
  342. */
  343. chrome.app.window.AppWindow.prototype.drawAttention = function() {};
  344. /**
  345. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  346. * @return {undefined}
  347. */
  348. chrome.app.window.AppWindow.prototype.clearAttention = function() {};
  349. /**
  350. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  351. * @return {undefined}
  352. */
  353. chrome.app.window.AppWindow.prototype.close = function() {};
  354. /**
  355. * @param {boolean=} opt_focus Should the window be focused? Defaults to true.
  356. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  357. * @return {undefined}
  358. */
  359. chrome.app.window.AppWindow.prototype.show = function(opt_focus) {};
  360. /**
  361. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  362. * @return {undefined}
  363. */
  364. chrome.app.window.AppWindow.prototype.hide = function() {};
  365. /**
  366. * @return {!chrome.app.window.ContentBounds} The current window bounds.
  367. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  368. */
  369. chrome.app.window.AppWindow.prototype.getBounds = function() {};
  370. /**
  371. * @param {!chrome.app.window.ContentBounds} bounds The new window bounds.
  372. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  373. * @return {undefined}
  374. */
  375. chrome.app.window.AppWindow.prototype.setBounds = function(bounds) {};
  376. /**
  377. * @return {boolean}
  378. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  379. */
  380. chrome.app.window.AppWindow.prototype.isAlwaysOnTop = function() {};
  381. /**
  382. * @param {boolean} alwaysOnTop Set whether the window should stay above most
  383. * other windows.
  384. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  385. * @return {undefined}
  386. */
  387. chrome.app.window.AppWindow.prototype.setAlwaysOnTop = function(alwaysOnTop) {};
  388. /**
  389. * @param {boolean} alwaysVisible Set whether the window is visible on all
  390. * workspaces.
  391. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  392. * @return {undefined}
  393. */
  394. chrome.app.window.AppWindow.prototype.setVisibleOnAllWorkspaces = function(
  395. alwaysVisible) {};
  396. /**
  397. * @param {boolean} wantAllKeys Set whether the window should get all keyboard
  398. * events including system keys that are usually not sent.
  399. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
  400. * @return {undefined}
  401. */
  402. chrome.app.window.AppWindow.prototype.setInterceptAllKeys = function(
  403. wantAllKeys) {};
  404. /** @type {!ChromeEvent} */
  405. chrome.app.window.AppWindow.prototype.onBoundsChanged;
  406. /** @type {!ChromeEvent} */
  407. chrome.app.window.AppWindow.prototype.onClosed;
  408. /** @type {!ChromeEvent} */
  409. chrome.app.window.AppWindow.prototype.onFullscreened;
  410. /** @type {!ChromeEvent} */
  411. chrome.app.window.AppWindow.prototype.onMinimized;
  412. /** @type {!ChromeEvent} */
  413. chrome.app.window.AppWindow.prototype.onMaximized;
  414. /** @type {!ChromeEvent} */
  415. chrome.app.window.AppWindow.prototype.onRestored;
  416. /** @type {!Window} */
  417. chrome.app.window.AppWindow.prototype.contentWindow;
  418. /** @type {string} */
  419. chrome.app.window.AppWindow.prototype.id;
  420. /** @type {!chrome.app.window.Bounds} */
  421. chrome.app.window.AppWindow.prototype.innerBounds;
  422. /** @type {!chrome.app.window.Bounds} */
  423. chrome.app.window.AppWindow.prototype.outerBounds;
  424. /**
  425. * @typedef {?{
  426. * left: number,
  427. * top: number,
  428. * width: number,
  429. * height: number,
  430. * minWidth: (number|undefined),
  431. * minHeight: (number|undefined),
  432. * maxWidth: (number|undefined),
  433. * maxHeight: (number|undefined),
  434. * setPosition: function(number, number),
  435. * setSize: function(number, number),
  436. * setMinimumSize: function(number, number),
  437. * setMaximumSize: function(number, number)
  438. * }}
  439. * @see http://developer.chrome.com/apps/app.window.html#type-Bounds
  440. */
  441. chrome.app.window.Bounds;
  442. /**
  443. * @typedef {?{
  444. * left: (number|undefined),
  445. * top: (number|undefined),
  446. * width: (number|undefined),
  447. * height: (number|undefined),
  448. * minWidth: (number|undefined),
  449. * minHeight: (number|undefined),
  450. * maxWidth: (number|undefined),
  451. * maxHeight: (number|undefined)
  452. * }}
  453. * @see http://developer.chrome.com/apps/app_window#type-BoundsSpecification
  454. */
  455. chrome.app.window.BoundsSpecification;
  456. /**
  457. * @typedef {?{
  458. * left: (number|undefined),
  459. * top: (number|undefined),
  460. * width: (number|undefined),
  461. * height: (number|undefined)
  462. * }}
  463. * @see http://developer.chrome.com/apps/app_window#type-ContentBounds
  464. */
  465. chrome.app.window.ContentBounds;
  466. /**
  467. * @typedef {?{
  468. * type: (string|undefined),
  469. * color: (string|undefined),
  470. * activeColor: (string|undefined),
  471. * inactiveColor: (string|undefined)
  472. * }}
  473. * @see http://developer.chrome.com/apps/app_window#type-FrameOptions
  474. */
  475. chrome.app.window.FrameOptions;
  476. /**
  477. * @typedef {?{
  478. * id: (string|undefined),
  479. * innerBounds: (!chrome.app.window.BoundsSpecification|undefined),
  480. * outerBounds: (!chrome.app.window.BoundsSpecification|undefined),
  481. * minWidth: (number|undefined),
  482. * minHeight: (number|undefined),
  483. * maxWidth: (number|undefined),
  484. * maxHeight: (number|undefined),
  485. * frame: (!chrome.app.window.FrameOptions|string|undefined),
  486. * bounds: (!chrome.app.window.ContentBounds|undefined),
  487. * state: (string|undefined),
  488. * hidden: (boolean|undefined),
  489. * resizable: (boolean|undefined),
  490. * singleton: (boolean|undefined),
  491. * alwaysOnTop: (boolean|undefined),
  492. * focused: (boolean|undefined),
  493. * visibleOnAllWorkspaces: (boolean|undefined)
  494. * }}
  495. * @see http://developer.chrome.com/apps/app.window.html#method-create
  496. */
  497. chrome.app.window.CreateWindowOptions;
  498. /**
  499. * @param {string} url URL to create.
  500. * @param {!chrome.app.window.CreateWindowOptions=} opt_options The options for
  501. * the new window.
  502. * @param {function(!chrome.app.window.AppWindow)=} opt_createWindowCallback
  503. * Callback to be run.
  504. * @see http://developer.chrome.com/apps/app.window.html#method-create
  505. * @return {undefined}
  506. */
  507. chrome.app.window.create = function(
  508. url, opt_options, opt_createWindowCallback) {};
  509. /**
  510. * Returns an AppWindow object for the current script context (ie JavaScript
  511. * 'window' object).
  512. * @return {!chrome.app.window.AppWindow}
  513. * @see http://developer.chrome.com/apps/app.window.html#method-current
  514. */
  515. chrome.app.window.current = function() {};
  516. /**
  517. * @type {!ChromeEvent}
  518. * @see http://developer.chrome.com/apps/app.window.html#event-onBoundsChanged
  519. */
  520. chrome.app.window.onBoundsChanged;
  521. /**
  522. * @type {!ChromeEvent}
  523. * @see http://developer.chrome.com/apps/app.window.html#event-onClosed
  524. */
  525. chrome.app.window.onClosed;
  526. /**
  527. * @type {!ChromeEvent}
  528. * @see http://developer.chrome.com/apps/app.window.html#event-onFullscreened
  529. */
  530. chrome.app.window.onFullscreened;
  531. /**
  532. * @type {!ChromeEvent}
  533. * @see http://developer.chrome.com/apps/app.window.html#event-onMaximized
  534. */
  535. chrome.app.window.onMaximized;
  536. /**
  537. * @type {!ChromeEvent}
  538. * @see http://developer.chrome.com/apps/app.window.html#event-onMinimized
  539. */
  540. chrome.app.window.onMinimized;
  541. /**
  542. * @type {!ChromeEvent}
  543. * @see http://developer.chrome.com/apps/app.window.html#event-onRestored
  544. */
  545. chrome.app.window.onRestored;
  546. /**
  547. * Private API.
  548. *
  549. * @const
  550. * @see https://code.google.com/p/chromium/codesearch#chromium/src/chrome/common/extensions/api/audio_modem.idl
  551. * @see go/chrome-modem
  552. */
  553. chrome.audioModem = {};
  554. /**
  555. * @typedef {?{
  556. * tokenLength: number,
  557. * crc: (boolean|undefined),
  558. * parity: (boolean|undefined)
  559. * }}
  560. */
  561. chrome.audioModem.TokenEncoding;
  562. /**
  563. * @typedef {?{
  564. * timeoutMillis: number,
  565. * band: string,
  566. * encoding: !chrome.audioModem.TokenEncoding
  567. * }}
  568. */
  569. chrome.audioModem.RequestParams;
  570. /** @constructor */
  571. chrome.audioModem.ReceivedToken = function() {};
  572. /** @type {!ArrayBuffer} */
  573. chrome.audioModem.ReceivedToken.prototype.token;
  574. /** @type {string} */
  575. chrome.audioModem.ReceivedToken.prototype.band;
  576. /**
  577. * @param {!chrome.audioModem.RequestParams} params
  578. * @param {!ArrayBuffer} token
  579. * @param {function(string)} callback
  580. * @return {undefined}
  581. */
  582. chrome.audioModem.transmit = function(params, token, callback) {};
  583. /**
  584. * @param {string} band
  585. * @param {function(string)} callback
  586. * @return {undefined}
  587. */
  588. chrome.audioModem.stopTransmit = function(band, callback) {};
  589. /**
  590. * @param {!chrome.audioModem.RequestParams} params
  591. * @param {function(string)} callback
  592. * @return {undefined}
  593. */
  594. chrome.audioModem.receive = function(params, callback) {};
  595. /**
  596. * @param {string} band
  597. * @param {function(string)} callback
  598. * @return {undefined}
  599. */
  600. chrome.audioModem.stopReceive = function(band, callback) {};
  601. /**
  602. * @interface
  603. * @extends {ChromeBaseEvent<function(!Array<!chrome.audioModem.ReceivedToken>)>}
  604. */
  605. chrome.audioModem.ReceivedEvent = function() {};
  606. /** @type {!chrome.audioModem.ReceivedEvent} */
  607. chrome.audioModem.onReceived;
  608. /** @type {!ChromeStringEvent} */
  609. chrome.audioModem.onTransmitFail;
  610. /**
  611. * @see https://developer.chrome.com/apps/bluetooth
  612. */
  613. chrome.bluetooth = {};
  614. /**
  615. * @constructor
  616. * @see https://developer.chrome.com/apps/bluetooth#type-AdapterState
  617. */
  618. chrome.bluetooth.AdapterState = function() {};
  619. /** @type {string} */
  620. chrome.bluetooth.AdapterState.prototype.address;
  621. /** @type {string} */
  622. chrome.bluetooth.AdapterState.prototype.name;
  623. /** @type {boolean} */
  624. chrome.bluetooth.AdapterState.prototype.powered;
  625. /** @type {boolean} */
  626. chrome.bluetooth.AdapterState.prototype.available;
  627. /** @type {boolean} */
  628. chrome.bluetooth.AdapterState.prototype.discovering;
  629. /**
  630. * @constructor
  631. * @see https://developer.chrome.com/apps/bluetooth#type-Device
  632. */
  633. chrome.bluetooth.Device = function() {};
  634. /** @type {string} */
  635. chrome.bluetooth.Device.prototype.address;
  636. /** @type {string|undefined} */
  637. chrome.bluetooth.Device.prototype.name;
  638. /** @type {number|undefined} */
  639. chrome.bluetooth.Device.prototype.deviceClass;
  640. /** @type {string|undefined} */
  641. chrome.bluetooth.Device.prototype.vendorIdSource;
  642. /** @type {string|undefined} */
  643. chrome.bluetooth.Device.prototype.vendorId;
  644. /** @type {number|undefined} */
  645. chrome.bluetooth.Device.prototype.productId;
  646. /** @type {number|undefined} */
  647. chrome.bluetooth.Device.prototype.deviceId;
  648. /** @type {string|undefined} */
  649. chrome.bluetooth.Device.prototype.type;
  650. /** @type {boolean|undefined} */
  651. chrome.bluetooth.Device.prototype.paired;
  652. /** @type {boolean|undefined} */
  653. chrome.bluetooth.Device.prototype.connected;
  654. /** @type {boolean|undefined} */
  655. chrome.bluetooth.Device.prototype.connecting;
  656. /** @type {boolean|undefined} */
  657. chrome.bluetooth.Device.prototype.connectable;
  658. /** @type {!Array<string>|undefined} */
  659. chrome.bluetooth.Device.prototype.uuids;
  660. /** @type {number|undefined} */
  661. chrome.bluetooth.Device.prototype.inquiryRssi;
  662. /** @type {number|undefined} */
  663. chrome.bluetooth.Device.prototype.inquiryTxPower;
  664. /**
  665. * @param {function(!chrome.bluetooth.AdapterState)} callback
  666. * @see https://developer.chrome.com/apps/bluetooth#method-getAdapterState
  667. * @return {undefined}
  668. */
  669. chrome.bluetooth.getAdapterState = function(callback) {};
  670. /**
  671. * @param {string} deviceAddress
  672. * @param {function(!chrome.bluetooth.Device)} callback
  673. * @see https://developer.chrome.com/apps/bluetooth#method-getDevice
  674. * @return {undefined}
  675. */
  676. chrome.bluetooth.getDevice = function(deviceAddress, callback) {};
  677. /**
  678. * @param {function(!Array<!chrome.bluetooth.Device>)} callback
  679. * @see https://developer.chrome.com/apps/bluetooth#method-getDevices
  680. * @return {undefined}
  681. */
  682. chrome.bluetooth.getDevices = function(callback) {};
  683. /**
  684. * @param {function()=} opt_callback
  685. * @see https://developer.chrome.com/apps/bluetooth#method-startDiscovery
  686. * @return {undefined}
  687. */
  688. chrome.bluetooth.startDiscovery = function(opt_callback) {};
  689. /**
  690. * @param {function()=} opt_callback
  691. * @see https://developer.chrome.com/apps/bluetooth#method-stopDiscovery
  692. * @return {undefined}
  693. */
  694. chrome.bluetooth.stopDiscovery = function(opt_callback) {};
  695. /**
  696. * Event whose listeners take an AdapaterState parameter.
  697. * @interface
  698. * @extends {ChromeBaseEvent<function(!chrome.bluetooth.AdapterState)>}
  699. */
  700. chrome.bluetooth.AdapterStateEvent = function() {};
  701. /**
  702. * @type {!chrome.bluetooth.AdapterStateEvent}
  703. * @see https://developer.chrome.com/apps/bluetooth#event-onAdapterStateChanged
  704. */
  705. chrome.bluetooth.onAdapterStateChanged;
  706. /**
  707. * Event whose listeners take an Device parameter.
  708. * @interface
  709. * @extends {ChromeBaseEvent<function(!chrome.bluetooth.Device)>}
  710. */
  711. chrome.bluetooth.DeviceEvent = function() {};
  712. /**
  713. * @type {!chrome.bluetooth.DeviceEvent}
  714. * @see https://developer.chrome.com/apps/bluetooth#event-onDeviceAdded
  715. */
  716. chrome.bluetooth.onDeviceAdded;
  717. /**
  718. * @type {!chrome.bluetooth.DeviceEvent}
  719. * @see https://developer.chrome.com/apps/bluetooth#event-onDeviceChanged
  720. */
  721. chrome.bluetooth.onDeviceChanged;
  722. /**
  723. * @type {!chrome.bluetooth.DeviceEvent}
  724. * @see https://developer.chrome.com/apps/bluetooth#event-onDeviceRemoved
  725. */
  726. chrome.bluetooth.onDeviceRemoved;
  727. /**
  728. * @const
  729. * @see https://developer.chrome.com/apps/bluetoothSocket
  730. */
  731. chrome.bluetoothSocket = {};
  732. /**
  733. * @typedef {{
  734. * persistent: (boolean|undefined),
  735. * name: (string|undefined),
  736. * bufferSize: (number|undefined)
  737. * }}
  738. * @see https://developer.chrome.com/apps/bluetoothSocket#type-SocketProperties
  739. */
  740. chrome.bluetoothSocket.SocketProperties;
  741. /**
  742. * @typedef {{
  743. * channel: (number|undefined),
  744. * psm: (number|undefined),
  745. * backlog: (number|undefined)
  746. * }}
  747. * @see https://developer.chrome.com/apps/bluetoothSocket#type-ListenOptions
  748. */
  749. chrome.bluetoothSocket.ListenOptions;
  750. /**
  751. * @constructor
  752. * @see https://developer.chrome.com/apps/bluetoothSocket#type-SocketInfo
  753. */
  754. chrome.bluetoothSocket.SocketInfo = function() {};
  755. /** @type {number} */
  756. chrome.bluetoothSocket.SocketInfo.prototype.socketId;
  757. /** @type {boolean} */
  758. chrome.bluetoothSocket.SocketInfo.prototype.persistent;
  759. /** @type {string|undefined} */
  760. chrome.bluetoothSocket.SocketInfo.prototype.name;
  761. /** @type {number|undefined} */
  762. chrome.bluetoothSocket.SocketInfo.prototype.bufferSize;
  763. /** @type {boolean} */
  764. chrome.bluetoothSocket.SocketInfo.prototype.paused;
  765. /** @type {boolean} */
  766. chrome.bluetoothSocket.SocketInfo.prototype.connected;
  767. /** @type {string|undefined} */
  768. chrome.bluetoothSocket.SocketInfo.prototype.address;
  769. /** @type {string|undefined} */
  770. chrome.bluetoothSocket.SocketInfo.prototype.uuid;
  771. /**
  772. * @param {!chrome.bluetoothSocket.SocketProperties|
  773. * function(!{socketId: number})} propertiesOrCallback
  774. * @param {function(!{socketId: number})=} opt_callback
  775. * @see https://developer.chrome.com/apps/bluetoothSocket#method-create
  776. * @return {undefined}
  777. */
  778. chrome.bluetoothSocket.create = function(propertiesOrCallback, opt_callback) {};
  779. /**
  780. * @param {number} socketId
  781. * @param {!chrome.bluetoothSocket.SocketProperties} properties
  782. * @param {function()=} opt_callback
  783. * @see https://developer.chrome.com/apps/bluetoothSocket#method-update
  784. * @return {undefined}
  785. */
  786. chrome.bluetoothSocket.update = function(socketId, properties, opt_callback) {};
  787. /**
  788. * @param {number} socketId
  789. * @param {boolean} paused
  790. * @param {function()=} opt_callback
  791. * @see https://developer.chrome.com/apps/bluetoothSocket#method-setPaused
  792. * @return {undefined}
  793. */
  794. chrome.bluetoothSocket.setPaused = function(socketId, paused, opt_callback) {};
  795. /**
  796. * @param {number} socketId
  797. * @param {string} uuid
  798. * @param {!chrome.bluetoothSocket.ListenOptions|function()} optionsOrCallback
  799. * @param {function()=} opt_callback
  800. * @see https://developer.chrome.com/apps/bluetoothSocket#method-listenUsingRfcomm
  801. * @return {undefined}
  802. */
  803. chrome.bluetoothSocket.listenUsingRfcomm = function(
  804. socketId, uuid, optionsOrCallback, opt_callback) {};
  805. /**
  806. * @param {number} socketId
  807. * @param {string} uuid
  808. * @param {!chrome.bluetoothSocket.ListenOptions|function()} optionsOrCallback
  809. * @param {function()=} opt_callback
  810. * @see https://developer.chrome.com/apps/bluetoothSocket#method-listenUsingL2cap
  811. * @return {undefined}
  812. */
  813. chrome.bluetoothSocket.listenUsingL2cap = function(
  814. socketId, uuid, optionsOrCallback, opt_callback) {};
  815. /**
  816. * @param {number} socketId
  817. * @param {string} address
  818. * @param {string} uuid
  819. * @param {function()} callback
  820. * @see https://developer.chrome.com/apps/bluetoothSocket#method-connect
  821. * @return {undefined}
  822. */
  823. chrome.bluetoothSocket.connect = function(socketId, address, uuid, callback) {};
  824. /**
  825. * @param {number} socketId
  826. * @param {function()=} opt_callback
  827. * @see https://developer.chrome.com/apps/bluetoothSocket#method-disconnect
  828. * @return {undefined}
  829. */
  830. chrome.bluetoothSocket.disconnect = function(socketId, opt_callback) {};
  831. /**
  832. * @param {number} socketId
  833. * @param {function()=} opt_callback
  834. * @see https://developer.chrome.com/apps/bluetoothSocket#method-close
  835. * @return {undefined}
  836. */
  837. chrome.bluetoothSocket.close = function(socketId, opt_callback) {};
  838. /**
  839. * @param {number} socketId
  840. * @param {!ArrayBuffer} data
  841. * @param {function(number)=} opt_callback
  842. * @see https://developer.chrome.com/apps/bluetoothSocket#method-send
  843. * @return {undefined}
  844. */
  845. chrome.bluetoothSocket.send = function(socketId, data, opt_callback) {};
  846. /**
  847. * @param {number} socketId
  848. * @param {function(!chrome.bluetoothSocket.SocketInfo)} callback
  849. * @see https://developer.chrome.com/apps/bluetoothSocket#method-getInfo
  850. * @return {undefined}
  851. */
  852. chrome.bluetoothSocket.getInfo = function(socketId, callback) {};
  853. /**
  854. * @param {function(!Array<!chrome.bluetoothSocket.SocketInfo>)} callback
  855. * @see https://developer.chrome.com/apps/bluetoothSocket#method-getSockets
  856. * @return {undefined}
  857. */
  858. chrome.bluetoothSocket.getSockets = function(callback) {};
  859. /**
  860. * @constructor
  861. * @see https://developer.chrome.com/apps/bluetoothSocket#event-onAccept
  862. */
  863. chrome.bluetoothSocket.AcceptEventData = function() {};
  864. /** @type {number} */
  865. chrome.bluetoothSocket.AcceptEventData.prototype.socketId;
  866. /** @type {number} */
  867. chrome.bluetoothSocket.AcceptEventData.prototype.clientSocketId;
  868. /**
  869. * Event whose listeners take a AcceptEventData parameter.
  870. * @interface
  871. * @extends {ChromeBaseEvent<function(!chrome.bluetoothSocket.AcceptEventData)>}
  872. */
  873. chrome.bluetoothSocket.AcceptEvent = function() {};
  874. /** @type {!chrome.bluetoothSocket.AcceptEvent} */
  875. chrome.bluetoothSocket.onAccept;
  876. /**
  877. * @constructor
  878. * @see https://developer.chrome.com/apps/bluetoothSocket#event-onAcceptError
  879. */
  880. chrome.bluetoothSocket.AcceptErrorEventData = function() {};
  881. /** @type {number} */
  882. chrome.bluetoothSocket.AcceptErrorEventData.prototype.socketId;
  883. /** @type {string} */
  884. chrome.bluetoothSocket.AcceptErrorEventData.prototype.errorMessage;
  885. /** @type {string} */
  886. chrome.bluetoothSocket.AcceptErrorEventData.prototype.error;
  887. /**
  888. * Event whose listeners take a AcceptErrorEventData parameter.
  889. * @interface
  890. * @extends {ChromeBaseEvent<function(!chrome.bluetoothSocket.AcceptErrorEventData)>}
  891. */
  892. chrome.bluetoothSocket.AcceptErrorEvent = function() {};
  893. /** @type {!chrome.bluetoothSocket.AcceptErrorEvent} */
  894. chrome.bluetoothSocket.onAcceptError;
  895. /**
  896. * @constructor
  897. * @see https://developer.chrome.com/apps/bluetoothSocket#event-onReceive
  898. */
  899. chrome.bluetoothSocket.ReceiveEventData = function() {};
  900. /** @type {number} */
  901. chrome.bluetoothSocket.ReceiveEventData.prototype.socketId;
  902. /** @type {!ArrayBuffer} */
  903. chrome.bluetoothSocket.ReceiveEventData.prototype.data;
  904. /**
  905. * Event whose listeners take a ReceiveEventData parameter.
  906. * @interface
  907. * @extends
  908. * {ChromeBaseEvent<function(!chrome.bluetoothSocket.ReceiveEventData)>}
  909. */
  910. chrome.bluetoothSocket.ReceiveEvent = function() {};
  911. /** @type {!chrome.bluetoothSocket.ReceiveEvent} */
  912. chrome.bluetoothSocket.onReceive;
  913. /**
  914. * @constructor
  915. * @see https://developer.chrome.com/apps/bluetoothSocket#event-onReceiveError
  916. */
  917. chrome.bluetoothSocket.ReceiveErrorEventData = function() {};
  918. /** @type {number} */
  919. chrome.bluetoothSocket.ReceiveErrorEventData.prototype.socketId;
  920. /** @type {string} */
  921. chrome.bluetoothSocket.ReceiveErrorEventData.prototype.errorMessage;
  922. /** @type {string} */
  923. chrome.bluetoothSocket.ReceiveErrorEventData.prototype.error;
  924. /**
  925. * Event whose listeners take a ReceiveErrorEventData parameter.
  926. * @interface
  927. * @extends {ChromeBaseEvent<
  928. * function(!chrome.bluetoothSocket.ReceiveErrorEventData)>}
  929. */
  930. chrome.bluetoothSocket.ReceiveErrorEvent = function() {};
  931. /** @type {!chrome.bluetoothSocket.ReceiveErrorEvent} */
  932. chrome.bluetoothSocket.onReceiveError;
  933. /**
  934. * @see https://developer.chrome.com/apps/bluetoothLowEnergy
  935. * @const
  936. */
  937. chrome.bluetoothLowEnergy = {};
  938. /**
  939. * @typedef {?{
  940. * uuid: string,
  941. * isPrimary: boolean,
  942. * instanceId: (string|undefined),
  943. * deviceAddress: (string|undefined)
  944. * }}
  945. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#type-Service
  946. */
  947. chrome.bluetoothLowEnergy.Service;
  948. /**
  949. * @constructor
  950. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#type-Request
  951. */
  952. chrome.bluetoothLowEnergy.Request = function() {};
  953. /** @type {number} */
  954. chrome.bluetoothLowEnergy.Request.prototype.requestId;
  955. /** @type {!Object} */
  956. chrome.bluetoothLowEnergy.Request.prototype.device;
  957. /** @type {!ArrayBuffer|undefined} */
  958. chrome.bluetoothLowEnergy.Request.prototype.value;
  959. /**
  960. * @typedef {?{
  961. * uuid: string,
  962. * service: (!chrome.bluetoothLowEnergy.Service|undefined),
  963. * properties: !Array<string>,
  964. * instanceId: (string|undefined),
  965. * value: (!ArrayBuffer|undefined)
  966. * }}
  967. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#type-Characteristic
  968. */
  969. chrome.bluetoothLowEnergy.Characteristic;
  970. /**
  971. * @typedef {?{
  972. * uuid: string,
  973. * characteristic: (!chrome.bluetoothLowEnergy.Characteristic|undefined),
  974. * permissions: !Array<string>,
  975. * instanceId: (string|undefined),
  976. * value: (!ArrayBuffer|undefined)
  977. * }}
  978. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#type-Descriptor
  979. */
  980. chrome.bluetoothLowEnergy.Descriptor;
  981. /**
  982. * @typedef {?{
  983. * persistent: boolean
  984. * }}
  985. */
  986. chrome.bluetoothLowEnergy.ConnectionProperties;
  987. /**
  988. * @param {string} deviceAddress
  989. * @param {!chrome.bluetoothLowEnergy.ConnectionProperties|function()}
  990. * propertiesOrCallback
  991. * @param {function()=} opt_callback
  992. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-connect
  993. * @return {undefined}
  994. */
  995. chrome.bluetoothLowEnergy.connect = function(
  996. deviceAddress, propertiesOrCallback, opt_callback) {};
  997. /**
  998. * @param {string} deviceAddress
  999. * @param {function()=} opt_callback
  1000. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-disconnect
  1001. * @return {undefined}
  1002. */
  1003. chrome.bluetoothLowEnergy.disconnect = function(deviceAddress, opt_callback) {};
  1004. /**
  1005. * @param {string} serviceId
  1006. * @param {function(!chrome.bluetoothLowEnergy.Service)} callback
  1007. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-getService
  1008. * @return {undefined}
  1009. */
  1010. chrome.bluetoothLowEnergy.getService = function(serviceId, callback) {};
  1011. /**
  1012. * @param {!chrome.bluetoothLowEnergy.Service} service
  1013. * @param {function(string)} callback
  1014. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-createService
  1015. * @return {undefined}
  1016. */
  1017. chrome.bluetoothLowEnergy.createService = function(service, callback) {};
  1018. /**
  1019. * @param {string} deviceAddress
  1020. * @param {function(!Array<!chrome.bluetoothLowEnergy.Service>)} callback
  1021. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-getServices
  1022. * @return {undefined}
  1023. */
  1024. chrome.bluetoothLowEnergy.getServices = function(deviceAddress, callback) {};
  1025. /**
  1026. * @param {string} characteristicId
  1027. * @param {function(!chrome.bluetoothLowEnergy.Characteristic)} callback
  1028. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-getCharacteristic
  1029. * @return {undefined}
  1030. */
  1031. chrome.bluetoothLowEnergy.getCharacteristic = function(
  1032. characteristicId, callback) {};
  1033. /**
  1034. * @param {!chrome.bluetoothLowEnergy.Characteristic} characteristic
  1035. * @param {string} serviceId
  1036. * @param {function(string)} callback
  1037. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-createCharacteristic
  1038. * @return {undefined}
  1039. */
  1040. chrome.bluetoothLowEnergy.createCharacteristic = function(
  1041. characteristic, serviceId, callback) {};
  1042. /**
  1043. * @param {string} serviceId
  1044. * @param {function(!Array<!chrome.bluetoothLowEnergy.Characteristic>)}
  1045. * callback
  1046. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-getCharacteristics
  1047. * @return {undefined}
  1048. */
  1049. chrome.bluetoothLowEnergy.getCharacteristics = function(serviceId, callback) {};
  1050. /**
  1051. * @param {string} serviceId
  1052. * @param {function(!Array<!chrome.bluetoothLowEnergy.Service>)} callback
  1053. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-getIncludedServices
  1054. * @return {undefined}
  1055. */
  1056. chrome.bluetoothLowEnergy.getIncludedServices = function(
  1057. serviceId, callback) {};
  1058. /**
  1059. * @param {string} descriptorId
  1060. * @param {function(!chrome.bluetoothLowEnergy.Descriptor)} callback
  1061. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-getDescriptor
  1062. * @return {undefined}
  1063. */
  1064. chrome.bluetoothLowEnergy.getDescriptor = function(descriptorId, callback) {};
  1065. /**
  1066. * @param {!chrome.bluetoothLowEnergy.Descriptor} descriptor
  1067. * @param {string} characteristicId
  1068. * @param {function(string)} callback
  1069. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-createDescriptor
  1070. * @return {undefined}
  1071. */
  1072. chrome.bluetoothLowEnergy.createDescriptor = function(
  1073. descriptor, characteristicId, callback) {};
  1074. /**
  1075. * @param {string} characteristicId
  1076. * @param {function(!Array<!chrome.bluetoothLowEnergy.Descriptor>)} callback
  1077. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-getDescriptors
  1078. * @return {undefined}
  1079. */
  1080. chrome.bluetoothLowEnergy.getDescriptors = function(
  1081. characteristicId, callback) {};
  1082. /**
  1083. * @param {string} characteristicId
  1084. * @param {function(!chrome.bluetoothLowEnergy.Characteristic)} callback
  1085. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-readCharacteristicValue
  1086. * @return {undefined}
  1087. */
  1088. chrome.bluetoothLowEnergy.readCharacteristicValue = function(
  1089. characteristicId, callback) {};
  1090. /**
  1091. * @param {string} characteristicId
  1092. * @param {!ArrayBuffer} value
  1093. * @param {function()} callback
  1094. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-writeCharacteristicValue
  1095. * @return {undefined}
  1096. */
  1097. chrome.bluetoothLowEnergy.writeCharacteristicValue = function(
  1098. characteristicId, value, callback) {};
  1099. /**
  1100. * @typedef {?{
  1101. * persistent: boolean
  1102. * }}
  1103. */
  1104. chrome.bluetoothLowEnergy.NotificationSessionProperties;
  1105. /**
  1106. * @param {string} characteristicId
  1107. * @param {!chrome.bluetoothLowEnergy.NotificationSessionProperties|function()}
  1108. * propertiesOrCallback
  1109. * @param {function()=} opt_callback
  1110. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-startCharacteristicNotifications
  1111. * @return {undefined}
  1112. */
  1113. chrome.bluetoothLowEnergy.startCharacteristicNotifications = function(
  1114. characteristicId, propertiesOrCallback, opt_callback) {};
  1115. /**
  1116. * @param {string} characteristicId
  1117. * @param {function()=} opt_callback
  1118. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-stopCharacteristicNotifications
  1119. * @return {undefined}
  1120. */
  1121. chrome.bluetoothLowEnergy.stopCharacteristicNotifications = function(
  1122. characteristicId, opt_callback) {};
  1123. /**
  1124. * @typedef {?{
  1125. * value: !ArrayBuffer,
  1126. * shouldIndicate: (boolean|undefined)
  1127. * }}
  1128. */
  1129. chrome.bluetoothLowEnergy.NotificationIndication;
  1130. /**
  1131. * @param {string} characteristicId
  1132. * @param {!chrome.bluetoothLowEnergy.NotificationIndication} notification
  1133. * @param {function()} callback
  1134. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-notifyCharacteristicValueChanged
  1135. * @return {undefined}
  1136. */
  1137. chrome.bluetoothLowEnergy.notifyCharacteristicValueChanged = function(
  1138. characteristicId, notification, callback) {};
  1139. /**
  1140. * @param {string} descriptorId
  1141. * @param {function(!chrome.bluetoothLowEnergy.Descriptor)} callback
  1142. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-readDescriptorValue
  1143. * @return {undefined}
  1144. */
  1145. chrome.bluetoothLowEnergy.readDescriptorValue = function(
  1146. descriptorId, callback) {};
  1147. /**
  1148. * @param {string} descriptorId
  1149. * @param {!ArrayBuffer} value
  1150. * @param {function()} callback
  1151. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-writeDescriptorValue
  1152. * @return {undefined}
  1153. */
  1154. chrome.bluetoothLowEnergy.writeDescriptorValue = function(
  1155. descriptorId, value, callback) {};
  1156. /**
  1157. * @param {string} serviceId
  1158. * @param {function()} callback
  1159. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-registerService
  1160. * @return {undefined}
  1161. */
  1162. chrome.bluetoothLowEnergy.registerService = function(serviceId, callback) {};
  1163. /**
  1164. * @param {string} serviceId
  1165. * @param {function()} callback
  1166. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-unregisterService
  1167. * @return {undefined}
  1168. */
  1169. chrome.bluetoothLowEnergy.unregisterService = function(serviceId, callback) {};
  1170. /**
  1171. * @param {string} serviceId
  1172. * @param {function()=} opt_callback
  1173. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-removeService
  1174. * @return {undefined}
  1175. */
  1176. chrome.bluetoothLowEnergy.removeService = function(serviceId, opt_callback) {};
  1177. /**
  1178. * @typedef {?{
  1179. * type: string,
  1180. * serviceUuids: (!Array<string>|undefined),
  1181. * manufacturerData: (!Array<{id: number, data: !Array<number>}>|undefined),
  1182. * solicitUuids: (!Array<string>|undefined),
  1183. * serviceData: (!Array<{uuid: string, data: !Array<number>}>|undefined)
  1184. * }}
  1185. */
  1186. chrome.bluetoothLowEnergy.Advertisement;
  1187. /**
  1188. * @param {!chrome.bluetoothLowEnergy.Advertisement} advertisement
  1189. * @param {function(number)} callback
  1190. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-registerAdvertisement
  1191. */
  1192. chrome.bluetoothLowEnergy.registerAdvertisement = function(
  1193. advertisement, callback) {};
  1194. /**
  1195. * @param {number} advertisementId
  1196. * @param {function()} callback
  1197. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-unregisterAdvertisement
  1198. */
  1199. chrome.bluetoothLowEnergy.unregisterAdvertisement = function(
  1200. advertisementId, callback) {};
  1201. /**
  1202. * @param {function()} callback
  1203. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-resetAdvertising
  1204. */
  1205. chrome.bluetoothLowEnergy.resetAdvertising = function(callback) {};
  1206. /**
  1207. * @param {number} minInterval
  1208. * @param {number} maxInterval
  1209. * @param {function()} callback
  1210. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-setAdvertisingInterval
  1211. */
  1212. chrome.bluetoothLowEnergy.setAdvertisingInterval = function(
  1213. minInterval, maxInterval, callback) {};
  1214. /**
  1215. * @typedef {?{
  1216. * requestId: number,
  1217. * isError: boolean,
  1218. * value: (!ArrayBuffer|undefined)
  1219. * }}
  1220. */
  1221. chrome.bluetoothLowEnergy.RequestResponse;
  1222. /** @param {!chrome.bluetoothLowEnergy.RequestResponse} response */
  1223. chrome.bluetoothLowEnergy.sendRequestResponse = function(response) {};
  1224. /**
  1225. * Event whose listeners take a Service parameter.
  1226. * @interface
  1227. * @extends {ChromeBaseEvent<function(!chrome.bluetoothLowEnergy.Service)>}
  1228. */
  1229. chrome.bluetoothLowEnergy.ServiceEvent = function() {};
  1230. /**
  1231. * @type {!chrome.bluetoothLowEnergy.ServiceEvent}
  1232. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#event-onServiceAdded
  1233. */
  1234. chrome.bluetoothLowEnergy.onServiceAdded;
  1235. /**
  1236. * @type {!chrome.bluetoothLowEnergy.ServiceEvent}
  1237. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#event-onServiceChanged
  1238. */
  1239. chrome.bluetoothLowEnergy.onServiceChanged;
  1240. /**
  1241. * @type {!chrome.bluetoothLowEnergy.ServiceEvent}
  1242. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#event-onServiceRemoved
  1243. */
  1244. chrome.bluetoothLowEnergy.onServiceRemoved;
  1245. /**
  1246. * Event whose listeners take a Characteristic parameter.
  1247. * @interface
  1248. * @extends {ChromeBaseEvent<function(!chrome.bluetoothLowEnergy.Characteristic)>}
  1249. */
  1250. chrome.bluetoothLowEnergy.CharacteristicEvent = function() {};
  1251. /**
  1252. * @type {!chrome.bluetoothLowEnergy.CharacteristicEvent}
  1253. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#event-onCharacteristicValueChanged
  1254. */
  1255. chrome.bluetoothLowEnergy.onCharacteristicValueChanged;
  1256. /**
  1257. * Event whose listeners take a Descriptor parameter.
  1258. * @interface
  1259. * @extends {ChromeBaseEvent<function(!chrome.bluetoothLowEnergy.Descriptor)>}
  1260. */
  1261. chrome.bluetoothLowEnergy.DescriptorEvent = function() {};
  1262. /**
  1263. * @type {!chrome.bluetoothLowEnergy.DescriptorEvent}
  1264. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#event-onDescriptorValueChanged
  1265. */
  1266. chrome.bluetoothLowEnergy.onDescriptorValueChanged;
  1267. /**
  1268. * Event whose listeners take a Request parameter.
  1269. * @interface
  1270. * @extends {ChromeBaseEvent<function(!chrome.bluetoothLowEnergy.Request,
  1271. * string)>}
  1272. */
  1273. chrome.bluetoothLowEnergy.RequestEvent = function() {};
  1274. /**
  1275. * @type {!chrome.bluetoothLowEnergy.RequestEvent}
  1276. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#event-onCharacteristicReadRequest
  1277. */
  1278. chrome.bluetoothLowEnergy.onCharacteristicReadRequest;
  1279. /**
  1280. * @type {!chrome.bluetoothLowEnergy.RequestEvent}
  1281. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#event-onCharacteristicWriteRequest
  1282. */
  1283. chrome.bluetoothLowEnergy.onCharacteristicWriteRequest;
  1284. /**
  1285. * @type {!chrome.bluetoothLowEnergy.RequestEvent}
  1286. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#event-onDescriptorReadRequest
  1287. */
  1288. chrome.bluetoothLowEnergy.onDescriptorReadRequest;
  1289. /**
  1290. * @type {!chrome.bluetoothLowEnergy.RequestEvent}
  1291. * @see https://developer.chrome.com/apps/bluetoothLowEnergy#event-onDescriptorWriteRequest
  1292. */
  1293. chrome.bluetoothLowEnergy.onDescriptorWriteRequest;
  1294. /**
  1295. * @const
  1296. * @see https://developer.chrome.com/extensions/browsingData
  1297. */
  1298. chrome.browsingData = {};
  1299. /**
  1300. * @typedef {?{
  1301. * since: (number|undefined),
  1302. * originTypes: ({
  1303. * unprotectedWeb: (boolean|undefined),
  1304. * protectedWeb: (boolean|undefined),
  1305. * extension: (boolean|undefined)
  1306. * }|undefined),
  1307. * }}
  1308. * @see https://developer.chrome.com/extensions/browsingData#type-RemovalOptions
  1309. */
  1310. chrome.browsingData.RemovalOptions;
  1311. /**
  1312. * @typedef {?{
  1313. * appcache: (boolean|undefined),
  1314. * cache: (boolean|undefined),
  1315. * cookies: (boolean|undefined),
  1316. * downloads: (boolean|undefined),
  1317. * fileSystems: (boolean|undefined),
  1318. * formData: (boolean|undefined),
  1319. * history: (boolean|undefined),
  1320. * indexedDB: (boolean|undefined),
  1321. * localStorage: (boolean|undefined),
  1322. * serverBoundCertificates: (boolean|undefined),
  1323. * passwords: (boolean|undefined),
  1324. * pluginData: (boolean|undefined),
  1325. * serviceWorkers: (boolean|undefined),
  1326. * webSQL: (boolean|undefined),
  1327. * }}
  1328. * @see https://developer.chrome.com/extensions/browsingData#type-DataTypeSet
  1329. */
  1330. chrome.browsingData.DataTypeSet;
  1331. /**
  1332. * @typedef {?{
  1333. * options: !chrome.browsingData.RemovalOptions,
  1334. * dataToRemove: !chrome.browsingData.DataTypeSet,
  1335. * dataRemovalPermitted: !chrome.browsingData.DataTypeSet,
  1336. * }}
  1337. */
  1338. chrome.browsingData.SettingsResponse;
  1339. /**
  1340. * @param {function(!chrome.browsingData.SettingsResponse): void} callback
  1341. * @see https://developer.chrome.com/extensions/browsingData#method-settings
  1342. */
  1343. chrome.browsingData.settings = function(callback) {};
  1344. /**
  1345. * @param {!chrome.browsingData.RemovalOptions} options
  1346. * @param {!chrome.browsingData.DataTypeSet} dataToRemove
  1347. * @param {function(): void=} callback
  1348. * @see https://developer.chrome.com/extensions/browsingData#method-remove
  1349. */
  1350. chrome.browsingData.remove = function(options, dataToRemove, callback) {};
  1351. /**
  1352. * @param {!chrome.browsingData.RemovalOptions} options
  1353. * @param {function(): void=} callback
  1354. * @see https://developer.chrome.com/extensions/browsingData#method-removeAppcache
  1355. */
  1356. chrome.browsingData.removeAppcache = function(options, callback) {};
  1357. /**
  1358. * @param {!chrome.browsingData.RemovalOptions} options
  1359. * @param {function(): void=} callback
  1360. * @see https://developer.chrome.com/extensions/browsingData#method-removeCache
  1361. */
  1362. chrome.browsingData.removeCache = function(options, callback) {};
  1363. /**
  1364. * @param {!chrome.browsingData.RemovalOptions} options
  1365. * @param {function(): void=} callback
  1366. * @see https://developer.chrome.com/extensions/browsingData#method-removeCookies
  1367. */
  1368. chrome.browsingData.removeCookies = function(options, callback) {};
  1369. /**
  1370. * @param {!chrome.browsingData.RemovalOptions} options
  1371. * @param {function(): void=} callback
  1372. * @see https://developer.chrome.com/extensions/browsingData#method-removeDownloads
  1373. */
  1374. chrome.browsingData.removeDownloads = function(options, callback) {};
  1375. /**
  1376. * @param {!chrome.browsingData.RemovalOptions} options
  1377. * @param {function(): void=} callback
  1378. * @see https://developer.chrome.com/extensions/browsingData#method-removeFileSystems
  1379. */
  1380. chrome.browsingData.removeFileSystems = function(options, callback) {};
  1381. /**
  1382. * @param {!chrome.browsingData.RemovalOptions} options
  1383. * @param {function(): void=} callback
  1384. * @see https://developer.chrome.com/extensions/browsingData#method-removeFormData
  1385. */
  1386. chrome.browsingData.removeFormData = function(options, callback) {};
  1387. /**
  1388. * @param {!chrome.browsingData.RemovalOptions} options
  1389. * @param {function(): void=} callback
  1390. * @see https://developer.chrome.com/extensions/browsingData#method-removeHistory
  1391. */
  1392. chrome.browsingData.removeHistory = function(options, callback) {};
  1393. /**
  1394. * @param {!chrome.browsingData.RemovalOptions} options
  1395. * @param {function(): void=} callback
  1396. * @see https://developer.chrome.com/extensions/browsingData#method-removeIndexedDB
  1397. */
  1398. chrome.browsingData.removeIndexedDB = function(options, callback) {};
  1399. /**
  1400. * @param {!chrome.browsingData.RemovalOptions} options
  1401. * @param {function(): void=} callback
  1402. * @see https://developer.chrome.com/extensions/browsingData#method-removeLocalStorage
  1403. */
  1404. chrome.browsingData.removeLocalStorage = function(options, callback) {};
  1405. /**
  1406. * @param {!chrome.browsingData.RemovalOptions} options
  1407. * @param {function(): void=} callback
  1408. * @see https://developer.chrome.com/extensions/browsingData#method-removePluginData
  1409. */
  1410. chrome.browsingData.removePluginData = function(options, callback) {};
  1411. /**
  1412. * @param {!chrome.browsingData.RemovalOptions} options
  1413. * @param {function(): void=} callback
  1414. * @see https://developer.chrome.com/extensions/browsingData#method-removePasswords
  1415. */
  1416. chrome.browsingData.removePasswords = function(options, callback) {};
  1417. /**
  1418. * @param {!chrome.browsingData.RemovalOptions} options
  1419. * @param {function(): void=} callback
  1420. * @see https://developer.chrome.com/extensions/browsingData#method-removeWebSQL
  1421. */
  1422. chrome.browsingData.removeWebSQL = function(options, callback) {};
  1423. /**
  1424. * @see http://developer.chrome.com/extensions/commands.html
  1425. * @const
  1426. */
  1427. chrome.commands = {};
  1428. /**
  1429. * @param {function(Array<string>): void} callback Callback function.
  1430. * @return {undefined}
  1431. */
  1432. chrome.commands.getAll = function(callback) {};
  1433. /** @type {!ChromeEvent} */
  1434. chrome.commands.onCommand;
  1435. /**
  1436. * @see https://developer.chrome.com/apps/copresence
  1437. * @const
  1438. */
  1439. chrome.copresence = {};
  1440. /**
  1441. * @typedef {?{
  1442. * lowPower: (boolean|undefined),
  1443. * onlyBroadcast: (boolean|undefined),
  1444. * onlyScan: (boolean|undefined),
  1445. * audible: (boolean|undefined)
  1446. * }}
  1447. * @see https://developer.chrome.com/apps/copresence#type-Strategy
  1448. */
  1449. chrome.copresence.Strategy;
  1450. /**
  1451. * @typedef {?{
  1452. * type: string,
  1453. * payload: ArrayBuffer
  1454. * }}
  1455. * @see https://developer.chrome.com/apps/copresence#type-Message
  1456. */
  1457. chrome.copresence.Message;
  1458. /**
  1459. * @typedef {?{
  1460. * onlyEarshot: (boolean|undefined)
  1461. * }}
  1462. * https://developer.chrome.com/apps/copresence#type-AccessPolicy
  1463. */
  1464. chrome.copresence.AccessPolicy;
  1465. /**
  1466. * @typedef {?{
  1467. * id: string,
  1468. * message: !chrome.copresence.Message,
  1469. * timeToLiveMillis: (number|undefined),
  1470. * policy: (!chrome.copresence.AccessPolicy|undefined),
  1471. * strategies: (!chrome.copresence.Strategy|undefined)
  1472. * }}
  1473. * @see https://developer.chrome.com/apps/copresence#type-PublishOperation
  1474. */
  1475. chrome.copresence.PublishOperation;
  1476. /** @typedef {?{type: string}} */
  1477. chrome.copresence.SubscriptionFilter;
  1478. /**
  1479. * @typedef {?{
  1480. * id: string,
  1481. * filter: !chrome.copresence.SubscriptionFilter,
  1482. * timeToLiveMillis: (number|undefined),
  1483. * strategies: (!chrome.copresence.Strategy|undefined)
  1484. * }}
  1485. * @see https://developer.chrome.com/apps/copresence#type-SubscribeOperation
  1486. */
  1487. chrome.copresence.SubscribeOperation;
  1488. /**
  1489. * @typedef {?{
  1490. * unpublishId: string
  1491. * }}
  1492. * @see https://developer.chrome.com/apps/copresence#type-UnpublishOperation
  1493. */
  1494. chrome.copresence.UnpublishOperation;
  1495. /**
  1496. * @typedef {?{
  1497. * unsubscribeId: string
  1498. * }}
  1499. * @see https://developer.chrome.com/apps/copresence#type-UnsubscribeOperation
  1500. */
  1501. chrome.copresence.UnsubscribeOperation;
  1502. /**
  1503. * @typedef {?{
  1504. * publish: (!chrome.copresence.PublishOperation|undefined),
  1505. * subscribe: (!chrome.copresence.SubscribeOperation|undefined),
  1506. * unpublish: (!chrome.copresence.UnpublishOperation|undefined),
  1507. * unsubscribe: (!chrome.copresence.UnsubscribeOperation|undefined)
  1508. * }}
  1509. * @see https://developer.chrome.com/apps/copresence#type-Operation
  1510. */
  1511. chrome.copresence.Operation;
  1512. /**
  1513. * @param {!Array<!chrome.copresence.Operation>} operations
  1514. * @param {function(string): void} callback
  1515. * @see https://developer.chrome.com/apps/copresence#method-execute
  1516. * @return {undefined}
  1517. */
  1518. chrome.copresence.execute = function(operations, callback) {};
  1519. /**
  1520. * Event whose listeners take a subscription id and received messages as a
  1521. * parameter.
  1522. * @interface
  1523. * @extends {ChromeBaseEvent<function(string,
  1524. * !Array<!chrome.copresence.Message>)>}
  1525. * @see https://developer.chrome.com/apps/copresence#event-onMessagesReceived
  1526. */
  1527. chrome.copresence.MessagesReceivedEvent = function() {};
  1528. /**
  1529. * @type {!chrome.copresence.MessagesReceivedEvent}
  1530. * @see https://developer.chrome.com/apps/copresence#event-onMessagesReceived
  1531. */
  1532. chrome.copresence.onMessagesReceived;
  1533. /**
  1534. * @type {!ChromeStringEvent}
  1535. * @see https://developer.chrome.com/apps/copresence#event-onStatusUpdated
  1536. */
  1537. chrome.copresence.onStatusUpdated;
  1538. /** @const */
  1539. chrome.devtools = {};
  1540. /**
  1541. * @see https://developer.chrome.com/extensions/devtools_inspectedWindow
  1542. * @const
  1543. */
  1544. chrome.devtools.inspectedWindow = {};
  1545. /**
  1546. * @constructor
  1547. * @see https://developer.chrome.com/extensions/devtools_inspectedWindow#type-Resource
  1548. */
  1549. chrome.devtools.inspectedWindow.Resource = function() {};
  1550. /** @type {string} */
  1551. chrome.devtools.inspectedWindow.Resource.prototype.url;
  1552. /** @param {function(string, string): void} callback */
  1553. chrome.devtools.inspectedWindow.Resource.prototype.getContent = function(
  1554. callback) {};
  1555. /**
  1556. * @param {string} content
  1557. * @param {boolean} commit
  1558. * @param {function(!Object): void=} callback
  1559. */
  1560. chrome.devtools.inspectedWindow.Resource.prototype.setContent = function(
  1561. content, commit, callback) {};
  1562. /**
  1563. * @type {number}
  1564. * @see https://developer.chrome.com/extensions/devtools_inspectedWindow#property-tabId
  1565. */
  1566. chrome.devtools.inspectedWindow.tabId;
  1567. /**
  1568. * @typedef {?{
  1569. * frameUrl: (string|undefined),
  1570. * useContentScriptContext: (boolean|undefined),
  1571. * contextSecurityOrigin: (string|undefined)
  1572. * }}
  1573. */
  1574. chrome.devtools.inspectedWindow.EvalOptions;
  1575. /**
  1576. * @param {string} expression
  1577. * @param {!chrome.devtools.inspectedWindow.EvalOptions=} options
  1578. * @param {function(!Object, !Object): void=} callback
  1579. * @see https://developer.chrome.com/extensions/devtools_inspectedWindow#method-eval
  1580. */
  1581. chrome.devtools.inspectedWindow.eval = function(
  1582. expression, options, callback) {};
  1583. /**
  1584. * @typedef {?{
  1585. * ignoreCache: (boolean|undefined),
  1586. * userAgent: (string|undefined),
  1587. * injectedScript: (string|undefined)
  1588. * }}
  1589. */
  1590. chrome.devtools.inspectedWindow.ReloadOptions;
  1591. /**
  1592. * @param {!chrome.devtools.inspectedWindow.ReloadOptions=} reloadOptions
  1593. * @see https://developer.chrome.com/extensions/devtools_inspectedWindow#method-reload
  1594. */
  1595. chrome.devtools.inspectedWindow.reload = function(reloadOptions) {};
  1596. /**
  1597. * @param {function(!Array<!chrome.devtools.inspectedWindow.Resource>): void}
  1598. * callback
  1599. * @see https://developer.chrome.com/extensions/devtools_inspectedWindow#method-getResources
  1600. */
  1601. chrome.devtools.inspectedWindow.getResources = function(callback) {};
  1602. /**
  1603. * @interface
  1604. * @extends {ChromeBaseEvent<
  1605. * function(!chrome.devtools.inspectedWindow.Resource)>}
  1606. */
  1607. chrome.devtools.inspectedWindow.ResourceEvent = function() {};
  1608. /**
  1609. * @see https://developer.chrome.com/extensions/devtools_inspectedWindow#event-onResourceAdded
  1610. * @type {!chrome.devtools.inspectedWindow.ResourceEvent}
  1611. */
  1612. chrome.devtools.inspectedWindow.onResourceAdded;
  1613. /**
  1614. * @interface
  1615. * @extends {ChromeBaseEvent<
  1616. * function(!chrome.devtools.inspectedWindow.Resource, string)>}
  1617. */
  1618. chrome.devtools.inspectedWindow.ResourceContentEvent = function() {};
  1619. /**
  1620. * @see https://developer.chrome.com/extensions/devtools_inspectedWindow#event-onResourceContentCommitted
  1621. * @type {!chrome.devtools.inspectedWindow.ResourceContentEvent}
  1622. */
  1623. chrome.devtools.inspectedWindow.onResourceContentCommitted;
  1624. /**
  1625. * @see https://developer.chrome.com/docs/extensions/reference/devtools_network/
  1626. * @const
  1627. */
  1628. chrome.devtools.network = {};
  1629. /**
  1630. * @see https://developer.chrome.com/docs/extensions/reference/devtools_network/#type-Request
  1631. * @constructor
  1632. */
  1633. chrome.devtools.network.Request = function() {};
  1634. /**
  1635. * @interface
  1636. * @extends {ChromeBaseEvent<
  1637. * function(!chrome.devtools.network.Request)>}
  1638. */
  1639. chrome.devtools.network.RequestEvent = function() {};
  1640. /**
  1641. * @see https://developer.chrome.com/docs/extensions/reference/devtools_network/#event-onRequestFinished
  1642. * @type {!chrome.devtools.network.RequestEvent}
  1643. */
  1644. chrome.devtools.network.onRequestFinished
  1645. /**
  1646. * @see https://developer.chrome.com/extensions/enterprise_platformKeys
  1647. * @const
  1648. */
  1649. chrome.enterprise = {};
  1650. /**
  1651. * @constructor
  1652. * deviceAttributes allows for reading device attributes.
  1653. * @see https://developer.chrome.com/extensions/enterprise_deviceAttributes.
  1654. */
  1655. chrome.enterprise.deviceAttributes = function() {};
  1656. /**
  1657. * @param {function(string): void} callback Called with the device identifier
  1658. * of the directory API when received.
  1659. * @return {undefined}
  1660. */
  1661. chrome.enterprise.deviceAttributes.getDirectoryDeviceId = function(callback) {};
  1662. /**
  1663. * @param {function(string): void} callback Called with the serial number of the
  1664. * device.
  1665. * @return {undefined}
  1666. */
  1667. chrome.enterprise.deviceAttributes.getDeviceSerialNumber = function(
  1668. callback) {};
  1669. /**
  1670. * @param {function(string): void} callback Called with the Asset ID of the
  1671. * device.
  1672. * @return {undefined}
  1673. */
  1674. chrome.enterprise.deviceAttributes.getDeviceAssetId = function(callback) {};
  1675. /**
  1676. * @param {function(string): void} callback Called with the Annotated Location
  1677. * of the device.
  1678. * @return {undefined}
  1679. */
  1680. chrome.enterprise.deviceAttributes.getDeviceAnnotatedLocation = function(
  1681. callback) {};
  1682. /**
  1683. * @constructor
  1684. * platformKeys allows for generating hardware-backed keys and the installation
  1685. * of certificates for these keys.
  1686. * @see https://developer.chrome.com/extensions/enterprise_platformKeys.
  1687. */
  1688. chrome.enterprise.platformKeys = function() {};
  1689. /**
  1690. * @constructor
  1691. * @see https://developer.chrome.com/extensions/enterprise_platformKeys#type-Token
  1692. */
  1693. chrome.enterprise.Token = function() {};
  1694. /**
  1695. * @type {string} Unique id for the Token, either "user" or "system."
  1696. */
  1697. chrome.enterprise.Token.prototype.id;
  1698. /**
  1699. * @type {!webCrypto.SubtleCrypto} Implements the WebCrypto's
  1700. * SubtleCrypto interface. The cryptographic operations, including key
  1701. * generation, are hardware-backed.
  1702. */
  1703. chrome.enterprise.Token.prototype.subtleCrypto;
  1704. /**
  1705. * @param {!ArrayBuffer} challenge A challenge as emitted by the Verified Access
  1706. * Web API.
  1707. * @param {boolean|function(!ArrayBuffer): void} registerKeyOrCallback Either a
  1708. * flag indicating whether to register the key, in which case the callback
  1709. * is passed as the next arg, or the callback. If a flag is set, the current
  1710. * Enterprise Machine Key is registered with the "system" token and
  1711. * relinquishes the Enterprise Machine Key role. The key can then be
  1712. * associated with a certificate and used like any other signing key. This
  1713. * key is 2048-bit RSA. Subsequent calls to this function will then generate
  1714. * a new Enterprise Machine Key.
  1715. * @param {function(!ArrayBuffer=): void=} callback The callback (called back
  1716. * with the challenge response), if arg2 was the registerKey flag.
  1717. * @return {undefined}
  1718. */
  1719. chrome.enterprise.platformKeys.challengeMachineKey = function(
  1720. challenge, registerKeyOrCallback, callback) {};
  1721. /**
  1722. * @param {!ArrayBuffer} challenge A challenge as emitted by the Verified Access
  1723. * Web API.
  1724. * @param {boolean} registerKey If set, the current Enterprise User Key is
  1725. * registered with the "user" token and relinquishes the Enterprise User
  1726. * Key role. The key can then be associated with a certificate and used like
  1727. * any other signing key. This key is 2048-bit RSA. Subsequent calls to this
  1728. * function will then generate a new Enterprise User Key.
  1729. * @param {function(!ArrayBuffer): void} callback Called back with the
  1730. * challenge response.
  1731. * @return {undefined}
  1732. */
  1733. chrome.enterprise.platformKeys.challengeUserKey = function(
  1734. challenge, registerKey, callback) {};
  1735. /**
  1736. * @param {function(!Array<!chrome.enterprise.Token>): void} callback Called
  1737. * with an array of Tokens.
  1738. * @return {undefined}
  1739. */
  1740. chrome.enterprise.platformKeys.getTokens = function(callback) {};
  1741. /**
  1742. * @param {string} tokenId Id of cetificate token either "user" or "system".
  1743. * @param {(function(!Array<!ArrayBuffer>): void)} callback Array of DER
  1744. * encoded x.509 certificates.
  1745. * @return {undefined}
  1746. */
  1747. chrome.enterprise.platformKeys.getCertificates = function(tokenId, callback) {};
  1748. /**
  1749. * @param {string} tokenId The id of a Token returned by getTokens.
  1750. * @param {!ArrayBuffer} certificate The DER encoding of a X.509 certificate.
  1751. * @param {function(): void=} opt_callback Called back when this operation is
  1752. * finished.
  1753. * @return {undefined}
  1754. */
  1755. chrome.enterprise.platformKeys.importCertificate = function(
  1756. tokenId, certificate, opt_callback) {};
  1757. /**
  1758. * @param {string} tokenId The id of a Token returned by getTokens.
  1759. * @param {!ArrayBuffer} certificate The DER encoding of a X.509 certificate.
  1760. * @param {(function(): void)=} opt_callback Called back when this operation is
  1761. * finished.
  1762. * @return {undefined}
  1763. */
  1764. chrome.enterprise.platformKeys.removeCertificate = function(
  1765. tokenId, certificate, opt_callback) {};
  1766. /**
  1767. * reportingPrivate is a Private API for reporting Chrome browser status to
  1768. * admin console.
  1769. * @see https://cs.chromium.org/chromium/src/chrome/common/extensions/api/enterprise_reporting_private.idl
  1770. */
  1771. chrome.enterprise.reportingPrivate = {};
  1772. /**
  1773. * Uploads the status of Chrome browser to the admin console by sending
  1774. * request to the DMServer. Sets runtime.lastError on failure.
  1775. * @param {!Object} report Object to report to admin console.
  1776. * @param {(function(): void)=} callback Called back when this operation is
  1777. * finished.
  1778. */
  1779. chrome.enterprise.reportingPrivate.uploadChromeDesktopReport = function(
  1780. report, callback) {};
  1781. /**
  1782. * Gets the identity of device that Chrome browser is running on. The ID is
  1783. * retrieved from the local device and used by the Google admin console.
  1784. * @param {(function(!string): void)=} callback Called with the device ID.
  1785. */
  1786. chrome.enterprise.reportingPrivate.getDeviceId = function(callback) {};
  1787. /**
  1788. * Returns a random secret stored in a platform specific storage.
  1789. * @param {(function(!ArrayBuffer): void)=} callback Called with the result.
  1790. */
  1791. chrome.enterprise.reportingPrivate.getPersistentSecret = function(callback) {};
  1792. /**
  1793. * Returns byte string associated with the data item stored in a platform
  1794. * specific storage.
  1795. * @param {!string} item Item name (can have containers separated by '/').
  1796. * @param {(function((!ArrayBuffer|undefined)): void)=} callback Called back with the
  1797. * response.
  1798. */
  1799. chrome.enterprise.reportingPrivate.getDeviceData = function(item, callback) {};
  1800. /**
  1801. * Stores byte string associated with the data item in a platform
  1802. * specific storage.
  1803. * @param {!string} item Item name (can have containers separated by '/').
  1804. * @param {!ArrayBuffer|undefined} data Byte string to associate with the data item.
  1805. * @param {(function(): void)=} callback Called back with the response.
  1806. */
  1807. chrome.enterprise.reportingPrivate.setDeviceData = function(
  1808. item, data, callback) {};
  1809. /**
  1810. * Represents a device info property type.
  1811. * @enum {string}
  1812. */
  1813. chrome.enterprise.reportingPrivate.SettingValue = {
  1814. UNKNOWN: '',
  1815. DISABLED: '',
  1816. ENABLED: '',
  1817. };
  1818. /**
  1819. * Type of the object returned by getDeviceInfo.
  1820. * @typedef {?{
  1821. * osName: string,
  1822. * osVersion: string,
  1823. * deviceHostName: string,
  1824. * deviceModel: string,
  1825. * serialNumber: string,
  1826. * screenLockSecured: chrome.enterprise.reportingPrivate.SettingValue,
  1827. * diskEncrypted: chrome.enterprise.reportingPrivate.SettingValue,
  1828. * macAddresses: (!Array<string>|undefined),
  1829. * }}
  1830. */
  1831. chrome.enterprise.reportingPrivate.DeviceInfo;
  1832. /**
  1833. * Returns the device information object.
  1834. * @param {(function(!chrome.enterprise.reportingPrivate.DeviceInfo): void)=}
  1835. * callback Called back with the response.
  1836. */
  1837. chrome.enterprise.reportingPrivate.getDeviceInfo = function(callback) {};
  1838. /**
  1839. * Represents possible states for the EnterpriseRealTimeUrlCheckMode policy
  1840. * @enum {number}
  1841. */
  1842. chrome.enterprise.reportingPrivate.RealtimeUrlCheckMode = {
  1843. DISABLED: 0,
  1844. ENABLED_MAIN_FRAME: 0,
  1845. };
  1846. /**
  1847. * Type of the object returned by getContextInfo.
  1848. * @typedef {?{
  1849. * browserAffiliationIds: (!Array<string>|undefined),
  1850. * profileAffiliationIds: (!Array<string>|undefined),
  1851. * onFileAttachedProviders: (!Array<string>|undefined),
  1852. * onFileDownloadedProviders: (!Array<string>|undefined),
  1853. * onBulkDataEntryProviders: (!Array<string>|undefined),
  1854. * onSecurityEventProviders: (!Array<string>|undefined),
  1855. * realtimeUrlCheckMode: chrome.enterprise.reportingPrivate.RealtimeUrlCheckMode,
  1856. * browserVersion: string,
  1857. * }}
  1858. */
  1859. chrome.enterprise.reportingPrivate.ContextInfo;
  1860. /**
  1861. * Returns the context information object.
  1862. * @param {(function(!chrome.enterprise.reportingPrivate.ContextInfo): void)}
  1863. * callback Called back with the response.
  1864. */
  1865. chrome.enterprise.reportingPrivate.getContextInfo = function(callback) {};
  1866. /**
  1867. * Possible states for the Certificate status.
  1868. * @enum {number}
  1869. */
  1870. chrome.enterprise.reportingPrivate.CertificateStatus = {
  1871. OK: 0,
  1872. POLICY_UNSET: 1,
  1873. };
  1874. /**
  1875. * Type of the object returned by getCertificate.
  1876. * @typedef {?{
  1877. * status: chrome.enterprise.reportingPrivate.CertificateStatus,
  1878. * encodedCertificate: (!ArrayBuffer|undefined),
  1879. * }}
  1880. */
  1881. chrome.enterprise.reportingPrivate.Certificate;
  1882. /**
  1883. * Returns the certificate object.
  1884. * @param {!string} url URL for which certificate needs to be fetched.
  1885. * @param {(function(!chrome.enterprise.reportingPrivate.Certificate): void)}
  1886. * callback Called back with the response.
  1887. */
  1888. chrome.enterprise.reportingPrivate.getCertificate = function(url, callback) {};
  1889. /**
  1890. * Metadata describing the type of event being reported
  1891. * @enum {number}
  1892. */
  1893. chrome.enterprise.reportingPrivate.EventType = {
  1894. DEVICE: 0,
  1895. USER: 1
  1896. };
  1897. /**
  1898. * Composite object that captures the information needed to report events.
  1899. * @typedef {?{
  1900. * recordData: !ArrayBufferView,
  1901. * priority: number,
  1902. * eventType: chrome.enterprise.reportingPrivate.EventType
  1903. * }}
  1904. */
  1905. chrome.enterprise.reportingPrivate.EnqueueRecordRequest;
  1906. /**
  1907. * Enqueues a record to be reported
  1908. * @param {!chrome.enterprise.reportingPrivate.EnqueueRecordRequest} request
  1909. * @param {(function(): void)=} callback Callback triggered after completion
  1910. */
  1911. chrome.enterprise.reportingPrivate.enqueueRecord = function(
  1912. request, callback) {};
  1913. /**
  1914. * @see https://developer.chrome.com/extensions/extension.html
  1915. * @const
  1916. */
  1917. chrome.extension = {};
  1918. /**
  1919. * @enum {string}
  1920. * @see https://developer.chrome.com/extensions/extension#type-ViewType
  1921. */
  1922. chrome.extension.ViewType = {
  1923. TAB: '',
  1924. POPUP: '',
  1925. };
  1926. /** @type {{message:(string|undefined)}|undefined} */
  1927. chrome.extension.lastError = {};
  1928. /** @type {boolean|undefined} */
  1929. chrome.extension.inIncognitoContext;
  1930. // TODO: change Object to !Object when it's clear nobody is passing in null
  1931. // TODO: change Port to !Port since it should never be null
  1932. /**
  1933. * @param {string|Object<string>=} opt_extensionIdOrConnectInfo Either the
  1934. * extensionId to connect to, in which case connectInfo params can be
  1935. * passed in the next optional argument, or the connectInfo params.
  1936. * @param {Object<string>=} opt_connectInfo The connectInfo object,
  1937. * if arg1 was the extensionId to connect to.
  1938. * @return {Port} New port.
  1939. */
  1940. chrome.extension.connect = function(
  1941. opt_extensionIdOrConnectInfo, opt_connectInfo) {};
  1942. /**
  1943. * @return {Window} The global JS object for the background page.
  1944. */
  1945. chrome.extension.getBackgroundPage = function() {};
  1946. /**
  1947. * @param {string} path A path to a resource within an extension expressed
  1948. * relative to it's install directory.
  1949. * @return {string} The fully-qualified URL to the resource.
  1950. */
  1951. chrome.extension.getURL = function(path) {};
  1952. /**
  1953. * @typedef {?{
  1954. * type: (!chrome.extension.ViewType|string|undefined),
  1955. * windowId: (number|undefined),
  1956. * tabId: (number|undefined)
  1957. * }}
  1958. */
  1959. chrome.extension.ViewInfo;
  1960. /**
  1961. * @param {?chrome.extension.ViewInfo=} opt_fetchProperties
  1962. * @return {Array<Window>} The global JS objects for each content view.
  1963. */
  1964. chrome.extension.getViews = function(opt_fetchProperties) {};
  1965. /**
  1966. * @param {function(boolean): void} callback Callback function.
  1967. * @return {undefined}
  1968. */
  1969. chrome.extension.isAllowedFileSchemeAccess = function(callback) {};
  1970. /**
  1971. * @param {function(boolean): void} callback Callback function.
  1972. * @return {undefined}
  1973. */
  1974. chrome.extension.isAllowedIncognitoAccess = function(callback) {};
  1975. /**
  1976. * @param {string|*} extensionIdOrRequest Either the extensionId to send the
  1977. * request to, in which case the request is passed as the next arg, or the
  1978. * request.
  1979. * @param {*=} opt_request The request value, if arg1 was the extensionId.
  1980. * @param {function(*): void=} opt_callback The callback function which
  1981. * takes a JSON response object sent by the handler of the request.
  1982. * @return {undefined}
  1983. */
  1984. chrome.extension.sendMessage = function(
  1985. extensionIdOrRequest, opt_request, opt_callback) {};
  1986. /**
  1987. * @param {number|*=} opt_arg1 Either the extensionId to send the request to,
  1988. * in which case the request is passed as the next arg, or the request.
  1989. * @param {*=} opt_request The request value, if arg1 was the extensionId.
  1990. * @param {function(*): void=} opt_callback The callback function which
  1991. * takes a JSON response object sent by the handler of the request.
  1992. * @return {undefined}
  1993. */
  1994. chrome.extension.sendRequest = function(opt_arg1, opt_request, opt_callback) {};
  1995. /**
  1996. * @param {string} data
  1997. * @return {undefined}
  1998. */
  1999. chrome.extension.setUpdateUrlData = function(data) {};
  2000. /** @type {!ChromeEvent} */
  2001. chrome.extension.onConnect;
  2002. /** @type {!ChromeEvent} */
  2003. chrome.extension.onConnectExternal;
  2004. /** @type {!ChromeEvent} */
  2005. chrome.extension.onMessage;
  2006. /** @type {!ChromeEvent} */
  2007. chrome.extension.onRequest;
  2008. /** @type {!ChromeEvent} */
  2009. chrome.extension.onRequestExternal;
  2010. /**
  2011. * @see https://developer.chrome.com/extensions/runtime.html
  2012. * @const
  2013. */
  2014. chrome.runtime = {};
  2015. /** @type {{message:(string|undefined)}|undefined} */
  2016. chrome.runtime.lastError;
  2017. /**
  2018. * @param {string|!Object=} opt_extensionIdOrConnectInfo Either the
  2019. * extensionId to connect to, in which case connectInfo params can be
  2020. * passed in the next optional argument, or the connectInfo params.
  2021. * @param {!Object=} opt_connectInfo The connectInfo object,
  2022. * if arg1 was the extensionId to connect to.
  2023. * @return {!Port} New port.
  2024. */
  2025. chrome.runtime.connect = function(
  2026. opt_extensionIdOrConnectInfo, opt_connectInfo) {};
  2027. /**
  2028. * @param {string|*} extensionIdOrMessage Either the extensionId to send the
  2029. * message to, in which case the message is passed as the next arg, or the
  2030. * message itself.
  2031. * @param {(*|!Object|function(*): void)=} opt_messageOrOptsOrCallback
  2032. * One of:
  2033. * The message, if arg1 was the extensionId.
  2034. * The options for message sending, if arg1 was the message and this
  2035. * argument is not a function.
  2036. * The callback, if arg1 was the message and this argument is a function.
  2037. * @param {(!Object|function(*): void)=} opt_optsOrCallback
  2038. * Either the options for message sending, if arg2 was the message,
  2039. * or the callback.
  2040. * @param {function(*): void=} opt_callback The callback function which
  2041. * takes a JSON response object sent by the handler of the request.
  2042. * @return {undefined}
  2043. */
  2044. chrome.runtime.sendMessage = function(
  2045. extensionIdOrMessage, opt_messageOrOptsOrCallback, opt_optsOrCallback,
  2046. opt_callback) {};
  2047. /** @type {string} */
  2048. chrome.runtime.id;
  2049. /**
  2050. * @param {function(!Window=): void} callback Callback function.
  2051. * @return {undefined}
  2052. */
  2053. chrome.runtime.getBackgroundPage = function(callback) {};
  2054. /**
  2055. * @param {function(): void=} opt_callback Callback function.
  2056. * @return {undefined}
  2057. */
  2058. chrome.runtime.openOptionsPage = function(opt_callback) {};
  2059. /**
  2060. * Manifest information returned from chrome.runtime.getManifest. See
  2061. * https://developer.chrome.com/extensions/manifest.html and
  2062. * https://developer.chrome.com/apps/manifest.html
  2063. *
  2064. * Note that:
  2065. * 1) There are several other fields not included here. They should be
  2066. * added to these externs as needed.
  2067. * 2) There are some distinct fields for app vs extension manifests. The
  2068. * below manifest definition contains the union of all fields; unique
  2069. * fields should be annotated as such (see e.g. kiosk_only property
  2070. * below).
  2071. * @constructor
  2072. */
  2073. chrome.runtime.Manifest = function() {};
  2074. /** @type {string} */
  2075. chrome.runtime.Manifest.prototype.name;
  2076. /** @type {string} */
  2077. chrome.runtime.Manifest.prototype.version;
  2078. /** @type {string|undefined} */
  2079. chrome.runtime.Manifest.prototype.version_name;
  2080. /** @type {number|undefined} */
  2081. chrome.runtime.Manifest.prototype.manifest_version;
  2082. /** @type {string|undefined} */
  2083. chrome.runtime.Manifest.prototype.description;
  2084. /** @type {!Object<string, string>} */
  2085. chrome.runtime.Manifest.prototype.icons;
  2086. /** @type {!chrome.runtime.Manifest.Oauth2|undefined} */
  2087. chrome.runtime.Manifest.prototype.oauth2;
  2088. /** @type {!Array<(string|!Object)>} */
  2089. chrome.runtime.Manifest.prototype.permissions;
  2090. /**
  2091. * App-only manifest field.
  2092. * @see https://developer.chrome.com/apps/manifest
  2093. * @type {boolean|undefined}
  2094. */
  2095. chrome.runtime.Manifest.prototype.kiosk_only;
  2096. /**
  2097. * App-only manifest field.
  2098. * @see https://developer.chrome.com/apps/manifest
  2099. * @type {boolean|undefined}
  2100. */
  2101. chrome.runtime.Manifest.prototype.kiosk_enabled;
  2102. /** @type {string|undefined} */
  2103. chrome.runtime.Manifest.prototype.replacement_web_app;
  2104. /**
  2105. * Oauth2 info in the manifest.
  2106. * See http://developer.chrome.com/apps/app_identity.html#update_manifest.
  2107. * @constructor
  2108. */
  2109. chrome.runtime.Manifest.Oauth2 = function() {};
  2110. /** @type {string} */
  2111. chrome.runtime.Manifest.Oauth2.prototype.client_id;
  2112. /**@type {!Array<string>} */
  2113. chrome.runtime.Manifest.Oauth2.prototype.scopes;
  2114. /**
  2115. * https://developer.chrome.com/extensions/runtime.html#method-getManifest
  2116. * https://developer.chrome.com/apps/runtime#method-getManifest
  2117. * @return {!chrome.runtime.Manifest} The full manifest file of the app or
  2118. * extension.
  2119. */
  2120. chrome.runtime.getManifest = function() {};
  2121. /**
  2122. * @param {string} path A path to a resource within an extension expressed
  2123. * relative to it's install directory.
  2124. * @return {string} The fully-qualified URL to the resource.
  2125. */
  2126. chrome.runtime.getURL = function(path) {};
  2127. /**
  2128. * @param {string} url This may be used to clean up server-side data, do
  2129. * analytics, and implement surveys. Maximum 255 characters.
  2130. * @return {undefined}
  2131. */
  2132. chrome.runtime.setUninstallURL = function(url) {};
  2133. /**
  2134. * Reloads the app or extension.
  2135. * @return {undefined}
  2136. */
  2137. chrome.runtime.reload = function() {};
  2138. /**
  2139. * @see https://developer.chrome.com/apps/runtime#method-requestUpdateCheck
  2140. * @param {function(string, !{version: string}=): void} callback Called with
  2141. * "throttled", "no_update", or "update_available". If an update is
  2142. * available, the object contains more information about the available
  2143. * update.
  2144. * @return {undefined}
  2145. */
  2146. chrome.runtime.requestUpdateCheck = function(callback) {};
  2147. /**
  2148. * Restart the ChromeOS device when the app runs in kiosk mode. Otherwise, it's
  2149. * no-op.
  2150. * @return {undefined}
  2151. */
  2152. chrome.runtime.restart = function() {};
  2153. /**
  2154. * @see https://developer.chrome.com/extensions/runtime#method-restartAfterDelay
  2155. * @param {number} seconds Time to wait in seconds before rebooting the device,
  2156. * or -1 to cancel a scheduled reboot.
  2157. * @param {function():void=} opt_callback A callback to be invoked when a
  2158. * restart request was successfully rescheduled.
  2159. * @return {undefined}
  2160. */
  2161. chrome.runtime.restartAfterDelay = function(seconds, opt_callback) {};
  2162. /**
  2163. * @see http://developer.chrome.com/extensions/runtime.html#method-connectNative
  2164. * @param {string} application Name of the registered native messaging host to
  2165. * connect to, like 'com.google.your_product'.
  2166. * @return {!Port} New port.
  2167. */
  2168. chrome.runtime.connectNative = function(application) {};
  2169. /**
  2170. * @see http://developer.chrome.com/extensions/runtime.html#method-sendNativeMessage
  2171. * @param {string} application Name of the registered native messaging host to
  2172. * connect to, like 'com.google.your_product'.
  2173. * @param {Object} message The message that will be passed to the native
  2174. * messaging host.
  2175. * @param {function(*)=} opt_callback Called with the response message sent by
  2176. * the native messaging host. If an error occurs while connecting to the
  2177. * native messaging host, the callback will be called with no arguments and
  2178. * chrome.runtime.lastError will be set to the error message.
  2179. * @return {undefined}
  2180. */
  2181. chrome.runtime.sendNativeMessage = function(
  2182. application, message, opt_callback) {};
  2183. /**
  2184. * The operating system chrome is running on.
  2185. * @see https://developer.chrome.com/apps/runtime#type-PlatformOs
  2186. * @enum {string}
  2187. */
  2188. chrome.runtime.PlatformOs = {
  2189. ANDROID: '',
  2190. CROS: '',
  2191. LINUX: '',
  2192. MAC: '',
  2193. OPENBSD: '',
  2194. WIN: '',
  2195. };
  2196. /**
  2197. * The machine's processor architecture.
  2198. * @see https://developer.chrome.com/apps/runtime#type-PlatformArch
  2199. * @enum {string}
  2200. */
  2201. chrome.runtime.PlatformArch = {
  2202. ARM: '',
  2203. ARM64: '',
  2204. MIPS: '',
  2205. MIPS64: '',
  2206. X86_32: '',
  2207. X86_64: '',
  2208. };
  2209. /**
  2210. * The native client architecture.
  2211. * @see https://developer.chrome.com/apps/runtime#type-PlatformNaclArch
  2212. * @enum {string}
  2213. */
  2214. chrome.runtime.PlatformNaclArch = {
  2215. ARM: '',
  2216. MIPS: '',
  2217. MIPS64: '',
  2218. X86_32: '',
  2219. X86_64: '',
  2220. };
  2221. /**
  2222. * @see https://developer.chrome.com/apps/runtime#type-PlatformInfo
  2223. * @typedef {{
  2224. * os: !chrome.runtime.PlatformOs,
  2225. * arch: !chrome.runtime.PlatformArch,
  2226. * nacl_arch: !chrome.runtime.PlatformNaclArch,
  2227. * }}
  2228. */
  2229. chrome.runtime.PlatformInfo;
  2230. /**
  2231. * @see https://developer.chrome.com/extensions/runtime#type-PlatformInfo
  2232. * @param {function(!chrome.runtime.PlatformInfo)} callback
  2233. * @return {undefined}
  2234. */
  2235. chrome.runtime.getPlatformInfo = function(callback) {};
  2236. /**
  2237. * @param {function(!DirectoryEntry)} callback
  2238. * @return {undefined}
  2239. */
  2240. chrome.runtime.getPackageDirectoryEntry = function(callback) {};
  2241. /** @type {!chrome.runtime.PortEvent} */
  2242. chrome.runtime.onConnect;
  2243. /** @type {!chrome.runtime.PortEvent} */
  2244. chrome.runtime.onConnectExternal;
  2245. /** @type {!chrome.runtime.PortEvent} */
  2246. chrome.runtime.onConnectNative;
  2247. /** @type {!ChromeObjectEvent} */
  2248. chrome.runtime.onInstalled;
  2249. /** @type {!chrome.runtime.MessageSenderEvent} */
  2250. chrome.runtime.onMessage;
  2251. /** @type {!chrome.runtime.MessageSenderEvent} */
  2252. chrome.runtime.onMessageExternal;
  2253. /** @type {!ChromeEvent} */
  2254. chrome.runtime.onStartup;
  2255. /** @type {!ChromeEvent} */
  2256. chrome.runtime.onSuspend;
  2257. /** @type {!ChromeEvent} */
  2258. chrome.runtime.onSuspendCanceled;
  2259. /** @type {!ChromeObjectEvent} */
  2260. chrome.runtime.onUpdateAvailable;
  2261. /** @type {!ChromeStringEvent} */
  2262. chrome.runtime.onRestartRequired;
  2263. /**
  2264. * Event whose listeners take a Port parameter.
  2265. * @interface
  2266. * @extends {ChromeBaseEvent<function(!Port)>}
  2267. */
  2268. chrome.runtime.PortEvent = function() {};
  2269. /**
  2270. * Event whose listeners take a MessageSender and additional parameters.
  2271. * @see http://developer.chrome.com/dev/apps/runtime.html#event-onMessage
  2272. * @interface
  2273. * @extends {ChromeBaseEvent<function(*, !MessageSender, function(*): void):
  2274. * (boolean|undefined)>}
  2275. */
  2276. chrome.runtime.MessageSenderEvent = function() {};
  2277. /**
  2278. * @const
  2279. * @see https://developer.chrome.com/extensions/tabs
  2280. */
  2281. chrome.tabs = {};
  2282. /**
  2283. * @enum {string}
  2284. * @see https://developer.chrome.com/extensions/tabs#type-TabStatus
  2285. */
  2286. chrome.tabs.TabStatus = {
  2287. COMPLETE: '',
  2288. LOADING: '',
  2289. };
  2290. /**
  2291. * @const {number}
  2292. * @see https://developer.chrome.com/extensions/tabs#property-TAB_ID_NONE
  2293. */
  2294. chrome.tabs.TAB_ID_NONE = -1;
  2295. /**
  2296. * @typedef {?{
  2297. * code: (string|undefined),
  2298. * file: (string|undefined),
  2299. * allFrames: (boolean|undefined),
  2300. * matchAboutBlank: (boolean|undefined),
  2301. * runAt: (string|undefined)
  2302. * }}
  2303. */
  2304. chrome.tabs.InjectDetails;
  2305. /**
  2306. * @see https://developer.chrome.com/extensions/tabs#method-captureVisibleTab
  2307. * @param {number|!chrome.types.ImageDetails|function(string):void}
  2308. * windowIdOrOptionsOrCallback One of:
  2309. * The target window.
  2310. * An object defining details about the format and quality of an image, in
  2311. * which case the window defaults to the current window.
  2312. * A callback function which accepts the data URL string of a JPEG encoding
  2313. * of the visible area of the captured tab.
  2314. * @param {(!chrome.types.ImageDetails|function(string):void)=}
  2315. * opt_optionsOrCallback Either an object defining details about the
  2316. * format and quality of an image, or a callback function which accepts the
  2317. * data URL string of a JPEG encoding of the visible area of the captured
  2318. * tab.
  2319. * @param {function(string):void=} opt_callback A callback function which
  2320. * accepts the data URL string of a JPEG encoding of the visible area of the
  2321. * captured tab.
  2322. * @return {undefined}
  2323. */
  2324. chrome.tabs.captureVisibleTab = function(
  2325. windowIdOrOptionsOrCallback, opt_optionsOrCallback, opt_callback) {};
  2326. /**
  2327. * @param {number} tabId Tab Id.
  2328. * @param {{name: (string|undefined)}=} connectInfo Info Object.
  2329. * @return {Port} New port.
  2330. */
  2331. chrome.tabs.connect = function(tabId, connectInfo) {};
  2332. /**
  2333. * @typedef {?{
  2334. * windowId: (number|undefined),
  2335. * index: (number|undefined),
  2336. * url: (string|undefined),
  2337. * active: (boolean|undefined),
  2338. * pinned: (boolean|undefined),
  2339. * openerTabId: (number|undefined)
  2340. * }}
  2341. */
  2342. chrome.tabs.CreateProperties;
  2343. /**
  2344. * @param {!chrome.tabs.CreateProperties} createProperties Info object.
  2345. * @param {function(!Tab): void=} opt_callback The callback function.
  2346. * @return {undefined}
  2347. */
  2348. chrome.tabs.create = function(createProperties, opt_callback) {};
  2349. /**
  2350. * @see https://developer.chrome.com/extensions/tabs#method-detectLanguage
  2351. * @param {number|function(string): void} tabIdOrCallback The tab id, or a
  2352. * callback function that will be invoked with the language of the active
  2353. * tab in the current window.
  2354. * @param {function(string): void=} opt_callback An optional callback function
  2355. * that will be invoked with the language of the tab specified as first
  2356. * argument.
  2357. * @return {undefined}
  2358. */
  2359. chrome.tabs.detectLanguage = function(tabIdOrCallback, opt_callback) {};
  2360. /**
  2361. * @see https://developer.chrome.com/extensions/tabs#method-discard
  2362. * @param {number|function(!Tab): void} tabIdOrCallback
  2363. * @param {function(!Tab): void=} opt_callback
  2364. */
  2365. chrome.tabs.discard;
  2366. /**
  2367. * @see https://developer.chrome.com/extensions/tabs#method-executeScript
  2368. * @param {number|!chrome.tabs.InjectDetails} tabIdOrDetails
  2369. * Either the id of the tab in which to run the script, or an object
  2370. * containing the details of the script to run, in which case the script
  2371. * will be executed in the active tab of the current window.
  2372. * @param {(!chrome.tabs.InjectDetails|function(!Array<*>):void)=}
  2373. * opt_detailsOrCallback Either an object containing the details of the
  2374. * script to run, if the tab id was speficied as first argument, or a
  2375. * callback that will be invoked with the result of the execution of the
  2376. * script in every injected frame.
  2377. * @param {function(!Array<*>):void=} opt_callback A callback that will be
  2378. * invoked with the result of the execution of the script in every
  2379. * injected frame.
  2380. * @return {undefined}
  2381. */
  2382. chrome.tabs.executeScript = function(
  2383. tabIdOrDetails, opt_detailsOrCallback, opt_callback) {};
  2384. /**
  2385. * @param {number} tabId Tab id.
  2386. * @param {function(!Tab): void} callback Callback.
  2387. * @return {undefined}
  2388. */
  2389. chrome.tabs.get = function(tabId, callback) {};
  2390. /**
  2391. * Note (2014-05-21): Because this function is deprecated, the types of it's
  2392. * parameters were not upgraded to make the first parameter optional and to mark
  2393. * the Array and Tab in the callback as non-null.
  2394. *
  2395. * @param {number?} windowId Window id.
  2396. * @param {function(Array<Tab>): void} callback Callback.
  2397. * @deprecated Please use tabs.query {windowId: windowId}.
  2398. * @return {undefined}
  2399. */
  2400. chrome.tabs.getAllInWindow = function(windowId, callback) {};
  2401. /**
  2402. * @param {function(!Tab=): void} callback Callback.
  2403. * @return {undefined}
  2404. */
  2405. chrome.tabs.getCurrent = function(callback) {};
  2406. /**
  2407. * Note (2014-05-21): Because this function is deprecated, the types of it's
  2408. * parameters were not upgraded to make the first parameter optional and to mark
  2409. * the Array and Tab in the callback as non-null.
  2410. *
  2411. * @param {number?} windowId Window id.
  2412. * @param {function(Tab): void} callback Callback.
  2413. * @deprecated Please use tabs.query({active: true}).
  2414. * @return {undefined}
  2415. */
  2416. chrome.tabs.getSelected = function(windowId, callback) {};
  2417. /**
  2418. * @see https://developer.chrome.com/extensions/tabs#method-getZoom
  2419. * @param {number|function(number): void} tabIdOrCallback
  2420. * @param {function(number): void=} opt_callback
  2421. * @return {undefined}
  2422. */
  2423. chrome.tabs.getZoom = function(tabIdOrCallback, opt_callback) {};
  2424. /**
  2425. * @see https://developer.chrome.com/extensions/tabs#type-ZoomSettings
  2426. * @typedef {?{
  2427. * mode: (string|undefined),
  2428. * scope: (string|undefined),
  2429. * defaultZoomFactor: (number|undefined),
  2430. * }}
  2431. */
  2432. chrome.tabs.ZoomSettings;
  2433. /**
  2434. * @see https://developer.chrome.com/extensions/tabs#method-getZoomSettings
  2435. * @param {number|function(!chrome.tabs.ZoomSettings): void} tabIdOrCallback
  2436. * @param {function(!chrome.tabs.ZoomSettings): void=} opt_callback
  2437. */
  2438. chrome.tabs.getZoomSettings = function(tabIdOrCallback, opt_callback) {};
  2439. /**
  2440. * @typedef {?{
  2441. * windowId: (number|undefined),
  2442. * tabs: (number|!Array<number>)
  2443. * }}
  2444. */
  2445. chrome.tabs.HighlightInfo;
  2446. /**
  2447. * @see https://developer.chrome.com/extensions/tabs#method-highlight
  2448. * @param {!chrome.tabs.HighlightInfo} highlightInfo
  2449. * @param {function(!ChromeWindow): void=} callback Callback function invoked
  2450. * for each window whose tabs were highlighted.
  2451. * @return {undefined}
  2452. */
  2453. chrome.tabs.highlight = function(highlightInfo, callback) {};
  2454. /**
  2455. * @link https://developer.chrome.com/extensions/tabs#method-insertCSS
  2456. * @param {number|!chrome.tabs.InjectDetails} tabIdOrDetails
  2457. * Either the id of the tab in which to run the script, or an object
  2458. * containing the details of the CSS to insert, in which case the script
  2459. * will be executed in the active tab of the current window.
  2460. * @param {(!chrome.tabs.InjectDetails|function():void)=}
  2461. * opt_detailsOrCallback Either an object containing the details of the
  2462. * CSS to insert, if the tab id was speficied as first argument, or a
  2463. * callback that will be invoked after the CSS has been injected.
  2464. * @param {function():void=} opt_callback A callback that will be invoked after
  2465. * the CSS has been injected.
  2466. * @return {undefined}
  2467. */
  2468. chrome.tabs.insertCSS = function(
  2469. tabIdOrDetails, opt_detailsOrCallback, opt_callback) {};
  2470. /**
  2471. * @typedef {?{
  2472. * windowId: (number|undefined),
  2473. * index: number
  2474. * }}
  2475. */
  2476. chrome.tabs.MoveProperties;
  2477. /**
  2478. * @param {number|!Array<number>} tabId Tab id or array of tab ids.
  2479. * @param {!chrome.tabs.MoveProperties} moveProperties
  2480. * @param {function((!Tab|!Array<!Tab>)): void=} opt_callback Callback.
  2481. * @return {undefined}
  2482. */
  2483. chrome.tabs.move = function(tabId, moveProperties, opt_callback) {};
  2484. /**
  2485. * @typedef {?{
  2486. * active: (boolean|undefined),
  2487. * pinned: (boolean|undefined),
  2488. * audible: (boolean|undefined),
  2489. * muted: (boolean|undefined),
  2490. * highlighted: (boolean|undefined),
  2491. * discarded: (boolean|undefined),
  2492. * autoDiscardable: (boolean|undefined),
  2493. * currentWindow: (boolean|undefined),
  2494. * lastFocusedWindow: (boolean|undefined),
  2495. * status: (!chrome.tabs.TabStatus|string|undefined),
  2496. * title: (string|undefined),
  2497. * url: (!Array<string>|string|undefined),
  2498. * windowId: (number|undefined),
  2499. * windowType: (string|undefined),
  2500. * index: (number|undefined)
  2501. * }}
  2502. */
  2503. chrome.tabs.QueryInfo;
  2504. /**
  2505. * @param {!chrome.tabs.QueryInfo} queryInfo
  2506. * @param {function(!Array<!Tab>): void} callback Callback.
  2507. * @return {undefined}
  2508. */
  2509. chrome.tabs.query = function(queryInfo, callback) {};
  2510. /**
  2511. * @see https://developer.chrome.com/extensions/tabs#method-query
  2512. * @param {number} tabId The ID of the tab which is to be duplicated.
  2513. * @param {(function(!Tab=):void)=} opt_callback A callback to be invoked with
  2514. * details about the duplicated tab.
  2515. * @return {undefined}
  2516. */
  2517. chrome.tabs.duplicate = function(tabId, opt_callback) {};
  2518. /**
  2519. * @typedef {?{
  2520. * bypassCache: (boolean|undefined)
  2521. * }}
  2522. */
  2523. chrome.tabs.ReloadProperties;
  2524. /**
  2525. * @see https://developer.chrome.com/extensions/tabs#method-reload
  2526. * @param {(number|!chrome.tabs.ReloadProperties|function():void)=}
  2527. * opt_tabIdOrReloadPropertiesOrCallback One of:
  2528. * The ID of the tab to reload; defaults to the selected tab of the current
  2529. * window.
  2530. * An object specifying boolean flags to customize the reload operation.
  2531. * A callback to be invoked when the reload is complete.
  2532. * @param {(!chrome.tabs.ReloadProperties|function():void)=}
  2533. * opt_reloadPropertiesOrCallback Either an object specifying boolean flags
  2534. * to customize the reload operation, or a callback to be invoked when the
  2535. * reload is complete, if no object needs to be specified.
  2536. * @param {function():void=} opt_callback A callback to be invoked when the
  2537. * reload is complete.
  2538. * @return {undefined}
  2539. */
  2540. chrome.tabs.reload = function(
  2541. opt_tabIdOrReloadPropertiesOrCallback, opt_reloadPropertiesOrCallback,
  2542. opt_callback) {};
  2543. /**
  2544. * @param {number|!Array<number>} tabIds A tab ID or an array of tab IDs.
  2545. * @param {function(): void=} opt_callback Callback.
  2546. * @return {undefined}
  2547. */
  2548. chrome.tabs.remove = function(tabIds, opt_callback) {};
  2549. /**
  2550. * @typedef {?{
  2551. * frameId: (number|undefined)
  2552. * }}
  2553. */
  2554. chrome.tabs.SendMessageOptions;
  2555. /**
  2556. * @param {number} tabId Tab id.
  2557. * @param {*} request The request value of any type.
  2558. * @param {(!chrome.tabs.SendMessageOptions|function(*): void)=}
  2559. * opt_optionsOrCallback The object with an optional "frameId" or the
  2560. * callback function.
  2561. * @param {function(*): void=} opt_callback The callback function which
  2562. * takes a JSON response object sent by the handler of the request.
  2563. * @return {undefined}
  2564. */
  2565. chrome.tabs.sendMessage = function(
  2566. tabId, request, opt_optionsOrCallback, opt_callback) {};
  2567. /**
  2568. * @param {number} tabId Tab id.
  2569. * @param {*} request The request value of any type.
  2570. * @param {function(*): void=} opt_callback The callback function which
  2571. * takes a JSON response object sent by the handler of the request.
  2572. * @deprecated Please use runtime.sendMessage.
  2573. * @return {undefined}
  2574. */
  2575. chrome.tabs.sendRequest = function(tabId, request, opt_callback) {};
  2576. /**
  2577. * @see https://developer.chrome.com/extensions/tabs#method-setZoom
  2578. * @param {number} tabIdOrZoomFactor
  2579. * @param {(number|function(): void)=} opt_zoomFactorOrCallback
  2580. * @param {function(): void=} opt_callback
  2581. * @return {undefined}
  2582. */
  2583. chrome.tabs.setZoom = function(
  2584. tabIdOrZoomFactor, opt_zoomFactorOrCallback, opt_callback) {};
  2585. /**
  2586. * @see https://developer.chrome.com/extensions/tabs#method-setZoomSettings
  2587. * @param {number|!chrome.tabs.ZoomSettings} tabIdOrZoomSettings
  2588. * @param {(!chrome.tabs.ZoomSettings|function(): void)=}
  2589. * opt_zoomSettingsOrCallback
  2590. * @param {function(): void=} opt_callback
  2591. */
  2592. chrome.tabs.setZoomSettings = function(
  2593. tabIdOrZoomSettings, opt_zoomSettingsOrCallback, opt_callback) {};
  2594. /**
  2595. * @typedef {?{
  2596. * url: (string|undefined),
  2597. * active: (boolean|undefined),
  2598. * highlighted: (boolean|undefined),
  2599. * pinned: (boolean|undefined),
  2600. * openerTabId: (number|undefined)
  2601. * }}
  2602. */
  2603. chrome.tabs.UpdateProperties;
  2604. /**
  2605. * @see https://developer.chrome.com/extensions/tabs#method-update
  2606. * @param {number|!chrome.tabs.UpdateProperties} tabIdOrUpdateProperties
  2607. * Either the id of the tab to update, or an object with new property
  2608. * values, in which case the selected tab of the current window will be
  2609. * updated.
  2610. * @param {(!chrome.tabs.UpdateProperties|function(Tab):void)=}
  2611. * opt_updatePropertiesOrCallback Either an object with new property values,
  2612. * if the tabId was specified as first parameter, or an optional callback
  2613. * that will be invoked with information about the tab being updated.
  2614. * @param {function(!Tab=): void=} opt_callback An optional callback that will
  2615. * be invoked with information about the tab being updated.
  2616. * @return {undefined}
  2617. */
  2618. chrome.tabs.update = function(
  2619. tabIdOrUpdateProperties, opt_updatePropertiesOrCallback, opt_callback) {};
  2620. /**
  2621. * @type {!ChromeEvent}
  2622. * @deprecated Please use tabs.onActivated.
  2623. */
  2624. chrome.tabs.onActiveChanged;
  2625. /** @type {!ChromeEvent} */
  2626. chrome.tabs.onActivated;
  2627. /** @type {!ChromeEvent} */
  2628. chrome.tabs.onAttached;
  2629. /** @type {!ChromeEvent} */
  2630. chrome.tabs.onCreated;
  2631. /** @type {!ChromeEvent} */
  2632. chrome.tabs.onDetached;
  2633. /**
  2634. * @type {!ChromeEvent}
  2635. * @deprecated Please use tabs.onHighlighted.
  2636. */
  2637. chrome.tabs.onHighlightChanged;
  2638. /**
  2639. * @type {!ChromeEvent}
  2640. */
  2641. chrome.tabs.onHighlighted;
  2642. /** @type {!ChromeEvent} */
  2643. chrome.tabs.onMoved;
  2644. /** @type {!ChromeEvent} */
  2645. chrome.tabs.onRemoved;
  2646. /** @type {!ChromeEvent} */
  2647. chrome.tabs.onUpdated;
  2648. /** @type {!ChromeEvent} */
  2649. chrome.tabs.onReplaced;
  2650. // DEPRECATED:
  2651. // TODO(user): Remove once all usage has been confirmed to have ended.
  2652. /**
  2653. * @type {!ChromeEvent}
  2654. * @deprecated Please use tabs.onActivated.
  2655. */
  2656. chrome.tabs.onSelectionChanged;
  2657. /**
  2658. * @see https://developer.chrome.com/extensions/tabs#event-onZoomChange
  2659. * @type {!ChromeObjectEvent}
  2660. */
  2661. chrome.tabs.onZoomChange;
  2662. /**
  2663. * @see https://developer.chrome.com/extensions/topSites
  2664. * @const
  2665. */
  2666. chrome.topSites = {};
  2667. /**
  2668. * @constructor
  2669. * @see https://developer.chrome.com/extensions/topSites#type-MostVisitedURL
  2670. */
  2671. chrome.topSites.MostVisitedURL = function() {};
  2672. /** @type {string} */
  2673. chrome.topSites.MostVisitedURL.prototype.url;
  2674. /** @type {string} */
  2675. chrome.topSites.MostVisitedURL.prototype.title;
  2676. /**
  2677. * Gets a list of top sites.
  2678. * @param {function(!Array<!chrome.topSites.MostVisitedURL>)} callback Invoked
  2679. * with a list of most visited URLs.
  2680. * @see https://developer.chrome.com/extensions/topSites#method-get
  2681. * @return {undefined}
  2682. */
  2683. chrome.topSites.get = function(callback) {};
  2684. /**
  2685. * @const
  2686. * @see https://developer.chrome.com/extensions/windows.html
  2687. */
  2688. chrome.windows = {};
  2689. /**
  2690. * @param {Object=} opt_createData May have many keys to specify parameters.
  2691. * Or the callback.
  2692. * @param {function(ChromeWindow): void=} opt_callback Callback.
  2693. * @return {undefined}
  2694. */
  2695. chrome.windows.create = function(opt_createData, opt_callback) {};
  2696. /**
  2697. * @param {number} id Window id.
  2698. * @param {Object=} opt_getInfo May have 'populate' key. Or the callback.
  2699. * @param {function(!ChromeWindow): void=} opt_callback Callback when
  2700. * opt_getInfo is an object.
  2701. * @return {undefined}
  2702. */
  2703. chrome.windows.get = function(id, opt_getInfo, opt_callback) {};
  2704. /**
  2705. * @param {Object=} opt_getInfo May have 'populate' key. Or the callback.
  2706. * @param {function(!Array<!ChromeWindow>): void=} opt_callback Callback.
  2707. * @return {undefined}
  2708. */
  2709. chrome.windows.getAll = function(opt_getInfo, opt_callback) {};
  2710. /**
  2711. * @param {Object=} opt_getInfo May have 'populate' key. Or the callback.
  2712. * @param {function(ChromeWindow): void=} opt_callback Callback.
  2713. * @return {undefined}
  2714. */
  2715. chrome.windows.getCurrent = function(opt_getInfo, opt_callback) {};
  2716. /**
  2717. * @param {Object=} opt_getInfo May have 'populate' key. Or the callback.
  2718. * @param {function(ChromeWindow): void=} opt_callback Callback.
  2719. * @return {undefined}
  2720. */
  2721. chrome.windows.getLastFocused = function(opt_getInfo, opt_callback) {};
  2722. /**
  2723. * @param {number} tabId Tab Id.
  2724. * @param {function(): void=} opt_callback Callback.
  2725. * @return {undefined}
  2726. */
  2727. chrome.windows.remove = function(tabId, opt_callback) {};
  2728. /**
  2729. * @param {number} tabId Tab Id.
  2730. * @param {Object} updateProperties An object which may have many keys for
  2731. * various options.
  2732. * @param {function(!ChromeWindow): void=} opt_callback Callback.
  2733. * @return {undefined}
  2734. */
  2735. chrome.windows.update = function(tabId, updateProperties, opt_callback) {};
  2736. /** @type {!ChromeEvent} */
  2737. chrome.windows.onCreated;
  2738. /** @type {!ChromeEvent} */
  2739. chrome.windows.onFocusChanged;
  2740. /** @type {!ChromeEvent} */
  2741. chrome.windows.onRemoved;
  2742. /**
  2743. * @see https://developer.chrome.com/extensions/windows.html#property-WINDOW_ID_NONE
  2744. * @type {number}
  2745. */
  2746. chrome.windows.WINDOW_ID_NONE;
  2747. /**
  2748. * @see https://developer.chrome.com/extensions/windows.html#property-WINDOW_ID_CURRENT
  2749. * @type {number}
  2750. */
  2751. chrome.windows.WINDOW_ID_CURRENT;
  2752. /**
  2753. * @const
  2754. * @see https://developer.chrome.com/extensions/i18n.html
  2755. */
  2756. chrome.i18n = {};
  2757. /**
  2758. * @param {function(Array<string>): void} callback The callback function which
  2759. * accepts an array of the accept languages of the browser, such as
  2760. * 'en-US','en','zh-CN'.
  2761. * @return {undefined}
  2762. */
  2763. chrome.i18n.getAcceptLanguages = function(callback) {};
  2764. /**
  2765. * @param {string} messageName
  2766. * @param {(string|Array<string>)=} opt_args
  2767. * @param {{escapeLt: boolean}=} opt_options
  2768. * @return {string}
  2769. * @see https://developer.chrome.com/extensions/i18n#method-getMessage
  2770. */
  2771. chrome.i18n.getMessage = function(messageName, opt_args, opt_options) {};
  2772. /**
  2773. * @return {string}
  2774. */
  2775. chrome.i18n.getUILanguage = function() {};
  2776. /**
  2777. * @param {string} text User input string to be detected.
  2778. * @param {function(!Object)} callback The callback for passing back the
  2779. * language detection result.
  2780. * @return {undefined}
  2781. */
  2782. chrome.i18n.detectLanguage = function(text, callback) {};
  2783. /**
  2784. * @const
  2785. * @see https://developer.chrome.com/extensions/pageAction.html
  2786. */
  2787. chrome.pageAction = {};
  2788. /**
  2789. * @param {number} tabId Tab Id.
  2790. * @return {undefined}
  2791. */
  2792. chrome.pageAction.hide = function(tabId) {};
  2793. /**
  2794. * @param {Object} details An object which has 'tabId' and either
  2795. * 'imageData' or 'path'.
  2796. * @param {(function(): void)=} callback The callback function. If an error
  2797. * occurs setting the icon, chrome.runtime.lastError will be set to the error
  2798. * message.
  2799. * @return {undefined}
  2800. */
  2801. chrome.pageAction.setIcon = function(details, callback) {};
  2802. /**
  2803. * @param {Object} details An object which may have 'popup' or 'tabId' as keys.
  2804. * @return {undefined}
  2805. */
  2806. chrome.pageAction.setPopup = function(details) {};
  2807. /**
  2808. * @param {Object} details An object which has 'tabId' and 'title'.
  2809. * @return {undefined}
  2810. */
  2811. chrome.pageAction.setTitle = function(details) {};
  2812. /**
  2813. * @param {number} tabId Tab Id.
  2814. * @param {(function(): void)=} callback The callback function. If an error
  2815. * occurs showing the pageAction, chrome.runtime.lastError will be set to the
  2816. * error message.
  2817. * @return {undefined}
  2818. */
  2819. chrome.pageAction.show = function(tabId, callback) {};
  2820. /** @type {!ChromeEvent} */
  2821. chrome.pageAction.onClicked;
  2822. /**
  2823. * @const
  2824. * @see https://developer.chrome.com/apps/browser
  2825. */
  2826. chrome.browser = {};
  2827. /**
  2828. * @param {{url: string}} details An object with a single 'url' key.
  2829. * @param {(function(): void)=} opt_callback The callback function. If an error
  2830. * occurs opening the URL, chrome.runtime.lastError will be set to the error
  2831. * message.
  2832. * @return {undefined}
  2833. */
  2834. chrome.browser.openTab = function(details, opt_callback) {};
  2835. /**
  2836. * @const
  2837. * @see https://developer.chrome.com/extensions/browserAction.html
  2838. */
  2839. chrome.browserAction = {};
  2840. /**
  2841. * @typedef {?{
  2842. * tabId: (number|undefined)
  2843. * }}
  2844. */
  2845. chrome.browserAction.Tab;
  2846. /**
  2847. * @typedef {Array<number>}
  2848. * @see https://developer.chrome.com/extensions/browserAction#type-ColorArray
  2849. */
  2850. chrome.browserAction.ColorArray;
  2851. /**
  2852. * @typedef {{
  2853. * imageData: (!ImageData|!Object<number, !ImageData>|undefined),
  2854. * path: (string|!Object<number, string>|undefined),
  2855. * tabId: (number|undefined)
  2856. * }}
  2857. */
  2858. chrome.browserAction.SetIconImageData;
  2859. /**
  2860. * @param {{
  2861. * title: string,
  2862. * tabId: (number|undefined)
  2863. * }} details
  2864. * @see https://developer.chrome.com/extensions/browserAction#method-setTitle
  2865. * @return {undefined}
  2866. */
  2867. chrome.browserAction.setTitle = function(details) {};
  2868. /**
  2869. * @param {!chrome.browserAction.Tab} details
  2870. * @param {function(string): void} callback
  2871. * @see https://developer.chrome.com/extensions/browserAction#method-getTitle
  2872. * @return {undefined}
  2873. */
  2874. chrome.browserAction.getTitle = function(details, callback) {};
  2875. /**
  2876. * @param {!chrome.browserAction.SetIconImageData} details
  2877. * @param {function(): void=} opt_callback
  2878. * @see https://developer.chrome.com/extensions/browserAction#method-setIcon
  2879. * @return {undefined}
  2880. */
  2881. chrome.browserAction.setIcon = function(details, opt_callback) {};
  2882. /**
  2883. * @param {{
  2884. * tabId: (number|undefined),
  2885. * popup: string
  2886. * }} details
  2887. * @see https://developer.chrome.com/extensions/browserAction#method-setPopup
  2888. * @return {undefined}
  2889. */
  2890. chrome.browserAction.setPopup = function(details) {};
  2891. /**
  2892. * @param {!chrome.browserAction.Tab} details
  2893. * @param {function(string): void} callback
  2894. * @see https://developer.chrome.com/extensions/browserAction#method-getPopup
  2895. * @return {undefined}
  2896. */
  2897. chrome.browserAction.getPopup = function(details, callback) {};
  2898. /**
  2899. * @param {{
  2900. * text: string,
  2901. * tabId: (number|undefined)
  2902. * }} details
  2903. * @see https://developer.chrome.com/extensions/browserAction#method-setBadgeText
  2904. * @return {undefined}
  2905. */
  2906. chrome.browserAction.setBadgeText = function(details) {};
  2907. /**
  2908. * @param {!chrome.browserAction.Tab} details
  2909. * @param {function(string): void} callback
  2910. * @see https://developer.chrome.com/extensions/browserAction#method-getBadgeText
  2911. * @return {undefined}
  2912. */
  2913. chrome.browserAction.getBadgeText = function(details, callback) {};
  2914. /**
  2915. * @param {{
  2916. * color: (string|chrome.browserAction.ColorArray),
  2917. * tabId: (number|undefined)
  2918. * }} details
  2919. * @see https://developer.chrome.com/extensions/browserAction#method-setBadgeBackgroundColor
  2920. * @return {undefined}
  2921. */
  2922. chrome.browserAction.setBadgeBackgroundColor = function(details) {};
  2923. /**
  2924. * @param {!chrome.browserAction.Tab} details
  2925. * @param {function(chrome.browserAction.ColorArray): void} callback
  2926. * @see https://developer.chrome.com/extensions/browserAction#method-getBadgeBackgroundColor
  2927. * @return {undefined}
  2928. */
  2929. chrome.browserAction.getBadgeBackgroundColor = function(details, callback) {};
  2930. /**
  2931. * @param {number=} opt_tabId
  2932. * @see https://developer.chrome.com/extensions/browserAction#method-enable
  2933. * @return {undefined}
  2934. */
  2935. chrome.browserAction.enable = function(opt_tabId) {};
  2936. /**
  2937. * @param {number=} opt_tabId
  2938. * @see https://developer.chrome.com/extensions/browserAction#method-disable
  2939. * @return {undefined}
  2940. */
  2941. chrome.browserAction.disable = function(opt_tabId) {};
  2942. /**
  2943. * @interface
  2944. * @extends {ChromeBaseEvent<function(!Tab)>}
  2945. */
  2946. chrome.browserAction.BrowserActionTabEvent = function() {};
  2947. /**
  2948. * @type {!chrome.browserAction.BrowserActionTabEvent}
  2949. * @see https://developer.chrome.com/extensions/browserAction#event-onClicked
  2950. */
  2951. chrome.browserAction.onClicked;
  2952. /**
  2953. * @const
  2954. * @see https://developer.chrome.com/extensions/bookmarks.html
  2955. */
  2956. chrome.bookmarks = {};
  2957. /**
  2958. * @typedef {?{
  2959. * parentId: (string|undefined),
  2960. * index: (number|undefined),
  2961. * url: (string|undefined),
  2962. * title: (string|undefined)
  2963. * }}
  2964. * @see https://developer.chrome.com/extensions/bookmarks#method-create
  2965. */
  2966. chrome.bookmarks.CreateDetails;
  2967. /**
  2968. * @typedef {?{
  2969. * query: (string|undefined),
  2970. * url: (string|undefined),
  2971. * title: (string|undefined)
  2972. * }}
  2973. * @see https://developer.chrome.com/extensions/bookmarks#method-search
  2974. */
  2975. chrome.bookmarks.SearchDetails;
  2976. /**
  2977. * @param {(string|Array<string>)} idOrIdList
  2978. * @param {function(Array<BookmarkTreeNode>): void} callback The
  2979. * callback function which accepts an array of BookmarkTreeNode.
  2980. * @return {Array<BookmarkTreeNode>}
  2981. */
  2982. chrome.bookmarks.get = function(idOrIdList, callback) {};
  2983. /**
  2984. * @param {string} id
  2985. * @param {function(Array<BookmarkTreeNode>): void} callback The
  2986. * callback function which accepts an array of BookmarkTreeNode.
  2987. * @return {Array<BookmarkTreeNode>}
  2988. */
  2989. chrome.bookmarks.getChildren = function(id, callback) {};
  2990. /**
  2991. * @param {number} numberOfItems The number of items to return.
  2992. * @param {function(Array<BookmarkTreeNode>): void} callback The
  2993. * callback function which accepts an array of BookmarkTreeNode.
  2994. * @return {Array<BookmarkTreeNode>}
  2995. */
  2996. chrome.bookmarks.getRecent = function(numberOfItems, callback) {};
  2997. /**
  2998. * @param {function(Array<BookmarkTreeNode>): void} callback The
  2999. * callback function which accepts an array of BookmarkTreeNode.
  3000. * @return {Array<BookmarkTreeNode>}
  3001. */
  3002. chrome.bookmarks.getTree = function(callback) {};
  3003. /**
  3004. * @param {string} id The ID of the root of the subtree to retrieve.
  3005. * @param {function(Array<BookmarkTreeNode>): void} callback The
  3006. * callback function which accepts an array of BookmarkTreeNode.
  3007. * @return {Array<BookmarkTreeNode>}
  3008. */
  3009. chrome.bookmarks.getSubTree = function(id, callback) {};
  3010. /**
  3011. * @param {string|!chrome.bookmarks.SearchDetails} query
  3012. * @param {function(Array<BookmarkTreeNode>): void} callback
  3013. * @return {Array<BookmarkTreeNode>}
  3014. */
  3015. chrome.bookmarks.search = function(query, callback) {};
  3016. /**
  3017. * @param {chrome.bookmarks.CreateDetails} bookmark
  3018. * @param {function(BookmarkTreeNode): void=} opt_callback The
  3019. * callback function which accepts a BookmarkTreeNode object.
  3020. * @return {undefined}
  3021. */
  3022. chrome.bookmarks.create = function(bookmark, opt_callback) {};
  3023. /**
  3024. * @param {string} id
  3025. * @param {Object} destination An object which has optional 'parentId' and
  3026. * optional 'index'.
  3027. * @param {function(BookmarkTreeNode): void=} opt_callback
  3028. * The callback function which accepts a BookmarkTreeNode object.
  3029. * @return {undefined}
  3030. */
  3031. chrome.bookmarks.move = function(id, destination, opt_callback) {};
  3032. /**
  3033. * @param {string} id
  3034. * @param {Object} changes An object which may have 'title' as a key.
  3035. * @param {function(BookmarkTreeNode): void=} opt_callback The
  3036. * callback function which accepts a BookmarkTreeNode object.
  3037. * @return {undefined}
  3038. */
  3039. chrome.bookmarks.update = function(id, changes, opt_callback) {};
  3040. /**
  3041. * @param {string} id
  3042. * @param {function(): void=} opt_callback
  3043. * @return {undefined}
  3044. */
  3045. chrome.bookmarks.remove = function(id, opt_callback) {};
  3046. /**
  3047. * @param {string} id
  3048. * @param {function(): void=} opt_callback
  3049. * @return {undefined}
  3050. */
  3051. chrome.bookmarks.removeTree = function(id, opt_callback) {};
  3052. /**
  3053. * @param {function(): void=} opt_callback
  3054. * @return {undefined}
  3055. */
  3056. chrome.bookmarks.import = function(opt_callback) {};
  3057. /**
  3058. * @param {function(): void=} opt_callback
  3059. * @return {undefined}
  3060. */
  3061. chrome.bookmarks.export = function(opt_callback) {};
  3062. /** @type {!ChromeEvent} */
  3063. chrome.bookmarks.onChanged;
  3064. /** @type {!ChromeEvent} */
  3065. chrome.bookmarks.onChildrenReordered;
  3066. /** @type {!ChromeEvent} */
  3067. chrome.bookmarks.onCreated;
  3068. /** @type {!ChromeEvent} */
  3069. chrome.bookmarks.onImportBegan;
  3070. /** @type {!ChromeEvent} */
  3071. chrome.bookmarks.onImportEnded;
  3072. /** @type {!ChromeEvent} */
  3073. chrome.bookmarks.onMoved;
  3074. /** @type {!ChromeEvent} */
  3075. chrome.bookmarks.onRemoved;
  3076. /**
  3077. * @typedef {?{
  3078. * content: string,
  3079. * description: string
  3080. * }}
  3081. */
  3082. var SuggestResult;
  3083. /**
  3084. * @const
  3085. * @see https://developer.chrome.com/extensions/omnibox.html
  3086. */
  3087. chrome.omnibox = {};
  3088. /**
  3089. * @interface
  3090. * @extends {ChromeBaseEvent<function(string,
  3091. * function(!Array<!SuggestResult>))>}
  3092. */
  3093. chrome.omnibox.InputChangedEvent = function() {};
  3094. /**
  3095. * @enum {string}
  3096. * @see https://developer.chrome.com/extensions/omnibox#type-OnInputEnteredDisposition
  3097. */
  3098. chrome.omnibox.OnInputEnteredDisposition = {
  3099. CURRENT_TAB: '',
  3100. NEW_BACKGROUND_TAB: '',
  3101. NEW_FOREGROUND_TAB: '',
  3102. };
  3103. /**
  3104. * @interface
  3105. * @extends {ChromeBaseEvent<
  3106. * function(string,!chrome.omnibox.OnInputEnteredDisposition)>}
  3107. */
  3108. chrome.omnibox.InputEnteredEvent = function() {};
  3109. /**
  3110. * @param {{description: string}} suggestion A partial SuggestResult object.
  3111. * @return {undefined}
  3112. */
  3113. chrome.omnibox.setDefaultSuggestion = function(suggestion) {};
  3114. /** @type {!ChromeEvent} */
  3115. chrome.omnibox.onInputCancelled;
  3116. /** @type {!chrome.omnibox.InputChangedEvent} */
  3117. chrome.omnibox.onInputChanged;
  3118. /** @type {!chrome.omnibox.InputEnteredEvent} */
  3119. chrome.omnibox.onInputEntered;
  3120. /** @type {!ChromeEvent} */
  3121. chrome.omnibox.onInputStarted;
  3122. /**
  3123. * @const
  3124. * @see https://developer.chrome.com/extensions/dev/contextMenus.html
  3125. */
  3126. chrome.contextMenus = {};
  3127. /**
  3128. * @typedef {?{
  3129. * type: (string|undefined),
  3130. * id: (string|undefined),
  3131. * title: (string|undefined),
  3132. * checked: (boolean|undefined),
  3133. * contexts: (!Array<string>|undefined),
  3134. * onclick: (function(!Object, !Tab)|undefined),
  3135. * parentId: (number|string|undefined),
  3136. * documentUrlPatterns: (!Array<string>|undefined),
  3137. * targetUrlPatterns: (!Array<string>|undefined),
  3138. * enabled: (boolean|undefined)
  3139. * }}
  3140. * @see https://developer.chrome.com/extensions/contextMenus#method-create
  3141. */
  3142. chrome.contextMenus.CreateProperties;
  3143. /**
  3144. * @typedef {?{
  3145. * type: (string|undefined),
  3146. * title: (string|undefined),
  3147. * checked: (boolean|undefined),
  3148. * contexts: (!Array<string>|undefined),
  3149. * onclick: (function(!Object, !Tab)|undefined),
  3150. * parentId: (number|string|undefined),
  3151. * documentUrlPatterns: (!Array<string>|undefined),
  3152. * targetUrlPatterns: (!Array<string>|undefined),
  3153. * enabled: (boolean|undefined)
  3154. * }}
  3155. * @see https://developer.chrome.com/extensions/contextMenus#method-update
  3156. */
  3157. chrome.contextMenus.UpdateProperties;
  3158. /**
  3159. * @param {!chrome.contextMenus.CreateProperties} createProperties
  3160. * @param {function()=} opt_callback
  3161. * @return {(number|string)} The id of the newly created window.
  3162. * @see https://developer.chrome.com/extensions/contextMenus#method-create
  3163. */
  3164. chrome.contextMenus.create = function(createProperties, opt_callback) {};
  3165. /**
  3166. * @param {(number|string)} id
  3167. * @param {!chrome.contextMenus.UpdateProperties} updateProperties
  3168. * @param {function()=} opt_callback
  3169. * @see https://developer.chrome.com/extensions/contextMenus#method-update
  3170. * @return {undefined}
  3171. */
  3172. chrome.contextMenus.update = function(id, updateProperties, opt_callback) {};
  3173. /**
  3174. * @param {(number|string)} menuItemId
  3175. * @param {function()=} opt_callback
  3176. * @see https://developer.chrome.com/extensions/contextMenus#method-remove
  3177. * @return {undefined}
  3178. */
  3179. chrome.contextMenus.remove = function(menuItemId, opt_callback) {};
  3180. /**
  3181. * @param {function()=} opt_callback
  3182. * @see https://developer.chrome.com/extensions/contextMenus#method-removeAll
  3183. * @return {undefined}
  3184. */
  3185. chrome.contextMenus.removeAll = function(opt_callback) {};
  3186. /**
  3187. * @interface
  3188. * @extends {ChromeBaseEvent<function(!OnClickData, !Tab=)>}
  3189. * @see https://developer.chrome.com/extensions/contextMenus#event-onClicked
  3190. */
  3191. chrome.contextMenus.ClickedEvent = function() {};
  3192. /**
  3193. * @type {!chrome.contextMenus.ClickedEvent}
  3194. * @see https://developer.chrome.com/extensions/contextMenus#event-onClicked
  3195. */
  3196. chrome.contextMenus.onClicked;
  3197. /**
  3198. * @const
  3199. * @see https://developer.chrome.com/extensions/dev/cookies.html
  3200. */
  3201. chrome.cookies = {};
  3202. /**
  3203. * This typedef is used for the parameters to chrome.cookies.get,
  3204. * chrome.cookies.remove, and for the parameter to remove's callback. These uses
  3205. * all identify a single cookie uniquely without specifying its content, and the
  3206. * objects are identical except for the storeId being optional vs required.
  3207. * If greater divergence occurs, then going to two typedefs is recommended.
  3208. *
  3209. * @typedef {?{
  3210. * url: string,
  3211. * name: string,
  3212. * storeId: (string|undefined)
  3213. * }}
  3214. */
  3215. chrome.cookies.CookieIdentifier;
  3216. /**
  3217. * @param {!chrome.cookies.CookieIdentifier} details
  3218. * @param {function(Cookie=): void} callback
  3219. * @return {undefined}
  3220. */
  3221. chrome.cookies.get = function(details, callback) {};
  3222. /**
  3223. * @param {Object} details
  3224. * @param {function(Array<Cookie>): void} callback
  3225. * @return {undefined}
  3226. */
  3227. chrome.cookies.getAll = function(details, callback) {};
  3228. /**
  3229. * @param {function(Array<CookieStore>): void} callback
  3230. * @return {undefined}
  3231. */
  3232. chrome.cookies.getAllCookieStores = function(callback) {};
  3233. /**
  3234. * @param {!chrome.cookies.CookieIdentifier} details
  3235. * @param {function(chrome.cookies.CookieIdentifier): void=} opt_callback If
  3236. * removal failed for any reason, the parameter will be "null", and
  3237. * "chrome.runtime.lastError" will be set.
  3238. * @return {undefined}
  3239. */
  3240. chrome.cookies.remove = function(details, opt_callback) {};
  3241. /**
  3242. * @typedef {?{
  3243. * url: string,
  3244. * name: (string|undefined),
  3245. * value: (string|undefined),
  3246. * domain: (string|undefined),
  3247. * path: (string|undefined),
  3248. * secure: (boolean|undefined),
  3249. * httpOnly: (boolean|undefined),
  3250. * expirationDate: (number|undefined),
  3251. * storeId: (string|undefined)
  3252. * }}
  3253. */
  3254. chrome.cookies.CookieSetDetails;
  3255. /**
  3256. * @param {!chrome.cookies.CookieSetDetails} details
  3257. * @param {function(Cookie): void=} opt_callback If setting failed for any
  3258. * reason, the parameter will be "null", and "chrome.runtime.lastError" will
  3259. * be set.
  3260. * @return {undefined}
  3261. */
  3262. chrome.cookies.set = function(details, opt_callback) {};
  3263. /**
  3264. * @see https://developer.chrome.com/extensions/cookies.html#event-onChanged
  3265. * @type {!ChromeEvent}
  3266. */
  3267. chrome.cookies.onChanged;
  3268. /** @constructor */
  3269. function CookieChangeInfo() {}
  3270. /** @type {boolean} */
  3271. CookieChangeInfo.prototype.removed;
  3272. /** @type {Cookie} */
  3273. CookieChangeInfo.prototype.cookie;
  3274. /** @type {string} */
  3275. CookieChangeInfo.prototype.cause;
  3276. /**
  3277. * @const
  3278. * @see https://developer.chrome.com/extensions/management
  3279. */
  3280. chrome.management = {};
  3281. /**
  3282. * @typedef {?{
  3283. * showConfirmDialog: (boolean|undefined)
  3284. * }}
  3285. */
  3286. chrome.management.InstallOptions;
  3287. /**
  3288. * @param {function(!Array<!ExtensionInfo>): void=} opt_callback Optional
  3289. * callback function.
  3290. * @return {undefined}
  3291. */
  3292. chrome.management.getAll = function(opt_callback) {};
  3293. /**
  3294. * @param {string} id
  3295. * @param {function(!ExtensionInfo): void=} opt_callback Optional callback
  3296. * function.
  3297. * @return {undefined}
  3298. */
  3299. chrome.management.get = function(id, opt_callback) {};
  3300. /**
  3301. * @param {function(!ExtensionInfo): void=} opt_callback Optional
  3302. * callback function
  3303. * @return {undefined}
  3304. */
  3305. chrome.management.getSelf = function(opt_callback) {};
  3306. /**
  3307. * @param {string} id The id of an already installed extension.
  3308. * @param {function(!Array<string>)=} opt_callback Optional callback function.
  3309. * @return {undefined}
  3310. */
  3311. chrome.management.getPermissionWarningsById = function(id, opt_callback) {};
  3312. /**
  3313. * @param {string} manifestStr Extension's manifest JSON string.
  3314. * @param {function(!Array<string>)=} opt_callback Optional callback function.
  3315. * @return {undefined}
  3316. */
  3317. chrome.management.getPermissionWarningsByManifest = function(
  3318. manifestStr, opt_callback) {};
  3319. /**
  3320. * @param {string} id The id of an already installed extension.
  3321. * @param {boolean} enabled Whether this item should be enabled.
  3322. * @param {function(): void=} opt_callback Optional callback function.
  3323. * @return {undefined}
  3324. */
  3325. chrome.management.setEnabled = function(id, enabled, opt_callback) {};
  3326. /**
  3327. * @param {string} id The id of an already installed extension.
  3328. * @param {(!chrome.management.InstallOptions|function(): void)=}
  3329. * opt_optionsOrCallback An optional uninstall options object or an optional
  3330. * callback function.
  3331. * @param {function(): void=} opt_callback Optional callback function.
  3332. * @return {undefined}
  3333. */
  3334. chrome.management.uninstall = function(
  3335. id, opt_optionsOrCallback, opt_callback) {};
  3336. /**
  3337. * @param {(!chrome.management.InstallOptions|function(): void)=}
  3338. * opt_optionsOrCallback An optional uninstall options object or an optional
  3339. * callback function.
  3340. * @param {function(): void=} opt_callback An optional callback function.
  3341. * @return {undefined}
  3342. */
  3343. chrome.management.uninstallSelf = function(
  3344. opt_optionsOrCallback, opt_callback) {};
  3345. /**
  3346. * @param {string} id The id of an already installed extension.
  3347. * @param {function(): void=} opt_callback Optional callback function.
  3348. * @return {undefined}
  3349. */
  3350. chrome.management.launchApp = function(id, opt_callback) {};
  3351. /**
  3352. * @param {string} id The id of an already installed extension.
  3353. * @param {function(): void=} opt_callback Optional callback function.
  3354. * @return {undefined}
  3355. */
  3356. chrome.management.createAppShortcut = function(id, opt_callback) {};
  3357. /**
  3358. * @param {string} id The id of an already installed extension.
  3359. * @param {string} launchType The LaunchType enum value to set. Make sure this
  3360. * value is in ExtensionInfo.availableLaunchTypes because the available
  3361. * launch types vary on different platforms and configurations.
  3362. * @param {function(): void=} opt_callback Optional callback function.
  3363. * @return {undefined}
  3364. */
  3365. chrome.management.setLaunchType = function(id, launchType, opt_callback) {};
  3366. /**
  3367. * @param {string} url The URL of a web page. The scheme of the URL can only be
  3368. * "http" or "https".
  3369. * @param {string} title The title of the generated app.
  3370. * @param {function(!ExtensionInfo): void=} opt_callback Optional callback
  3371. * function.
  3372. * @return {undefined}
  3373. */
  3374. chrome.management.generateAppForLink = function(url, title, opt_callback) {};
  3375. /**
  3376. * @param {function():void=} callback
  3377. * @return {undefined}
  3378. */
  3379. chrome.management.installReplacementWebApp = function(callback) {};
  3380. /**
  3381. * Event whose listeners take an ExtensionInfo parameter.
  3382. * @interface
  3383. * @extends {ChromeBaseEvent<function(!ExtensionInfo)>}
  3384. */
  3385. function ChromeExtensionInfoEvent() {};
  3386. /** @type {!ChromeExtensionInfoEvent} */
  3387. chrome.management.onInstalled;
  3388. /** @type {!ChromeStringEvent} */
  3389. chrome.management.onUninstalled;
  3390. /** @type {!ChromeExtensionInfoEvent} */
  3391. chrome.management.onEnabled;
  3392. /** @type {!ChromeExtensionInfoEvent} */
  3393. chrome.management.onDisabled;
  3394. /**
  3395. * @const
  3396. * @see https://developer.chrome.com/extensions/idle.html
  3397. */
  3398. chrome.idle = {};
  3399. /**
  3400. * @param {number} thresholdSeconds Threshold in seconds, used to determine
  3401. * when a machine is in the idle state.
  3402. * @param {function(string): void} callback Callback to handle the state.
  3403. * @return {undefined}
  3404. */
  3405. chrome.idle.queryState = function(thresholdSeconds, callback) {};
  3406. /**
  3407. * @param {number} intervalInSeconds Threshold, in seconds, used to determine
  3408. * when the system is in an idle state.
  3409. * @return {undefined}
  3410. */
  3411. chrome.idle.setDetectionInterval = function(intervalInSeconds) {};
  3412. /**
  3413. * @param {function(number): void} callback Callback to receive the delay
  3414. * @return {undefined}
  3415. */
  3416. chrome.idle.getAutoLockDelay = function(callback) {};
  3417. /** @type {!ChromeEvent} */
  3418. chrome.idle.onStateChanged;
  3419. /**
  3420. * @const
  3421. * @see https://developer.chrome.com/extensions/contentSettings.html
  3422. */
  3423. chrome.contentSettings = {};
  3424. /** @type {!ContentSetting} */
  3425. chrome.contentSettings.cookies;
  3426. /** @type {!ContentSetting} */
  3427. chrome.contentSettings.images;
  3428. /** @type {!ContentSetting} */
  3429. chrome.contentSettings.javascript;
  3430. /** @type {!ContentSetting} */
  3431. chrome.contentSettings.plugins;
  3432. /** @type {!ContentSetting} */
  3433. chrome.contentSettings.popups;
  3434. /** @type {!ContentSetting} */
  3435. chrome.contentSettings.notifications;
  3436. /**
  3437. * @const
  3438. * @see https://developer.chrome.com/extensions/fileBrowserHandler
  3439. */
  3440. chrome.fileBrowserHandler = {};
  3441. /**
  3442. * @typedef {?{
  3443. * suggestedName: string,
  3444. * allowedFileExtensions: (!Array<string>|undefined)
  3445. * }}
  3446. */
  3447. chrome.fileBrowserHandler.SelectFileSelectionParams;
  3448. /**
  3449. * Prompts user to select file path under which file should be saved.
  3450. * @see https://developer.chrome.com/extensions/fileBrowserHandler#method-selectFile
  3451. * @param {!chrome.fileBrowserHandler.SelectFileSelectionParams} selectionParams
  3452. * Parameters that will be used while selecting the file.
  3453. * @param {function(!Object)} callback Function called upon completion.
  3454. * @return {undefined}
  3455. */
  3456. chrome.fileBrowserHandler.selectFile = function(selectionParams, callback) {};
  3457. /**
  3458. * @interface
  3459. * @extends {ChromeBaseEvent<function(string, !FileHandlerExecuteEventDetails)>}
  3460. * @see https://developer.chrome.com/extensions/fileBrowserHandler#event-onExecute
  3461. */
  3462. chrome.fileBrowserHandler.ExecuteEvent = function() {};
  3463. /**
  3464. * Fired when file system action is executed from ChromeOS file browser.
  3465. * @see https://developer.chrome.com/extensions/fileBrowserHandler#event-onExecute
  3466. * @type {!chrome.fileBrowserHandler.ExecuteEvent}
  3467. */
  3468. chrome.fileBrowserHandler.onExecute;
  3469. /**
  3470. * @const
  3471. * @see https://developer.chrome.com/extensions/gcm
  3472. */
  3473. chrome.gcm = {};
  3474. /**
  3475. * @see https://developer.chrome.com/extensions/gcm#property-MAX_MESSAGE_SIZE
  3476. * @type {number}
  3477. */
  3478. chrome.gcm.MAX_MESSAGE_SIZE;
  3479. /**
  3480. * Registers the application with GCM. The registration ID will be returned by
  3481. * the callback. If register is called again with the same list of senderIds,
  3482. * the same registration ID will be returned.
  3483. * @see https://developer.chrome.com/extensions/gcm#method-register
  3484. * @param {!Array<string>} senderIds A list of server IDs that are allowed to
  3485. * send messages to the application.
  3486. * @param {function(string): void} callback Function called when
  3487. * registration completes with registration ID as argument.
  3488. * @return {undefined}
  3489. */
  3490. chrome.gcm.register = function(senderIds, callback) {};
  3491. /**
  3492. * Unregisters the application from GCM.
  3493. * @see https://developer.chrome.com/extensions/gcm#method-unregister
  3494. * @param {function(): void} callback Called when unregistration is done.
  3495. * @return {undefined}
  3496. */
  3497. chrome.gcm.unregister = function(callback) {};
  3498. /**
  3499. * Sends an upstream message using GCM.
  3500. * @see https://developer.chrome.com/extensions/gcm#method-send
  3501. * @param {!chrome.gcm.Message} message Message to be sent.
  3502. * @param {function(string): void} callback Called with message ID.
  3503. * @return {undefined}
  3504. */
  3505. chrome.gcm.send = function(message, callback) {};
  3506. /**
  3507. * Outgoing message.
  3508. * @typedef {?{
  3509. * destinationId: string,
  3510. * messageId: string,
  3511. * timeToLive: (number|undefined),
  3512. * data: !Object<string, string>
  3513. * }}
  3514. */
  3515. chrome.gcm.Message;
  3516. /**
  3517. * An event, fired when a message is received through GCM.
  3518. * @see https://developer.chrome.com/extensions/gcm#event-onMessage
  3519. * @type {!chrome.gcm.OnMessageEvent}
  3520. */
  3521. chrome.gcm.onMessage;
  3522. /**
  3523. * An event, fired when GCM server had to delete messages to the application
  3524. * from its queue in order to manage its size.
  3525. * @see https://developer.chrome.com/extensions/gcm#event-onMessagesDeleted
  3526. * @type {!ChromeEvent}
  3527. */
  3528. chrome.gcm.onMessagesDeleted;
  3529. /**
  3530. * An event indicating problems with sending messages.
  3531. * @see https://developer.chrome.com/extensions/gcm#event-onSendError
  3532. * @type {!chrome.gcm.OnSendErrorEvent}
  3533. */
  3534. chrome.gcm.onSendError;
  3535. /**
  3536. * @interface
  3537. * @extends {ChromeBaseEvent<function(!Object)>}
  3538. */
  3539. chrome.gcm.OnMessageEvent = function() {};
  3540. /**
  3541. * @interface
  3542. * @extends {ChromeBaseEvent<function(!Object)>}
  3543. */
  3544. chrome.gcm.OnSendErrorEvent = function() {};
  3545. /**
  3546. * @const
  3547. * @see https://developer.chrome.com/extensions/history.html
  3548. */
  3549. chrome.history = {};
  3550. /**
  3551. * @param {Object<string, string>} details Object with a 'url' key.
  3552. * @return {undefined}
  3553. */
  3554. chrome.history.addUrl = function(details) {};
  3555. /**
  3556. * @param {function(): void} callback Callback function.
  3557. * @return {undefined}
  3558. */
  3559. chrome.history.deleteAll = function(callback) {};
  3560. /**
  3561. * @param {Object<string, string>} range Object with 'startTime'
  3562. * and 'endTime' keys.
  3563. * @param {function(): void} callback Callback function.
  3564. * @return {undefined}
  3565. */
  3566. chrome.history.deleteRange = function(range, callback) {};
  3567. /**
  3568. * @param {Object<string, string>} details Object with a 'url' key.
  3569. * @return {undefined}
  3570. */
  3571. chrome.history.deleteUrl = function(details) {};
  3572. /**
  3573. * @param {Object<string, string>} details Object with a 'url' key.
  3574. * @param {function(!Array<!VisitItem>): void} callback Callback function.
  3575. * @return {!Array<!VisitItem>}
  3576. */
  3577. chrome.history.getVisits = function(details, callback) {};
  3578. /**
  3579. * @param {Object<string, string>} query Object with a 'text' (string)
  3580. * key and optional 'startTime' (number), 'endTime' (number) and
  3581. * 'maxResults' keys.
  3582. * @param {function(!Array<!HistoryItem>): void} callback Callback function.
  3583. * @return {!Array<!HistoryItem>}
  3584. */
  3585. chrome.history.search = function(query, callback) {};
  3586. /** @type {!ChromeEvent} */
  3587. chrome.history.onVisitRemoved;
  3588. /** @type {!ChromeEvent} */
  3589. chrome.history.onVisited;
  3590. /**
  3591. * @const
  3592. * @see http://developer.chrome.com/apps/identity.html
  3593. */
  3594. chrome.identity = {};
  3595. /** @typedef {?{id: string}} */
  3596. chrome.identity.AccountInfo;
  3597. /**
  3598. * @param {function(!Array<!chrome.identity.AccountInfo>): void} callback
  3599. * @return {undefined}
  3600. */
  3601. chrome.identity.getAccounts = function(callback) {};
  3602. /**
  3603. * @param {(!chrome.identity.TokenDetails|function(string=): void)}
  3604. * detailsOrCallback Token options or a callback function if no options are
  3605. * specified.
  3606. * @param {function(string=): void=} opt_callback A callback function if options
  3607. * are specified.
  3608. * @return {undefined}
  3609. */
  3610. chrome.identity.getAuthToken = function(detailsOrCallback, opt_callback) {};
  3611. /**
  3612. * @typedef {?{
  3613. * interactive: (boolean|undefined),
  3614. * account: (!chrome.identity.AccountInfo|undefined),
  3615. * scopes: (!Array<string>|undefined)
  3616. * }}
  3617. */
  3618. chrome.identity.TokenDetails;
  3619. /**
  3620. * @param {!chrome.identity.InvalidTokenDetails} details
  3621. * @param {function(): void=} opt_callback
  3622. * @return {undefined}
  3623. */
  3624. chrome.identity.removeCachedAuthToken = function(details, opt_callback) {};
  3625. /** @typedef {?{token: string}} */
  3626. chrome.identity.InvalidTokenDetails;
  3627. /**
  3628. * @param {!chrome.identity.WebAuthFlowDetails} details
  3629. * @param {function(string=): void} callback
  3630. * @return {undefined}
  3631. */
  3632. chrome.identity.launchWebAuthFlow = function(details, callback) {};
  3633. /** @typedef {?{url: string, interactive: (boolean|undefined)}} */
  3634. chrome.identity.WebAuthFlowDetails;
  3635. /** @typedef {?{id: string, email: string}} */
  3636. chrome.identity.ProfileUserInfo;
  3637. /**
  3638. * @enum {string}
  3639. * See https://developer.chrome.com/docs/extensions/reference/identity/#type-AccountStatus
  3640. */
  3641. chrome.identity.AccountStatus = {
  3642. SYNC: '',
  3643. ANY: '',
  3644. };
  3645. /**
  3646. * See https://developer.chrome.com/docs/extensions/reference/identity/#type-ProfileDetails
  3647. * @typedef {{accountStatus: (!chrome.identity.AccountStatus|undefined)}}
  3648. */
  3649. chrome.identity.ProfileDetails;
  3650. /**
  3651. * @param {!chrome.identity.ProfileDetails|function(!chrome.identity.ProfileUserInfo):void} accountStatusOrCallback
  3652. * Either the accountStatus of the primary profile account or the callback
  3653. * @param {function(!chrome.identity.ProfileUserInfo):void=} opt_callback if
  3654. * the accountStatus is provided
  3655. * @return {undefined}
  3656. */
  3657. chrome.identity.getProfileUserInfo = function(accountStatusOrCallback, opt_callback) {};
  3658. /**
  3659. * @interface
  3660. * @extends {ChromeBaseEvent<function(!chrome.identity.AccountInfo, boolean)>}
  3661. */
  3662. chrome.identity.OnSignInChangedEvent = function() {};
  3663. /** @type {!chrome.identity.OnSignInChangedEvent} */
  3664. chrome.identity.onSignInChanged;
  3665. /**
  3666. * @param {string=} opt_path
  3667. * @return {string}
  3668. */
  3669. chrome.identity.getRedirectURL = function(opt_path) {};
  3670. /**
  3671. * @const
  3672. * @see https://developer.chrome.com/extensions/input.ime.html
  3673. */
  3674. chrome.input = {};
  3675. /** @const */
  3676. chrome.input.ime = {};
  3677. /**
  3678. * @typedef {?{
  3679. * left: number,
  3680. * top: number,
  3681. * width: number,
  3682. * height: number
  3683. * }}
  3684. * @see https://developer.chrome.com/extensions/input_ime#type-CreateWindowOptions
  3685. */
  3686. chrome.input.ime.Bounds;
  3687. /**
  3688. * @typedef {?{
  3689. * windowType: chrome.input.ime.WindowType,
  3690. * url: (string|undefined),
  3691. * bounds: (chrome.input.ime.Bounds|undefined)
  3692. * }}
  3693. * @see https://developer.chrome.com/extensions/input_ime#type-CreateWindowOptions
  3694. */
  3695. chrome.input.ime.CreateWindowOptions;
  3696. /**
  3697. * @enum {string}
  3698. * @see https://developer.chrome.com/extensions/system.display#type-MirrorMode
  3699. */
  3700. chrome.input.ime.WindowType = {
  3701. NORMAL: '',
  3702. FOLLOW_CURSOR: '',
  3703. };
  3704. /**
  3705. * The OnKeyEvent event takes an extra argument.
  3706. *
  3707. * The addListener() method for this class takes more than one argument, so it
  3708. * isn't possible to just extend ChromeBaseEvent here.
  3709. * @interface
  3710. * @extends {ChromeBaseEventNoListeners}
  3711. */
  3712. function ChromeInputImeOnKeyEventEvent() {}
  3713. /**
  3714. * @param {function(string, !ChromeKeyboardEvent): (boolean|undefined)} callback
  3715. * callback.
  3716. * @param {Array<string>=} opt_extraInfoSpec Array of extra information.
  3717. * @return {undefined}
  3718. */
  3719. ChromeInputImeOnKeyEventEvent.prototype.addListener = function(
  3720. callback, opt_extraInfoSpec) {};
  3721. /**
  3722. * @param {function(string, !ChromeKeyboardEvent): (boolean|undefined)} callback
  3723. * callback.
  3724. * @return {undefined}
  3725. */
  3726. ChromeInputImeOnKeyEventEvent.prototype.removeListener = function(callback) {};
  3727. /**
  3728. * @param {function(string, !ChromeKeyboardEvent): (boolean|undefined)} callback
  3729. * callback.
  3730. * @return {boolean}
  3731. */
  3732. ChromeInputImeOnKeyEventEvent.prototype.hasListener = function(callback) {};
  3733. /**
  3734. * @return {boolean}
  3735. */
  3736. ChromeInputImeOnKeyEventEvent.prototype.hasListeners = function() {};
  3737. /**
  3738. * @param {function(boolean): void=} callback Callback function.
  3739. * @return {undefined}
  3740. */
  3741. chrome.input.ime.activate = function(callback) {};
  3742. /**
  3743. * @param {!Object<string,number>} parameters An object with a
  3744. * 'contextID' (number) key.
  3745. * @param {function(boolean): void=} callback Callback function.
  3746. * @return {undefined}
  3747. */
  3748. chrome.input.ime.clearComposition = function(parameters, callback) {};
  3749. /**
  3750. * @param {!Object<string,(string|number)>} parameters An object with
  3751. * 'contextID' (number) and 'text' (string) keys.
  3752. * @param {function(boolean): void=} opt_callback Callback function.
  3753. * @return {undefined}
  3754. */
  3755. chrome.input.ime.commitText = function(parameters, opt_callback) {};
  3756. /**
  3757. * @param {!chrome.input.ime.CreateWindowOptions} options Options of the created
  3758. * IME window.
  3759. * @param {function(Window): void=} callback Callback function.
  3760. * @return {undefined}
  3761. */
  3762. chrome.input.ime.createWindow = function(options, callback) {};
  3763. /**
  3764. * @param {function(boolean): void} callback Callback function.
  3765. * @return {undefined}
  3766. */
  3767. chrome.input.ime.deactivate = function(callback) {};
  3768. /**
  3769. * @param {!Object<string,(string|number)>} parameters An object with
  3770. * 'contextID' (number) and 'text' (string) keys.
  3771. * @param {function(boolean): void=} opt_callback Callback function.
  3772. * @return {undefined}
  3773. */
  3774. chrome.input.ime.deleteSurroundingText = function(parameters, opt_callback) {};
  3775. /**
  3776. * @return {undefined}
  3777. */
  3778. chrome.input.ime.hideInputView = function() {};
  3779. /**
  3780. * @param {function(boolean): void=} callback Callback function.
  3781. * @return {undefined}
  3782. */
  3783. chrome.input.ime.hideWindow = function(callback) {};
  3784. /**
  3785. * @param {!Object<number,Array<KeyboardEvent>>}
  3786. * parameters An object with 'contextID' (number) and 'keyData'
  3787. * (Array<KeyboardEvent>) keys.
  3788. * @param {function(boolean): void=} callback Callback function.
  3789. * @return {undefined}
  3790. */
  3791. chrome.input.ime.sendKeyEvents = function(parameters, callback) {};
  3792. /**
  3793. * @param {!Object<string,(number|Object<string,(string|number|boolean)>)>}
  3794. * parameters An object with 'engineID' (string) and 'properties'
  3795. * (Object) keys.
  3796. * @param {function(boolean): void=} opt_callback Callback function.
  3797. * @return {undefined}
  3798. */
  3799. chrome.input.ime.setCandidateWindowProperties = function(
  3800. parameters, opt_callback) {};
  3801. /**
  3802. * @param {!Object<string,(number|Object<string,(string|number)>)>}
  3803. * parameters An object with 'contextID' (number) and 'candidates'
  3804. * (array of object) keys.
  3805. * @param {function(boolean): void=} opt_callback Callback function.
  3806. * @return {undefined}
  3807. */
  3808. chrome.input.ime.setCandidates = function(parameters, opt_callback) {};
  3809. /**
  3810. * @param {!Object<string,(string|number|Object<string,(string|number)>)>}
  3811. * parameters An object with 'contextID' (number), 'text' (string),
  3812. * 'selectionStart (number), 'selectionEnd' (number), 'cursor' (number),
  3813. * and 'segments' (array of object) keys.
  3814. * @param {function(boolean): void=} opt_callback Callback function.
  3815. * @return {undefined}
  3816. */
  3817. chrome.input.ime.setComposition = function(parameters, opt_callback) {};
  3818. /**
  3819. * @param {!Object<string,number>} parameters An object with
  3820. * 'contextID' (number) and 'candidateID' (number) keys.
  3821. * @param {function(boolean): void=} opt_callback Callback function.
  3822. * @return {undefined}
  3823. */
  3824. chrome.input.ime.setCursorPosition = function(parameters, opt_callback) {};
  3825. /**
  3826. * @enum {string}
  3827. * @see https://developer.chrome.com/extensions/input.ime#type-AssistiveWindowType
  3828. */
  3829. chrome.input.ime.AssistiveWindowType = {
  3830. UNDO: '',
  3831. };
  3832. /**
  3833. * Properties of the assistive window.
  3834. * @typedef {{
  3835. * type: !chrome.input.ime.AssistiveWindowType,
  3836. * visible: boolean
  3837. * }}
  3838. * @see https://developer.chrome.com/extensions/input.ime#type-AssistiveWindowProperties
  3839. */
  3840. chrome.input.ime.AssistiveWindowProperties;
  3841. /**
  3842. * Shows/Hides an assistive window with the given properties.
  3843. * @param {{
  3844. * contextID: number,
  3845. * properties: !chrome.input.ime.AssistiveWindowProperties
  3846. * }} parameters
  3847. * @param {function(boolean): void=} callback Called when the operation
  3848. * completes.
  3849. * @see https://developer.chrome.com/extensions/input.ime#method-setAssistiveWindowProperties
  3850. */
  3851. chrome.input.ime.setAssistiveWindowProperties = function(
  3852. parameters, callback) {};
  3853. /**
  3854. * @enum {string}
  3855. * @see https://developer.chrome.com/extensions/input.ime#type-AssistiveWindowButton
  3856. */
  3857. chrome.input.ime.AssistiveWindowButton = {
  3858. UNDO: '',
  3859. ADD_TO_DICTIONARY: '',
  3860. };
  3861. /**
  3862. * This event is sent when a button in an assistive window is clicked.
  3863. * @type {!ChromeEvent}
  3864. * @see https://developer.chrome.com/extensions/input.ime#event-onAssistiveWindowButtonClicked
  3865. */
  3866. chrome.input.ime.onAssistiveWindowButtonClicked;
  3867. /**
  3868. * @param {!Object<string,(string|Array<Object<string,(string|boolean)>>)>}
  3869. * parameters An object with 'engineID' (string) and 'items'
  3870. * (array of object) keys.
  3871. * @param {function(): void=} opt_callback Callback function.
  3872. * @return {undefined}
  3873. */
  3874. chrome.input.ime.setMenuItems = function(parameters, opt_callback) {};
  3875. /**
  3876. * @param {function(boolean): void=} callback Callback function.
  3877. * @return {undefined}
  3878. */
  3879. chrome.input.ime.showWindow = function(callback) {};
  3880. /**
  3881. * @param {!Object<string,(string|Array<Object<string,(string|boolean)>>)>}
  3882. * parameters An object with 'engineID' (string) and 'items'
  3883. * (array of object) keys.
  3884. * @param {function(): void=} opt_callback Callback function.
  3885. * @return {undefined}
  3886. */
  3887. chrome.input.ime.updateMenuItems = function(parameters, opt_callback) {};
  3888. /**
  3889. * @param {string} requestId Request id of the event that was handled. This
  3890. * should come from keyEvent.requestId.
  3891. * @param {boolean} response True if the keystroke was handled, false if not.
  3892. * @return {undefined}
  3893. */
  3894. chrome.input.ime.keyEventHandled = function(requestId, response) {};
  3895. /** @type {!ChromeEvent} */
  3896. chrome.input.ime.onActivate;
  3897. /** @type {!ChromeEvent} */
  3898. chrome.input.ime.onBlur;
  3899. /** @type {!ChromeEvent} */
  3900. chrome.input.ime.onCandidateClicked;
  3901. /** @type {!ChromeEvent} */
  3902. chrome.input.ime.onDeactivated;
  3903. /** @type {!ChromeEvent} */
  3904. chrome.input.ime.onFocus;
  3905. /** @type {!ChromeEvent} */
  3906. chrome.input.ime.onInputContextUpdate;
  3907. /** @type {!ChromeInputImeOnKeyEventEvent} */
  3908. chrome.input.ime.onKeyEvent;
  3909. /** @type {!ChromeEvent} */
  3910. chrome.input.ime.onMenuItemActivated;
  3911. /** @type {!ChromeEvent} */
  3912. chrome.input.ime.onReset;
  3913. /** @type {!ChromeEvent} */
  3914. chrome.input.ime.onSurroundingTextChanged;
  3915. /**
  3916. * namespace
  3917. * @see http://developer.chrome.com/apps/mediaGalleries
  3918. * @const
  3919. */
  3920. chrome.mediaGalleries = {};
  3921. /**
  3922. * @param {{interactive: (string|undefined)}|function(!Array<!FileSystem>)}
  3923. * detailsOrCallback A details object for whether the request should be
  3924. * interactive if permissions haven't been granted yet or the callback.
  3925. * @param {function(!Array<!FileSystem>)=} opt_callback A success callback if
  3926. * no details were supplied as arg1.
  3927. * @return {undefined}
  3928. */
  3929. chrome.mediaGalleries.getMediaFileSystems = function(
  3930. detailsOrCallback, opt_callback) {};
  3931. /**
  3932. * @param {function(!Array<!FileSystem>, string)} callback Callback function.
  3933. * @return {undefined}
  3934. */
  3935. chrome.mediaGalleries.addUserSelectedFolder = function(callback) {};
  3936. /**
  3937. * @param {string} galleryId ID of the media gallery.
  3938. * @param {function()=} opt_callback Optional callback function.
  3939. * @return {undefined}
  3940. */
  3941. chrome.mediaGalleries.dropPermissionForMediaFileSystem = function(
  3942. galleryId, opt_callback) {};
  3943. chrome.mediaGalleries.startMediaScan = function() {};
  3944. chrome.mediaGalleries.cancelMediaScan = function() {};
  3945. /**
  3946. * @param {function(!Array<!FileSystem>)} callback Callback function.
  3947. * @return {undefined}
  3948. */
  3949. chrome.mediaGalleries.addScanResults = function(callback) {};
  3950. /**
  3951. * @typedef {{
  3952. * name: string,
  3953. * galleryId: string,
  3954. * deviceId: (string|undefined),
  3955. * isRemovable: boolean,
  3956. * isMediaDevice: boolean,
  3957. * isAvailable: boolean
  3958. * }}
  3959. */
  3960. chrome.mediaGalleries.MediaFileSystemMetadata;
  3961. /**
  3962. * @param {!FileSystem} mediaFileSystem The file system to get metadata for.
  3963. * @return {!chrome.mediaGalleries.MediaFileSystemMetadata}
  3964. */
  3965. chrome.mediaGalleries.getMediaFileSystemMetadata = function(mediaFileSystem) {};
  3966. /**
  3967. * @param {function(!Array<!chrome.mediaGalleries.MediaFileSystemMetadata>)}
  3968. * callback Callback function.
  3969. * @return {undefined}
  3970. */
  3971. chrome.mediaGalleries.getAllMediaFileSystemMetadata = function(callback) {};
  3972. /**
  3973. * @typedef {{
  3974. * mimeType: string,
  3975. * height: (number|undefined),
  3976. * width: (number|undefined),
  3977. * xResolution: (number|undefined),
  3978. * yResolution: (number|undefined),
  3979. * duration: (number|undefined),
  3980. * rotation: (number|undefined),
  3981. * cameraMake: (string|undefined),
  3982. * cameraModel: (string|undefined),
  3983. * exposureTimeSeconds: (number|undefined),
  3984. * flashFired: (boolean|undefined),
  3985. * fNumber: (number|undefined),
  3986. * focalLengthMm: (number|undefined),
  3987. * isoEquivalent: (number|undefined),
  3988. * album: (string|undefined),
  3989. * artist: (string|undefined),
  3990. * comment: (string|undefined),
  3991. * copyright: (string|undefined),
  3992. * disc: (number|undefined),
  3993. * genre: (string|undefined),
  3994. * language: (string|undefined),
  3995. * title: (string|undefined),
  3996. * track: (number|undefined),
  3997. * rawTags: !Array<!chrome.mediaGalleries.metadata.RawTag>,
  3998. * attachedImages: !Array<!Blob>
  3999. * }}
  4000. */
  4001. chrome.mediaGalleries.MetaData;
  4002. /** @const */
  4003. chrome.mediaGalleries.metadata = {};
  4004. /** @constructor */
  4005. chrome.mediaGalleries.metadata.RawTag = function() {};
  4006. /** @type {string} */
  4007. chrome.mediaGalleries.metadata.RawTag.prototype.type;
  4008. /** @type {!Object<string, string>} */
  4009. chrome.mediaGalleries.metadata.RawTag.prototype.tags;
  4010. /**
  4011. * @param {!Blob} mediaFile The media file for which to get metadata.
  4012. * @param {{metadataType: (string|undefined)}|
  4013. * function(!chrome.mediaGalleries.MetaData)} optionsOrCallback The options
  4014. * for the metadata to retrieve or the callback to invoke with the metadata.
  4015. * The metadataType should either be 'all' or 'mimeTypeOnly'. Defaults to
  4016. * 'all' if the metadataType is omitted.
  4017. * @param {function(!chrome.mediaGalleries.MetaData)=} opt_callback If options
  4018. * were passed as arg2, the callback to invoke with the metadata.
  4019. * @return {undefined}
  4020. */
  4021. chrome.mediaGalleries.getMetadata = function(
  4022. mediaFile, optionsOrCallback, opt_callback) {};
  4023. /**
  4024. * @typedef {function({galleryId: string, success: boolean}): void}
  4025. */
  4026. chrome.mediaGalleries.AddGalleryWatchCallback;
  4027. /**
  4028. * @param {string} galleryId The media gallery's ID.
  4029. * @param {!chrome.mediaGalleries.AddGalleryWatchCallback} callback Fired with
  4030. * success or failure result.
  4031. * @return {undefined}
  4032. */
  4033. chrome.mediaGalleries.addGalleryWatch = function(galleryId, callback) {};
  4034. /**
  4035. * @param {string} galleryId The media gallery's ID.
  4036. * @return {undefined}
  4037. */
  4038. chrome.mediaGalleries.removeGalleryWatch = function(galleryId) {};
  4039. /**
  4040. * @param {function(!Array<string>): void} callback Callback function notifies
  4041. * which galleries are being watched.
  4042. * @return {undefined}
  4043. */
  4044. chrome.mediaGalleries.getAllGalleryWatch = function(callback) {};
  4045. chrome.mediaGalleries.removeAllGalleryWatch = function() {};
  4046. /**
  4047. * @interface
  4048. * @extends {ChromeBaseEvent<!chrome.mediaGalleries.GalleryChangeCallback>}
  4049. */
  4050. chrome.mediaGalleries.GalleryChangeEvent = function() {};
  4051. /**
  4052. * @typedef {function({type: string, galleryId: string}): void}
  4053. */
  4054. chrome.mediaGalleries.GalleryChangeCallback;
  4055. /**
  4056. * @type {!chrome.mediaGalleries.GalleryChangeEvent}
  4057. */
  4058. chrome.mediaGalleries.onGalleryChanged;
  4059. /**
  4060. * @typedef {{
  4061. * type: string,
  4062. * galleryCount: (number|undefined),
  4063. * audioCount: (number|undefined),
  4064. * imageCount: (number|undefined),
  4065. * videoCount: (number|undefined)
  4066. * }}
  4067. */
  4068. chrome.mediaGalleries.OnScanProgressDetails;
  4069. /**
  4070. * Event whose listeners take a chrome.mediaGalleries.OnScanProgressDetails
  4071. * parameter.
  4072. * @interface
  4073. * @extends {ChromeBaseEvent<function(!chrome.mediaGalleries.OnScanProgressDetails)>}
  4074. */
  4075. chrome.mediaGalleries.ScanProgressEvent = function() {};
  4076. /** @type {!chrome.mediaGalleries.ScanProgressEvent} */
  4077. chrome.mediaGalleries.onScanProgress;
  4078. /**
  4079. * @const
  4080. * @see https://developer.chrome.com/extensions/pageCapture.html
  4081. */
  4082. chrome.pageCapture = {};
  4083. /**
  4084. * @param {Object<string, number>} details Object with a 'tabId' (number) key.
  4085. * @param {function(Blob=): void} callback Callback function.
  4086. * @return {undefined}
  4087. */
  4088. chrome.pageCapture.saveAsMHTML = function(details, callback) {};
  4089. /**
  4090. * @const
  4091. * @see https://developer.chrome.com/extensions/permissions.html
  4092. */
  4093. chrome.permissions = {};
  4094. /**
  4095. * @typedef {{
  4096. * permissions: (Array<string>|undefined),
  4097. * origins: (Array<string>|undefined)
  4098. * }}
  4099. * @see http://developer.chrome.com/extensions/permissions.html#type-Permissions
  4100. */
  4101. chrome.permissions.Permissions;
  4102. /**
  4103. * @param {!chrome.permissions.Permissions} permissions
  4104. * @param {function(boolean): void} callback Callback function.
  4105. * @return {undefined}
  4106. */
  4107. chrome.permissions.contains = function(permissions, callback) {};
  4108. /**
  4109. * @param {function(!chrome.permissions.Permissions): void} callback
  4110. * Callback function.
  4111. * @return {undefined}
  4112. */
  4113. chrome.permissions.getAll = function(callback) {};
  4114. /**
  4115. * @param {!chrome.permissions.Permissions} permissions
  4116. * @param {function(boolean): void=} opt_callback Callback function.
  4117. * @return {undefined}
  4118. */
  4119. chrome.permissions.remove = function(permissions, opt_callback) {};
  4120. /**
  4121. * @param {!chrome.permissions.Permissions} permissions
  4122. * @param {function(boolean): void=} opt_callback Callback function.
  4123. * @return {undefined}
  4124. */
  4125. chrome.permissions.request = function(permissions, opt_callback) {};
  4126. /** @type {!ChromeEvent} */
  4127. chrome.permissions.onAdded;
  4128. /** @type {!ChromeEvent} */
  4129. chrome.permissions.onRemoved;
  4130. /**
  4131. * @const
  4132. * @see https://developer.chrome.com/extensions/platformKeys
  4133. */
  4134. chrome.platformKeys = {};
  4135. /**
  4136. * @see https://developer.chrome.com/extensions/platformKeys#type-Match
  4137. * @constructor
  4138. */
  4139. chrome.platformKeys.Match = function() {};
  4140. /** @type {!ArrayBuffer} */
  4141. chrome.platformKeys.Match.prototype.certificate;
  4142. /** @type {!Object} */
  4143. chrome.platformKeys.Match.prototype.keyAlgorithm;
  4144. /**
  4145. * @typedef {?{
  4146. * certificateTypes: !Array<string>,
  4147. * certificateAuthorities: !Array<!ArrayBuffer>
  4148. * }}
  4149. */
  4150. chrome.platformKeys.SelectCertificateDetailRequest;
  4151. /**
  4152. * @typedef {?{
  4153. * request: !chrome.platformKeys.SelectCertificateDetailRequest,
  4154. * clientCerts: (!Array<!ArrayBuffer>|undefined),
  4155. * interactive: boolean
  4156. * }}
  4157. *
  4158. * @see https://developer.chrome.com/extensions/platformKeys#method-selectClientCertificates
  4159. */
  4160. chrome.platformKeys.SelectCertificateDetails;
  4161. /**
  4162. * @param {!chrome.platformKeys.SelectCertificateDetails} details
  4163. * @param {!function(!Array<!chrome.platformKeys.Match>)} callback
  4164. */
  4165. chrome.platformKeys.selectClientCertificates = function(details, callback) {};
  4166. /**
  4167. * @param {!ArrayBuffer} certificate
  4168. * @param {!Object} parameters
  4169. * @param {!function(!Object, ?Object)} callback
  4170. */
  4171. chrome.platformKeys.getKeyPair = function(certificate, parameters, callback) {};
  4172. /**
  4173. * @return {!Object}
  4174. */
  4175. chrome.platformKeys.subtleCrypto = function() {};
  4176. /**
  4177. * @typedef {?{
  4178. * serverCertificateChain: !Array<!ArrayBuffer>,
  4179. * hostname: string
  4180. * }}
  4181. *
  4182. * @see https://developer.chrome.com/extensions/platformKeys#method-verifyTLSServerCertificate
  4183. */
  4184. chrome.platformKeys.VerifyServerCertificateDetails;
  4185. /**
  4186. * @param {!chrome.platformKeys.VerifyServerCertificateDetails} details
  4187. * @param {!function(!Object)} callback
  4188. */
  4189. chrome.platformKeys.verifyTLSServerCertificate = function(details, callback) {};
  4190. /**
  4191. * @const
  4192. * @see http://developer.chrome.com/dev/extensions/power.html
  4193. */
  4194. chrome.power = {};
  4195. /**
  4196. * @param {string} level A string describing the degree to which power
  4197. * management should be disabled, should be either "system" or "display".
  4198. * @return {undefined}
  4199. */
  4200. chrome.power.requestKeepAwake = function(level) {};
  4201. /**
  4202. * Releases a request previously made via requestKeepAwake().
  4203. * @return {undefined}
  4204. */
  4205. chrome.power.releaseKeepAwake = function() {};
  4206. /**
  4207. * @const
  4208. * @see https://developer.chrome.com/extensions/privacy.html
  4209. */
  4210. chrome.privacy = {};
  4211. /** @type {!Object<string,!ChromeSetting>} */
  4212. chrome.privacy.network;
  4213. /** @type {!Object<string,!ChromeSetting>} */
  4214. chrome.privacy.services;
  4215. /** @type {!Object<string,!ChromeSetting>} */
  4216. chrome.privacy.websites;
  4217. /**
  4218. * @const
  4219. * @see https://developer.chrome.com/extensions/proxy.html
  4220. */
  4221. chrome.proxy = {};
  4222. /**
  4223. * @const
  4224. * @see https://developer.chrome.com/extensions/proxy#property-settings
  4225. */
  4226. chrome.proxy.settings = {};
  4227. /**
  4228. * @typedef {?{
  4229. * incognito: (boolean|undefined),
  4230. * }}
  4231. */
  4232. chrome.proxy.settings.GetParameter;
  4233. /**
  4234. * @typedef {{
  4235. * value: *,
  4236. * levelOfControl: string,
  4237. * incognitoSpecific: (boolean|undefined),
  4238. * }}
  4239. */
  4240. chrome.proxy.settings.GetResponse;
  4241. /**
  4242. * @param {!chrome.proxy.settings.GetParameter} details
  4243. * @param {(function(!chrome.proxy.settings.GetResponse): void)=} callback
  4244. */
  4245. chrome.proxy.settings.get = function(details, callback) {};
  4246. /**
  4247. * @param {{
  4248. * value: *,
  4249. * scope: (string|undefined),
  4250. * }} details
  4251. * @param {(function(): void)=} callback
  4252. */
  4253. chrome.proxy.settings.set = function(details, callback) {};
  4254. /**
  4255. * @param {{
  4256. * scope: (string|undefined),
  4257. * }} details
  4258. * @param {(function(): void)=} callback
  4259. */
  4260. chrome.proxy.settings.clear = function(details, callback) {};
  4261. /** @type {!ChromeEvent} */
  4262. chrome.proxy.onProxyError;
  4263. /**
  4264. * @const
  4265. * @see http://developer.chrome.com/apps/socket.html
  4266. */
  4267. chrome.socket = {};
  4268. /**
  4269. * @constructor
  4270. */
  4271. chrome.socket.CreateInfo = function() {};
  4272. /** @type {number} */
  4273. chrome.socket.CreateInfo.prototype.socketId;
  4274. /**
  4275. * @constructor
  4276. */
  4277. chrome.socket.ReadInfo = function() {};
  4278. /** @type {number} */
  4279. chrome.socket.ReadInfo.prototype.resultCode;
  4280. /** @type {!ArrayBuffer} */
  4281. chrome.socket.ReadInfo.prototype.data;
  4282. /**
  4283. * @constructor
  4284. */
  4285. chrome.socket.WriteInfo = function() {};
  4286. /** @type {number} */
  4287. chrome.socket.WriteInfo.prototype.bytesWritten;
  4288. /**
  4289. * @constructor
  4290. */
  4291. chrome.socket.RecvFromInfo = function() {};
  4292. /** @type {number} */
  4293. chrome.socket.RecvFromInfo.prototype.resultCode;
  4294. /** @type {!ArrayBuffer} */
  4295. chrome.socket.RecvFromInfo.prototype.data;
  4296. /** @type {string} */
  4297. chrome.socket.RecvFromInfo.prototype.address;
  4298. /** @type {number} */
  4299. chrome.socket.RecvFromInfo.prototype.port;
  4300. /**
  4301. * @constructor
  4302. */
  4303. chrome.socket.AcceptInfo = function() {};
  4304. /** @type {number} */
  4305. chrome.socket.AcceptInfo.prototype.resultCode;
  4306. /** @type {(number|undefined)} */
  4307. chrome.socket.AcceptInfo.prototype.socketId;
  4308. /**
  4309. * @constructor
  4310. */
  4311. chrome.socket.SocketInfo = function() {};
  4312. /** @type {string} */
  4313. chrome.socket.SocketInfo.prototype.socketType;
  4314. /** @type {boolean} */
  4315. chrome.socket.SocketInfo.prototype.connected;
  4316. /** @type {(string|undefined)} */
  4317. chrome.socket.SocketInfo.prototype.peerAddress;
  4318. /** @type {(number|undefined)} */
  4319. chrome.socket.SocketInfo.prototype.peerPort;
  4320. /** @type {(string|undefined)} */
  4321. chrome.socket.SocketInfo.prototype.localAddress;
  4322. /** @type {(number|undefined)} */
  4323. chrome.socket.SocketInfo.prototype.localPort;
  4324. /**
  4325. * @constructor
  4326. */
  4327. chrome.socket.NetworkAdapterInfo = function() {};
  4328. /** @type {string} */
  4329. chrome.socket.NetworkAdapterInfo.prototype.name;
  4330. /** @type {string} */
  4331. chrome.socket.NetworkAdapterInfo.prototype.address;
  4332. /**
  4333. * @param {string} type The type of socket to create. Must be 'tcp' or 'udp'.
  4334. * @param {(Object|function(!chrome.socket.CreateInfo))} optionsOrCallback The
  4335. * socket options or callback.
  4336. * @param {function(!chrome.socket.CreateInfo)=} opt_callback Called when the
  4337. * socket has been created.
  4338. * @return {undefined}
  4339. */
  4340. chrome.socket.create = function(type, optionsOrCallback, opt_callback) {};
  4341. /**
  4342. * @param {number} socketId The id of the socket to destroy.
  4343. * @return {undefined}
  4344. */
  4345. chrome.socket.destroy = function(socketId) {};
  4346. /**
  4347. * @param {number} socketId The id of the socket.
  4348. * @param {string} hostname The hostname or IP address of the remote machine.
  4349. * @param {number} port The port of the remote machine.
  4350. * @param {function(number)} callback Called when the connection attempt is
  4351. * complete.
  4352. * @return {undefined}
  4353. */
  4354. chrome.socket.connect = function(socketId, hostname, port, callback) {};
  4355. /**
  4356. * @param {number} socketId The id of the socket.
  4357. * @param {string} address The address of the local machine.
  4358. * @param {number} port The port of the local machine.
  4359. * @param {function(number)} callback Called when the bind attempt is complete.
  4360. * @return {undefined}
  4361. */
  4362. chrome.socket.bind = function(socketId, address, port, callback) {};
  4363. /**
  4364. * @param {number} socketId The id of the socket to disconnect.
  4365. * @return {undefined}
  4366. */
  4367. chrome.socket.disconnect = function(socketId) {};
  4368. /**
  4369. * @param {number} socketId The id of the socket to read from.
  4370. * @param {(number|function(!chrome.socket.ReadInfo))} bufferSizeOrCallback The
  4371. * read buffer size or the callback.
  4372. * @param {function(!chrome.socket.ReadInfo)=} opt_callback Called with data
  4373. * that was available to be read without blocking.
  4374. * @return {undefined}
  4375. */
  4376. chrome.socket.read = function(socketId, bufferSizeOrCallback, opt_callback) {};
  4377. /**
  4378. * @param {number} socketId The id of the socket to write to.
  4379. * @param {!ArrayBuffer} data The data to write.
  4380. * @param {function(!chrome.socket.WriteInfo)} callback Called when the write
  4381. * operation completes without blocking or an error occurs.
  4382. * @return {undefined}
  4383. */
  4384. chrome.socket.write = function(socketId, data, callback) {};
  4385. /**
  4386. * @param {number} socketId The id of the socket to read from.
  4387. * @param {(number|function(!chrome.socket.RecvFromInfo))} bufferSizeOrCallback
  4388. * The read buffer size or the callback.
  4389. * @param {function(!chrome.socket.RecvFromInfo)=} opt_callback Called with data
  4390. * that was available to be read without blocking.
  4391. * @return {undefined}
  4392. */
  4393. chrome.socket.recvFrom = function(
  4394. socketId, bufferSizeOrCallback, opt_callback) {};
  4395. /**
  4396. * @param {number} socketId The id of the socket to write to.
  4397. * @param {!ArrayBuffer} data The data to write.
  4398. * @param {string} address The address of the remote machine.
  4399. * @param {number} port The port of the remote machine.
  4400. * @param {function(!chrome.socket.WriteInfo)} callback Called when the write
  4401. * operation completes without blocking or an error occurs.
  4402. * @return {undefined}
  4403. */
  4404. chrome.socket.sendTo = function(socketId, data, address, port, callback) {};
  4405. /**
  4406. * @param {number} socketId The id of the socket to listen on.
  4407. * @param {string} address The address of the local machine to listen on. Use
  4408. * '0' to listen on all addresses.
  4409. * @param {number} port The port of the local machine.
  4410. * @param {(number|function(number))} backlogOrCallback The length of the
  4411. * socket's listen queue or the callback.
  4412. * @param {function(number)=} opt_callback Called when the listen operation
  4413. * completes.
  4414. * @return {undefined}
  4415. */
  4416. chrome.socket.listen = function(
  4417. socketId, address, port, backlogOrCallback, opt_callback) {};
  4418. /**
  4419. * @param {number} socketId The id of the socket to accept a connection on.
  4420. * @param {function(!chrome.socket.AcceptInfo)} callback Called when a new
  4421. * socket is accepted.
  4422. * @return {undefined}
  4423. */
  4424. chrome.socket.accept = function(socketId, callback) {};
  4425. /**
  4426. * @param {number} socketId The id of the socket to listen on.
  4427. * @param {boolean} enable If true, enable keep-alive functionality.
  4428. * @param {(number|function(boolean))} delayOrCallback The delay in seconds
  4429. * between the last packet received and the first keepalive probe (default
  4430. * is 0) or the callback
  4431. * @param {function(boolean)=} opt_callback Called when the setKeepAlive attempt
  4432. * is complete.
  4433. * @return {undefined}
  4434. */
  4435. chrome.socket.setKeepAlive = function(
  4436. socketId, enable, delayOrCallback, opt_callback) {};
  4437. /**
  4438. * @param {number} socketId The id of the socket to listen on.
  4439. * @param {boolean} noDelay If true, disables Nagle's algorithm.
  4440. * @param {function(boolean)} callback Called when the setNoDelay attempt is
  4441. * complete.
  4442. * @return {undefined}
  4443. */
  4444. chrome.socket.setNoDelay = function(socketId, noDelay, callback) {};
  4445. /**
  4446. * @param {number} socketId The id of the socket.
  4447. * @param {function(!chrome.socket.SocketInfo)} callback Called when the state
  4448. * is available.
  4449. * @return {undefined}
  4450. */
  4451. chrome.socket.getInfo = function(socketId, callback) {};
  4452. /**
  4453. * @param {function(!Array<!chrome.socket.NetworkAdapterInfo>)} callback Called
  4454. * when local adapter information is available.
  4455. * @return {undefined}
  4456. */
  4457. chrome.socket.getNetworkList = function(callback) {};
  4458. /**
  4459. * @param {number} socketId The id of the socket.
  4460. * @param {string} address The group address to join. Domain names are not
  4461. * supported.
  4462. * @param {function(number)} callback Called when the join operation is done.
  4463. * @return {undefined}
  4464. */
  4465. chrome.socket.joinGroup = function(socketId, address, callback) {};
  4466. /**
  4467. * @param {number} socketId The id of the socket.
  4468. * @param {string} address The group address to leave. Domain names are not
  4469. * supported.
  4470. * @param {function(number)} callback Called when the leave operation is done.
  4471. * @return {undefined}
  4472. */
  4473. chrome.socket.leaveGroup = function(socketId, address, callback) {};
  4474. /**
  4475. * @param {number} socketId The id of the socket.
  4476. * @param {number} ttl The time-to-live value.
  4477. * @param {function(number)} callback Called when the configuration operation is
  4478. * done.
  4479. * @return {undefined}
  4480. */
  4481. chrome.socket.setMulticastTimeToLive = function(socketId, ttl, callback) {};
  4482. /**
  4483. * @param {number} socketId The id of the socket.
  4484. * @param {boolean} enabled True to enable loopback mode.
  4485. * @param {function(number)} callback Called when the configuration operation is
  4486. * done.
  4487. * @return {undefined}
  4488. */
  4489. chrome.socket.setMulticastLoopbackMode = function(
  4490. socketId, enabled, callback) {};
  4491. /**
  4492. * @param {number} socketId The id of the socket.
  4493. * @param {function(!Array<string>)} callback Called with an array of string
  4494. * groups.
  4495. * @return {undefined}
  4496. */
  4497. chrome.socket.getJoinedGroups = function(socketId, callback) {};
  4498. /**
  4499. * @const
  4500. */
  4501. chrome.sockets = {};
  4502. /**
  4503. * @const
  4504. * @see https://developer.chrome.com/apps/sockets_tcp
  4505. */
  4506. chrome.sockets.tcp = {};
  4507. /**
  4508. * @constructor
  4509. * @see https://developer.chrome.com/apps/sockets_tcp#type-SocketInfo
  4510. */
  4511. chrome.sockets.tcp.SocketInfo = function() {};
  4512. /** @type {number} */
  4513. chrome.sockets.tcp.SocketInfo.prototype.socketId;
  4514. /** @type {boolean} */
  4515. chrome.sockets.tcp.SocketInfo.prototype.persistent;
  4516. /** @type {string|undefined} */
  4517. chrome.sockets.tcp.SocketInfo.prototype.name;
  4518. /** @type {number|undefined} */
  4519. chrome.sockets.tcp.SocketInfo.prototype.bufferSize;
  4520. /** @type {boolean} */
  4521. chrome.sockets.tcp.SocketInfo.prototype.paused;
  4522. /** @type {boolean} */
  4523. chrome.sockets.tcp.SocketInfo.prototype.connected;
  4524. /** @type {string|undefined} */
  4525. chrome.sockets.tcp.SocketInfo.prototype.localAddress;
  4526. /** @type {number|undefined} */
  4527. chrome.sockets.tcp.SocketInfo.prototype.localPort;
  4528. /** @type {string|undefined} */
  4529. chrome.sockets.tcp.SocketInfo.prototype.peerAddress;
  4530. /** @type {number|undefined} */
  4531. chrome.sockets.tcp.SocketInfo.prototype.peerPort;
  4532. /**
  4533. * @typedef {?{
  4534. * persistent: (boolean|undefined),
  4535. * name: (string|undefined),
  4536. * bufferSize: (number|undefined)
  4537. * }}
  4538. * @see https://developer.chrome.com/apps/sockets_tcp#type-SocketProperties
  4539. */
  4540. chrome.sockets.tcp.SocketProperties;
  4541. /**
  4542. * @typedef {?{
  4543. * min: (string|undefined),
  4544. * max: (string|undefined)
  4545. * }}
  4546. * @see https://developer.chrome.com/apps/sockets_tcp#method-secure
  4547. */
  4548. chrome.sockets.tcp.SecurePropertiesTlsVersion;
  4549. /**
  4550. * @typedef {?{
  4551. * tlsVersion: (chrome.sockets.tcp.SecurePropertiesTlsVersion|undefined)
  4552. * }}
  4553. * @see https://developer.chrome.com/apps/sockets_tcp#method-secure
  4554. */
  4555. chrome.sockets.tcp.SecureProperties;
  4556. /**
  4557. * @param {!chrome.sockets.tcp.SocketProperties|
  4558. * function(!Object)} propertiesOrCallback
  4559. * @param {function(!Object)=} opt_callback
  4560. * @see https://developer.chrome.com/apps/sockets_tcp#method-create
  4561. * @return {undefined}
  4562. */
  4563. chrome.sockets.tcp.create = function(propertiesOrCallback, opt_callback) {};
  4564. /**
  4565. * @param {number} socketId
  4566. * @param {!chrome.sockets.tcp.SocketProperties} properties
  4567. * @param {function()=} opt_callback
  4568. * @see https://developer.chrome.com/apps/sockets_tcp#method-update
  4569. * @return {undefined}
  4570. */
  4571. chrome.sockets.tcp.update = function(socketId, properties, opt_callback) {};
  4572. /**
  4573. * @param {number} socketId
  4574. * @param {boolean} paused
  4575. * @param {function()=} opt_callback
  4576. * @see https://developer.chrome.com/apps/sockets_tcp#method-setPaused
  4577. * @return {undefined}
  4578. */
  4579. chrome.sockets.tcp.setPaused = function(socketId, paused, opt_callback) {};
  4580. /**
  4581. * @param {number} socketId
  4582. * @param {boolean} enable
  4583. * @param {(number|function(number))} delayOrCallback
  4584. * @param {function(number)=} opt_callback
  4585. * @see https://developer.chrome.com/apps/sockets_tcp#method-setKeepAlive
  4586. * @return {undefined}
  4587. */
  4588. chrome.sockets.tcp.setKeepAlive = function(
  4589. socketId, enable, delayOrCallback, opt_callback) {};
  4590. /**
  4591. * @param {number} socketId
  4592. * @param {boolean} noDelay
  4593. * @param {function(number)} callback
  4594. * @see https://developer.chrome.com/apps/sockets_tcp#method-setNoDelay
  4595. * @return {undefined}
  4596. */
  4597. chrome.sockets.tcp.setNoDelay = function(socketId, noDelay, callback) {};
  4598. /**
  4599. * @param {number} socketId
  4600. * @param {string} peerAddress
  4601. * @param {number} peerPort
  4602. * @param {function(number)} callback
  4603. * @see https://developer.chrome.com/apps/sockets_tcp#method-connect
  4604. * @return {undefined}
  4605. */
  4606. chrome.sockets.tcp.connect = function(
  4607. socketId, peerAddress, peerPort, callback) {};
  4608. /**
  4609. * @param {number} socketId The id of the socket to disconnect.
  4610. * @param {function()=} opt_callback
  4611. * @see https://developer.chrome.com/apps/sockets_tcp#method-disconnect
  4612. * @return {undefined}
  4613. */
  4614. chrome.sockets.tcp.disconnect = function(socketId, opt_callback) {};
  4615. /**
  4616. * @param {number} socketId
  4617. * @param {!chrome.sockets.tcp.SecureProperties|function(number)}
  4618. * optionsOrCallback
  4619. * @param {function(number)=} opt_callback
  4620. * @see https://developer.chrome.com/apps/sockets_tcp#method-secure
  4621. * @return {undefined}
  4622. */
  4623. chrome.sockets.tcp.secure = function(
  4624. socketId, optionsOrCallback, opt_callback) {};
  4625. /**
  4626. * @param {number} socketId
  4627. * @param {!ArrayBuffer} data
  4628. * @param {function(!Object)} callback
  4629. * @see https://developer.chrome.com/apps/sockets_tcp#method-send
  4630. * @return {undefined}
  4631. */
  4632. chrome.sockets.tcp.send = function(socketId, data, callback) {};
  4633. /**
  4634. * @param {number} socketId
  4635. * @param {function()=} opt_callback
  4636. * @see https://developer.chrome.com/apps/sockets_tcp#method-close
  4637. * @return {undefined}
  4638. */
  4639. chrome.sockets.tcp.close = function(socketId, opt_callback) {};
  4640. /**
  4641. * @param {number} socketId
  4642. * @param {function(!chrome.sockets.tcp.SocketInfo)} callback
  4643. * @see https://developer.chrome.com/apps/sockets_tcp#method-getInfo
  4644. * @return {undefined}
  4645. */
  4646. chrome.sockets.tcp.getInfo = function(socketId, callback) {};
  4647. /**
  4648. * @param {function(!Array<!chrome.sockets.tcp.SocketInfo>)} callback
  4649. * @see https://developer.chrome.com/apps/sockets_tcp#method-getSockets
  4650. * @return {undefined}
  4651. */
  4652. chrome.sockets.tcp.getSockets = function(callback) {};
  4653. /**
  4654. * @constructor
  4655. * @see https://developer.chrome.com/apps/sockets_tcp#event-onReceive
  4656. */
  4657. chrome.sockets.tcp.ReceiveEventData = function() {};
  4658. /** @type {number} */
  4659. chrome.sockets.tcp.ReceiveEventData.prototype.socketId;
  4660. /** @type {!ArrayBuffer} */
  4661. chrome.sockets.tcp.ReceiveEventData.prototype.data;
  4662. /**
  4663. * Event whose listeners take a ReceiveEventData parameter.
  4664. * @interface
  4665. * @extends {ChromeBaseEvent<function(!chrome.sockets.tcp.ReceiveEventData)>}
  4666. */
  4667. chrome.sockets.tcp.ReceiveEvent = function() {};
  4668. /** @type {!chrome.sockets.tcp.ReceiveEvent} */
  4669. chrome.sockets.tcp.onReceive;
  4670. /**
  4671. * @constructor
  4672. * @see https://developer.chrome.com/apps/sockets_tcp#event-onReceiveError
  4673. */
  4674. chrome.sockets.tcp.ReceiveErrorEventData = function() {};
  4675. /** @type {number} */
  4676. chrome.sockets.tcp.ReceiveErrorEventData.prototype.socketId;
  4677. /** @type {number} */
  4678. chrome.sockets.tcp.ReceiveErrorEventData.prototype.resultCode;
  4679. /**
  4680. * Event whose listeners take a ReceiveErrorEventData parameter.
  4681. * @interface
  4682. * @extends {ChromeBaseEvent<function(!chrome.sockets.tcp.ReceiveErrorEventData)>}
  4683. */
  4684. chrome.sockets.tcp.ReceiveErrorEvent = function() {};
  4685. /** @type {!chrome.sockets.tcp.ReceiveErrorEvent} */
  4686. chrome.sockets.tcp.onReceiveError;
  4687. /**
  4688. * @const
  4689. * @see https://developer.chrome.com/apps/sockets_tcpServer
  4690. */
  4691. chrome.sockets.tcpServer = {};
  4692. /**
  4693. * @typedef {?{
  4694. * persistent: (boolean|undefined),
  4695. * name: (string|undefined),
  4696. * }}
  4697. * @see https://developer.chrome.com/apps/sockets_tcpServer#type-SocketProperties
  4698. */
  4699. chrome.sockets.tcpServer.SocketProperties;
  4700. /**
  4701. * @constructor
  4702. * @see https://developer.chrome.com/apps/sockets_tcpServer#type-SocketInfo
  4703. */
  4704. chrome.sockets.tcpServer.SocketInfo = function() {};
  4705. /** @type {number} */
  4706. chrome.sockets.tcpServer.SocketInfo.prototype.socketId;
  4707. /** @type {boolean} */
  4708. chrome.sockets.tcpServer.SocketInfo.prototype.persistent;
  4709. /** @type {string|undefined} */
  4710. chrome.sockets.tcpServer.SocketInfo.prototype.name;
  4711. /** @type {boolean} */
  4712. chrome.sockets.tcpServer.SocketInfo.prototype.paused;
  4713. /** @type {string|undefined} */
  4714. chrome.sockets.tcpServer.SocketInfo.prototype.localAddress;
  4715. /** @type {number|undefined} */
  4716. chrome.sockets.tcpServer.SocketInfo.prototype.localPort;
  4717. /**
  4718. * @param {
  4719. * (!chrome.sockets.tcpServer.SocketProperties|function(!Object))
  4720. * } propertiesOrCallback
  4721. * @param {function(!Object)=} opt_callback
  4722. * @return {undefined}
  4723. * @see https://developer.chrome.com/apps/sockets_tcpServer#method-create
  4724. */
  4725. chrome.sockets.tcpServer.create = function(
  4726. propertiesOrCallback, opt_callback) {};
  4727. /**
  4728. * @param {number} socketId
  4729. * @param {!chrome.sockets.tcpServer.SocketProperties} properties
  4730. * @param {function(): void=} opt_callback
  4731. * @return {undefined}
  4732. * @see https://developer.chrome.com/apps/sockets_tcpServer#method-update
  4733. */
  4734. chrome.sockets.tcpServer.update = function(
  4735. socketId, properties, opt_callback) {};
  4736. /**
  4737. * @param {number} socketId
  4738. * @param {boolean} paused
  4739. * @param {function(): void=} opt_callback
  4740. * @return {undefined}
  4741. * @see https://developer.chrome.com/apps/sockets_tcpServer#method-setPaused
  4742. */
  4743. chrome.sockets.tcpServer.setPaused = function(
  4744. socketId, paused, opt_callback) {};
  4745. /**
  4746. * @param {number} socketId
  4747. * @param {string} address
  4748. * @param {number} port
  4749. * @param {number|function(number)} backlogOrCallback
  4750. * @param {function(number)=} opt_callback
  4751. * @return {undefined}
  4752. * @see https://developer.chrome.com/apps/sockets_tcpServer#method-listen
  4753. */
  4754. chrome.sockets.tcpServer.listen = function(
  4755. socketId, address, port, backlogOrCallback, opt_callback) {};
  4756. /**
  4757. * @param {number} socketId The id of the socket to disconnect.
  4758. * @param {function()=} opt_callback
  4759. * @see https://developer.chrome.com/apps/sockets_tcpServer#method-disconnect
  4760. * @return {undefined}
  4761. */
  4762. chrome.sockets.tcpServer.disconnect = function(socketId, opt_callback) {};
  4763. /**
  4764. * @param {number} socketId
  4765. * @param {function()=} opt_callback
  4766. * @see https://developer.chrome.com/apps/sockets_tcpServer#method-close
  4767. * @return {undefined}
  4768. */
  4769. chrome.sockets.tcpServer.close = function(socketId, opt_callback) {};
  4770. /**
  4771. * @param {number} socketId
  4772. * @param {function(!chrome.sockets.tcpServer.SocketInfo)} callback
  4773. * @see https://developer.chrome.com/apps/sockets_tcpServer#method-getInfo
  4774. * @return {undefined}
  4775. */
  4776. chrome.sockets.tcpServer.getInfo = function(socketId, callback) {};
  4777. /**
  4778. * @param {function(!Array<!chrome.sockets.tcpServer.SocketInfo>)} callback
  4779. * @see https://developer.chrome.com/apps/sockets_tcpServerp#method-getSockets
  4780. * @return {undefined}
  4781. */
  4782. chrome.sockets.tcpServer.getSockets = function(callback) {};
  4783. /**
  4784. * @constructor
  4785. * @see https://developer.chrome.com/apps/sockets_tcpServer#event-onAccept
  4786. */
  4787. chrome.sockets.tcpServer.AcceptEventData = function() {};
  4788. /** @type {number} */
  4789. chrome.sockets.tcpServer.AcceptEventData.prototype.socketId;
  4790. /** @type {number} */
  4791. chrome.sockets.tcpServer.AcceptEventData.prototype.clientSocketId;
  4792. /**
  4793. * Event whose listeners take a AcceptEventData parameter.
  4794. * @interface
  4795. * @extends {ChromeBaseEvent<function(!chrome.sockets.tcpServer.AcceptEventData)>}
  4796. */
  4797. chrome.sockets.tcpServer.AcceptEvent = function() {};
  4798. /** @type {!chrome.sockets.tcpServer.AcceptEvent} */
  4799. chrome.sockets.tcpServer.onAccept;
  4800. /**
  4801. * @constructor
  4802. * @see https://developer.chrome.com/apps/sockets_tcpServer#event-onAcceptError
  4803. */
  4804. chrome.sockets.tcpServer.AcceptErrorEventData = function() {};
  4805. /** @type {number} */
  4806. chrome.sockets.tcpServer.AcceptErrorEventData.prototype.socketId;
  4807. /** @type {number} */
  4808. chrome.sockets.tcpServer.AcceptErrorEventData.prototype.resultCode;
  4809. /**
  4810. * Event whose listeners take a AcceptErrorEventData parameter.
  4811. * @interface
  4812. * @extends {ChromeBaseEvent<function(!chrome.sockets.tcpServer.AcceptErrorEventData)>}
  4813. */
  4814. chrome.sockets.tcpServer.AcceptErrorEvent = function() {};
  4815. /** @type {!chrome.sockets.tcpServer.AcceptErrorEvent} */
  4816. chrome.sockets.tcpServer.onAcceptError;
  4817. /**
  4818. * @see https://developer.chrome.com/apps/sockets_udp
  4819. * @const
  4820. */
  4821. chrome.sockets.udp = {};
  4822. /**
  4823. * @typedef {?{
  4824. * persistent: (boolean|undefined),
  4825. * name: (string|undefined),
  4826. * bufferSize: (number|undefined)
  4827. * }}
  4828. * @see https://developer.chrome.com/apps/sockets_udp#type-SocketProperties
  4829. */
  4830. chrome.sockets.udp.SocketProperties;
  4831. /**
  4832. * @constructor
  4833. * @see https://developer.chrome.com/apps/sockets_udp#type-SocketInfo
  4834. */
  4835. chrome.sockets.udp.SocketInfo = function() {};
  4836. /** @type {number} */
  4837. chrome.sockets.udp.SocketInfo.prototype.socketId;
  4838. /** @type {boolean} */
  4839. chrome.sockets.udp.SocketInfo.prototype.persistent;
  4840. /** @type {string|undefined} */
  4841. chrome.sockets.udp.SocketInfo.prototype.name;
  4842. /** @type {number|undefined} */
  4843. chrome.sockets.udp.SocketInfo.prototype.bufferSize;
  4844. /** @type {boolean} */
  4845. chrome.sockets.udp.SocketInfo.prototype.paused;
  4846. /** @type {string|undefined} */
  4847. chrome.sockets.udp.SocketInfo.prototype.localAddress;
  4848. /** @type {number|undefined} */
  4849. chrome.sockets.udp.SocketInfo.prototype.localPort;
  4850. /**
  4851. * @param {
  4852. * (!chrome.sockets.udp.SocketProperties|function(!Object))
  4853. * } propertiesOrCallback
  4854. * @param {function(!Object)=} opt_callback
  4855. * @return {undefined}
  4856. * @see https://developer.chrome.com/apps/sockets_udp#method-create
  4857. */
  4858. chrome.sockets.udp.create = function(propertiesOrCallback, opt_callback) {};
  4859. /**
  4860. * @param {number} socketId
  4861. * @param {!chrome.sockets.udp.SocketProperties} properties
  4862. * @param {function(): void=} opt_callback
  4863. * @return {undefined}
  4864. * @see https://developer.chrome.com/apps/sockets_udp#method-update
  4865. */
  4866. chrome.sockets.udp.update = function(socketId, properties, opt_callback) {};
  4867. /**
  4868. * @param {number} socketId
  4869. * @param {boolean} paused
  4870. * @param {function(): void=} opt_callback
  4871. * @return {undefined}
  4872. * @see https://developer.chrome.com/apps/sockets_udp#method-setPaused
  4873. */
  4874. chrome.sockets.udp.setPaused = function(socketId, paused, opt_callback) {};
  4875. /**
  4876. * @param {number} socketId
  4877. * @param {string} address
  4878. * @param {number} port
  4879. * @param {function(number): void} callback
  4880. * @return {undefined}
  4881. * @see https://developer.chrome.com/apps/sockets_udp#method-bind
  4882. */
  4883. chrome.sockets.udp.bind = function(socketId, address, port, callback) {};
  4884. /**
  4885. * @param {number} socketId
  4886. * @param {!ArrayBuffer} data
  4887. * @param {string} address
  4888. * @param {number} port
  4889. * @param {function(!Object): void} callback
  4890. * @return {undefined}
  4891. * @see https://developer.chrome.com/apps/sockets_udp#method-send
  4892. */
  4893. chrome.sockets.udp.send = function(socketId, data, address, port, callback) {};
  4894. /**
  4895. * @param {number} socketId
  4896. * @param {function()} callback
  4897. * @return {undefined}
  4898. * @see https://developer.chrome.com/apps/sockets_udp#method-close
  4899. */
  4900. chrome.sockets.udp.close = function(socketId, callback) {};
  4901. /**
  4902. * @param {number} socketId
  4903. * @param {function(!chrome.sockets.udp.SocketInfo): void} callback
  4904. * @return {undefined}
  4905. * @see https://developer.chrome.com/apps/sockets_udp#method-getInfo
  4906. */
  4907. chrome.sockets.udp.getInfo = function(socketId, callback) {};
  4908. /**
  4909. * @param {function(!Array<!chrome.sockets.udp.SocketInfo>): void} callback
  4910. * @return {undefined}
  4911. * @see https://developer.chrome.com/apps/sockets_udp#method-getSockets
  4912. */
  4913. chrome.sockets.udp.getSockets = function(callback) {};
  4914. /**
  4915. * @param {number} socketId
  4916. * @param {string} address
  4917. * @param {function(number): void} callback
  4918. * @return {undefined}
  4919. * @see https://developer.chrome.com/apps/sockets_udp#method-joinGroup
  4920. */
  4921. chrome.sockets.udp.joinGroup = function(socketId, address, callback) {};
  4922. /**
  4923. * @param {number} socketId
  4924. * @param {string} address
  4925. * @param {function(number): void} callback
  4926. * @return {undefined}
  4927. * @see https://developer.chrome.com/apps/sockets_udp#method-leaveGroup
  4928. */
  4929. chrome.sockets.udp.leaveGroup = function(socketId, address, callback) {};
  4930. /**
  4931. * @param {number} socketId
  4932. * @param {number} ttl
  4933. * @param {function(number): void} callback
  4934. * @return {undefined}
  4935. * @see https://developer.chrome.com/apps/sockets_udp#method-setMulticastTimeToLive
  4936. */
  4937. chrome.sockets.udp.setMulticastTimeToLive = function(
  4938. socketId, ttl, callback) {};
  4939. /**
  4940. * @param {number} socketId
  4941. * @param {boolean} enabled
  4942. * @param {function(number): void} callback
  4943. * @return {undefined}
  4944. * @see https://developer.chrome.com/apps/sockets_udp#method-setMulticastLoopbackMode
  4945. */
  4946. chrome.sockets.udp.setMulticastLoopbackMode = function(
  4947. socketId, enabled, callback) {};
  4948. /**
  4949. * @param {number} socketId
  4950. * @param {function(!Array<string>): void} callback
  4951. * @return {undefined}
  4952. * @see https://developer.chrome.com/apps/sockets_udp#method-getJoinedGroups
  4953. */
  4954. chrome.sockets.udp.getJoinedGroups = function(socketId, callback) {};
  4955. /**
  4956. * @param {number} socketId
  4957. * @param {boolean} enabled
  4958. * @param {function(number): void} callback
  4959. * @return {undefined}
  4960. * @see https://developer.chrome.com/apps/sockets_udp#method-send
  4961. */
  4962. chrome.sockets.udp.setBroadcast = function(socketId, enabled, callback) {};
  4963. /**
  4964. * @type {!ChromeObjectEvent}
  4965. * @see https://developer.chrome.com/apps/sockets_udp#event-onReceive
  4966. */
  4967. chrome.sockets.udp.onReceive;
  4968. /**
  4969. * @type {!ChromeObjectEvent}
  4970. * @see https://developer.chrome.com/apps/sockets_udp#event-onReceiveError
  4971. */
  4972. chrome.sockets.udp.onReceiveError;
  4973. /**
  4974. * @const
  4975. * @see https://developer.chrome.com/extensions/storage.html
  4976. */
  4977. chrome.storage = {};
  4978. /** @type {!StorageArea} */
  4979. chrome.storage.sync;
  4980. /** @type {!StorageArea} */
  4981. chrome.storage.local;
  4982. /** @type {!StorageArea} */
  4983. chrome.storage.managed;
  4984. /** @type {!StorageChangeEvent} */
  4985. chrome.storage.onChanged;
  4986. /** @const */
  4987. chrome.system = {};
  4988. /**
  4989. * @const
  4990. * @see https://developer.chrome.com/extensions/system_cpu.html
  4991. */
  4992. chrome.system.cpu = {};
  4993. /**
  4994. * @typedef {?{
  4995. * user: number,
  4996. * kernel: number,
  4997. * idle: number,
  4998. * total: number,
  4999. * }}
  5000. */
  5001. chrome.system.cpu.CpuTime;
  5002. /**
  5003. * @typedef {?{
  5004. * usage: !chrome.system.cpu.CpuTime,
  5005. * }}
  5006. */
  5007. chrome.system.cpu.ProcessorInfo;
  5008. /**
  5009. * @typedef {?{
  5010. * numOfProcessors: number,
  5011. * archName: string,
  5012. * modelName: string,
  5013. * features: !Array<string>,
  5014. * processors: !Array<!chrome.system.cpu.ProcessorInfo>,
  5015. * temperatures: !Array<number>,
  5016. * }}
  5017. */
  5018. chrome.system.cpu.CpuInfo;
  5019. /**
  5020. * @param {function(!chrome.system.cpu.CpuInfo)} callback
  5021. * @return {undefined}
  5022. */
  5023. chrome.system.cpu.getInfo = function(callback) {};
  5024. /**
  5025. * @const
  5026. * @see http://developer.chrome.com/apps/system_display.html
  5027. */
  5028. chrome.system.display = {};
  5029. /**
  5030. * @enum {string}
  5031. * @see https://developer.chrome.com/extensions/system.display#type-MirrorMode
  5032. */
  5033. chrome.system.display.MirrorMode = {
  5034. OFF: '',
  5035. NORMAL: '',
  5036. MIXED: '',
  5037. };
  5038. /**
  5039. * @typedef {!{
  5040. * left: number,
  5041. * top: number,
  5042. * width: number,
  5043. * height: number
  5044. * }}
  5045. * @see https://developer.chrome.com/extensions/system.display#type-Bounds
  5046. */
  5047. chrome.system.display.Bounds;
  5048. /**
  5049. * @typedef {!{
  5050. * left: number,
  5051. * top: number,
  5052. * right: number,
  5053. * bottom: number
  5054. * }}
  5055. * @see https://developer.chrome.com/extensions/system.display#type-Insets
  5056. */
  5057. chrome.system.display.Insets;
  5058. /**
  5059. * @typedef {!{
  5060. * x: number,
  5061. * y: number
  5062. * }}
  5063. * @see https://developer.chrome.com/extensions/system.display#type-Point
  5064. */
  5065. chrome.system.display.Point;
  5066. /**
  5067. * @typedef {!{
  5068. * displayPoint: !chrome.system.display.Point,
  5069. * touchPoint: !chrome.system.display.Point
  5070. * }}
  5071. * @see https://developer.chrome.com/extensions/system.display#type-TouchCalibrationPair
  5072. */
  5073. chrome.system.display.TouchCalibrationPair;
  5074. /**
  5075. * @typedef {!{
  5076. * pair1: !chrome.system.display.TouchCalibrationPair,
  5077. * pair2: !chrome.system.display.TouchCalibrationPair,
  5078. * pair3: !chrome.system.display.TouchCalibrationPair,
  5079. * pair4: !chrome.system.display.TouchCalibrationPair
  5080. * }}
  5081. * @see https://developer.chrome.com/extensions/system.display#type-TouchCalibrationPairQuad
  5082. */
  5083. chrome.system.display.TouchCalibrationPairQuad;
  5084. /**
  5085. * @typedef {!{
  5086. * width: number,
  5087. * height: number,
  5088. * widthInNativePixels: number,
  5089. * heightInNativePixels: number,
  5090. * uiScale: number,
  5091. * deviceScaleFactor: number,
  5092. * isNative: boolean,
  5093. * isSelected: boolean
  5094. * }}
  5095. * @see https://developer.chrome.com/extensions/system.display#type-DisplayMode
  5096. */
  5097. chrome.system.display.DisplayMode;
  5098. /**
  5099. * @enum {string}
  5100. * @see https://developer.chrome.com/extensions/system.display#type-LayoutPosition
  5101. */
  5102. chrome.system.display.LayoutPosition = {
  5103. TOP: '',
  5104. RIGHT: '',
  5105. BOTTOM: '',
  5106. LEFT: '',
  5107. };
  5108. /**
  5109. * @typedef {!{
  5110. * id: string,
  5111. * parentId: string,
  5112. * position: (!chrome.system.display.LayoutPosition|string),
  5113. * offset: number
  5114. * }}
  5115. * @see https://developer.chrome.com/extensions/system.display#type-DisplayLayout
  5116. */
  5117. chrome.system.display.DisplayLayout;
  5118. /**
  5119. * @typedef {!{
  5120. * isUnified: (boolean|undefined),
  5121. * mirroringSourceId: (string|undefined),
  5122. * mirroringDestinationIds: (!Array<string>|undefined),
  5123. * isPrimary: (boolean|undefined),
  5124. * overscan: (!chrome.system.display.Insets|undefined),
  5125. * rotation: (number|undefined),
  5126. * boundsOriginX: (number|undefined),
  5127. * boundsOriginY: (number|undefined),
  5128. * displayMode: (!chrome.system.display.DisplayMode|undefined),
  5129. * availableDisplayZoomFactors: (!Array<number>|undefined),
  5130. * displayZoomFactor: (number|undefined)
  5131. * }}
  5132. * @see https://developer.chrome.com/extensions/system.display#type-DisplayProperties
  5133. */
  5134. chrome.system.display.DisplayProperties;
  5135. /**
  5136. * @typedef {!{
  5137. * singleUnified: (boolean|undefined)
  5138. * }}
  5139. * @see https://developer.chrome.com/extensions/system.display#type-GetInfoFlags
  5140. */
  5141. chrome.system.display.GetInfoFlags;
  5142. /**
  5143. * @typedef {!{
  5144. * mode: (!chrome.system.display.MirrorMode|string),
  5145. * mirroringSourceId: (string|undefined),
  5146. * mirroringDestinationIds: (!Array<string>|undefined),
  5147. * }}
  5148. * @see https://developer.chrome.com/extensions/system.display#type-MirrorModeInfo
  5149. */
  5150. chrome.system.display.MirrorModeInfo;
  5151. /**
  5152. * @typedef {!{
  5153. * manufacturerId: string,
  5154. * productId: string,
  5155. * yearOfManufacture: number,
  5156. * }}
  5157. */
  5158. chrome.system.display.Edid;
  5159. /**
  5160. * An undocumented type that defines the objects passed to getInfo()'s callback.
  5161. * @constructor
  5162. */
  5163. chrome.system.display.DisplayUnitInfo = function() {};
  5164. /** @type {string} */
  5165. chrome.system.display.DisplayUnitInfo.prototype.id;
  5166. /** @type {string} */
  5167. chrome.system.display.DisplayUnitInfo.prototype.name;
  5168. /** @type {!chrome.system.display.Edid|undefined} */
  5169. chrome.system.display.DisplayUnitInfo.prototype.edid;
  5170. /** @type {string} */
  5171. chrome.system.display.DisplayUnitInfo.prototype.mirroringSourceId;
  5172. /** @type {!Array<string>} */
  5173. chrome.system.display.DisplayUnitInfo.prototype.mirroringDestinationIds;
  5174. /** @type {boolean} */
  5175. chrome.system.display.DisplayUnitInfo.prototype.isPrimary;
  5176. /** @type {boolean} */
  5177. chrome.system.display.DisplayUnitInfo.prototype.isInternal;
  5178. /** @type {boolean} */
  5179. chrome.system.display.DisplayUnitInfo.prototype.isEnabled;
  5180. /** @type {number} */
  5181. chrome.system.display.DisplayUnitInfo.prototype.dpiX;
  5182. /** @type {number} */
  5183. chrome.system.display.DisplayUnitInfo.prototype.dpiY;
  5184. /** @type {number} */
  5185. chrome.system.display.DisplayUnitInfo.prototype.rotation;
  5186. /** @type {!chrome.system.display.Bounds} */
  5187. chrome.system.display.DisplayUnitInfo.prototype.bounds;
  5188. /** @type {!chrome.system.display.Insets} */
  5189. chrome.system.display.DisplayUnitInfo.prototype.overscan;
  5190. /** @type {!chrome.system.display.Bounds} */
  5191. chrome.system.display.DisplayUnitInfo.prototype.workArea;
  5192. /** @type {!Array<!chrome.system.display.DisplayMode>} */
  5193. chrome.system.display.DisplayUnitInfo.prototype.modes;
  5194. /** @type {boolean} */
  5195. chrome.system.display.DisplayUnitInfo.prototype.hasTouchSupport;
  5196. /** @type {!Array<number>} */
  5197. chrome.system.display.DisplayUnitInfo.prototype.availableDisplayZoomFactors;
  5198. /** @type {number} */
  5199. chrome.system.display.DisplayUnitInfo.prototype.displayZoomFactor;
  5200. /**
  5201. * @param {!chrome.system.display.GetInfoFlags|
  5202. * function(!Array<!chrome.system.display.DisplayUnitInfo>):void}
  5203. * flags Options affecting how the information is returned.
  5204. * @param {function(!Array<!chrome.system.display.DisplayUnitInfo>):void=}
  5205. * callback The callback to invoke with the results.
  5206. * @return {undefined}
  5207. * @see https://developer.chrome.com/extensions/system.display#method-getInfo
  5208. */
  5209. chrome.system.display.getInfo = function(flags, callback) {};
  5210. /**
  5211. * @param {function(!Array<!chrome.system.display.DisplayLayout>):void} callback
  5212. * The callback to invoke with the results.
  5213. * @see https://developer.chrome.com/extensions/system.display#method-getDisplayLayout
  5214. */
  5215. chrome.system.display.getDisplayLayout = function(callback) {};
  5216. /**
  5217. * @param {string} id The display's unique identifier.
  5218. * @param {!chrome.system.display.DisplayProperties} info The information about
  5219. * display properties that should be changed. A property will be changed
  5220. * only if a new value for it is specified in info.
  5221. * @param {function():void=} callback Empty function called when the function
  5222. * finishes. To find out whether the function succeeded, runtime.lastError
  5223. * should be queried.
  5224. * @see https://developer.chrome.com/extensions/system.display#method-setDisplayProperties
  5225. */
  5226. chrome.system.display.setDisplayProperties = function(id, info, callback) {};
  5227. /**
  5228. * @param {!Array<!chrome.system.display.DisplayLayout>} layouts The layout
  5229. * information, required for all displays except the primary display.
  5230. * @param {function():void=} callback Empty function called when the function
  5231. * finishes. To find out whether the function succeeded, runtime.lastError
  5232. * should be queried.
  5233. * @see https://developer.chrome.com/extensions/system.display#method-setDisplayLayout
  5234. */
  5235. chrome.system.display.setDisplayLayout = function(layouts, callback) {};
  5236. /**
  5237. * @param {!chrome.system.display.MirrorModeInfo} info The information of the
  5238. * mirror mode that should be applied to the display mode.
  5239. * @param {function():void=} callback Empty function called when the function
  5240. * finishes. To find out whether the function succeeded,
  5241. * $(ref:runtime.lastError) should be queried.
  5242. * @see https://developer.chrome.com/extensions/system.display#method-setMirrorMode
  5243. */
  5244. chrome.system.display.setMirrorMode = function(info, callback) {};
  5245. /**
  5246. * @param {boolean} enabled True if unified desktop should be enabled.
  5247. * @see https://developer.chrome.com/extensions/system.display#method-enableUnifiedDesktop
  5248. */
  5249. chrome.system.display.enableUnifiedDesktop = function(enabled) {};
  5250. /**
  5251. * @param {string} id The display's unique identifier.
  5252. * @see https://developer.chrome.com/extensions/system.display#method-overscanCalibrationStart
  5253. */
  5254. chrome.system.display.overscanCalibrationStart = function(id) {};
  5255. /**
  5256. * @param {string} id The display's unique identifier.
  5257. * @param {!chrome.system.display.Insets} delta The amount to change the
  5258. * overscan insets.
  5259. * @see https://developer.chrome.com/extensions/system.display#method-overscanCalibrationAdjust
  5260. */
  5261. chrome.system.display.overscanCalibrationAdjust = function(id, delta) {};
  5262. /**
  5263. * @param {string} id The display's unique identifier.
  5264. * @see https://developer.chrome.com/extensions/system.display#method-overscanCalibrationReset
  5265. */
  5266. chrome.system.display.overscanCalibrationReset = function(id) {};
  5267. /**
  5268. * @param {string} id The display's unique identifier.
  5269. * @see https://developer.chrome.com/extensions/system.display#method-overscanCalibrationComplete
  5270. */
  5271. chrome.system.display.overscanCalibrationComplete = function(id) {};
  5272. /**
  5273. * @param {string} id The display's unique identifier.
  5274. * @param {function(boolean):void=} callback Optional callback to inform the
  5275. * caller that the touch calibration has ended. The argument of the callback
  5276. * informs if the calibration was a success or not.
  5277. * @see https://developer.chrome.com/extensions/system.display#method-showNativeTouchCalibration
  5278. */
  5279. chrome.system.display.showNativeTouchCalibration = function(id, callback) {};
  5280. /**
  5281. * @param {string} id The display's unique identifier.
  5282. * @see https://developer.chrome.com/extensions/system.display#method-startCustomTouchCalibration
  5283. */
  5284. chrome.system.display.startCustomTouchCalibration = function(id) {};
  5285. /**
  5286. * @param {!chrome.system.display.TouchCalibrationPairQuad} pairs The pairs of
  5287. * point used to calibrate the display.
  5288. * @param {!chrome.system.display.Bounds} bounds Bounds of the display when the
  5289. * touch calibration was performed. |bounds.left| and |bounds.top| values
  5290. * are ignored.
  5291. * @see https://developer.chrome.com/extensions/system.display#method-completeCustomTouchCalibration
  5292. */
  5293. chrome.system.display.completeCustomTouchCalibration = function(
  5294. pairs, bounds) {};
  5295. /**
  5296. * @param {string} id The display's unique identifier.
  5297. * @see https://developer.chrome.com/extensions/system.display#method-clearTouchCalibration
  5298. */
  5299. chrome.system.display.clearTouchCalibration = function(id) {};
  5300. /**
  5301. * @type {!ChromeEvent}
  5302. * @see https://developer.chrome.com/extensions/system.display#event-onDisplayChanged
  5303. */
  5304. chrome.system.display.onDisplayChanged;
  5305. /**
  5306. * @const
  5307. * @see https://developer.chrome.com/extensions/system_memory
  5308. */
  5309. chrome.system.memory = {};
  5310. /**
  5311. * Get physical memory information.
  5312. * @param {function(!chrome.system.memory.MemoryInfo)} callback
  5313. * @return {undefined}
  5314. */
  5315. chrome.system.memory.getInfo = function(callback) {};
  5316. /**
  5317. * @constructor
  5318. */
  5319. chrome.system.memory.MemoryInfo = function() {};
  5320. /** @type {number} */
  5321. chrome.system.memory.MemoryInfo.prototype.capacity;
  5322. /** @type {number} */
  5323. chrome.system.memory.MemoryInfo.prototype.availableCapacity;
  5324. /**
  5325. * @const
  5326. * @see http://developer.chrome.com/apps/system_network.html
  5327. */
  5328. chrome.system.network = {};
  5329. /**
  5330. * @param {function(!Array<!chrome.system.network.NetworkInterface>)} callback
  5331. * @return {undefined}
  5332. */
  5333. chrome.system.network.getNetworkInterfaces = function(callback) {};
  5334. /**
  5335. * @interface
  5336. */
  5337. chrome.system.network.NetworkInterface = function() {};
  5338. /**
  5339. * @const {string} The underlying name of the adapter. On *nix, this will
  5340. * typically be "eth0", "wlan0", etc.
  5341. */
  5342. chrome.system.network.NetworkInterface.prototype.name;
  5343. /** @const {string} The available IPv4/6 address. */
  5344. chrome.system.network.NetworkInterface.prototype.address;
  5345. /** @const {number} The prefix length */
  5346. chrome.system.network.NetworkInterface.prototype.prefixLength;
  5347. /**
  5348. * @const
  5349. */
  5350. chrome.types = {};
  5351. /**
  5352. * @typedef {?{
  5353. * format: (string|undefined),
  5354. * quality: (number|undefined)
  5355. * }}
  5356. */
  5357. chrome.types.ImageDetails;
  5358. /**
  5359. * @const
  5360. * @see https://developer.chrome.com/extensions/types.html
  5361. */
  5362. chrome.chromeSetting = {};
  5363. /** @type {!ChromeEvent} */
  5364. chrome.chromeSetting.onChange;
  5365. /**
  5366. * @const
  5367. * @see https://developer.chrome.com/extensions/webNavigation.html
  5368. */
  5369. chrome.webNavigation = {};
  5370. /**
  5371. * @param {Object} details Object with a 'tabId' (number) key.
  5372. * @param {function(!Array<Object<string, (boolean|number|string)>>)} callback
  5373. * Callback function.
  5374. * @return {undefined}
  5375. */
  5376. chrome.webNavigation.getAllFrames = function(details, callback) {};
  5377. /**
  5378. * @param {Object} details Object with 'tabId' (number) and 'frameId' (number)
  5379. * keys.
  5380. * @param {function(Object<string, (boolean|string)>)} callback
  5381. * Callback function.
  5382. * @return {undefined}
  5383. */
  5384. chrome.webNavigation.getFrame = function(details, callback) {};
  5385. /** @type {!ChromeEvent} */
  5386. chrome.webNavigation.onBeforeNavigate;
  5387. /** @type {!ChromeEvent} */
  5388. chrome.webNavigation.onCommitted;
  5389. /** @type {!ChromeEvent} */
  5390. chrome.webNavigation.onDOMContentLoaded;
  5391. /** @type {!ChromeEvent} */
  5392. chrome.webNavigation.onCompleted;
  5393. /** @type {!ChromeEvent} */
  5394. chrome.webNavigation.onErrorOccurred;
  5395. /** @type {!ChromeEvent} */
  5396. chrome.webNavigation.onCreatedNavigationTarget;
  5397. /** @type {!ChromeEvent} */
  5398. chrome.webNavigation.onReferenceFragmentUpdated;
  5399. /** @type {!ChromeEvent} */
  5400. chrome.webNavigation.onTabReplaced;
  5401. /** @type {!ChromeEvent} */
  5402. chrome.webNavigation.onHistoryStateUpdated;
  5403. /**
  5404. * Base event type for WebRequest-releated events.
  5405. *
  5406. * The `addListener()` methods for these take more than one argument, so they
  5407. * cannot just extend `ChromeBaseEvent`.
  5408. * @interface
  5409. * @extends {ChromeBaseEventNoListeners}
  5410. * @template LISTENER
  5411. */
  5412. function WebRequestBaseEvent() {}
  5413. /**
  5414. * @param {LISTENER} listener Listener function.
  5415. * @param {!RequestFilter} filter A set of filters that restrict
  5416. * the events that will be sent to this listener.
  5417. * @param {!Array<string>=} opt_extraInfoSpec Array of extra information
  5418. * that should be passed to the listener function.
  5419. * @return {undefined}
  5420. */
  5421. WebRequestBaseEvent.prototype.addListener = function(
  5422. listener, filter, opt_extraInfoSpec) {};
  5423. /**
  5424. * @param {LISTENER} listener Listener function.
  5425. * @return {undefined}
  5426. */
  5427. WebRequestBaseEvent.prototype.removeListener = function(listener) {};
  5428. /**
  5429. * @param {LISTENER} listener Listener function.
  5430. * @return {boolean}
  5431. */
  5432. WebRequestBaseEvent.prototype.hasListener = function(listener) {};
  5433. /**
  5434. * @return {boolean}
  5435. */
  5436. WebRequestBaseEvent.prototype.hasListeners = function() {};
  5437. /**
  5438. * Most event listeners for WebRequest take extra arguments.
  5439. * @see https://developer.chrome.com/extensions/webRequest
  5440. * @interface
  5441. * @extends {WebRequestBaseEvent<function(!Object)>}
  5442. */
  5443. function WebRequestEvent() {}
  5444. /**
  5445. * Some event listeners can be optionally synchronous.
  5446. * @see https://developer.chrome.com/extensions/webRequest
  5447. * @interface
  5448. * @extends {WebRequestBaseEvent<function(!Object):
  5449. * (undefined|!BlockingResponse)>}
  5450. */
  5451. function WebRequestOptionallySynchronousEvent() {}
  5452. /**
  5453. * The onAuthRequired event listener can be optionally synchronous, and can also
  5454. * optionally take a callback.
  5455. * @see https://developer.chrome.com/extensions/webRequest
  5456. * @interface
  5457. * @extends {WebRequestBaseEvent<
  5458. * function(
  5459. * !Object,
  5460. * function(!BlockingResponse)=): (undefined|!BlockingResponse)>}
  5461. */
  5462. function WebRequestOnAuthRequiredEvent() {}
  5463. /**
  5464. * The onErrorOccurred event takes one fewer parameter than the others.
  5465. *
  5466. * The `addListener()` methods for these take more than one argument, so they
  5467. * cannot just extend `ChromeBaseEvent`.
  5468. * @see https://developer.chrome.com/extensions/webRequest
  5469. * @interface
  5470. * @extends {ChromeBaseEventNoListeners}
  5471. */
  5472. function WebRequestOnErrorOccurredEvent() {}
  5473. /**
  5474. * @param {function(!Object): void} listener Listener function.
  5475. * @param {!RequestFilter} filter A set of filters that restrict
  5476. * the events that will be sent to this listener.
  5477. * @return {undefined}
  5478. */
  5479. WebRequestOnErrorOccurredEvent.prototype.addListener = function(
  5480. listener, filter) {};
  5481. /**
  5482. * @param {function(!Object): void} listener Listener function.
  5483. * @return {undefined}
  5484. */
  5485. WebRequestOnErrorOccurredEvent.prototype.removeListener = function(listener) {};
  5486. /**
  5487. * @param {function(!Object): void} listener Listener function.
  5488. * @return {boolean}
  5489. */
  5490. WebRequestOnErrorOccurredEvent.prototype.hasListener = function(listener) {};
  5491. /**
  5492. * @return {boolean}
  5493. */
  5494. WebRequestOnErrorOccurredEvent.prototype.hasListeners = function() {};
  5495. /**
  5496. * @const
  5497. * @see https://developer.chrome.com/extensions/webRequest
  5498. */
  5499. chrome.webRequest = {};
  5500. /**
  5501. * @param {function(): void=} opt_callback Callback function.
  5502. * @return {undefined}
  5503. */
  5504. chrome.webRequest.handlerBehaviorChanged = function(opt_callback) {};
  5505. /** @type {!WebRequestOnAuthRequiredEvent} */
  5506. chrome.webRequest.onAuthRequired;
  5507. /** @type {!WebRequestEvent} */
  5508. chrome.webRequest.onBeforeRedirect;
  5509. /** @type {!WebRequestOptionallySynchronousEvent} */
  5510. chrome.webRequest.onBeforeRequest;
  5511. /** @type {!WebRequestOptionallySynchronousEvent} */
  5512. chrome.webRequest.onBeforeSendHeaders;
  5513. /** @type {!WebRequestEvent} */
  5514. chrome.webRequest.onCompleted;
  5515. /** @type {!WebRequestOnErrorOccurredEvent} */
  5516. chrome.webRequest.onErrorOccurred;
  5517. /** @type {!WebRequestOptionallySynchronousEvent} */
  5518. chrome.webRequest.onHeadersReceived;
  5519. /** @type {!WebRequestEvent} */
  5520. chrome.webRequest.onResponseStarted;
  5521. /** @type {!WebRequestEvent} */
  5522. chrome.webRequest.onSendHeaders;
  5523. // Classes
  5524. /**
  5525. * @see https://developer.chrome.com/extensions/management.html
  5526. * @constructor
  5527. */
  5528. function ExtensionInfo() {}
  5529. /** @type {string} */
  5530. ExtensionInfo.prototype.id;
  5531. /** @type {string} */
  5532. ExtensionInfo.prototype.name;
  5533. /** @type {string} */
  5534. ExtensionInfo.prototype.shortName;
  5535. /** @type {string} */
  5536. ExtensionInfo.prototype.description;
  5537. /** @type {string} */
  5538. ExtensionInfo.prototype.version;
  5539. /** @type {boolean} */
  5540. ExtensionInfo.prototype.mayDisable;
  5541. /** @type {boolean} */
  5542. ExtensionInfo.prototype.enabled;
  5543. /** @type {string|undefined} */
  5544. ExtensionInfo.prototype.disabledReason;
  5545. /** @type {boolean} */
  5546. ExtensionInfo.prototype.isApp;
  5547. /** @type {string} */
  5548. ExtensionInfo.prototype.type;
  5549. /** @type {string|undefined} */
  5550. ExtensionInfo.prototype.appLaunchUrl;
  5551. /** @type {string|undefined} */
  5552. ExtensionInfo.prototype.homepageUrl;
  5553. /** @type {string|undefined} */
  5554. ExtensionInfo.prototype.updateUrl;
  5555. /** @type {boolean} */
  5556. ExtensionInfo.prototype.offlineEnabled;
  5557. /** @type {string} */
  5558. ExtensionInfo.prototype.optionsUrl;
  5559. /** @type {!Array<!IconInfo>|undefined} */
  5560. ExtensionInfo.prototype.icons;
  5561. /** @type {!Array<string>} */
  5562. ExtensionInfo.prototype.permissions;
  5563. /** @type {!Array<string>} */
  5564. ExtensionInfo.prototype.hostPermissions;
  5565. /** @type {string} */
  5566. ExtensionInfo.prototype.installType;
  5567. /** @type {string|undefined} */
  5568. ExtensionInfo.prototype.launchType;
  5569. /** @type {!Array<string>|undefined} */
  5570. ExtensionInfo.prototype.availableLaunchTypes;
  5571. /**
  5572. * @see https://developer.chrome.com/extensions/management.html
  5573. * @constructor
  5574. */
  5575. function IconInfo() {}
  5576. /** @type {number} */
  5577. IconInfo.prototype.size;
  5578. /** @type {string} */
  5579. IconInfo.prototype.url;
  5580. /**
  5581. * @see https://developer.chrome.com/extensions/windows.html
  5582. * @constructor
  5583. */
  5584. function ChromeWindow() {}
  5585. /** @type {number} */
  5586. ChromeWindow.prototype.id;
  5587. /** @type {boolean} */
  5588. ChromeWindow.prototype.focused;
  5589. /** @type {number} */
  5590. ChromeWindow.prototype.top;
  5591. /** @type {number} */
  5592. ChromeWindow.prototype.left;
  5593. /** @type {number} */
  5594. ChromeWindow.prototype.width;
  5595. /** @type {number} */
  5596. ChromeWindow.prototype.height;
  5597. /** @type {Array<Tab>} */
  5598. ChromeWindow.prototype.tabs;
  5599. /** @type {boolean} */
  5600. ChromeWindow.prototype.incognito;
  5601. /** @type {string} */
  5602. ChromeWindow.prototype.type;
  5603. /** @type {string} */
  5604. ChromeWindow.prototype.state;
  5605. /** @type {boolean} */
  5606. ChromeWindow.prototype.alwaysOnTop;
  5607. /**
  5608. * @see http://developer.chrome.com/extensions/pushMessaging.html
  5609. * @const
  5610. */
  5611. chrome.pushMessaging = {};
  5612. /**
  5613. * @type {!chrome.pushMessaging.PushMessageEvent}
  5614. */
  5615. chrome.pushMessaging.onMessage;
  5616. /**
  5617. * @param {boolean|function(!chrome.pushMessaging.ChannelIdResult)}
  5618. * interactiveOrCallback Either a flag(optional), if set to true, user will
  5619. * be asked to log in if they are not already logged in, or, when he flag is
  5620. * not given, the callback.
  5621. * @param {function(!chrome.pushMessaging.ChannelIdResult)=} opt_callback
  5622. * Callback.
  5623. * @return {undefined}
  5624. */
  5625. chrome.pushMessaging.getChannelId = function(
  5626. interactiveOrCallback, opt_callback) {};
  5627. /**
  5628. * Event whose listeners take a chrome.pushMessaging.Message parameter.
  5629. * @interface
  5630. * @extends {ChromeBaseEvent<function(!chrome.pushMessaging.Message)>}
  5631. */
  5632. chrome.pushMessaging.PushMessageEvent = function() {};
  5633. /**
  5634. * @see https://developer.chrome.com/extensions/bookmarks.html#type-BookmarkTreeNode
  5635. * @constructor
  5636. */
  5637. function BookmarkTreeNode() {}
  5638. /** @type {string} */
  5639. BookmarkTreeNode.prototype.id;
  5640. /** @type {string|undefined} */
  5641. BookmarkTreeNode.prototype.parentId;
  5642. /** @type {number|undefined} */
  5643. BookmarkTreeNode.prototype.index;
  5644. /** @type {string|undefined} */
  5645. BookmarkTreeNode.prototype.url;
  5646. /** @type {string} */
  5647. BookmarkTreeNode.prototype.title;
  5648. /** @type {number|undefined} */
  5649. BookmarkTreeNode.prototype.dateAdded;
  5650. /** @type {number|undefined} */
  5651. BookmarkTreeNode.prototype.dateGroupModified;
  5652. /** @type {string|undefined} */
  5653. BookmarkTreeNode.prototype.unmodifiable;
  5654. /** @type {!Array<!BookmarkTreeNode>|undefined} */
  5655. BookmarkTreeNode.prototype.children;
  5656. /**
  5657. * @see https://developer.chrome.com/extensions/dev/cookies.html#type-Cookie
  5658. * @constructor
  5659. */
  5660. function Cookie() {}
  5661. /** @type {string} */
  5662. Cookie.prototype.name;
  5663. /** @type {string} */
  5664. Cookie.prototype.value;
  5665. /** @type {string} */
  5666. Cookie.prototype.domain;
  5667. /** @type {boolean} */
  5668. Cookie.prototype.hostOnly;
  5669. /** @type {string} */
  5670. Cookie.prototype.path;
  5671. /** @type {boolean} */
  5672. Cookie.prototype.secure;
  5673. /** @type {boolean} */
  5674. Cookie.prototype.httpOnly;
  5675. /** @type {boolean} */
  5676. Cookie.prototype.session;
  5677. /** @type {number} */
  5678. Cookie.prototype.expirationDate;
  5679. /** @type {string} */
  5680. Cookie.prototype.storeId;
  5681. /**
  5682. * @see https://developer.chrome.com/extensions/dev/cookies.html#type-CookieStore
  5683. * @constructor
  5684. */
  5685. function CookieStore() {}
  5686. /** @type {string} */
  5687. CookieStore.prototype.id;
  5688. /** @type {Array<number>} */
  5689. CookieStore.prototype.tabIds;
  5690. /**
  5691. * @see https://developer.chrome.com/docs/extensions/reference/contextMenus/#type-OnClickData
  5692. * @constructor
  5693. */
  5694. function OnClickData() {}
  5695. /** @type {number|string} */
  5696. OnClickData.prototype.menuItemId;
  5697. /** @type {number|string} */
  5698. OnClickData.prototype.parentMenuItemId;
  5699. /** @type {string} */
  5700. OnClickData.prototype.mediaType;
  5701. /** @type {string} */
  5702. OnClickData.prototype.linkUrl;
  5703. /** @type {string} */
  5704. OnClickData.prototype.srcUrl;
  5705. /** @type {string} */
  5706. OnClickData.prototype.pageUrl;
  5707. /** @type {string} */
  5708. OnClickData.prototype.frameUrl;
  5709. /** @type {number} */
  5710. OnClickData.prototype.frameId;
  5711. /** @type {string} */
  5712. OnClickData.prototype.selectionText;
  5713. /** @type {boolean} */
  5714. OnClickData.prototype.editable;
  5715. /** @type {boolean} */
  5716. OnClickData.prototype.wasChecked;
  5717. /** @type {boolean} */
  5718. OnClickData.prototype.checked;
  5719. /**
  5720. * @see https://developer.chrome.com/extensions/debugger.html#type-Debuggee
  5721. * @constructor
  5722. */
  5723. function Debuggee() {}
  5724. /** @type {number} */
  5725. Debuggee.prototype.tabId;
  5726. /**
  5727. * @see https://developer.chrome.com/extensions/contentSettings.html#type-ResourceIdentifier
  5728. * @constructor
  5729. */
  5730. function ResourceIdentifier() {}
  5731. /** @type {string} */
  5732. ResourceIdentifier.prototype.id;
  5733. /** @type {string} */
  5734. ResourceIdentifier.prototype.description;
  5735. /**
  5736. * @see https://developer.chrome.com/extensions/contentSettings.html#type-ContentSetting
  5737. * @constructor
  5738. */
  5739. function ContentSetting() {}
  5740. /**
  5741. * @param {!Object<string,string>} details Settings details.
  5742. * @param {function(): void=} opt_callback Callback function.
  5743. * @return {undefined}
  5744. */
  5745. ContentSetting.prototype.clear = function(details, opt_callback) {};
  5746. /**
  5747. * @param {!Object<string,(string|boolean|ResourceIdentifier)>} details
  5748. * Settings details.
  5749. * @param {function({setting: *}): void} callback Callback function.
  5750. * @return {undefined}
  5751. */
  5752. ContentSetting.prototype.get = function(details, callback) {};
  5753. /**
  5754. * @param {function(): void} callback Callback function.
  5755. * @return {undefined}
  5756. */
  5757. ContentSetting.prototype.getResourceIdentifiers = function(callback) {};
  5758. /**
  5759. * @param {!Object<string,(string|ResourceIdentifier)>} details
  5760. * Settings details.
  5761. * @param {function(): void=} opt_callback Callback function.
  5762. * @return {undefined}
  5763. */
  5764. ContentSetting.prototype.set = function(details, opt_callback) {};
  5765. /**
  5766. * @see https://developer.chrome.com/extensions/history.html#type-HistoryItem
  5767. * @constructor
  5768. */
  5769. function HistoryItem() {}
  5770. /** @type {string} */
  5771. HistoryItem.prototype.id;
  5772. /** @type {string} */
  5773. HistoryItem.prototype.url;
  5774. /** @type {string} */
  5775. HistoryItem.prototype.title;
  5776. /** @type {number} */
  5777. HistoryItem.prototype.lastVisitTime;
  5778. /** @type {number} */
  5779. HistoryItem.prototype.visitCount;
  5780. /** @type {number} */
  5781. HistoryItem.prototype.typedCount;
  5782. /**
  5783. * @see https://developer.chrome.com/extensions/history.html#type-VisitItem
  5784. * @constructor
  5785. */
  5786. function VisitItem() {}
  5787. /** @type {string} */
  5788. VisitItem.prototype.id;
  5789. /** @type {string} */
  5790. VisitItem.prototype.visitId;
  5791. /** @type {number} */
  5792. VisitItem.prototype.visitTime;
  5793. /** @type {string} */
  5794. VisitItem.prototype.referringVisitId;
  5795. /** @type {string} */
  5796. VisitItem.prototype.transition;
  5797. /**
  5798. * @see https://developer.chrome.com/extensions/fileBrowserHandler.html#type-FileHandlerExecuteEventDetails
  5799. * @constructor
  5800. */
  5801. function FileHandlerExecuteEventDetails() {}
  5802. /** @type {!Array<!FileEntry>} */
  5803. FileHandlerExecuteEventDetails.prototype.entries;
  5804. /** @type {number|undefined} */
  5805. FileHandlerExecuteEventDetails.prototype.tab_id;
  5806. /**
  5807. * @see https://developer.chrome.com/extensions/input.ime.html#type-KeyboardEvent
  5808. * @constructor
  5809. */
  5810. function ChromeKeyboardEvent() {}
  5811. /** @type {string} */
  5812. ChromeKeyboardEvent.prototype.type;
  5813. /** @type {string} */
  5814. ChromeKeyboardEvent.prototype.requestId;
  5815. /** @type {string|undefined} */
  5816. ChromeKeyboardEvent.prototype.extensionId;
  5817. /** @type {string} */
  5818. ChromeKeyboardEvent.prototype.key;
  5819. /** @type {string} */
  5820. ChromeKeyboardEvent.prototype.code;
  5821. /** @type {number|undefined} */
  5822. ChromeKeyboardEvent.prototype.keyCode;
  5823. /** @type {boolean|undefined} */
  5824. ChromeKeyboardEvent.prototype.altKey;
  5825. /** @type {boolean|undefined} */
  5826. ChromeKeyboardEvent.prototype.altgrKey;
  5827. /** @type {boolean|undefined} */
  5828. ChromeKeyboardEvent.prototype.ctrlKey;
  5829. /** @type {boolean|undefined} */
  5830. ChromeKeyboardEvent.prototype.shiftKey;
  5831. /** @type {boolean|undefined} */
  5832. ChromeKeyboardEvent.prototype.capsLock;
  5833. /**
  5834. * @see https://developer.chrome.com/extensions/input.ime.html#type-InputContext
  5835. * @constructor
  5836. */
  5837. chrome.input.ime.InputContext = function() {};
  5838. /** @type {number} */
  5839. chrome.input.ime.InputContext.prototype.contextID;
  5840. /** @type {string} */
  5841. chrome.input.ime.InputContext.prototype.type;
  5842. /** @type {boolean} */
  5843. chrome.input.ime.InputContext.prototype.autoCorrect;
  5844. /** @type {boolean} */
  5845. chrome.input.ime.InputContext.prototype.autoComplete;
  5846. /** @type {string} */
  5847. chrome.input.ime.InputContext.prototype.autoCapitalize;
  5848. /** @type {boolean} */
  5849. chrome.input.ime.InputContext.prototype.spellCheck;
  5850. /** @type {boolean} */
  5851. chrome.input.ime.InputContext.prototype.shouldDoLearning;
  5852. /**
  5853. * @see https://developer.chrome.com/extensions/proxy.html#type-ProxyServer
  5854. * @constructor
  5855. */
  5856. function ProxyServer() {}
  5857. /** @type {string} */
  5858. ProxyServer.prototype.scheme;
  5859. /** @type {string} */
  5860. ProxyServer.prototype.host;
  5861. /** @type {number} */
  5862. ProxyServer.prototype.port;
  5863. /**
  5864. * @see https://developer.chrome.com/extensions/proxy.html#type-ProxyRules
  5865. * @constructor
  5866. */
  5867. function ProxyRules() {}
  5868. /** @type {ProxyServer} */
  5869. ProxyRules.prototype.singleProxy;
  5870. /** @type {ProxyServer} */
  5871. ProxyRules.prototype.proxyForHttp;
  5872. /** @type {ProxyServer} */
  5873. ProxyRules.prototype.proxyForHttps;
  5874. /** @type {ProxyServer} */
  5875. ProxyRules.prototype.proxyForFtp;
  5876. /** @type {ProxyServer} */
  5877. ProxyRules.prototype.fallbackProxy;
  5878. /** @type {!Array<string>} */
  5879. ProxyRules.prototype.bypassList;
  5880. /**
  5881. * @see https://developer.chrome.com/extensions/proxy.html#type-PacScript
  5882. * @constructor
  5883. */
  5884. function PacScript() {}
  5885. /** @type {string} */
  5886. PacScript.prototype.url;
  5887. /** @type {string} */
  5888. PacScript.prototype.data;
  5889. /** @type {boolean} */
  5890. PacScript.prototype.mandatory;
  5891. /**
  5892. * @see https://developer.chrome.com/extensions/proxy.html#type-ProxyConfig
  5893. * @constructor
  5894. */
  5895. function ProxyConfig() {}
  5896. /** @type {ProxyRules} */
  5897. ProxyConfig.prototype.rules;
  5898. /** @type {PacScript} */
  5899. ProxyConfig.prototype.pacScript;
  5900. /** @type {string} */
  5901. ProxyConfig.prototype.mode;
  5902. /**
  5903. * The event listener for Storage receives an Object mapping each
  5904. * key that changed to its corresponding StorageChange for that item.
  5905. *
  5906. * Listener will receive an object that maps each key to its StorageChange,
  5907. * and the namespace ("sync" or "local") of the storage area the changes
  5908. * are for.
  5909. * @see https://developer.chrome.com/extensions/storage#event-onChanged
  5910. * @interface
  5911. * @extends {ChromeBaseEvent<function(!Object<string, !StorageChange>, string)>}
  5912. */
  5913. function StorageChangeEvent() {}
  5914. /**
  5915. * The event listener for StorageArea receives an Object mapping each
  5916. * key that changed to its corresponding StorageChange for that item.
  5917. *
  5918. * Listener will receive an object that maps each key to its StorageChange.
  5919. * @see https://developer.chrome.com/extensions/storage#type-StorageArea
  5920. * @interface
  5921. * @extends {ChromeBaseEvent<function(!Object<string, !StorageChange>)>}
  5922. */
  5923. function StorageAreaChangeEvent() {}
  5924. /**
  5925. * @see https://developer.chrome.com/extensions/storage.html#type-StorageChange
  5926. * @constructor
  5927. */
  5928. function StorageChange() {}
  5929. /** @type {?} */
  5930. StorageChange.prototype.oldValue;
  5931. /** @type {?} */
  5932. StorageChange.prototype.newValue;
  5933. /**
  5934. * @see https://developer.chrome.com/extensions/storage.html#type-StorageArea
  5935. * @constructor
  5936. */
  5937. function StorageArea() {}
  5938. /**
  5939. * @param {(string|!Array<string>|!Object|null|function(!Object))=}
  5940. * keysOrCallback
  5941. * A single key to get, list of keys to get, or a dictionary
  5942. * specifying default values (see description of the
  5943. * object). An empty list or object will return an empty
  5944. * result object. Pass in null to get the entire contents of storage.
  5945. * @param {function(!Object)=} opt_callback Callback with storage items, or null
  5946. * on failure.
  5947. * @return {undefined}
  5948. */
  5949. StorageArea.prototype.get = function(keysOrCallback, opt_callback) {};
  5950. /**
  5951. * @param {(string|!Array<string>|null|function(!Object))=} keysOrCallback
  5952. * A single key or list of keys to get the total usage for. An empty list
  5953. * will return 0. Pass in null to get the total usage of all of storage.
  5954. * @param {function(number)=} opt_callback
  5955. * Callback with the amount of space being used by storage.
  5956. * @return {undefined}
  5957. */
  5958. StorageArea.prototype.getBytesInUse = function(keysOrCallback, opt_callback) {};
  5959. /**
  5960. * @param {!Object<string>} items
  5961. * Object specifying items to augment storage
  5962. * with. Values that cannot be serialized (functions, etc) will be ignored.
  5963. * @param {function()=} opt_callback Callback.
  5964. * @return {undefined}
  5965. */
  5966. StorageArea.prototype.set = function(items, opt_callback) {};
  5967. /**
  5968. * @param {(string|!Array<string>)} keys
  5969. * A single key or a list of keys for items to remove.
  5970. * @param {function()=} opt_callback Callback.
  5971. * @return {undefined}
  5972. */
  5973. StorageArea.prototype.remove = function(keys, opt_callback) {};
  5974. /**
  5975. * Removes all items from storage.
  5976. * @param {function(): void=} opt_callback Callback function.
  5977. * @return {undefined}
  5978. */
  5979. StorageArea.prototype.clear = function(opt_callback) {};
  5980. /**
  5981. * Fired when one or more items change.
  5982. * @type {!StorageAreaChangeEvent}
  5983. */
  5984. StorageArea.prototype.onChanged;
  5985. /**
  5986. * @see https://developer.chrome.com/extensions/types.html#type-ChromeSetting
  5987. * @constructor
  5988. */
  5989. function ChromeSetting() {}
  5990. /**
  5991. * @param {Object} details Object with a 'scope' (string) key.
  5992. * @param {function(): void=} opt_callback Callback function.
  5993. * @return {undefined}
  5994. */
  5995. ChromeSetting.prototype.clear = function(details, opt_callback) {};
  5996. /**
  5997. * @param {Object} details Object with an 'incognito' (boolean) key.
  5998. * @param {function(Object<string, *>): void} callback Callback function.
  5999. * @return {undefined}
  6000. */
  6001. ChromeSetting.prototype.get = function(details, callback) {};
  6002. /**
  6003. * @param {Object} details Object with a 'value' (*) key and an optional
  6004. * 'scope' (string) key.
  6005. * @param {function(): void=} opt_callback Callback function.
  6006. * @return {undefined}
  6007. */
  6008. ChromeSetting.prototype.set = function(details, opt_callback) {};
  6009. /** @type {!ChromeObjectEvent} */
  6010. ChromeSetting.prototype.onChange;
  6011. /**
  6012. * @see https://developer.chrome.com/extensions/webRequest#type-RequestFilter
  6013. * @typedef {?{
  6014. * urls: !Array<string>,
  6015. * types: (!Array<string>|undefined),
  6016. * tabId: (number|undefined),
  6017. * windowId: (number|undefined),
  6018. * }}
  6019. */
  6020. var RequestFilter;
  6021. /**
  6022. * @see https://developer.chrome.com/extensions/webRequest#type-HttpHeaders
  6023. * @typedef {?{
  6024. * name: string,
  6025. * value: (string|undefined),
  6026. * binaryValue: (!Array<number>|undefined),
  6027. * }}
  6028. */
  6029. var HttpHeader;
  6030. /**
  6031. * @see https://developer.chrome.com/extensions/webRequest#type-HttpHeaders
  6032. * @typedef {?Array<!HttpHeader>}
  6033. */
  6034. chrome.webRequest.HttpHeaders;
  6035. /**
  6036. * @see https://developer.chrome.com/extensions/webRequest#type-BlockingResponse
  6037. * @typedef {?{
  6038. * cancel: (boolean|undefined),
  6039. * redirectUrl: (string|undefined),
  6040. * requestHeaders: (!chrome.webRequest.HttpHeaders|undefined),
  6041. * responseHeaders: (!chrome.webRequest.HttpHeaders|undefined),
  6042. * authCredentials: (!{username: string, password: string}|undefined),
  6043. * }}
  6044. */
  6045. var BlockingResponse;
  6046. /**
  6047. * @see http://developer.chrome.com/extensions/pushMessaging.html#type-Message
  6048. * @constructor
  6049. */
  6050. chrome.pushMessaging.Message = function() {};
  6051. /**
  6052. * @type {number}
  6053. */
  6054. chrome.pushMessaging.Message.prototype.subchannelId;
  6055. /**
  6056. * @type {string}
  6057. */
  6058. chrome.pushMessaging.Message.prototype.payload;
  6059. /**
  6060. * @see http://developer.chrome.com/extensions/pushMessaging.html#type-ChannelIdResult
  6061. * @constructor
  6062. */
  6063. chrome.pushMessaging.ChannelIdResult = function() {};
  6064. /**
  6065. * @type {string}
  6066. */
  6067. chrome.pushMessaging.ChannelIdResult.prototype.channelId;
  6068. /**
  6069. * The `chrome.fileSystem` API makes use of the Entry and FileEntry types
  6070. * defined in {@code javascript/externs/fileapi.js}.
  6071. * @const
  6072. * @see http://developer.chrome.com/apps/fileSystem.html
  6073. */
  6074. chrome.fileSystem = {};
  6075. /**
  6076. * @param {!Entry} entry The entry to get the display path for. The entry can
  6077. * originally be obtained through
  6078. * `chrome.fileSystem.chooseEntry` or
  6079. * `chrome.fileSystem.restoreEntry`.
  6080. * @param {function(string)} callback A success callback.
  6081. * @see http://developer.chrome.com/apps/fileSystem.html#method-getDisplayPath
  6082. * @return {undefined}
  6083. */
  6084. chrome.fileSystem.getDisplayPath = function(entry, callback) {};
  6085. /**
  6086. * @param {!Entry} entry The entry to get a writable entry for.
  6087. * @param {function(!Entry)} callback A success callback.
  6088. * @see http://developer.chrome.com/apps/fileSystem.html#method-getWritableEntry
  6089. * @return {undefined}
  6090. */
  6091. chrome.fileSystem.getWritableEntry = function(entry, callback) {};
  6092. /**
  6093. * @param {!Entry} entry The entry to query writability.
  6094. * @param {function(boolean)} callback A success callback.
  6095. * @see http://developer.chrome.com/apps/fileSystem.html#method-isWritableEntry
  6096. * @return {undefined}
  6097. */
  6098. chrome.fileSystem.isWritableEntry = function(entry, callback) {};
  6099. /**
  6100. * @typedef {{
  6101. * description: (string|undefined),
  6102. * mimeTypes: (!Array<string>|undefined),
  6103. * extensions: (!Array<string>|undefined)
  6104. * }}
  6105. * @see http://developer.chrome.com/apps/fileSystem.html#method-chooseEntry
  6106. */
  6107. chrome.fileSystem.AcceptsOption;
  6108. /**
  6109. * @typedef {{
  6110. * type: (string|undefined),
  6111. * suggestedName: (string|undefined),
  6112. * accepts: (!Array<!chrome.fileSystem.AcceptsOption>|undefined),
  6113. * acceptsAllTypes: (boolean|undefined),
  6114. * acceptsMultiple: (boolean|undefined)
  6115. * }}
  6116. * @see http://developer.chrome.com/apps/fileSystem.html#method-chooseEntry
  6117. */
  6118. chrome.fileSystem.ChooseEntryOptions;
  6119. /**
  6120. * @typedef {?{
  6121. * volumeId: string,
  6122. * writable: (boolean|undefined)
  6123. * }}
  6124. * @see http://developer.chrome.com/apps/fileSystem.html#method-requestFileSystem
  6125. */
  6126. chrome.fileSystem.RequestFileSystemOptions;
  6127. /**
  6128. * @see http://developer.chrome.com/apps/fileSystem.html#method-getVolumeList
  6129. * @constructor
  6130. */
  6131. chrome.fileSystem.Volume = function() {};
  6132. /** @type {string} */
  6133. chrome.fileSystem.Volume.prototype.volumeId;
  6134. /** @type {boolean} */
  6135. chrome.fileSystem.Volume.prototype.writable;
  6136. /**
  6137. * @param {!chrome.fileSystem.ChooseEntryOptions|
  6138. * function(Entry=, !Array<!FileEntry>=)} optionsOrCallback The
  6139. * options for the file prompt or the callback.
  6140. * @param {function(Entry=, !Array<!FileEntry>=)=} opt_callback A success
  6141. * callback, if arg1 is options.
  6142. * @see http://developer.chrome.com/apps/fileSystem.html#method-chooseEntry
  6143. * @return {undefined}
  6144. */
  6145. chrome.fileSystem.chooseEntry = function(optionsOrCallback, opt_callback) {};
  6146. /**
  6147. * @param {string} id The ID of the file entry to restore.
  6148. * @param {function(!Entry)} callback A success callback.
  6149. * @see http://developer.chrome.com/apps/fileSystem.html#method-restoreEntry
  6150. * @return {undefined}
  6151. */
  6152. chrome.fileSystem.restoreEntry = function(id, callback) {};
  6153. /**
  6154. * @param {string} id The ID of the file entry to query restorability.
  6155. * @param {function(boolean)} callback A success callback.
  6156. * @see http://developer.chrome.com/apps/fileSystem.html#method-isRestorable
  6157. * @return {undefined}
  6158. */
  6159. chrome.fileSystem.isRestorable = function(id, callback) {};
  6160. /**
  6161. * @param {!Entry} entry The entry to regain access to.
  6162. * @return {string} The ID that can be passed to restoreEntry to regain access
  6163. * to the given file entry.
  6164. * @see http://developer.chrome.com/apps/fileSystem.html#method-retainEntry
  6165. */
  6166. chrome.fileSystem.retainEntry = function(entry) {};
  6167. /**
  6168. * @param {!chrome.fileSystem.RequestFileSystemOptions} options Options for the
  6169. * request.
  6170. * @param {function(!FileSystem=)} callback A completion callback with the file
  6171. * system in case of a success. Otherwise the error is passed as
  6172. * chrome.runtime.lastError.
  6173. * @see http://developer.chrome.com/apps/fileSystem.html#method-requestFileSystem
  6174. * @return {undefined}
  6175. */
  6176. chrome.fileSystem.requestFileSystem = function(options, callback) {};
  6177. /**
  6178. * @param {function(!Array<!chrome.fileSystem.Volume>=)} callback A completion
  6179. * callback with the file system list in case of a success. Otherwise the
  6180. * error is passed as chrome.runtime.lastError.
  6181. * @see http://developer.chrome.com/apps/fileSystem.html#method-getVolumeList
  6182. * @return {undefined}
  6183. */
  6184. chrome.fileSystem.getVolumeList = function(callback) {};
  6185. /**
  6186. * @const
  6187. * @see https://developer.chrome.com/apps/syncFileSystem
  6188. */
  6189. chrome.syncFileSystem = {};
  6190. /**
  6191. * Returns a syncable filesystem backed by Google Drive. The returned
  6192. * DOMFileSystem instance can be operated on in the same way as
  6193. * the Temporary and Persistent file systems (see
  6194. * http://www.w3.org/TR/file-system-api/), except that the filesystem
  6195. * object returned for Sync FileSystem does NOT support directory
  6196. * operations (yet). You can get a list of file entries by reading
  6197. * the root directory (by creating a new DirectoryReader),
  6198. * but cannot create a new directory in it.
  6199. *
  6200. * <p>Calling this multiple times from the same app will return the same
  6201. * handle to the same file system.
  6202. *
  6203. * <p>Note this call can fail. For example, if the user is not signed in
  6204. * to Chrome or if there is no network operation. To handle these errors
  6205. * it is important chrome.runtime.lastError is checked in the callback.
  6206. *
  6207. * @param {function(!FileSystem)} callback A callback type for
  6208. * requestFileSystem.
  6209. * @see https://developer.chrome.com/apps/syncFileSystem#method-requestFileSystem
  6210. * @return {undefined}
  6211. */
  6212. chrome.syncFileSystem.requestFileSystem = function(callback) {};
  6213. /**
  6214. * Sets the default conflict resolution policy for the 'syncable' file
  6215. * storage for the app. By default it is set to 'last_write_win'.
  6216. * When conflict resolution policy is set to 'last_write_win' conflicts
  6217. * for existing files are automatically resolved next time the file is updated.
  6218. * `callback` can be optionally given to know if the request has
  6219. * succeeded or not.
  6220. *
  6221. * @param {string} policy Any of 'last_write_win' or 'manual'
  6222. * @param {function()=} opt_callback
  6223. *
  6224. * @see https://developer.chrome.com/apps/syncFileSystem#method-setConflictResolutionPolicy
  6225. * @return {undefined}
  6226. */
  6227. chrome.syncFileSystem.setConflictResolutionPolicy = function(
  6228. policy, opt_callback) {};
  6229. /**
  6230. * Gets the current conflict resolution policy.
  6231. *
  6232. * @param {function(string)} callback Accepting any of 'last_write_win'
  6233. * or 'manual'.
  6234. * @see https://developer.chrome.com/apps/syncFileSystem#method-getConflictResolutionPolicy
  6235. * @return {undefined}
  6236. */
  6237. chrome.syncFileSystem.getConflictResolutionPolicy = function(callback) {};
  6238. /**
  6239. * Returns the current usage and quota in bytes for the 'syncable' file
  6240. * storage for the app.
  6241. *
  6242. * @param {!FileSystem} fileSystem
  6243. * @param {function(!Object)} callback Taking an object substantially similar
  6244. * to {@code {'usageBytes': number, quotaBytes: number}}.
  6245. * @see https://developer.chrome.com/apps/syncFileSystem#method-getUsageAndQuota
  6246. * @return {undefined}
  6247. */
  6248. chrome.syncFileSystem.getUsageAndQuota = function(fileSystem, callback) {};
  6249. /**
  6250. * Returns the FileStatus for the given fileEntry. The status value can be
  6251. * 'synced', 'pending' or 'conflicting'. Note that 'conflicting' state only
  6252. * happens when the service's conflict resolution policy is set to 'manual'.
  6253. *
  6254. * @param {!Entry} fileEntry
  6255. * @param {function(string)} callback Called with any of 'synced', 'pending'
  6256. * or 'conflicting'.
  6257. *
  6258. * @see https://developer.chrome.com/apps/syncFileSystem#method-getFileStatus
  6259. * @return {undefined}
  6260. */
  6261. chrome.syncFileSystem.getFileStatus = function(fileEntry, callback) {};
  6262. /**
  6263. * Returns each FileStatus for the given fileEntry array. Typically called
  6264. * with the result from dirReader.readEntries().
  6265. *
  6266. * @param {!Array<!FileEntry>} fileEntries
  6267. * @param {function(!Array<!Object>)} callback Each object will look like:
  6268. * {@code {'fileEntry': Entry, 'status': string, 'error': string?}}.
  6269. *
  6270. * @see https://developer.chrome.com/apps/syncFileSystem#method-getFileStatuses
  6271. * @return {undefined}
  6272. */
  6273. chrome.syncFileSystem.getFileStatuses = function(fileEntries, callback) {};
  6274. /**
  6275. * Since Chrome 31.
  6276. *
  6277. * <p>Returns the current sync backend status.
  6278. *
  6279. * @param {function(string)} callback Arg is any of 'initializing', 'running',
  6280. * 'authentication_required', 'temporary_unavailable', or 'disabled'.
  6281. *
  6282. * @see https://developer.chrome.com/apps/syncFileSystem#method-getServiceStatus
  6283. * @return {undefined}
  6284. */
  6285. chrome.syncFileSystem.getServiceStatus = function(callback) {};
  6286. /**
  6287. * Fired when an error or other status change has happened in the sync
  6288. * backend (for example, when the sync is temporarily disabled due
  6289. * to network or authentication error).
  6290. *
  6291. * @type {!ChromeObjectEvent}
  6292. *
  6293. * @see https://developer.chrome.com/apps/syncFileSystem#event-onServiceStatusChanged
  6294. */
  6295. chrome.syncFileSystem.onServiceStatusChanged;
  6296. /**
  6297. * Fired when a file has been updated by the background sync service.
  6298. *
  6299. * @type {!ChromeObjectEvent}
  6300. *
  6301. * @see https://developer.chrome.com/apps/syncFileSystem#event-onFileStatusChanged
  6302. */
  6303. chrome.syncFileSystem.onFileStatusChanged;
  6304. /**
  6305. * @const
  6306. * @see http://developer.chrome.com/extensions/alarms.html
  6307. */
  6308. chrome.alarms = {};
  6309. /**
  6310. * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event
  6311. * is fired. If there is another alarm with the same name (or no name if none is
  6312. * specified), it will be cancelled and replaced by this alarm.
  6313. * @param {string|!chrome.alarms.AlarmCreateInfo} nameOrAlarmCreateInfo Either
  6314. * the name to identify this alarm or the info used to create the alarm. If
  6315. * no name is passed, the empty string is used to identify the alarm.
  6316. * @param {!chrome.alarms.AlarmCreateInfo=} opt_alarmInfo If a name was passed
  6317. * as arg1, the info used to create the alarm.
  6318. * @see http://developer.chrome.com/extensions/alarms.html#method-create
  6319. * @return {undefined}
  6320. */
  6321. chrome.alarms.create = function(nameOrAlarmCreateInfo, opt_alarmInfo) {};
  6322. /**
  6323. * Retrieves details about the specified alarm.
  6324. * @param {string|function(!chrome.alarms.Alarm)} nameOrCallback The name
  6325. * of the alarm to get or the callback to invoke with the alarm. If no name
  6326. * is passed, the empty string is used to get the alarm.
  6327. * @param {function(!chrome.alarms.Alarm)=} opt_callback If a name was passed
  6328. * as arg1, the callback to invoke with the alarm.
  6329. * @see http://developer.chrome.com/extensions/alarms.html#method-get
  6330. * @return {undefined}
  6331. */
  6332. chrome.alarms.get = function(nameOrCallback, opt_callback) {};
  6333. /**
  6334. * Gets an array of all the alarms.
  6335. * @param {function(!Array<!chrome.alarms.Alarm>)} callback
  6336. * @see http://developer.chrome.com/extensions/alarms.html#method-getAll
  6337. * @return {undefined}
  6338. */
  6339. chrome.alarms.getAll = function(callback) {};
  6340. /**
  6341. * Clears the alarm with the given name.
  6342. * @param {string=} opt_name
  6343. * @param {function(boolean)=} opt_callback A callback that will be called with
  6344. * a boolean for whether the alarm was cleared.
  6345. * @see http://developer.chrome.com/extensions/alarms.html#method-clear
  6346. * @return {undefined}
  6347. */
  6348. chrome.alarms.clear = function(opt_name, opt_callback) {};
  6349. /**
  6350. * Clears all alarms.
  6351. * @param {function(boolean)=} opt_callback A callback that will be called with
  6352. * a boolean for whether the alarms were cleared.
  6353. * @see http://developer.chrome.com/extensions/alarms.html#method-clearAll
  6354. * @return {undefined}
  6355. */
  6356. chrome.alarms.clearAll = function(opt_callback) {};
  6357. /**
  6358. * Fired when an alarm has elapsed. Useful for event pages.
  6359. * @type {!chrome.alarms.AlarmEvent}
  6360. * @see http://developer.chrome.com/extensions/alarms.html#event-onAlarm
  6361. */
  6362. chrome.alarms.onAlarm;
  6363. /**
  6364. * @interface
  6365. * @extends {ChromeBaseEvent<function(!chrome.alarms.Alarm)>}
  6366. */
  6367. chrome.alarms.AlarmEvent = function() {};
  6368. /**
  6369. * @interface
  6370. * @see http://developer.chrome.com/extensions/alarms.html#type-Alarm
  6371. */
  6372. chrome.alarms.Alarm = function() {};
  6373. /**
  6374. * Name of this alarm.
  6375. * @type {string}
  6376. */
  6377. chrome.alarms.Alarm.prototype.name;
  6378. /**
  6379. * Time at which this alarm was scheduled to fire, in milliseconds past the
  6380. * epoch (e.g. Date.now() + n). For performance reasons, the alarm may have been
  6381. * delayed an arbitrary amount beyond this.
  6382. * @type {number}
  6383. */
  6384. chrome.alarms.Alarm.prototype.scheduledTime;
  6385. /**
  6386. * If not null, the alarm is a repeating alarm and will fire again in
  6387. * periodInMinutes minutes.
  6388. * @type {?number}
  6389. */
  6390. chrome.alarms.Alarm.prototype.periodInMinutes;
  6391. /**
  6392. * @typedef {{
  6393. * when: (number|undefined),
  6394. * delayInMinutes: (number|undefined),
  6395. * periodInMinutes: (number|undefined)
  6396. * }}
  6397. * @see http://developer.chrome.com/extensions/alarms.html#method-create
  6398. */
  6399. chrome.alarms.AlarmCreateInfo;
  6400. /**
  6401. * @see https://developer.chrome.com/apps/hid
  6402. * @const
  6403. */
  6404. chrome.hid = {};
  6405. /**
  6406. * @constructor
  6407. * @see https://developer.chrome.com/apps/hid#type-DeviceFilter
  6408. */
  6409. chrome.hid.DeviceFilter = function() {};
  6410. /**
  6411. * Device vendor ID.
  6412. * @type {number|undefined}
  6413. */
  6414. chrome.hid.DeviceFilter.prototype.vendorId;
  6415. /**
  6416. * Device product ID, only checked if the vendor ID matches.
  6417. * @type {number|undefined}
  6418. */
  6419. chrome.hid.DeviceFilter.prototype.productId;
  6420. /**
  6421. * HID usage page identifier.
  6422. * @type {number|undefined}
  6423. */
  6424. chrome.hid.DeviceFilter.prototype.usagePage;
  6425. /**
  6426. * HID usage identifier, checked only if the HID usage page matches.
  6427. * @type {number|undefined}
  6428. */
  6429. chrome.hid.DeviceFilter.prototype.usage;
  6430. /**
  6431. * @typedef {?{
  6432. * vendorId: (number|undefined),
  6433. * productId: (number|undefined),
  6434. * filters: (!Array<!chrome.hid.DeviceFilter>|undefined)
  6435. * }}
  6436. * Deprecated since Chrome 39: vendorId, productId
  6437. * Since Chrome 39: filters
  6438. * @see https://developer.chrome.com/apps/hid#method-getDevices
  6439. */
  6440. chrome.hid.HidGetDevicesOptions;
  6441. /**
  6442. * @typedef {?{
  6443. * multiple: (boolean|undefined),
  6444. * filters: (!Array<!chrome.hid.DeviceFilter>|undefined)
  6445. * }}
  6446. * @see https://developer.chrome.com/apps/hid#method-getUserSelectedDevices
  6447. */
  6448. chrome.hid.HidGetUserSelectedDevicesOptions;
  6449. /**
  6450. * @typedef {?{
  6451. * usagePage: number,
  6452. * usage: number,
  6453. * reportIds: !Array<number>
  6454. * }}
  6455. * @see https://developer.chrome.com/apps/hid#method-getDevices
  6456. */
  6457. chrome.hid.HidDeviceUsage;
  6458. /**
  6459. * @constructor
  6460. * @see https://developer.chrome.com/apps/hid#type-HidDeviceInfo
  6461. */
  6462. chrome.hid.HidDeviceInfo = function() {};
  6463. /**
  6464. * Opaque device ID.
  6465. * @type {number}
  6466. */
  6467. chrome.hid.HidDeviceInfo.prototype.deviceId;
  6468. /**
  6469. * Vendor ID.
  6470. * @type {number}
  6471. */
  6472. chrome.hid.HidDeviceInfo.prototype.vendorId;
  6473. /**
  6474. * Product ID.
  6475. * @type {number}
  6476. */
  6477. chrome.hid.HidDeviceInfo.prototype.productId;
  6478. /**
  6479. * The product name read from the device, if available.
  6480. * Since Chrome 46.
  6481. * @type {string}
  6482. */
  6483. chrome.hid.HidDeviceInfo.prototype.productName;
  6484. /**
  6485. * The serial number read from the device, if available.
  6486. * Since Chrome 46.
  6487. * @type {string}
  6488. */
  6489. chrome.hid.HidDeviceInfo.prototype.serialNumber;
  6490. /**
  6491. * Top-level collections from this device's report descriptors.
  6492. * @type {!Array<!chrome.hid.HidDeviceUsage>}
  6493. */
  6494. chrome.hid.HidDeviceInfo.prototype.collections;
  6495. /**
  6496. * Top-level collection's maximum input report size.
  6497. * @type {number}
  6498. */
  6499. chrome.hid.HidDeviceInfo.prototype.maxInputReportSize;
  6500. /**
  6501. * Top-level collection's maximum output report size.
  6502. * @type {number}
  6503. */
  6504. chrome.hid.HidDeviceInfo.prototype.maxOutputReportSize;
  6505. /**
  6506. * Top-level collection's maximum feature report size.
  6507. * @type {number}
  6508. */
  6509. chrome.hid.HidDeviceInfo.prototype.maxFeatureReportSize;
  6510. /**
  6511. * Raw device report descriptor (not available on Windows).
  6512. * Since Chrome 42.
  6513. * @type {!ArrayBuffer}
  6514. */
  6515. chrome.hid.HidDeviceInfo.prototype.reportDescriptor;
  6516. /**
  6517. * @typedef {?{
  6518. * connectionId: number
  6519. * }}
  6520. * @see https://developer.chrome.com/apps/hid#method-connect
  6521. */
  6522. chrome.hid.HidConnectInfo;
  6523. /**
  6524. * @see https://developer.chrome.com/apps/hid#method-getDevices
  6525. * Enumerates all the connected HID devices specified by the
  6526. * vendorId/productId/interfaceId tuple.
  6527. * @param {!chrome.hid.HidGetDevicesOptions} options The properties to search
  6528. * for on target devices.
  6529. * @param {function(!Array<!chrome.hid.HidDeviceInfo>)} callback Invoked with a
  6530. * list of |HidDeviceInfo|s on complete.
  6531. * @return {undefined}
  6532. */
  6533. chrome.hid.getDevices = function(options, callback) {};
  6534. /**
  6535. * @see https://developer.chrome.com/apps/hid#method-getUserSelectedDevices
  6536. * Presents a device picker to the user and returns HidDeviceInfo objects for
  6537. * the devices selected. If the user cancels the picker devices will be empty. A
  6538. * user gesture is required for the dialog to display. Without a user gesture,
  6539. * the callback will run as though the user cancelled. If multiple filters are
  6540. * provided devices matching any filter will be displayed.
  6541. * @param {!chrome.hid.HidGetUserSelectedDevicesOptions} options
  6542. * @param {function(!Array<!chrome.hid.HidDeviceInfo>)} callback Invoked with a
  6543. * list of |HidDeviceInfo|s on complete.
  6544. * @return {undefined}
  6545. */
  6546. chrome.hid.getUserSelectedDevices = function(options, callback) {};
  6547. /**
  6548. * @see https://developer.chrome.com/apps/hid#method-connect
  6549. * Opens a connection to a HID device for communication.
  6550. * @param {number} deviceId The ID of the device to open.
  6551. * @param {function(!Object=)} callback Invoked with an |HidConnectInfo| if the
  6552. * connection succeeds, or undefined if it fails.
  6553. * @return {undefined}
  6554. */
  6555. chrome.hid.connect = function(deviceId, callback) {};
  6556. /**
  6557. * @see https://developer.chrome.com/apps/hid#method-disconnect
  6558. * Disconnects from a device.
  6559. * @param {number} connectionId The connection to close.
  6560. * @param {function()=} opt_callback The callback to invoke once the connection
  6561. * is closed.
  6562. * @return {undefined}
  6563. */
  6564. chrome.hid.disconnect = function(connectionId, opt_callback) {};
  6565. /**
  6566. * @see https://developer.chrome.com/apps/hid#method-receive
  6567. * Receives an input report from an HID device.
  6568. * @param {number} connectionId The connection from which to receive the report.
  6569. * @param {function(number, !ArrayBuffer)} callback The callback to invoke with
  6570. * the received report.
  6571. * @return {undefined}
  6572. */
  6573. chrome.hid.receive = function(connectionId, callback) {};
  6574. /**
  6575. * @see https://developer.chrome.com/apps/hid#method-send
  6576. * Sends an output report to an HID device.
  6577. * @param {number} connectionId The connection to which to send the report.
  6578. * @param {number} reportId The report ID to use, or 0 if none.
  6579. * @param {!ArrayBuffer} data The report data.
  6580. * @param {function()} callback The callback to invoke once the write is
  6581. * finished.
  6582. * @return {undefined}
  6583. */
  6584. chrome.hid.send = function(connectionId, reportId, data, callback) {};
  6585. /**
  6586. * @see https://developer.chrome.com/apps/hid#method-receiveFeatureReport
  6587. * Receives a feature report from the device.
  6588. * @param {number} connectionId The connection from which to read the feature
  6589. * report.
  6590. * @param {number} reportId The report ID to use, or 0 if none.
  6591. * @param {number} size The size of the feature report to receive.
  6592. * @param {function(!ArrayBuffer)} callback The callback to invoke with the
  6593. * received report.
  6594. * @return {undefined}
  6595. */
  6596. chrome.hid.receiveFeatureReport = function(
  6597. connectionId, reportId, size, callback) {};
  6598. /**
  6599. * @see https://developer.chrome.com/apps/hid#method-sendFeatureReport
  6600. * Sends a feature report to the device.
  6601. * @param {number} connectionId The connection to which to send the feature
  6602. * report.
  6603. * @param {number} reportId The report ID to use, or 0 if none.
  6604. * @param {!ArrayBuffer} data The report data.
  6605. * @param {function()} callback The callback to invoke once the write is
  6606. * finished.
  6607. * @return {undefined}
  6608. */
  6609. chrome.hid.sendFeatureReport = function(
  6610. connectionId, reportId, data, callback) {};
  6611. /**
  6612. * Event whose listeners take an HidDeviceInfo parameter.
  6613. * @interface
  6614. * @extends {ChromeBaseEvent<function(!chrome.hid.HidDeviceInfo)>}
  6615. */
  6616. chrome.hid.DeviceAddedEvent = function() {};
  6617. /**
  6618. * @type {!chrome.hid.DeviceAddedEvent}
  6619. * @see https://developer.chrome.com/apps/hid#event-onDeviceAdded
  6620. */
  6621. chrome.hid.onDeviceAdded;
  6622. /**
  6623. * @type {!ChromeNumberEvent}
  6624. * @see https://developer.chrome.com/apps/hid#event-onDeviceRemoved
  6625. */
  6626. chrome.hid.onDeviceRemoved;
  6627. /**
  6628. * @see http://developer.chrome.com/extensions/notifications.html
  6629. * @const
  6630. */
  6631. chrome.notifications = {};
  6632. /**
  6633. * @typedef {{
  6634. * title: string,
  6635. * iconUrl: (string|undefined)
  6636. * }}
  6637. * @see http://developer.chrome.com/extensions/notifications.html#type-NotificationOptions
  6638. */
  6639. chrome.notifications.NotificationButton;
  6640. /**
  6641. * @typedef {{
  6642. * title: string,
  6643. * message: string
  6644. * }}
  6645. * @see http://developer.chrome.com/extensions/notifications.html#type-NotificationOptions
  6646. */
  6647. chrome.notifications.NotificationItem;
  6648. /**
  6649. * @typedef {{
  6650. * type: (string|undefined),
  6651. * iconUrl: (string|undefined),
  6652. * appIconMaskUrl: (string|undefined),
  6653. * title: (string|undefined),
  6654. * message: (string|undefined),
  6655. * contextMessage: (string|undefined),
  6656. * priority: (number|undefined),
  6657. * eventTime: (number|undefined),
  6658. * buttons: (!Array<!chrome.notifications.NotificationButton>|undefined),
  6659. * imageUrl: (string|undefined),
  6660. * items: (!Array<!chrome.notifications.NotificationItem>|undefined),
  6661. * progress: (number|undefined),
  6662. * isClickable: (boolean|undefined),
  6663. * requireInteraction: (boolean|undefined),
  6664. * silent: (boolean|undefined)
  6665. * }}
  6666. * @see http://developer.chrome.com/extensions/notifications.html#type-NotificationOptions
  6667. */
  6668. chrome.notifications.NotificationOptions;
  6669. /**
  6670. * @typedef {function(boolean): void}
  6671. * @see http://developer.chrome.com/extensions/notifications.html#method-update
  6672. * @see http://developer.chrome.com/extensions/notifications.html#method-clear
  6673. */
  6674. chrome.notifications.BooleanCallback;
  6675. /**
  6676. * @typedef {function(!Object): void}
  6677. * @see http://developer.chrome.com/extensions/notifications.html#method-getAll
  6678. */
  6679. chrome.notifications.ObjectCallback;
  6680. /**
  6681. * @typedef {function(string, boolean): void}
  6682. * @see http://developer.chrome.com/extensions/notifications.html#event-onClosed
  6683. */
  6684. chrome.notifications.ClosedCallback;
  6685. /**
  6686. * @typedef {function(string, number): void}
  6687. * @see http://developer.chrome.com/extensions/notifications.html#event-onButtonClicked
  6688. */
  6689. chrome.notifications.ButtonCallback;
  6690. /**
  6691. * @param {string|!chrome.notifications.NotificationOptions}
  6692. * notificationIdOrOptions
  6693. * @param {(!chrome.notifications.NotificationOptions|function(string): void)=}
  6694. * opt_optionsOrCallback
  6695. * @param {(function(string): void)=} opt_callback
  6696. * @see http://developer.chrome.com/extensions/notifications.html#method-create
  6697. * @return {undefined}
  6698. */
  6699. chrome.notifications.create = function(
  6700. notificationIdOrOptions, opt_optionsOrCallback, opt_callback) {};
  6701. /**
  6702. * @param {string} notificationId
  6703. * @param {!chrome.notifications.NotificationOptions} options
  6704. * @param {chrome.notifications.BooleanCallback=} opt_callback
  6705. * @see http://developer.chrome.com/extensions/notifications.html#method-update
  6706. * @return {undefined}
  6707. */
  6708. chrome.notifications.update = function(
  6709. notificationId, options, opt_callback) {};
  6710. /**
  6711. * @param {string} notificationId
  6712. * @param {!chrome.notifications.BooleanCallback=} opt_callback
  6713. * @see http://developer.chrome.com/extensions/notifications.html#method-clear
  6714. * @return {undefined}
  6715. */
  6716. chrome.notifications.clear = function(notificationId, opt_callback) {};
  6717. /**
  6718. * @see http://developer.chrome.com/extensions/notifications.html#method-getAll
  6719. * @param {!chrome.notifications.ObjectCallback} callback
  6720. * @return {undefined}
  6721. */
  6722. chrome.notifications.getAll = function(callback) {};
  6723. /**
  6724. * @see http://developer.chrome.com/extensions/notifications.html#method-getPermissionLevel
  6725. * @param {function(string): void} callback takes 'granted' or 'denied'
  6726. * @return {undefined}
  6727. */
  6728. chrome.notifications.getPermissionLevel = function(callback) {};
  6729. /**
  6730. * @type {!chrome.notifications.ClosedEvent}
  6731. * @see http://developer.chrome.com/extensions/notifications.html#event-onClosed
  6732. */
  6733. chrome.notifications.onClosed;
  6734. /**
  6735. * The user clicked a non-button area of the notification. Callback receives a
  6736. * notificationId.
  6737. * @type {!ChromeStringEvent}
  6738. * @see http://developer.chrome.com/extensions/notifications.html#event-onClicked
  6739. */
  6740. chrome.notifications.onClicked;
  6741. /**
  6742. * @type {!chrome.notifications.ButtonClickedEvent}
  6743. * @see http://developer.chrome.com/extensions/notifications.html#event-onButtonClicked
  6744. */
  6745. chrome.notifications.onButtonClicked;
  6746. /**
  6747. * Indicates permission level change. Callback should expect 'granted' or
  6748. * 'denied'.
  6749. * @type {!ChromeStringEvent}
  6750. * @see http://developer.chrome.com/extensions/notifications.html#event-onPermissionLevelChanged
  6751. */
  6752. chrome.notifications.onPermissionLevelChanged;
  6753. /**
  6754. * @type {!ChromeEvent}
  6755. * @see http://developer.chrome.com/extensions/notifications.html#event-onShowSettings
  6756. */
  6757. chrome.notifications.onShowSettings;
  6758. /**
  6759. * @interface
  6760. * @extends {ChromeBaseEvent<!chrome.notifications.ClosedCallback>}
  6761. * @see http://developer.chrome.com/extensions/notifications.html#event-onClosed
  6762. */
  6763. chrome.notifications.ClosedEvent = function() {};
  6764. /**
  6765. * @interface
  6766. * @extends {ChromeBaseEvent<!chrome.notifications.ButtonCallback>}
  6767. * @see http://developer.chrome.com/extensions/notifications.html#event-onButtonClicked
  6768. */
  6769. chrome.notifications.ButtonClickedEvent = function() {};
  6770. /**
  6771. * @const
  6772. * @see http://developer.chrome.com/apps/system_storage.html
  6773. */
  6774. chrome.system.storage = {};
  6775. /** @constructor */
  6776. chrome.system.storage.StorageUnitInfo = function() {};
  6777. /** @type {string} */
  6778. chrome.system.storage.StorageUnitInfo.prototype.id;
  6779. /** @type {string} */
  6780. chrome.system.storage.StorageUnitInfo.prototype.name;
  6781. /** @type {string} Any of 'fixed', 'removable', or 'unknown' */
  6782. chrome.system.storage.StorageUnitInfo.prototype.type;
  6783. /** @type {number} */
  6784. chrome.system.storage.StorageUnitInfo.prototype.capacity;
  6785. /**
  6786. * Event whose listeners take a StorageUnitInfoEvent parameter.
  6787. * @interface
  6788. * @extends {ChromeBaseEvent<function(!chrome.system.storage.StorageUnitInfo)>}
  6789. */
  6790. chrome.system.storage.StorageUnitInfoEvent = function() {};
  6791. /** @type {chrome.system.storage.StorageUnitInfoEvent} */
  6792. chrome.system.storage.onAttached;
  6793. /** @type {!ChromeStringEvent} */
  6794. chrome.system.storage.onDetached;
  6795. /**
  6796. * Gets the storage information from the system.
  6797. * @param {function(!Array<!chrome.system.storage.StorageUnitInfo>)} callback
  6798. * @return {undefined}
  6799. */
  6800. chrome.system.storage.getInfo = function(callback) {};
  6801. /**
  6802. * Ejects a removable storage device.
  6803. * @param {string} id The transient device ID from StorageUnitInfo.
  6804. * @param {function(string)} callback Callback function where the value
  6805. * is any of: "success", "in_use", "no_such_device", "failure"
  6806. * @return {undefined}
  6807. */
  6808. chrome.system.storage.ejectDevice = function(id, callback) {};
  6809. /**
  6810. * Gets the available capacity of a specified storage device.
  6811. * @param {string} id The transient device ID from StorageUnitInfo.
  6812. * @param {function(Object<string, number>)} callback A callback function that
  6813. * accepts an object with `id` and `availableCapacity` fields.
  6814. * @return {undefined}
  6815. */
  6816. chrome.system.storage.getAvailableCapacity = function(id, callback) {};
  6817. /**
  6818. * @see http://developer.chrome.com/apps/usb.html
  6819. * @const
  6820. */
  6821. chrome.usb = {};
  6822. /** @constructor */
  6823. chrome.usb.Device = function Device() {};
  6824. /** @type {number} */
  6825. chrome.usb.Device.prototype.device;
  6826. /** @type {number} */
  6827. chrome.usb.Device.prototype.vendorId;
  6828. /** @type {number} */
  6829. chrome.usb.Device.prototype.productId;
  6830. /** @type {number} */
  6831. chrome.usb.Device.prototype.version;
  6832. /**
  6833. * The product name read from the device, if available.
  6834. * Since Chrome 46.
  6835. * @type {string}
  6836. */
  6837. chrome.usb.Device.prototype.productName;
  6838. /**
  6839. * The manufacturer name read from the device, if available.
  6840. * Since Chrome 46.
  6841. * @type {string}
  6842. */
  6843. chrome.usb.Device.prototype.manufacturerName;
  6844. /**
  6845. * The serial number read from the device, if available.
  6846. * Since Chrome 46.
  6847. * @type {string}
  6848. */
  6849. chrome.usb.Device.prototype.serialNumber;
  6850. /** @constructor */
  6851. chrome.usb.ConnectionHandle = function ConnectionHandle() {};
  6852. /** @type {number} */
  6853. chrome.usb.ConnectionHandle.prototype.handle;
  6854. /** @type {number} */
  6855. chrome.usb.ConnectionHandle.prototype.vendorId;
  6856. /** @type {number} */
  6857. chrome.usb.ConnectionHandle.prototype.productId;
  6858. /**
  6859. * @typedef {?{
  6860. * direction: string,
  6861. * endpoint: number,
  6862. * length: (number|undefined),
  6863. * data: (!ArrayBuffer|undefined),
  6864. * timeout: (number|undefined)
  6865. * }}
  6866. */
  6867. chrome.usb.GenericTransferInfo;
  6868. /**
  6869. * @typedef {?{
  6870. * direction: string,
  6871. * recipient: string,
  6872. * requestType: string,
  6873. * request: number,
  6874. * value: number,
  6875. * index: number,
  6876. * length: (number|undefined),
  6877. * data: (!ArrayBuffer|undefined),
  6878. * timeout: (number|undefined)
  6879. * }}
  6880. */
  6881. chrome.usb.ControlTransferInfo;
  6882. /** @constructor */
  6883. chrome.usb.TransferResultInfo = function() {};
  6884. /** @type {number|undefined} */
  6885. chrome.usb.TransferResultInfo.prototype.resultCode;
  6886. /** @type {!ArrayBuffer|undefined} */
  6887. chrome.usb.TransferResultInfo.prototype.data;
  6888. /**
  6889. * @typedef {?{
  6890. * vendorId: number,
  6891. * productId: number,
  6892. * interfaceId: (number|undefined)
  6893. * }}
  6894. */
  6895. chrome.usb.FindDevicesOptions;
  6896. /**
  6897. * @typedef {?{
  6898. * vendorId: (number|undefined),
  6899. * productId: (number|undefined),
  6900. * interfaceClass: (number|undefined),
  6901. * interfaceSubclass: (number|undefined),
  6902. * interfaceProtocol: (number|undefined)
  6903. * }}
  6904. */
  6905. chrome.usb.DeviceFilter;
  6906. /**
  6907. * @typedef {?{
  6908. * vendorId: (number|undefined),
  6909. * productId: (number|undefined),
  6910. * filters: (!Array<!chrome.usb.DeviceFilter>|undefined)
  6911. * }}
  6912. */
  6913. chrome.usb.GetDevicesOptions;
  6914. /**
  6915. * @typedef {?{
  6916. * multiple: (boolean|undefined),
  6917. * filters: (!Array<!chrome.usb.DeviceFilter>|undefined)
  6918. * }}
  6919. */
  6920. chrome.usb.GetUserSelectedDevicesOptions;
  6921. /**
  6922. * @typedef {?{
  6923. * transferInfo: !chrome.usb.GenericTransferInfo,
  6924. * packets: number,
  6925. * packetLength: number
  6926. * }}
  6927. */
  6928. chrome.usb.IsochronousTransferInfo;
  6929. /** @constructor */
  6930. chrome.usb.EndpointDescriptor = function() {};
  6931. /** @type {number} */
  6932. chrome.usb.EndpointDescriptor.prototype.address;
  6933. /** @type {string} */
  6934. chrome.usb.EndpointDescriptor.prototype.type;
  6935. /** @type {string} */
  6936. chrome.usb.EndpointDescriptor.prototype.direction;
  6937. /** @type {number} */
  6938. chrome.usb.EndpointDescriptor.prototype.maximumPacketSize;
  6939. /** @type {(string|undefined)} */
  6940. chrome.usb.EndpointDescriptor.prototype.synchronization;
  6941. /** @type {(string|undefined)} */
  6942. chrome.usb.EndpointDescriptor.prototype.usage;
  6943. /** @type {(number|undefined)} */
  6944. chrome.usb.EndpointDescriptor.prototype.pollingInterval;
  6945. /** @type {!ArrayBuffer} */
  6946. chrome.usb.EndpointDescriptor.prototype.extra_data;
  6947. /** @constructor */
  6948. chrome.usb.InterfaceDescriptor = function() {};
  6949. /** @type {number} */
  6950. chrome.usb.InterfaceDescriptor.prototype.interfaceNumber;
  6951. /** @type {number} */
  6952. chrome.usb.InterfaceDescriptor.prototype.alternateSetting;
  6953. /** @type {number} */
  6954. chrome.usb.InterfaceDescriptor.prototype.interfaceClass;
  6955. /** @type {number} */
  6956. chrome.usb.InterfaceDescriptor.prototype.interfaceSubclass;
  6957. /** @type {number} */
  6958. chrome.usb.InterfaceDescriptor.prototype.interfaceProtocol;
  6959. /** @type {(string|undefined)} */
  6960. chrome.usb.InterfaceDescriptor.prototype.description;
  6961. /** @type {!Array.<!chrome.usb.EndpointDescriptor>} */
  6962. chrome.usb.InterfaceDescriptor.prototype.endpoints;
  6963. /** @type {!ArrayBuffer} */
  6964. chrome.usb.InterfaceDescriptor.prototype.extra_data;
  6965. /** @constructor */
  6966. chrome.usb.ConfigDescriptor = function() {};
  6967. /** @type {boolean} */
  6968. chrome.usb.ConfigDescriptor.prototype.active;
  6969. /** @type {number} */
  6970. chrome.usb.ConfigDescriptor.prototype.configurationValue;
  6971. /** @type {string|undefined} */
  6972. chrome.usb.ConfigDescriptor.prototype.description;
  6973. /** @type {boolean} */
  6974. chrome.usb.ConfigDescriptor.prototype.selfPowered;
  6975. /** @type {boolean} */
  6976. chrome.usb.ConfigDescriptor.prototype.remoteWakeup;
  6977. /** @type {number} */
  6978. chrome.usb.ConfigDescriptor.prototype.maxPower;
  6979. /** @type {!Array<!chrome.usb.InterfaceDescriptor>} */
  6980. chrome.usb.ConfigDescriptor.prototype.interfaces;
  6981. /** @type {!ArrayBuffer} */
  6982. chrome.usb.ConfigDescriptor.prototype.extra_data;
  6983. /**
  6984. * @see http://developer.chrome.com/apps/usb.html#method-getDevices
  6985. * @param {!chrome.usb.GetDevicesOptions} options The properties to
  6986. * search for on target devices.
  6987. * @param {function(!Array<!chrome.usb.Device>)} callback Invoked with a list
  6988. * of |Device|s on complete.
  6989. * @return {undefined}
  6990. */
  6991. chrome.usb.getDevices = function(options, callback) {};
  6992. /**
  6993. * @see http://developer.chrome.com/apps/usb.html#method-getUserSelectedDevices
  6994. * @param {!chrome.usb.GetUserSelectedDevicesOptions} options Configuration of
  6995. * the device picker dialog box.
  6996. * @param {function(!Array<!chrome.usb.Device>)} callback Invoked with a list
  6997. * of |Device|s on complete.
  6998. * @return {undefined}
  6999. */
  7000. chrome.usb.getUserSelectedDevices = function(options, callback) {};
  7001. /**
  7002. * @see http://developer.chrome.com/apps/usb.html#method-getConfigurations
  7003. * @param {!chrome.usb.Device} device The device to fetch descriptors from.
  7004. * @param {function(!Array<!chrome.usb.ConfigDescriptor>)} callback Invoked with
  7005. * the full set of device configuration descriptors.
  7006. * @return {undefined}
  7007. */
  7008. chrome.usb.getConfigurations = function(device, callback) {};
  7009. /**
  7010. * @see http://developer.chrome.com/apps/usb.html#method-requestAccess
  7011. * @param {!chrome.usb.Device} device The device to request access to.
  7012. * @param {number} interfaceId
  7013. * @param {function(boolean)} callback
  7014. * @return {undefined}
  7015. */
  7016. chrome.usb.requestAccess = function(device, interfaceId, callback) {};
  7017. /**
  7018. * @see http://developer.chrome.com/apps/usb.html#method-openDevice
  7019. * @param {!chrome.usb.Device} device The device to open.
  7020. * @param {function(!chrome.usb.ConnectionHandle)} callback Invoked with the
  7021. * created ConnectionHandle on complete.
  7022. * @return {undefined}
  7023. */
  7024. chrome.usb.openDevice = function(device, callback) {};
  7025. /**
  7026. * @see http://developer.chrome.com/apps/usb.html#method-findDevices
  7027. * @param {!chrome.usb.FindDevicesOptions} options The properties to search for
  7028. * on target devices.
  7029. * @param {function(!Array<!chrome.usb.ConnectionHandle>)} callback Invoked
  7030. * with the opened ConnectionHandle on complete.
  7031. * @return {undefined}
  7032. */
  7033. chrome.usb.findDevices = function(options, callback) {};
  7034. /**
  7035. * @see http://developer.chrome.com/apps/usb.html#method-closeDevice
  7036. * @param {!chrome.usb.ConnectionHandle} handle The connection handle to close.
  7037. * @param {function()=} opt_callback The callback to invoke once the device is
  7038. * closed.
  7039. * @return {undefined}
  7040. */
  7041. chrome.usb.closeDevice = function(handle, opt_callback) {};
  7042. /**
  7043. * @see http://developer.chrome.com/apps/usb.html#method-setConfiguration
  7044. * @param {!chrome.usb.ConnectionHandle} handle The connection handle for which
  7045. * to select a device configuration.
  7046. * @param {number} configurationValue The configuration to select.
  7047. * @param {function()} callback The callback to invoke on complete.
  7048. * @return {undefined}
  7049. */
  7050. chrome.usb.setConfiguration = function(handle, configurationValue, callback) {};
  7051. /**
  7052. * @see http://developer.chrome.com/apps/usb.html#method-getConfiguration
  7053. * @param {!chrome.usb.ConnectionHandle} handle The connection handle for which
  7054. * to get the current device configuration descriptor.
  7055. * @param {function(!chrome.usb.ConfigDescriptor)} callback The callback to
  7056. * invoke on complete.
  7057. * @return {undefined}
  7058. */
  7059. chrome.usb.getConfiguration = function(handle, callback) {};
  7060. /**
  7061. * @see http://developer.chrome.com/apps/usb.html#method-listInterfaces
  7062. * @param {!chrome.usb.ConnectionHandle} handle The device from which the
  7063. * interfaces should be listed.
  7064. * @param {function(!Array<!chrome.usb.InterfaceDescriptor>)} callback The
  7065. * callback to invoke when the interfaces are enumerated.
  7066. * @return {undefined}
  7067. */
  7068. chrome.usb.listInterfaces = function(handle, callback) {};
  7069. /**
  7070. * @see http://developer.chrome.com/apps/usb.html#method-claimInterface
  7071. * @param {!chrome.usb.ConnectionHandle} handle The device on which the
  7072. * interface is to be claimed.
  7073. * @param {number} interfaceNumber
  7074. * @param {function()} callback The callback to invoke once the interface is
  7075. * claimed.
  7076. * @return {undefined}
  7077. */
  7078. chrome.usb.claimInterface = function(handle, interfaceNumber, callback) {};
  7079. /**
  7080. * @see http://developer.chrome.com/apps/usb.html#method-releaseInterface
  7081. * @param {!chrome.usb.ConnectionHandle} handle The device on which the
  7082. * interface is to be released.
  7083. * @param {number} interfaceNumber
  7084. * @param {function()} callback The callback to invoke once the interface is
  7085. * released.
  7086. * @return {undefined}
  7087. */
  7088. chrome.usb.releaseInterface = function(handle, interfaceNumber, callback) {};
  7089. /**
  7090. * @see http://developer.chrome.com/apps/usb.html#method-setInterfaceAlternateSetting
  7091. * @param {!chrome.usb.ConnectionHandle} handle The device on which the
  7092. * interface settings are to be set.
  7093. * @param {number} interfaceNumber
  7094. * @param {number} alternateSetting The alternate setting to set.
  7095. * @param {function()} callback The callback to invoke once the interface
  7096. * setting is set.
  7097. * @return {undefined}
  7098. */
  7099. chrome.usb.setInterfaceAlternateSetting = function(
  7100. handle, interfaceNumber, alternateSetting, callback) {};
  7101. /**
  7102. * @see http://developer.chrome.com/apps/usb.html#method-controlTransfer
  7103. * @param {!chrome.usb.ConnectionHandle} handle A connection handle to make the
  7104. * transfer on.
  7105. * @param {!chrome.usb.ControlTransferInfo} transferInfo The parameters to the
  7106. * transfer.
  7107. * @param {function(!chrome.usb.TransferResultInfo)} callback Invoked once the
  7108. * transfer has completed.
  7109. * @return {undefined}
  7110. */
  7111. chrome.usb.controlTransfer = function(handle, transferInfo, callback) {};
  7112. /**
  7113. * @see http://developer.chrome.com/apps/usb.html#method-bulkTransfer
  7114. * @param {!chrome.usb.ConnectionHandle} handle A connection handle to make
  7115. * the transfer on.
  7116. * @param {!chrome.usb.GenericTransferInfo} transferInfo The parameters to the
  7117. * transfer. See GenericTransferInfo.
  7118. * @param {function(!chrome.usb.TransferResultInfo)} callback Invoked once the
  7119. * transfer has completed.
  7120. * @return {undefined}
  7121. */
  7122. chrome.usb.bulkTransfer = function(handle, transferInfo, callback) {};
  7123. /**
  7124. * @see http://developer.chrome.com/apps/usb.html#method-interruptTransfer
  7125. * @param {!chrome.usb.ConnectionHandle} handle A connection handle to make the
  7126. * transfer on.
  7127. * @param {!chrome.usb.GenericTransferInfo} transferInfo The parameters to the
  7128. * transfer. See GenericTransferInfo.
  7129. * @param {function(!chrome.usb.TransferResultInfo)} callback Invoked once the
  7130. * transfer has completed.
  7131. * @return {undefined}
  7132. */
  7133. chrome.usb.interruptTransfer = function(handle, transferInfo, callback) {};
  7134. /**
  7135. * @see http://developer.chrome.com/apps/usb.html#method-isochronousTransfer
  7136. * @param {!chrome.usb.ConnectionHandle} handle A connection handle to make the
  7137. * transfer on.
  7138. * @param {!chrome.usb.IsochronousTransferInfo} transferInfo The parameters to
  7139. * the transfer.
  7140. * @param {function(!chrome.usb.TransferResultInfo)} callback Invoked once the
  7141. * transfer has been completed.
  7142. * @return {undefined}
  7143. */
  7144. chrome.usb.isochronousTransfer = function(handle, transferInfo, callback) {};
  7145. /**
  7146. * @see http://developer.chrome.com/apps/usb.html#method-resetDevice
  7147. * @param {!chrome.usb.ConnectionHandle} handle A connection handle to reset.
  7148. * @param {function(boolean)} callback Invoked once the device is reset with a
  7149. * boolean indicating whether the reset completed successfully.
  7150. * @return {undefined}
  7151. */
  7152. chrome.usb.resetDevice = function(handle, callback) {};
  7153. /**
  7154. * Event whose listeners take an chrome.usb.Device parameter.
  7155. * @interface
  7156. * @extends {ChromeBaseEvent<function(!chrome.usb.Device)>}
  7157. */
  7158. chrome.usb.DeviceEvent = function() {};
  7159. /**
  7160. * @type {!chrome.usb.DeviceEvent}
  7161. * @see https://developer.chrome.com/apps/usb#event-onDeviceAdded
  7162. */
  7163. chrome.usb.onDeviceAdded;
  7164. /**
  7165. * @type {!chrome.usb.DeviceEvent}
  7166. * @see https://developer.chrome.com/apps/usb#event-onDeviceRemoved
  7167. */
  7168. chrome.usb.onDeviceRemoved;
  7169. /**
  7170. * @see https://developer.chrome.com/apps/serial
  7171. * @const
  7172. */
  7173. chrome.serial = {};
  7174. /**
  7175. * @typedef {?{
  7176. * persistent: (boolean|undefined),
  7177. * name: (string|undefined),
  7178. * bufferSize: (number|undefined),
  7179. * bitrate: (number|undefined),
  7180. * dataBits: (string|undefined),
  7181. * parityBit: (string|undefined),
  7182. * stopBits: (string|undefined),
  7183. * ctsFlowControl: (boolean|undefined),
  7184. * receiveTimeout: (number|undefined),
  7185. * sendTimeout: (number|undefined)
  7186. * }}
  7187. * @see https://developer.chrome.com/apps/serial#type-ConnectionOptions
  7188. */
  7189. chrome.serial.ConnectionOptions;
  7190. /**
  7191. * @typedef {?{
  7192. * connectionId: number,
  7193. * paused: boolean,
  7194. * persistent: boolean,
  7195. * name: string,
  7196. * bufferSize: number,
  7197. * receiveTimeout: number,
  7198. * sendTimeout: number,
  7199. * bitrate: (number|undefined),
  7200. * dataBits: (string|undefined),
  7201. * parityBit: (string|undefined),
  7202. * stopBits: (string|undefined),
  7203. * ctsFlowControl: (boolean|undefined)
  7204. * }}
  7205. * @see https://developer.chrome.com/apps/serial#type-ConnectionInfo
  7206. */
  7207. chrome.serial.ConnectionInfo;
  7208. /**
  7209. * Returns information about available serial devices on the system. The
  7210. * list is regenerated each time this method is called.
  7211. * @param {function(!Array<!Object>)} callback Invoked with a
  7212. * list of ports on complete.
  7213. * @see https://developer.chrome.com/apps/serial#method-getDevices
  7214. * @return {undefined}
  7215. */
  7216. chrome.serial.getDevices = function(callback) {};
  7217. /**
  7218. * Connects to a given serial port.
  7219. * @param {string} path The system path of the serial port to open.
  7220. * @param {!chrome.serial.ConnectionOptions|
  7221. * function(!chrome.serial.ConnectionInfo)} optionsOrCallback
  7222. * Port configuration options, or the callback invoked with the created
  7223. * ConnectionInfo on complete.
  7224. * @param {function(!chrome.serial.ConnectionInfo)=} opt_callback Invoked with
  7225. * the created ConnectionInfo on complete.
  7226. * @see https://developer.chrome.com/apps/serial#method-connect
  7227. * @return {undefined}
  7228. */
  7229. chrome.serial.connect = function(path, optionsOrCallback, opt_callback) {};
  7230. /**
  7231. * Update the option settings on an open serial port connection.
  7232. * @param {number} connectionId The id of the opened connection.
  7233. * @param {!chrome.serial.ConnectionOptions} options Port configuration
  7234. * options.
  7235. * @param {function(boolean)} callback Called when the configuration has
  7236. * completed.
  7237. * @see https://developer.chrome.com/apps/serial#method-update
  7238. * @return {undefined}
  7239. */
  7240. chrome.serial.update = function(connectionId, options, callback) {};
  7241. /**
  7242. * Disconnects from a serial port.
  7243. * @param {number} connectionId The id of the opened connection.
  7244. * @param {function(boolean)} callback Called when the connection
  7245. * has been closed.
  7246. * @see https://developer.chrome.com/apps/serial#method-disconnect
  7247. * @return {undefined}
  7248. */
  7249. chrome.serial.disconnect = function(connectionId, callback) {};
  7250. /**
  7251. * Pauses or unpauses an open connection.
  7252. * @param {number} connectionId The id of the opened connection.
  7253. * @param {boolean} paused Flag to indicate whether to pause or unpause.
  7254. * @param {function()} callback Called when the configuration has completed.
  7255. * @see https://developer.chrome.com/apps/serial#method-setPaused
  7256. * @return {undefined}
  7257. */
  7258. chrome.serial.setPaused = function(connectionId, paused, callback) {};
  7259. /**
  7260. * Retrieves the state of a given connection.
  7261. * @param {number} connectionId The id of the opened connection.
  7262. * @param {function(!chrome.serial.ConnectionInfo)} callback
  7263. * Called with connection state information when available.
  7264. * @see https://developer.chrome.com/apps/serial#method-getInfo
  7265. * @return {undefined}
  7266. */
  7267. chrome.serial.getInfo = function(connectionId, callback) {};
  7268. /**
  7269. * Retrieves the list of currently opened serial port connections owned by
  7270. * the application.
  7271. * @param {function(!Array<!chrome.serial.ConnectionInfo>)} callback
  7272. * Called with the list of |ConnectionInfo|s when available.
  7273. * @see https://developer.chrome.com/apps/serial#method-getConnections
  7274. * @return {undefined}
  7275. */
  7276. chrome.serial.getConnections = function(callback) {};
  7277. /**
  7278. * Writes data to the given connection.
  7279. * @param {number} connectionId The id of the opened connection.
  7280. * @param {!ArrayBuffer} data The data to send.
  7281. * @param {function(!Object)} callback Called when the operation has
  7282. * completed.
  7283. * @see https://developer.chrome.com/apps/serial#method-send
  7284. * @return {undefined}
  7285. */
  7286. chrome.serial.send = function(connectionId, data, callback) {};
  7287. /**
  7288. * Flushes all bytes in the given connection's input and output buffers.
  7289. * @param {number} connectionId The id of the opened connection.
  7290. * @param {function(boolean)} callback
  7291. * @see https://developer.chrome.com/apps/serial#method-flush
  7292. * @return {undefined}
  7293. */
  7294. chrome.serial.flush = function(connectionId, callback) {};
  7295. /**
  7296. * Retrieves the state of control signals on a given connection.
  7297. * @param {number} connectionId The id of the opened connection.
  7298. * @param {function(!Object)} callback
  7299. * @see https://developer.chrome.com/apps/serial#method-getControlSignals
  7300. * @return {undefined}
  7301. */
  7302. chrome.serial.getControlSignals = function(connectionId, callback) {};
  7303. /**
  7304. * @typedef {?{
  7305. * dtr: (boolean|undefined),
  7306. * rts: (boolean|undefined)
  7307. * }}
  7308. */
  7309. chrome.serial.ControlSignals;
  7310. /**
  7311. * Sets the state of control signals on a given connection.
  7312. * @param {number} connectionId The id of the opened connection.
  7313. * @param {!chrome.serial.ControlSignals} signals
  7314. * The set of signal changes to send to the device.
  7315. * @param {function(boolean)} callback Called once the control signals
  7316. * have been set.
  7317. * @see https://developer.chrome.com/apps/serial#method-setControlSignals
  7318. * @return {undefined}
  7319. */
  7320. chrome.serial.setControlSignals = function(connectionId, signals, callback) {};
  7321. /**
  7322. * Event raised when data has been read from the connection.
  7323. * @type {!ChromeObjectEvent}
  7324. * @see https://developer.chrome.com/apps/serial#event-onReceive
  7325. */
  7326. chrome.serial.onReceive;
  7327. /**
  7328. * Event raised when an error occurred while the runtime was waiting for
  7329. * data on the serial port. Once this event is raised, the connection may
  7330. * be set to paused. A "timeout" error does not pause the connection.
  7331. * @type {!ChromeObjectEvent}
  7332. * @see https://developer.chrome.com/apps/serial#event-onReceiveError
  7333. */
  7334. chrome.serial.onReceiveError;
  7335. ////////////////////////////////////////////////////////////////////////////////
  7336. /////////////////////////// Chrome Private APIs ////////////////////////////////
  7337. ////////////////////////////////////////////////////////////////////////////////
  7338. /**
  7339. * @const
  7340. */
  7341. chrome.musicManagerPrivate = {};
  7342. /**
  7343. * @param {function(string): void} callback
  7344. * @return {undefined}
  7345. */
  7346. chrome.musicManagerPrivate.getDeviceId = function(callback) {};
  7347. /**
  7348. * @const
  7349. */
  7350. chrome.mediaGalleriesPrivate = {};
  7351. /**
  7352. * @typedef {function({deviceId: string, deviceName: string}): void}
  7353. */
  7354. chrome.mediaGalleriesPrivate.DeviceCallback;
  7355. /**
  7356. * @typedef {function({galleryId: string}): void}
  7357. */
  7358. chrome.mediaGalleriesPrivate.GalleryChangeCallback;
  7359. /**
  7360. * @typedef {function({galleryId: string, success: boolean}): void}
  7361. */
  7362. chrome.mediaGalleriesPrivate.AddGalleryWatchCallback;
  7363. /**
  7364. * @param {string} galleryId
  7365. * @param {!chrome.mediaGalleriesPrivate.AddGalleryWatchCallback} callback
  7366. * @return {undefined}
  7367. */
  7368. chrome.mediaGalleriesPrivate.addGalleryWatch = function(galleryId, callback) {};
  7369. /**
  7370. * @type {!chrome.mediaGalleriesPrivate.DeviceEvent}
  7371. * @deprecated Use {chrome.system.storage.onAttach}.
  7372. */
  7373. chrome.mediaGalleriesPrivate.onDeviceAttached;
  7374. /**
  7375. * @type {!chrome.mediaGalleriesPrivate.DeviceEvent}
  7376. * @deprecated Use {chrome.system.storage.onDetach}.
  7377. */
  7378. chrome.mediaGalleriesPrivate.onDeviceDetached;
  7379. /**
  7380. * @type {!chrome.mediaGalleriesPrivate.GalleryChangeEvent}
  7381. */
  7382. chrome.mediaGalleriesPrivate.onGalleryChanged;
  7383. /**
  7384. * @interface
  7385. * @extends {ChromeBaseEvent<!chrome.mediaGalleriesPrivate.DeviceCallback>}
  7386. * @deprecated Use {chrome.system.storage.DeviceEvent}.
  7387. */
  7388. chrome.mediaGalleriesPrivate.DeviceEvent = function() {};
  7389. /**
  7390. * @interface
  7391. * @extends {ChromeBaseEvent<!chrome.mediaGalleriesPrivate.GalleryChangeCallback>}
  7392. */
  7393. chrome.mediaGalleriesPrivate.GalleryChangeEvent = function() {};
  7394. /**
  7395. * safeBrowsingPrivate is a Private API for observing events and retrieving a
  7396. * referrer chain.
  7397. * @see https://cs.chromium.org/chromium/src/chrome/common/extensions/api/safe_browsing_private.idl
  7398. */
  7399. chrome.safeBrowsingPrivate = {};
  7400. /**
  7401. * @enum {string}
  7402. */
  7403. chrome.safeBrowsingPrivate.URLType = {
  7404. EVENT_URL: '',
  7405. LANDING_PAGE: '',
  7406. LANDING_REFERRER: '',
  7407. CLIENT_REDIRECT: '',
  7408. RECENT_NAVIGATION: '',
  7409. REFERRER: '',
  7410. };
  7411. /**
  7412. * @enum {string}
  7413. */
  7414. chrome.safeBrowsingPrivate.NavigationInitiation = {
  7415. BROWSER_INITIATED: '',
  7416. RENDERER_INITIATED_WITHOUT_USER_GESTURE: '',
  7417. RENDERER_INITIATED_WITH_USER_GESTURE: '',
  7418. };
  7419. /**
  7420. * @typedef {{
  7421. * url: string,
  7422. * userName: string,
  7423. * isPhishingUrl: boolean
  7424. * }}
  7425. */
  7426. chrome.safeBrowsingPrivate.PolicySpecifiedPasswordReuse;
  7427. /**
  7428. * @typedef {{
  7429. * url: string,
  7430. * fileName: string,
  7431. * downloadDigestSha256: string,
  7432. * userName: string
  7433. * }}
  7434. */
  7435. chrome.safeBrowsingPrivate.DangerousDownloadInfo;
  7436. /**
  7437. * @typedef {{
  7438. * url: string,
  7439. * reason: string,
  7440. * netErrorCode: (string|undefined),
  7441. * userName: string
  7442. * }}
  7443. */
  7444. chrome.safeBrowsingPrivate.InterstitialInfo;
  7445. /**
  7446. * @typedef {{
  7447. * url: (string|undefined)
  7448. * }}
  7449. */
  7450. chrome.safeBrowsingPrivate.ServerRedirect;
  7451. /**
  7452. * @typedef {{
  7453. * url: string,
  7454. * mainFrameUrl: (string|undefined),
  7455. * urlType: !chrome.safeBrowsingPrivate.URLType,
  7456. * ipAddresses: (!Array<string>|undefined),
  7457. * referrerUrl: (string|undefined),
  7458. * referrerMainFrameUrl: (string|undefined),
  7459. * isRetargeting: (boolean|undefined),
  7460. * navigationTimeMs: (number|undefined),
  7461. * serverRedirectChain:
  7462. * (!Array<!chrome.safeBrowsingPrivate.ServerRedirect>|undefined),
  7463. * navigationInitiation:
  7464. * (!chrome.safeBrowsingPrivate.NavigationInitiation|undefined),
  7465. * maybeLaunchedByExternalApp: (boolean|undefined)
  7466. * }}
  7467. */
  7468. chrome.safeBrowsingPrivate.ReferrerChainEntry;
  7469. /**
  7470. * Gets referrer chain for the specified tab.
  7471. * @param {number} tabId Id of the tab from which to retrieve the referrer.
  7472. * @param {function(!Array<!chrome.safeBrowsingPrivate.ReferrerChainEntry>):void}
  7473. * callback Called with the list of referrer chain entries.
  7474. */
  7475. chrome.safeBrowsingPrivate.getReferrerChain = function(tabId, callback) {};
  7476. /**
  7477. * Fired when Chrome detects a reuse of a policy specified password.
  7478. * @type {!ChromeObjectEvent}
  7479. */
  7480. chrome.safeBrowsingPrivate.onPolicySpecifiedPasswordReuseDetected;
  7481. /**
  7482. * Fired when the user changed their policy specified password.
  7483. * @type {!ChromeStringEvent}
  7484. */
  7485. chrome.safeBrowsingPrivate.onPolicySpecifiedPasswordChanged;
  7486. /**
  7487. * Fired when the user opened a dangerous download.
  7488. * @type {!ChromeObjectEvent}
  7489. */
  7490. chrome.safeBrowsingPrivate.onDangerousDownloadOpened;
  7491. /**
  7492. * Fired when a security interstitial is shown to the user.
  7493. * @type {!ChromeObjectEvent}
  7494. */
  7495. chrome.safeBrowsingPrivate.onSecurityInterstitialShown;
  7496. /**
  7497. * Fired when the user clicked-through a security interstitial.
  7498. * @type {!ChromeObjectEvent}
  7499. */
  7500. chrome.safeBrowsingPrivate.onSecurityInterstitialProceeded;
  7501. /**
  7502. * WARNING(2014/08/14): This API is still under active initial development and
  7503. * unstable. The types are not well defined or documented, and this API
  7504. * definition here should not be used as an example for other APIs added to this
  7505. * file. Please contact mednik@ for questions on and maintenance for this API.
  7506. * @const
  7507. * @see http://goo.gl/afV8wB
  7508. */
  7509. chrome.mdns = {};
  7510. /**
  7511. * Data type sent to the event handler of chrome.mdns.onServiceList.
  7512. * @constructor
  7513. */
  7514. chrome.mdns.MdnsService = function() {};
  7515. /** @type {string} */
  7516. chrome.mdns.MdnsService.prototype.serviceName;
  7517. /** @type {string} */
  7518. chrome.mdns.MdnsService.prototype.serviceHostPort;
  7519. /** @type {string} */
  7520. chrome.mdns.MdnsService.prototype.ipAddress;
  7521. /** @type {!Array<string>} */
  7522. chrome.mdns.MdnsService.prototype.serviceData;
  7523. /**
  7524. * Event whose listeners take an array of MdnsService parameter.
  7525. *
  7526. * The `addListener()` methods for these take more than one argument, so they
  7527. * cannot just extend `ChromeBaseEvent`.
  7528. * @interface
  7529. * @extends {ChromeBaseEventNoListeners}
  7530. */
  7531. chrome.mdns.ServiceListEvent = function() {};
  7532. /**
  7533. * @param {function(!Array<!chrome.mdns.MdnsService>): void} callback
  7534. * @param {!Object=} opt_filter
  7535. * @return {undefined}
  7536. */
  7537. chrome.mdns.ServiceListEvent.prototype.addListener = function(
  7538. callback, opt_filter) {};
  7539. /**
  7540. * @param {function(!Array<!chrome.mdns.MdnsService>): void} callback
  7541. * @return {undefined}
  7542. */
  7543. chrome.mdns.ServiceListEvent.prototype.removeListener = function(callback) {};
  7544. /**
  7545. * @param {function(!Array<!chrome.mdns.MdnsService>): void} callback
  7546. * @return {boolean}
  7547. */
  7548. chrome.mdns.ServiceListEvent.prototype.hasListener = function(callback) {};
  7549. /** @return {boolean} */
  7550. chrome.mdns.ServiceListEvent.prototype.hasListeners = function() {};
  7551. /** @type {!chrome.mdns.ServiceListEvent} */
  7552. chrome.mdns.onServiceList;
  7553. /**
  7554. * @param {function()} callback
  7555. * @return {undefined}
  7556. */
  7557. chrome.mdns.forceDiscovery = function(callback) {};
  7558. /**
  7559. * @const
  7560. * @see http://goo.gl/79p5h5
  7561. */
  7562. chrome.gcdPrivate = {};
  7563. /**
  7564. * Represents a GCD device discovered locally or registered to a given user.
  7565. * deviceId: Opaque device identifier to be passed to API.
  7566. * setupType: How this device was discovered.
  7567. * cloudId: Cloud identifier string.
  7568. * deviceName: Device human readable name.
  7569. * deviceType: Device type (camera, printer, etc).
  7570. * deviceDescription: Device human readable description.
  7571. * @typedef {?{
  7572. * deviceId: string,
  7573. * setupType: string,
  7574. * cloudId: (string|undefined),
  7575. * deviceType: string,
  7576. * deviceName: string,
  7577. * deviceDescription: string
  7578. * }}
  7579. */
  7580. chrome.gcdPrivate.Device;
  7581. /**
  7582. * Returns the list of cloud devices visible locally or available in the
  7583. * cloud for user account.
  7584. * @param {function(!Array<!chrome.gcdPrivate.Device>): void} callback
  7585. * @return {undefined}
  7586. */
  7587. chrome.gcdPrivate.getCloudDeviceList = function(callback) {};
  7588. /**
  7589. * Queries network for local devices. Triggers onDeviceStateChanged and
  7590. * onDeviceRemoved events. Call this function *only* after registering for
  7591. * onDeviceStateChanged and onDeviceRemoved events, or it will do nothing.
  7592. * @return {undefined}
  7593. */
  7594. chrome.gcdPrivate.queryForNewLocalDevices = function() {};
  7595. /**
  7596. * Cache the WiFi password in the browser process for use during
  7597. * provisioning. This is done to allow the gathering of the wifi password to
  7598. * not be done while connected to the device's network. Callback is called
  7599. * with true if wifi password was cached and false if it was unavailable.
  7600. * @param {string} ssid
  7601. * @param {function(boolean): void} callback
  7602. * @return {undefined}
  7603. */
  7604. chrome.gcdPrivate.prefetchWifiPassword = function(ssid, callback) {};
  7605. /**
  7606. * Returns local device information.
  7607. * @param {string} serviceName The mDNS service name of the device.
  7608. * @param {function(string, !Object): void}
  7609. * callback Called when when the device info is available or on error.
  7610. * |status|: The status of the operation (success or type of error).
  7611. * |deviceInfo|: Content of /privet/info response.
  7612. * https://developers.google.com/cloud-devices/v1/reference/local-api/info
  7613. * @return {undefined}
  7614. */
  7615. chrome.gcdPrivate.getDeviceInfo = function(serviceName, callback) {};
  7616. /**
  7617. * Create new pairing session.
  7618. * @param {string} serviceName The mDNS service name of the device.
  7619. * @param {function(number, string, !Array<string>): void}
  7620. * callback Called when the session is established or on error. 1st param,
  7621. * |sessionId|, is the session ID (identifies the session for future calls).
  7622. * 2nd param, |status|, is the status (success or type of error). 3rd param,
  7623. * |pairingTypes|, is a list of pairing types supported by this device.
  7624. * @return {undefined}
  7625. */
  7626. chrome.gcdPrivate.createSession = function(serviceName, callback) {};
  7627. /**
  7628. * Start pairing with the selected method.
  7629. * @param {number} sessionId
  7630. * @param {string} pairingType
  7631. * @param {function(string): void} callback
  7632. * @return {undefined}
  7633. */
  7634. chrome.gcdPrivate.startPairing = function(sessionId, pairingType, callback) {};
  7635. /**
  7636. * Confirm pairing code.
  7637. * @param {number} sessionId
  7638. * @param {string} code
  7639. * @param {function(string): void} callback
  7640. * @return {undefined}
  7641. */
  7642. chrome.gcdPrivate.confirmCode = function(sessionId, code, callback) {};
  7643. /**
  7644. * Send an encrypted message to the device. If the message is a setup message
  7645. * with a wifi ssid specified but no password, the password cached from
  7646. * prefetchWifiPassword() will be used and the call will fail if it's not
  7647. * available. For open networks use an empty string as the password.
  7648. * @param {number} sessionId
  7649. * @param {string} api The API path.
  7650. * @param {!Object} input The input message to be sent over the encrypted
  7651. * channel.
  7652. * @param {function(string, ?Object): void} callback
  7653. * @return {undefined}
  7654. */
  7655. chrome.gcdPrivate.sendMessage = function(sessionId, api, input, callback) {};
  7656. /**
  7657. * Terminate the session with the device.
  7658. * @param {number} sessionId
  7659. * @return {undefined}
  7660. */
  7661. chrome.gcdPrivate.terminateSession = function(sessionId) {};
  7662. /**
  7663. * Returns command definitions.
  7664. * @param {string} deviceId The device to get command definitions for.
  7665. * @param {function(!Object): void} callback The result callback.
  7666. * @return {undefined}
  7667. */
  7668. chrome.gcdPrivate.getCommandDefinitions = function(deviceId, callback) {};
  7669. /**
  7670. * Creates and sends a new command.
  7671. * @param {string} deviceId The device to send the command to.
  7672. * @param {number} expireInMs The number of milliseconds since now before the
  7673. * command expires. An expired command should not be executed by the device.
  7674. * Acceptable values are 10 sec (10000 ms) to 30 days (2592000000 ms),
  7675. * inclusive. All values outside that range will be replaced by 30 days.
  7676. * @param {!Object} command Described at
  7677. * https://developers.google.com/cloud-devices/v1/reference/commands.
  7678. * @param {function(!Object): void} callback The result callback.
  7679. * @return {undefined}
  7680. */
  7681. chrome.gcdPrivate.insertCommand = function(
  7682. deviceId, expireInMs, command, callback) {};
  7683. /**
  7684. * Returns a particular command.
  7685. * @param {string} commandId Unique command ID.
  7686. * @param {function(!Object): void} callback The result callback.
  7687. * @return {undefined}
  7688. */
  7689. chrome.gcdPrivate.getCommand = function(commandId, callback) {};
  7690. /**
  7691. * Cancels a command.
  7692. * @param {string} commandId Unique command ID.
  7693. * @param {function(!Object): void} callback The result callback.
  7694. * @return {undefined}
  7695. */
  7696. chrome.gcdPrivate.cancelCommand = function(commandId, callback) {};
  7697. /**
  7698. * Lists all commands in order of creation.
  7699. * @param {string} deviceId The device to send the command to.
  7700. * @param {string} byUser List all the commands issued by the user. Special
  7701. * value 'me' can be used to list by the current user.
  7702. * @param {string} state Command state.
  7703. * @param {function(!Array<!Object>): void} callback The result callback.
  7704. * @return {undefined}
  7705. */
  7706. chrome.gcdPrivate.getCommandsList = function(
  7707. deviceId, byUser, state, callback) {};
  7708. /**
  7709. * Event whose listeners take a chrome.gcdPrivate.Device.
  7710. * @interface
  7711. * @extends {ChromeBaseEvent<function(!chrome.gcdPrivate.Device)>}
  7712. */
  7713. chrome.gcdPrivate.DeviceEvent = function() {};
  7714. /**
  7715. * Fires when a device's state changes. When a listener is first added, this
  7716. * event fires for all known devices on the network. Afterwards, it will fire
  7717. * with device status updates.
  7718. * @type {!chrome.gcdPrivate.DeviceEvent}
  7719. */
  7720. chrome.gcdPrivate.onDeviceStateChanged;
  7721. /**
  7722. * Fires when a given device disappears.
  7723. * |deviceId| The device that has disappeared.
  7724. * @type {!ChromeStringEvent}
  7725. */
  7726. chrome.gcdPrivate.onDeviceRemoved;
  7727. /**
  7728. * @const
  7729. * @see https://cs.chromium.org/chromium/src/extensions/common/api/bluetooth_private.idl
  7730. */
  7731. chrome.bluetoothPrivate = {};
  7732. /** @constructor */
  7733. chrome.bluetoothPrivate.PairingEvent = function() {};
  7734. /** @type {string} */
  7735. chrome.bluetoothPrivate.PairingEvent.prototype.pairing;
  7736. /** @type {!chrome.bluetooth.Device} */
  7737. chrome.bluetoothPrivate.PairingEvent.prototype.device;
  7738. /** @type {string|undefined} */
  7739. chrome.bluetoothPrivate.PairingEvent.prototype.pincode;
  7740. /** @type {number|undefined} */
  7741. chrome.bluetoothPrivate.PairingEvent.prototype.passkey;
  7742. /** @type {number|undefined} */
  7743. chrome.bluetoothPrivate.PairingEvent.prototype.enteredKey;
  7744. /**
  7745. * @typedef {{
  7746. * name: (string|undefined),
  7747. * powered: (boolean|undefined),
  7748. * discoverable: (boolean|undefined)
  7749. * }}
  7750. */
  7751. chrome.bluetoothPrivate.NewAdapterState;
  7752. /**
  7753. * @typedef {{
  7754. * device: !chrome.bluetooth.Device,
  7755. * response: (string|undefined),
  7756. * pincode: (string|undefined),
  7757. * passkey: (number|undefined),
  7758. * enteredKey: (number|undefined)
  7759. * }}
  7760. */
  7761. chrome.bluetoothPrivate.SetPairingResponseOptions;
  7762. /**
  7763. * @param {!chrome.bluetoothPrivate.NewAdapterState} adapterState
  7764. * @param {function()} callback
  7765. * @return {undefined}
  7766. */
  7767. chrome.bluetoothPrivate.setAdapterState = function(adapterState, callback) {};
  7768. /**
  7769. * @param {!chrome.bluetoothPrivate.SetPairingResponseOptions} options
  7770. * @param {function()} callback
  7771. * @return {undefined}
  7772. */
  7773. chrome.bluetoothPrivate.setPairingResponse = function(options, callback) {};
  7774. /**
  7775. * @param {string} deviceAddress
  7776. * @param {function():void=} callback
  7777. */
  7778. chrome.bluetoothPrivate.disconnectAll = function(deviceAddress, callback) {};
  7779. /**
  7780. * @param {string} deviceAddress
  7781. * @param {function():void=} callback
  7782. * @return {undefined}
  7783. */
  7784. chrome.bluetoothPrivate.forgetDevice = function(deviceAddress, callback) {};
  7785. /**
  7786. * @typedef {{
  7787. * transport: (!chrome.bluetoothPrivate.TransportType|undefined),
  7788. * uuids: ((string|!Array<string>)|undefined),
  7789. * rssi: (number|undefined),
  7790. * pathloss: (number|undefined)
  7791. * }}
  7792. */
  7793. chrome.bluetoothPrivate.DiscoveryFilter;
  7794. /**
  7795. * Set or clear discovery filter.
  7796. * @param {!chrome.bluetoothPrivate.DiscoveryFilter} discoveryFilter
  7797. * @param {function():void=} callback
  7798. */
  7799. chrome.bluetoothPrivate.setDiscoveryFilter = function(
  7800. discoveryFilter, callback) {};
  7801. /**
  7802. * Event whose listeners take a PairingEvent parameter.
  7803. * @interface
  7804. * @extends {ChromeBaseEvent<function(!chrome.bluetoothPrivate.PairingEvent)>}
  7805. */
  7806. chrome.bluetoothPrivate.PairingEventEvent = function() {};
  7807. /** @type {!chrome.bluetoothPrivate.PairingEventEvent} */
  7808. chrome.bluetoothPrivate.onPairing;
  7809. /**
  7810. * @param {string} deviceAddress
  7811. * @param {function(): void=} callback
  7812. */
  7813. chrome.bluetoothPrivate.pair = function(deviceAddress, callback) {};
  7814. /**
  7815. * @enum {string}
  7816. * @see https://developer.chrome.com/extensions/bluetoothPrivate#type-PairingResponse
  7817. */
  7818. chrome.bluetoothPrivate.PairingResponse = {
  7819. CONFIRM: '',
  7820. REJECT: '',
  7821. CANCEL: '',
  7822. };
  7823. /**
  7824. * @enum {string}
  7825. * @see https://developer.chrome.com/extensions/bluetoothPrivate#type-PairingEventType
  7826. */
  7827. chrome.bluetoothPrivate.PairingEventType = {
  7828. REQUEST_PINCODE: '',
  7829. DISPLAY_PINCODE: '',
  7830. REQUEST_PASSKEY: '',
  7831. DISPLAY_PASSKEY: '',
  7832. KEYS_ENTERED: '',
  7833. CONFIRM_PASSKEY: '',
  7834. REQUEST_AUTHORIZATION: '',
  7835. COMPLETE: '',
  7836. };
  7837. /**
  7838. * @enum {string}
  7839. * @see https://developer.chrome.com/extensions/bluetoothPrivate#type-ConnectResultType
  7840. */
  7841. chrome.bluetoothPrivate.ConnectResultType = {
  7842. ALREADY_CONNECTED: '',
  7843. ATTRIBUTE_LENGTH_INVALID: '',
  7844. AUTH_CANCELED: '',
  7845. AUTH_FAILED: '',
  7846. AUTH_REJECTED: '',
  7847. AUTH_TIMEOUT: '',
  7848. CONNECTION_CONGESTED: '',
  7849. FAILED: '',
  7850. IN_PROGRESS: '',
  7851. INSUFFICIENT_ENCRYPTION: '',
  7852. OFFSET_INVALID: '',
  7853. READ_NOT_PERMITTED: '',
  7854. REQUEST_NOT_SUPPORTED: '',
  7855. SUCCESS: '',
  7856. UNKNOWN_ERROR: '',
  7857. UNSUPPORTED_DEVICE: '',
  7858. WRITE_NOT_PERMITTED: '',
  7859. };
  7860. /**
  7861. * @enum {string}
  7862. * @see https://developer.chrome.com/extensions/bluetoothPrivate#type-TransportType
  7863. */
  7864. chrome.bluetoothPrivate.TransportType = {
  7865. LE: '',
  7866. BREDR: '',
  7867. DUAL: '',
  7868. };
  7869. /**
  7870. * Connects to the given device. This will only throw an error if the device
  7871. * address is invalid or the device is already connected. Otherwise this will
  7872. * succeed and invoke |callback| with ConnectResultType.
  7873. * @param {string} deviceAddress
  7874. * @param {function(!chrome.bluetoothPrivate.ConnectResultType):void=} callback
  7875. */
  7876. chrome.bluetoothPrivate.connect = function(deviceAddress, callback) {};
  7877. /**
  7878. * @const
  7879. * @see http://goo.gl/XmVdHm
  7880. */
  7881. chrome.inlineInstallPrivate = {};
  7882. /**
  7883. * Installs the given app ID.
  7884. * @param {string} id
  7885. * @param {function(string, string): void=} opt_callback Response callback that
  7886. * returns two string: (1) an error string (or empty string on success) and
  7887. * (2) an error code in case of error
  7888. * @return {undefined}
  7889. */
  7890. chrome.inlineInstallPrivate.install = function(id, opt_callback) {};
  7891. /**
  7892. * @const
  7893. * @see https://goo.gl/7dvJFW
  7894. */
  7895. chrome.wallpaper = {};
  7896. /**
  7897. * @enum {string}
  7898. * @see https://goo.gl/7dvJFW#type-WallpaperLayout
  7899. */
  7900. chrome.wallpaper.WallpaperLayout = {
  7901. STRETCH: '',
  7902. CENTER: '',
  7903. CENTER_CROPPED: '',
  7904. };
  7905. /**
  7906. * Sets wallpaper to the image at url or wallpaperData with the specified
  7907. * layout.
  7908. * @param {{
  7909. * data: (ArrayBuffer|undefined),
  7910. * url: (string|undefined),
  7911. * layout: (chrome.wallpaper.WallpaperLayout|string),
  7912. * filename: string,
  7913. * thumbnail: (boolean|undefined)
  7914. * }} details
  7915. * @param {function(ArrayBuffer=)} callback
  7916. * @return {undefined}
  7917. * @see https://goo.gl/7dvJFW#method-setWallpaper
  7918. */
  7919. chrome.wallpaper.setWallpaper = function(details, callback) {};
  7920. /**
  7921. * @const
  7922. * @see https://developer.chrome.com/extensions/downloads
  7923. */
  7924. chrome.downloads = {};
  7925. /**
  7926. * @enum {string}
  7927. * @see https://developer.chrome.com/extensions/downloads#type-FilenameConflictAction
  7928. */
  7929. chrome.downloads.FilenameConflictAction = {
  7930. UNIQUIFY: '',
  7931. OVERWRITE: '',
  7932. PROMPT: ''
  7933. };
  7934. /**
  7935. * @enum {string}
  7936. * @see https://developer.chrome.com/extensions/downloads#type-InterruptReason
  7937. */
  7938. chrome.downloads.InterruptReason = {
  7939. FILE_FAILED: '',
  7940. FILE_ACCESS_DENIED: '',
  7941. FILE_NO_SPACE: '',
  7942. FILE_NAME_TOO_LONG: '',
  7943. FILE_TOO_LARGE: '',
  7944. FILE_VIRUS_INFECTED: '',
  7945. FILE_TRANSIENT_ERROR: '',
  7946. FILE_BLOCKED: '',
  7947. FILE_SECURITY_CHECK_FAILED: '',
  7948. FILE_TOO_SHORT: '',
  7949. FILE_HASH_MISMATCH: '',
  7950. NETWORK_FAILED: '',
  7951. NETWORK_TIMEOUT: '',
  7952. NETWORK_DISCONNECTED: '',
  7953. NETWORK_SERVER_DOWN: '',
  7954. NETWORK_INVALID_REQUEST: '',
  7955. SERVER_FAILED: '',
  7956. SERVER_NO_RANGE: '',
  7957. SERVER_BAD_CONTENT: '',
  7958. SERVER_UNAUTHORIZED: '',
  7959. SERVER_CERT_PROBLEM: '',
  7960. SERVER_FORBIDDEN: '',
  7961. SERVER_UNREACHABLE: '',
  7962. USER_CANCELED: '',
  7963. USER_SHUTDOWN: '',
  7964. CRASH: '',
  7965. };
  7966. /**
  7967. * @enum {string}
  7968. * @see https://developer.chrome.com/extensions/downloads#type-DangerType
  7969. */
  7970. chrome.downloads.DangerType = {
  7971. FILE: '',
  7972. URL: '',
  7973. CONTENT: '',
  7974. UNCOMMON: '',
  7975. HOST: '',
  7976. UNWANTED: '',
  7977. SAFE: '',
  7978. ACCEPTED: ''
  7979. };
  7980. /**
  7981. * @enum {string}
  7982. * @see https://developer.chrome.com/extensions/downloads#type-State
  7983. */
  7984. chrome.downloads.State = {
  7985. IN_PROGRESS: '',
  7986. INTERRUPTED: '',
  7987. COMPLETE: '',
  7988. };
  7989. /**
  7990. * @constructor
  7991. * @see https://developer.chrome.com/extensions/downloads#type-DownloadItem
  7992. */
  7993. chrome.downloads.DownloadItem = function() {};
  7994. /** @type {number} */
  7995. chrome.downloads.DownloadItem.prototype.id;
  7996. /** @type {string} */
  7997. chrome.downloads.DownloadItem.prototype.url;
  7998. /** @type {string} */
  7999. chrome.downloads.DownloadItem.prototype.finalUrl;
  8000. /** @type {string} */
  8001. chrome.downloads.DownloadItem.prototype.referrer;
  8002. /** @type {string} */
  8003. chrome.downloads.DownloadItem.prototype.filename;
  8004. /** @type {boolean} */
  8005. chrome.downloads.DownloadItem.prototype.incognito;
  8006. /** @type {!chrome.downloads.DangerType|string} */
  8007. chrome.downloads.DownloadItem.prototype.danger;
  8008. /** @type {string} */
  8009. chrome.downloads.DownloadItem.prototype.mime;
  8010. /** @type {string} */
  8011. chrome.downloads.DownloadItem.prototype.startTime;
  8012. /** @type {?string} */
  8013. chrome.downloads.DownloadItem.prototype.endTime;
  8014. /** @type {?string} */
  8015. chrome.downloads.DownloadItem.prototype.estimatedEndTime;
  8016. /** @type {!chrome.downloads.State|string} */
  8017. chrome.downloads.DownloadItem.prototype.state;
  8018. /** @type {boolean} */
  8019. chrome.downloads.DownloadItem.prototype.paused;
  8020. /** @type {boolean} */
  8021. chrome.downloads.DownloadItem.prototype.canResume;
  8022. /** @type {!chrome.downloads.InterruptReason|string|undefined} */
  8023. chrome.downloads.DownloadItem.prototype.error;
  8024. /** @type {number} */
  8025. chrome.downloads.DownloadItem.prototype.bytesReceived;
  8026. /** @type {number} */
  8027. chrome.downloads.DownloadItem.prototype.totalBytes;
  8028. /** @type {number} */
  8029. chrome.downloads.DownloadItem.prototype.fileSize;
  8030. /** @type {boolean} */
  8031. chrome.downloads.DownloadItem.prototype.exists;
  8032. /** @type {?string} */
  8033. chrome.downloads.DownloadItem.prototype.byExtensionId;
  8034. /** @type {?string} */
  8035. chrome.downloads.DownloadItem.prototype.byExtensionName;
  8036. /**
  8037. * @constructor
  8038. * @see https://developer.chrome.com/extensions/downloads#type-StringDelta
  8039. */
  8040. chrome.downloads.StringDelta = function() {};
  8041. /** @type {?string} */
  8042. chrome.downloads.StringDelta.prototype.previous;
  8043. /** @type {?string} */
  8044. chrome.downloads.StringDelta.prototype.current;
  8045. /**
  8046. * @constructor
  8047. * @see https://developer.chrome.com/extensions/downloads#type-DoubleDelta
  8048. */
  8049. chrome.downloads.DoubleDelta = function() {};
  8050. /** @type {?number} */
  8051. chrome.downloads.DoubleDelta.prototype.previous;
  8052. /** @type {?number} */
  8053. chrome.downloads.DoubleDelta.prototype.current;
  8054. /**
  8055. * @constructor
  8056. * @see https://developer.chrome.com/extensions/downloads#type-BooleanDelta
  8057. */
  8058. chrome.downloads.BooleanDelta = function() {};
  8059. /** @type {?boolean} */
  8060. chrome.downloads.BooleanDelta.prototype.previous;
  8061. /** @type {?boolean} */
  8062. chrome.downloads.BooleanDelta.prototype.current;
  8063. /**
  8064. * @param {{
  8065. * url: string,
  8066. * filename: (string|undefined),
  8067. * conflictAction:
  8068. * (!chrome.downloads.FilenameConflictAction|string|undefined),
  8069. * saveAs: (boolean|undefined),
  8070. * method: (string|undefined),
  8071. * headers: (!Array<{name:string, value:string}>|undefined),
  8072. * body: (string|undefined)
  8073. * }} details
  8074. * @param {function(number)=} opt_callback
  8075. * @see https://developer.chrome.com/extensions/downloads#method-download
  8076. */
  8077. chrome.downloads.download = function(details, opt_callback) {};
  8078. /**
  8079. * @typedef {?{
  8080. * query: (!Array<string>|undefined),
  8081. * startedBefore: (string|undefined),
  8082. * startedAfter: (string|undefined),
  8083. * endedBefore: (string|undefined),
  8084. * endedAfter: (string|undefined),
  8085. * totalBytesGreater: (number|undefined),
  8086. * totalBytesLess: (number|undefined),
  8087. * filenameRegex: (string|undefined),
  8088. * urlRegex: (string|undefined),
  8089. * finalUrlRegex: (string|undefined),
  8090. * limit: (number|undefined),
  8091. * orderedBy: (!Array<string>|undefined),
  8092. * id: (number|undefined),
  8093. * url: (string|undefined),
  8094. * finalUrl: (string|undefined),
  8095. * filename: (string|undefined),
  8096. * danger: (!chrome.downloads.DangerType|string|undefined),
  8097. * mime: (string|undefined),
  8098. * startTime: (string|undefined),
  8099. * endTime: (string|undefined),
  8100. * state: (!chrome.downloads.State|string|undefined),
  8101. * paused: (boolean|undefined),
  8102. * error: (!chrome.downloads.InterruptReason|string|undefined),
  8103. * bytesReceived: (number|undefined),
  8104. * totalBytes: (number|undefined),
  8105. * fileSize: (number|undefined),
  8106. * exists: (boolean|undefined)
  8107. * }}
  8108. */
  8109. chrome.downloads.Query;
  8110. /**
  8111. * @param {!chrome.downloads.Query} query
  8112. * @param {function(!Array<!chrome.downloads.DownloadItem>)} callback
  8113. * @see https://developer.chrome.com/extensions/downloads#method-search
  8114. */
  8115. chrome.downloads.search = function(query, callback) {};
  8116. /**
  8117. * @param {number} id
  8118. * @param {function()=} opt_callback
  8119. *
  8120. * @see https://developer.chrome.com/extensions/downloads#method-pause
  8121. */
  8122. chrome.downloads.pause = function(id, opt_callback) {};
  8123. /**
  8124. * @param {number} id
  8125. * @param {function()=} opt_callback
  8126. *
  8127. * @see https://developer.chrome.com/extensions/downloads#method-resume
  8128. */
  8129. chrome.downloads.resume = function(id, opt_callback) {};
  8130. /**
  8131. * @param {number} id
  8132. * @param {function()=} opt_callback
  8133. *
  8134. * @see https://developer.chrome.com/extensions/downloads#method-cancel
  8135. */
  8136. chrome.downloads.cancel = function(id, opt_callback) {};
  8137. /**
  8138. * @param {number} id
  8139. * @param {{size:(number|undefined)}|function(string)} optionsOrCallback
  8140. * @param {function(string)=} opt_callback
  8141. *
  8142. * @see https://developer.chrome.com/extensions/downloads#method-getFileIcon
  8143. */
  8144. chrome.downloads.getFileIcon = function(id, optionsOrCallback, opt_callback) {};
  8145. /**
  8146. * @param {number} id
  8147. * @see https://developer.chrome.com/extensions/downloads#method-open
  8148. */
  8149. chrome.downloads.open = function(id) {};
  8150. /**
  8151. * @param {number} id
  8152. * @see https://developer.chrome.com/extensions/downloads#method-show
  8153. */
  8154. chrome.downloads.show = function(id) {};
  8155. /**
  8156. * @see https://developer.chrome.com/extensions/downloads#method-showDefaultFolder
  8157. */
  8158. chrome.downloads.showDefaultFolder = function() {};
  8159. /**
  8160. * @param {!chrome.downloads.Query} query
  8161. * @param {function(!Array<number>)} callback
  8162. * @see https://developer.chrome.com/extensions/downloads#method-erase
  8163. */
  8164. chrome.downloads.erase = function(query, callback) {};
  8165. /**
  8166. * @param {number} id
  8167. * @param {function()=} opt_callback
  8168. *
  8169. * @see https://developer.chrome.com/extensions/downloads#method-removeFile
  8170. */
  8171. chrome.downloads.removeFile = function(id, opt_callback) {};
  8172. /**
  8173. * @param {number} id
  8174. * @param {function()=} opt_callback
  8175. *
  8176. * @see https://developer.chrome.com/extensions/downloads#method-acceptDanger
  8177. */
  8178. chrome.downloads.acceptDanger = function(id, opt_callback) {};
  8179. /**
  8180. * @param {number} id
  8181. *
  8182. * @see https://developer.chrome.com/extensions/downloads#method-drag
  8183. */
  8184. chrome.downloads.drag = function(id) {};
  8185. /**
  8186. * @param {boolean} enabled
  8187. *
  8188. * @see https://developer.chrome.com/extensions/downloads#method-setShelfEnabled
  8189. */
  8190. chrome.downloads.setShelfEnabled = function(enabled) {};
  8191. /**
  8192. * @interface
  8193. * @extends {ChromeBaseEvent<function(!chrome.downloads.DownloadItem)>}
  8194. * @see https://developer.chrome.com/extensions/downloads#event-onCreated
  8195. */
  8196. chrome.downloads.CreatedEvent = function() {};
  8197. /**
  8198. * @type {!chrome.downloads.CreatedEvent}
  8199. * https://developer.chrome.com/extensions/downloads#event-onCreated
  8200. */
  8201. chrome.downloads.onCreated;
  8202. /**
  8203. * @type {!ChromeNumberEvent}
  8204. * https://developer.chrome.com/extensions/downloads#event-onErased
  8205. */
  8206. chrome.downloads.onErased;
  8207. /**
  8208. * @type {!ChromeObjectEvent}
  8209. * https://developer.chrome.com/extensions/downloads#event-onChanged
  8210. */
  8211. chrome.downloads.onChanged;
  8212. /**
  8213. * @typedef {?{
  8214. * filename: string,
  8215. * conflictAction: (!chrome.downloads.FilenameConflictAction|undefined)
  8216. * }}
  8217. * @see https://developer.chrome.com/extensions/downloads#event-onDeterminingFilename
  8218. */
  8219. chrome.downloads.FilenameSuggestion;
  8220. /**
  8221. * @interface
  8222. * @extends {ChromeBaseEvent<
  8223. * function(
  8224. * !chrome.downloads.DownloadItem,
  8225. * function(!chrome.downloads.FilenameSuggestion=))>}
  8226. * @see https://developer.chrome.com/extensions/downloads#event-onDeterminingFilename
  8227. */
  8228. chrome.downloads.DeterminingFilenameEvent = function() {};
  8229. /**
  8230. * @type {!chrome.downloads.DeterminingFilenameEvent}
  8231. * https://developer.chrome.com/extensions/downloads#event-onDeterminingFilename
  8232. */
  8233. chrome.downloads.onDeterminingFilename;
  8234. /**
  8235. * @const
  8236. * @see https://developer.chrome.com/extensions/declarativeContent
  8237. */
  8238. chrome.declarativeContent = {};
  8239. /**
  8240. * @typedef {!{
  8241. * pageUrl: (!UrlFilter|undefined),
  8242. * css: (!Array<string>|undefined),
  8243. * isBookmarked: (boolean|undefined)
  8244. * }}
  8245. * @see https://developer.chrome.com/extensions/declarativeContent#type-PageStateMatcher
  8246. */
  8247. chrome.declarativeContent.PageStateMatcherLiteral;
  8248. /**
  8249. * @constructor
  8250. * @param {!chrome.declarativeContent.PageStateMatcherLiteral=} literalValue
  8251. * @see https://developer.chrome.com/extensions/declarativeContent#type-PageStateMatcher
  8252. */
  8253. chrome.declarativeContent.PageStateMatcher = function(literalValue) {};
  8254. /**
  8255. * @constructor
  8256. * @see https://developer.chrome.com/extensions/declarativeContent#type-ShowPageAction
  8257. */
  8258. chrome.declarativeContent.ShowPageAction = function() {};
  8259. /**
  8260. * @typedef {!{
  8261. * imageData: (!ImageData|!Object<number, !ImageData>|undefined)
  8262. * }}
  8263. * @see https://developer.chrome.com/extensions/declarativeContent#type-SetIcon
  8264. */
  8265. chrome.declarativeContent.SetIconLiteral;
  8266. /**
  8267. * @constructor
  8268. * @param {!chrome.declarativeContent.SetIconLiteral} literalValue
  8269. * @see https://developer.chrome.com/extensions/declarativeContent#type-SetIcon
  8270. */
  8271. chrome.declarativeContent.SetIcon = function(literalValue) {};
  8272. /**
  8273. * @typedef {!{
  8274. * css: (!Array<string>|undefined),
  8275. * js: (!Array<string>|undefined),
  8276. * allFrames: (boolean|undefined),
  8277. * matchAboutBlank: (boolean|undefined)
  8278. * }}
  8279. * @see https://developer.chrome.com/extensions/declarativeContent#type-RequestContentScript
  8280. */
  8281. chrome.declarativeContent.RequestContentScriptLiteral;
  8282. /**
  8283. * @constructor
  8284. * @param {!chrome.declarativeContent.RequestContentScriptLiteral=} literalValue
  8285. * @see https://developer.chrome.com/extensions/declarativeContent#type-RequestContentScript
  8286. */
  8287. chrome.declarativeContent.RequestContentScript = function(literalValue) {};
  8288. /**
  8289. * @type {!ChromeVoidEvent}
  8290. * @see https://developer.chrome.com/extensions/declarativeContent#event-onPageChanged
  8291. */
  8292. chrome.declarativeContent.onPageChanged;
  8293. /**
  8294. * @see https://developer.chrome.com/extensions/instanceID
  8295. * @const
  8296. */
  8297. chrome.instanceID = {};
  8298. /**
  8299. * @param {function(string)} callback
  8300. * @see https://developer.chrome.com/extensions/instanceID#method-getID
  8301. */
  8302. chrome.instanceID.getID = function(callback) {};
  8303. /**
  8304. * @param {function(number)} callback
  8305. * @see https://developer.chrome.com/extensions/instanceID#method-getCreationTime
  8306. */
  8307. chrome.instanceID.getCreationTime = function(callback) {};
  8308. /**
  8309. * @typedef {{
  8310. * authorizedEntity: string,
  8311. * scope: string,
  8312. * options: (!Object|undefined)
  8313. * }}
  8314. */
  8315. chrome.instanceID.GetTokenParams;
  8316. /**
  8317. * @param {!chrome.instanceID.GetTokenParams} getTokenParams
  8318. * @param {function(string)} callback
  8319. * @see https://developer.chrome.com/extensions/instanceID#method-getToken
  8320. */
  8321. chrome.instanceID.getToken = function(getTokenParams, callback) {};
  8322. /**
  8323. * @typedef {{
  8324. * authorizedEntity: string,
  8325. * scope: string,
  8326. * }}
  8327. */
  8328. chrome.instanceID.DeleteTokenParams;
  8329. /**
  8330. * @param {!chrome.instanceID.DeleteTokenParams} deleteTokenParams
  8331. * @param {function()} callback
  8332. * @see https://developer.chrome.com/extensions/instanceID#method-deleteToken
  8333. */
  8334. chrome.instanceID.deleteToken = function(deleteTokenParams, callback) {};
  8335. /**
  8336. * @param {function()} callback
  8337. * @see https://developer.chrome.com/extensions/instanceID#method-deleteID
  8338. */
  8339. chrome.instanceID.deleteID = function(callback) {};
  8340. /**
  8341. * @const
  8342. * @see https://developer.chrome.com/extensions/instanceID#event-onTokenRefresh
  8343. */
  8344. chrome.instanceID.onTokenRefresh = {};
  8345. /**
  8346. * @param {function()} callback
  8347. * @see https://developer.chrome.com/extensions/instanceID#event-onTokenRefresh
  8348. */
  8349. chrome.instanceID.onTokenRefresh.addListener = function(callback) {};