[{"data":1,"prerenderedAt":1531},["ShallowReactive",2],{"navigation":3,"\u002Ftauri\u002Fjavascript-api":129,"\u002Ftauri\u002Fjavascript-api-surround":1526},[4,27,65,107,125],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":26},"Getting started","i-lucide-rocket","\u002Fgetting-started","1.getting-started",[10,14,18,22],{"title":11,"path":12,"stem":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction",{"title":15,"path":16,"stem":17},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation",{"title":19,"path":20,"stem":21},"Quick start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start",{"title":23,"path":24,"stem":25},"MSRV","\u002Fgetting-started\u002Fmsrv","1.getting-started\u002F9.msrv",false,{"title":28,"icon":29,"path":30,"stem":31,"children":32,"page":26},"Client","i-lucide-plug-zap","\u002Fclient","2.client",[33,37,41,45,49,53,57,61],{"title":34,"path":35,"stem":36},"Configuration","\u002Fclient\u002Fconfiguration","2.client\u002F1.configuration",{"title":38,"path":39,"stem":40},"Events and acks","\u002Fclient\u002Fevents-and-acks","2.client\u002F2.events-and-acks",{"title":42,"path":43,"stem":44},"Connection state","\u002Fclient\u002Fconnection-state","2.client\u002F3.connection-state",{"title":46,"path":47,"stem":48},"Transports and proxies","\u002Fclient\u002Ftransports-and-proxies","2.client\u002F4.transports-and-proxies",{"title":50,"path":51,"stem":52},"TLS","\u002Fclient\u002Ftls","2.client\u002F5.tls",{"title":54,"path":55,"stem":56},"Errors","\u002Fclient\u002Ferrors","2.client\u002F6.errors",{"title":58,"path":59,"stem":60},"Debugging","\u002Fclient\u002Fdebugging","2.client\u002F7.debugging",{"title":62,"path":63,"stem":64},"Blocking client","\u002Fclient\u002Fblocking","2.client\u002F8.blocking",{"title":66,"icon":67,"path":68,"stem":69,"children":70,"page":26},"Tauri plugin","i-simple-icons-tauri","\u002Ftauri","3.tauri",[71,75,79,83,87,91,95,99,103],{"title":72,"path":73,"stem":74},"Setup","\u002Ftauri\u002Fsetup","3.tauri\u002F1.setup",{"title":76,"path":77,"stem":78},"JavaScript API","\u002Ftauri\u002Fjavascript-api","3.tauri\u002F2.javascript-api",{"title":80,"path":81,"stem":82},"Rust API","\u002Ftauri\u002Frust-api","3.tauri\u002F3.rust-api",{"title":84,"path":85,"stem":86},"Permissions","\u002Ftauri\u002Fpermissions","3.tauri\u002F4.permissions",{"title":88,"path":89,"stem":90},"Security","\u002Ftauri\u002Fsecurity","3.tauri\u002F5.security",{"title":92,"path":93,"stem":94},"Messages and errors","\u002Ftauri\u002Fmessages-and-errors","3.tauri\u002F6.messages-and-errors",{"title":96,"path":97,"stem":98},"Troubleshooting","\u002Ftauri\u002Ftroubleshooting","3.tauri\u002F7.troubleshooting",{"title":100,"path":101,"stem":102},"Example app","\u002Ftauri\u002Fexample","3.tauri\u002F8.example",{"title":104,"path":105,"stem":106},"Plugin changelog","\u002Ftauri\u002Fchangelog","3.tauri\u002F9.changelog",{"title":108,"icon":109,"path":110,"stem":111,"children":112,"page":26},"Guides","i-lucide-book-open","\u002Fguides","4.guides",[113,117,121],{"title":114,"path":115,"stem":116},"Migration from rust_socketio","\u002Fguides\u002Fmigration","4.guides\u002F1.migration",{"title":118,"path":119,"stem":120},"Comparison","\u002Fguides\u002Fcomparison","4.guides\u002F2.comparison",{"title":122,"path":123,"stem":124},"Contributing","\u002Fguides\u002Fcontributing","4.guides\u002F3.contributing",{"title":126,"path":127,"stem":128},"Changelog","\u002Fchangelog","9.changelog",{"id":130,"title":76,"body":131,"description":1520,"extension":1521,"links":1522,"meta":1523,"navigation":198,"path":77,"seo":1524,"stem":78,"__hash__":1525},"docs\u002F3.tauri\u002F2.javascript-api.md",{"type":132,"value":133,"toc":1512},"minimark",[134,678,683,757,781,902,906,909,1072,1079,1082,1276,1300,1309,1313,1333,1337,1376,1379,1397,1508],[135,136,141],"pre",{"className":137,"code":138,"language":139,"meta":140,"style":140},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { connect, attach, list, SocketIoError } from 'tauri-plugin-socketio-api'\n\nconst socket = await connect('chat', {\n  url: 'https:\u002F\u002Fchat.example.com',      \u002F\u002F the path is the namespace, like socket.io-client\n  auth: { token },\n  transports: ['websocket'],            \u002F\u002F default: polling upgraded to websocket\n  reconnectionDelay: 500,\n  events: ['message', 'typing'],        \u002F\u002F optional: forward only these events to this webview\n})\n\nsocket.on('message', (text, from) => console.log(from, text))\nsocket.on('question', (q, ack) => ack('answer'))       \u002F\u002F the server emitted with a callback\nsocket.onAny((event, ...args) => console.debug(event, args))\nconst off = socket.onState((s) => console.log(s.status))\n\nawait socket.emit('message', 'hi', new Uint8Array([1, 2, 3]))\nconst [sum] = await socket.emitWithAck('add', [1, 2], { timeout: 5000 })\n","ts","",[142,143,144,193,200,235,258,274,300,315,348,357,362,417,468,512,555,560,617],"code",{"__ignoreMap":140},[145,146,149,153,157,161,164,167,169,172,174,177,180,183,186,190],"span",{"class":147,"line":148},"line",1,[145,150,152],{"class":151},"s7zQu","import",[145,154,156],{"class":155},"sMK4o"," {",[145,158,160],{"class":159},"sTEyZ"," connect",[145,162,163],{"class":155},",",[145,165,166],{"class":159}," attach",[145,168,163],{"class":155},[145,170,171],{"class":159}," list",[145,173,163],{"class":155},[145,175,176],{"class":159}," SocketIoError",[145,178,179],{"class":155}," }",[145,181,182],{"class":151}," from",[145,184,185],{"class":155}," '",[145,187,189],{"class":188},"sfazB","tauri-plugin-socketio-api",[145,191,192],{"class":155},"'\n",[145,194,196],{"class":147,"line":195},2,[145,197,199],{"emptyLinePlaceholder":198},true,"\n",[145,201,203,207,210,213,216,219,222,225,228,230,232],{"class":147,"line":202},3,[145,204,206],{"class":205},"spNyl","const",[145,208,209],{"class":159}," socket ",[145,211,212],{"class":155},"=",[145,214,215],{"class":151}," await",[145,217,160],{"class":218},"s2Zo4",[145,220,221],{"class":159},"(",[145,223,224],{"class":155},"'",[145,226,227],{"class":188},"chat",[145,229,224],{"class":155},[145,231,163],{"class":155},[145,233,234],{"class":155}," {\n",[145,236,238,242,245,247,250,252,254],{"class":147,"line":237},4,[145,239,241],{"class":240},"swJcz","  url",[145,243,244],{"class":155},":",[145,246,185],{"class":155},[145,248,249],{"class":188},"https:\u002F\u002Fchat.example.com",[145,251,224],{"class":155},[145,253,163],{"class":155},[145,255,257],{"class":256},"sHwdD","      \u002F\u002F the path is the namespace, like socket.io-client\n",[145,259,261,264,266,268,271],{"class":147,"line":260},5,[145,262,263],{"class":240},"  auth",[145,265,244],{"class":155},[145,267,156],{"class":155},[145,269,270],{"class":159}," token ",[145,272,273],{"class":155},"},\n",[145,275,277,280,282,285,287,290,292,295,297],{"class":147,"line":276},6,[145,278,279],{"class":240},"  transports",[145,281,244],{"class":155},[145,283,284],{"class":159}," [",[145,286,224],{"class":155},[145,288,289],{"class":188},"websocket",[145,291,224],{"class":155},[145,293,294],{"class":159},"]",[145,296,163],{"class":155},[145,298,299],{"class":256},"            \u002F\u002F default: polling upgraded to websocket\n",[145,301,303,306,308,312],{"class":147,"line":302},7,[145,304,305],{"class":240},"  reconnectionDelay",[145,307,244],{"class":155},[145,309,311],{"class":310},"sbssI"," 500",[145,313,314],{"class":155},",\n",[145,316,318,321,323,325,327,330,332,334,336,339,341,343,345],{"class":147,"line":317},8,[145,319,320],{"class":240},"  events",[145,322,244],{"class":155},[145,324,284],{"class":159},[145,326,224],{"class":155},[145,328,329],{"class":188},"message",[145,331,224],{"class":155},[145,333,163],{"class":155},[145,335,185],{"class":155},[145,337,338],{"class":188},"typing",[145,340,224],{"class":155},[145,342,294],{"class":159},[145,344,163],{"class":155},[145,346,347],{"class":256},"        \u002F\u002F optional: forward only these events to this webview\n",[145,349,351,354],{"class":147,"line":350},9,[145,352,353],{"class":155},"}",[145,355,356],{"class":159},")\n",[145,358,360],{"class":147,"line":359},10,[145,361,199],{"emptyLinePlaceholder":198},[145,363,365,368,371,374,376,378,380,382,384,387,391,393,395,398,401,404,406,409,412,414],{"class":147,"line":364},11,[145,366,367],{"class":159},"socket",[145,369,370],{"class":155},".",[145,372,373],{"class":218},"on",[145,375,221],{"class":159},[145,377,224],{"class":155},[145,379,329],{"class":188},[145,381,224],{"class":155},[145,383,163],{"class":155},[145,385,386],{"class":155}," (",[145,388,390],{"class":389},"sHdIc","text",[145,392,163],{"class":155},[145,394,182],{"class":389},[145,396,397],{"class":155},")",[145,399,400],{"class":205}," =>",[145,402,403],{"class":159}," console",[145,405,370],{"class":155},[145,407,408],{"class":218},"log",[145,410,411],{"class":159},"(from",[145,413,163],{"class":155},[145,415,416],{"class":159}," text))\n",[145,418,420,422,424,426,428,430,433,435,437,439,442,444,447,449,451,453,455,457,460,462,465],{"class":147,"line":419},12,[145,421,367],{"class":159},[145,423,370],{"class":155},[145,425,373],{"class":218},[145,427,221],{"class":159},[145,429,224],{"class":155},[145,431,432],{"class":188},"question",[145,434,224],{"class":155},[145,436,163],{"class":155},[145,438,386],{"class":155},[145,440,441],{"class":389},"q",[145,443,163],{"class":155},[145,445,446],{"class":389}," ack",[145,448,397],{"class":155},[145,450,400],{"class":205},[145,452,446],{"class":218},[145,454,221],{"class":159},[145,456,224],{"class":155},[145,458,459],{"class":188},"answer",[145,461,224],{"class":155},[145,463,464],{"class":159},"))       ",[145,466,467],{"class":256},"\u002F\u002F the server emitted with a callback\n",[145,469,471,473,475,478,480,482,485,487,490,493,495,497,499,501,504,507,509],{"class":147,"line":470},13,[145,472,367],{"class":159},[145,474,370],{"class":155},[145,476,477],{"class":218},"onAny",[145,479,221],{"class":159},[145,481,221],{"class":155},[145,483,484],{"class":389},"event",[145,486,163],{"class":155},[145,488,489],{"class":155}," ...",[145,491,492],{"class":389},"args",[145,494,397],{"class":155},[145,496,400],{"class":205},[145,498,403],{"class":159},[145,500,370],{"class":155},[145,502,503],{"class":218},"debug",[145,505,506],{"class":159},"(event",[145,508,163],{"class":155},[145,510,511],{"class":159}," args))\n",[145,513,515,517,520,522,525,527,530,532,534,537,539,541,543,545,547,550,552],{"class":147,"line":514},14,[145,516,206],{"class":205},[145,518,519],{"class":159}," off ",[145,521,212],{"class":155},[145,523,524],{"class":159}," socket",[145,526,370],{"class":155},[145,528,529],{"class":218},"onState",[145,531,221],{"class":159},[145,533,221],{"class":155},[145,535,536],{"class":389},"s",[145,538,397],{"class":155},[145,540,400],{"class":205},[145,542,403],{"class":159},[145,544,370],{"class":155},[145,546,408],{"class":218},[145,548,549],{"class":159},"(s",[145,551,370],{"class":155},[145,553,554],{"class":159},"status))\n",[145,556,558],{"class":147,"line":557},15,[145,559,199],{"emptyLinePlaceholder":198},[145,561,563,566,568,570,573,575,577,579,581,583,585,588,590,592,595,598,601,604,606,609,611,614],{"class":147,"line":562},16,[145,564,565],{"class":151},"await",[145,567,524],{"class":159},[145,569,370],{"class":155},[145,571,572],{"class":218},"emit",[145,574,221],{"class":159},[145,576,224],{"class":155},[145,578,329],{"class":188},[145,580,224],{"class":155},[145,582,163],{"class":155},[145,584,185],{"class":155},[145,586,587],{"class":188},"hi",[145,589,224],{"class":155},[145,591,163],{"class":155},[145,593,594],{"class":155}," new",[145,596,597],{"class":218}," Uint8Array",[145,599,600],{"class":159},"([",[145,602,603],{"class":310},"1",[145,605,163],{"class":155},[145,607,608],{"class":310}," 2",[145,610,163],{"class":155},[145,612,613],{"class":310}," 3",[145,615,616],{"class":159},"]))\n",[145,618,620,622,624,627,629,632,634,636,638,641,643,645,648,650,652,654,656,658,660,662,664,666,669,671,674,676],{"class":147,"line":619},17,[145,621,206],{"class":205},[145,623,284],{"class":155},[145,625,626],{"class":159},"sum",[145,628,294],{"class":155},[145,630,631],{"class":155}," =",[145,633,215],{"class":151},[145,635,524],{"class":159},[145,637,370],{"class":155},[145,639,640],{"class":218},"emitWithAck",[145,642,221],{"class":159},[145,644,224],{"class":155},[145,646,647],{"class":188},"add",[145,649,224],{"class":155},[145,651,163],{"class":155},[145,653,284],{"class":159},[145,655,603],{"class":310},[145,657,163],{"class":155},[145,659,608],{"class":310},[145,661,294],{"class":159},[145,663,163],{"class":155},[145,665,156],{"class":155},[145,667,668],{"class":240}," timeout",[145,670,244],{"class":155},[145,672,673],{"class":310}," 5000",[145,675,179],{"class":155},[145,677,356],{"class":159},[679,680,682],"h2",{"id":681},"functions","Functions",[684,685,686,699],"table",{},[687,688,689],"thead",{},[690,691,692,696],"tr",{},[693,694,695],"th",{},"Function",[693,697,698],{},"What",[700,701,702,721,731,743],"tbody",{},[690,703,704,710],{},[705,706,707],"td",{},[142,708,709],{},"connect(id, options)",[705,711,712,713,716,717,720],{},"connects a new client under ",[142,714,715],{},"id",", owned by the webviews (",[142,718,719],{},"Access::Full","), and subscribes to it",[690,722,723,728],{},[705,724,725],{},[142,726,727],{},"attach(id, { events? })",[705,729,730],{},"subscribes to a registered client (one Rust registered, or one connected before a reload)",[690,732,733,738],{},[705,734,735],{},[142,736,737],{},"list()",[705,739,740],{},[142,741,742],{},"[{ id, access: 'full' | 'readOnly', namespace, state }]",[690,744,745,754],{},[705,746,747,750,751],{},[142,748,749],{},"encodeArgs(args)"," \u002F ",[142,752,753],{},"decodeArgs({ args, binary })",[705,755,756],{},"the binary encoding used on the IPC",[758,759,760,764,765,768,769,772,773,776,777,780],"p",{},[761,762,763],"strong",{},"Ids are unique."," ",[142,766,767],{},"connect"," with an id in use rejects with ",[142,770,771],{},"AlreadyExists",", typically after a page reload, since the client lives in Rust. ",[142,774,775],{},"attach(id)"," to it, or ",[142,778,779],{},"disconnect"," it first.",[135,782,784],{"className":137,"code":783,"language":139,"meta":140,"style":140},"const socket = await connect('chat', { url }).catch((e) => {\n  if (e instanceof SocketIoError && e.kind === 'AlreadyExists') return attach('chat')\n  throw e\n})\n",[142,785,786,835,888,896],{"__ignoreMap":140},[145,787,788,790,792,794,796,798,800,802,804,806,808,810,813,815,817,819,822,824,826,829,831,833],{"class":147,"line":148},[145,789,206],{"class":205},[145,791,209],{"class":159},[145,793,212],{"class":155},[145,795,215],{"class":151},[145,797,160],{"class":218},[145,799,221],{"class":159},[145,801,224],{"class":155},[145,803,227],{"class":188},[145,805,224],{"class":155},[145,807,163],{"class":155},[145,809,156],{"class":155},[145,811,812],{"class":159}," url ",[145,814,353],{"class":155},[145,816,397],{"class":159},[145,818,370],{"class":155},[145,820,821],{"class":218},"catch",[145,823,221],{"class":159},[145,825,221],{"class":155},[145,827,828],{"class":389},"e",[145,830,397],{"class":155},[145,832,400],{"class":205},[145,834,234],{"class":155},[145,836,837,840,842,844,847,850,853,856,858,861,864,866,868,870,873,876,878,880,882,884,886],{"class":147,"line":195},[145,838,839],{"class":151},"  if",[145,841,386],{"class":240},[145,843,828],{"class":159},[145,845,846],{"class":155}," instanceof",[145,848,176],{"class":849},"sBMFI",[145,851,852],{"class":155}," &&",[145,854,855],{"class":159}," e",[145,857,370],{"class":155},[145,859,860],{"class":159},"kind",[145,862,863],{"class":155}," ===",[145,865,185],{"class":155},[145,867,771],{"class":188},[145,869,224],{"class":155},[145,871,872],{"class":240},") ",[145,874,875],{"class":151},"return",[145,877,166],{"class":218},[145,879,221],{"class":240},[145,881,224],{"class":155},[145,883,227],{"class":188},[145,885,224],{"class":155},[145,887,356],{"class":240},[145,889,890,893],{"class":147,"line":202},[145,891,892],{"class":151},"  throw",[145,894,895],{"class":159}," e\n",[145,897,898,900],{"class":147,"line":237},[145,899,353],{"class":155},[145,901,356],{"class":159},[679,903,905],{"id":904},"options","Options",[758,907,908],{},"Durations are in milliseconds.",[684,910,911,920],{},[687,912,913],{},[690,914,915,918],{},[693,916,917],{},"Option",[693,919,698],{},[700,921,922,932,949,971,981,1005,1015,1037,1052,1062],{},[690,923,924,929],{},[705,925,926],{},[142,927,928],{},"url",[705,930,931],{},"server URL; its path is the namespace",[690,933,934,943],{},[705,935,936,939,940],{},[142,937,938],{},"namespace",", ",[142,941,942],{},"path",[705,944,945,946,397],{},"namespace, engine.io path (default ",[142,947,948],{},"\u002Fsocket.io\u002F",[690,950,951,959],{},[705,952,953,939,956],{},[142,954,955],{},"query",[142,957,958],{},"headers",[705,960,961,962,965,966,397],{},"query parameters, extra headers (",[142,963,964],{},"extraHeaders","; some are ",[967,968,970],"a",{"href":969},"\u002Ftauri\u002Fsecurity#headers","refused",[690,972,973,978],{},[705,974,975],{},[142,976,977],{},"auth",[705,979,980],{},"the CONNECT payload",[690,982,983,988],{},[705,984,985],{},[142,986,987],{},"transports",[705,989,990,993,994,939,997,1000,1001,1004],{},[142,991,992],{},"['polling', 'websocket']"," (default: polling upgraded to websocket), ",[142,995,996],{},"['websocket']",[142,998,999],{},"['polling']"," or ",[142,1002,1003],{},"'websocket-upgrade'"," (the upgrade must succeed)",[690,1006,1007,1012],{},[705,1008,1009],{},[142,1010,1011],{},"timeout",[705,1013,1014],{},"one connect attempt (handshake + upgrade + CONNECT), default 20000",[690,1016,1017,1034],{},[705,1018,1019,939,1022,939,1025,939,1028,939,1031],{},[142,1020,1021],{},"reconnection",[142,1023,1024],{},"reconnectionAttempts",[142,1026,1027],{},"reconnectionDelay",[142,1029,1030],{},"reconnectionDelayMax",[142,1032,1033],{},"randomizationFactor",[705,1035,1036],{},"backoff, as in socket.io-client",[690,1038,1039,1047],{},[705,1040,1041,939,1044],{},[142,1042,1043],{},"reconnectOnDisconnect",[142,1045,1046],{},"bufferWhileDisconnected",[705,1048,1049,1050],{},"see ",[967,1051,34],{"href":35},[690,1053,1054,1059],{},[705,1055,1056],{},[142,1057,1058],{},"ca",[705,1060,1061],{},"PEM certificates to trust instead of the default roots (a private CA); certificate checks cannot be turned off",[690,1063,1064,1069],{},[705,1065,1066],{},[142,1067,1068],{},"events",[705,1070,1071],{},"forwarding filter: only these events reach this webview (state is always forwarded)",[758,1073,1074,1075,1078],{},"A wrong option type or value rejects with ",[142,1076,1077],{},"InvalidOptions"," (the value is not echoed).",[679,1080,1081],{"id":367},"Socket",[684,1083,1084,1093],{},[687,1085,1086],{},[690,1087,1088,1091],{},[693,1089,1090],{},"Member",[693,1092,698],{},[700,1094,1095,1112,1122,1149,1169,1181,1191,1206,1223,1239,1253,1263],{},[690,1096,1097,1102],{},[705,1098,1099],{},[142,1100,1101],{},"emit(event, ...args)",[705,1103,1104,1105,939,1108,1111],{},"sends; rejects with ",[142,1106,1107],{},"NotConnected",[142,1109,1110],{},"AccessDenied",", ...",[690,1113,1114,1119],{},[705,1115,1116],{},[142,1117,1118],{},"emitWithAck(event, args, { timeout })",[705,1120,1121],{},"resolves with the ack's arguments (default timeout 10 s)",[690,1123,1124,1134],{},[705,1125,1126,939,1128,939,1131],{},[142,1127,373],{},[142,1129,1130],{},"once",[142,1132,1133],{},"off(event, listener?)",[705,1135,1136,1137,1140,1141,1144,1145,1148],{},"event listeners; the last argument is an ",[142,1138,1139],{},"ack"," function when the server passed a callback (calling it again does nothing; a failed answer is logged). ",[142,1142,1143],{},"off(event, fn)"," also removes ",[142,1146,1147],{},"once(event, fn)",". A throwing listener does not stop the others",[690,1150,1151,1156],{},[705,1152,1153],{},[142,1154,1155],{},"on('connect' | 'disconnect' | 'connect_error', …)",[705,1157,1158,1159,1161,1162,1165,1166],{},"from the state transitions, as in socket.io-client: ",[142,1160,779],{}," gets the reason, ",[142,1163,1164],{},"connect_error"," a ",[142,1167,1168],{},"SocketIoError",[690,1170,1171,1178],{},[705,1172,1173,939,1175],{},[142,1174,477],{},[142,1176,1177],{},"offAny",[705,1179,1180],{},"every event",[690,1182,1183,1188],{},[705,1184,1185],{},[142,1186,1187],{},"onState(listener)",[705,1189,1190],{},"state changes; returns an unsubscribe function",[690,1192,1193,1203],{},[705,1194,1195,939,1198,939,1200],{},[142,1196,1197],{},"connected",[142,1199,715],{},[142,1201,1202],{},"lastState",[705,1204,1205],{},"the latest state seen, synchronously",[690,1207,1208,1216],{},[705,1209,1210,939,1213],{},[142,1211,1212],{},"state()",[142,1214,1215],{},"linkInfo()",[705,1217,1218,1219,1222],{},"ask Rust; ",[142,1220,1221],{},"LinkInfo"," mirrors the Rust one (times as Unix epoch milliseconds)",[690,1224,1225,1236],{},[705,1226,1227,939,1230,939,1233],{},[142,1228,1229],{},"setAuth(auth)",[142,1231,1232],{},"setHeaders(headers)",[142,1234,1235],{},"setQuery(query)",[705,1237,1238],{},"used from the next connect attempt",[690,1240,1241,1246],{},[705,1242,1243],{},[142,1244,1245],{},"reconnect()",[705,1247,1248,1249,1252],{},"connects a ",[142,1250,1251],{},"closed"," client again (rejected, attempts used up, server disconnect)",[690,1254,1255,1260],{},[705,1256,1257],{},[142,1258,1259],{},"close()",[705,1261,1262],{},"stops receiving in this webview; the client stays connected",[690,1264,1265,1270],{},[705,1266,1267],{},[142,1268,1269],{},"disconnect()",[705,1271,1272,1273,1275],{},"leaves, closes and unregisters the client (every webview sees ",[142,1274,1251],{},"; this socket reports it as soon as the call resolves)",[758,1277,1278,1279,750,1282,750,1285,1288,1289,1292,1293,1296,1297,1299],{},"Auth, headers and query are read again before every connect attempt, so ",[142,1280,1281],{},"setAuth",[142,1283,1284],{},"setHeaders",[142,1286,1287],{},"setQuery"," take effect on the next reconnect. They and ",[142,1290,1291],{},"reconnect"," work on clients a webview connected; they fail with ",[142,1294,1295],{},"NotConfigurable"," on Rust's clients and ",[142,1298,1110],{}," on read-only ones.",[758,1301,1302,1303,1306,1307,370],{},"States are ",[142,1304,1305],{},"{ status: 'connecting' | 'connected' | 'disconnected' | 'reconnecting' | 'closed', ... }",", see ",[967,1308,92],{"href":93},[679,1310,1312],{"id":1311},"timing","Timing",[758,1314,1315,1317,1318,750,1320,1323,1324,939,1327,1330,1331,370],{},[142,1316,767],{}," attaches the subscription before connecting, so the events the server sends right after the connect are not lost. When ",[142,1319,767],{},[142,1321,1322],{},"attach"," resolve, the socket already has the current state (",[142,1325,1326],{},"socket.connected",[142,1328,1329],{},"socket.id","); messages are held until the call resolved and the subscription's snapshot (its first state message) arrived, then dispatched in the next task (states older than the snapshot are dropped). Add handlers right after the ",[142,1332,565],{},[679,1334,1336],{"id":1335},"binary","Binary",[758,1338,1339,939,1342,1345,1346,1349,1350,1353,1354,1357,1358,1360,1361,1364,1365,1368,1369,1371,1372,1375],{},[142,1340,1341],{},"Uint8Array",[142,1343,1344],{},"ArrayBuffer",", typed arrays, ",[142,1347,1348],{},"DataView","s, ",[142,1351,1352],{},"Blob","s and ",[142,1355,1356],{},"File","s anywhere in the arguments are sent as socket.io attachments; incoming attachments arrive as ",[142,1359,1341],{},"s. On the IPC they are ",[142,1362,1363],{},"{ args, binary }",", where ",[142,1366,1367],{},"{\"_placeholder\":true,\"num\":n}"," in ",[142,1370,492],{}," stands for ",[142,1373,1374],{},"binary[n]"," (socket.io-parser's encoding). Without attachments nothing is replaced: a JSON object that looks like a placeholder stays JSON. Bytes cross the IPC as arrays of numbers, so prefer the websocket for large blobs.",[679,1377,54],{"id":1378},"errors",[758,1380,1381,1382,1384,1385,939,1387,1389,1390,1393,1394,370],{},"Rejections are ",[142,1383,1168],{}," with ",[142,1386,860],{},[142,1388,329],{}," and ",[142,1391,1392],{},"data","; see ",[967,1395,92],{"href":1396},"\u002Ftauri\u002Fmessages-and-errors#errors",[135,1398,1400],{"className":137,"code":1399,"language":139,"meta":140,"style":140},"try {\n  await socket.emitWithAck('save', [doc], { timeout: 3000 })\n} catch (e) {\n  if (e instanceof SocketIoError && e.kind === 'AckTimeout') retry()\n}\n",[142,1401,1402,1409,1453,1466,1503],{"__ignoreMap":140},[145,1403,1404,1407],{"class":147,"line":148},[145,1405,1406],{"class":151},"try",[145,1408,234],{"class":155},[145,1410,1411,1414,1416,1418,1420,1422,1424,1427,1429,1431,1433,1436,1438,1440,1442,1444,1446,1449,1451],{"class":147,"line":195},[145,1412,1413],{"class":151},"  await",[145,1415,524],{"class":159},[145,1417,370],{"class":155},[145,1419,640],{"class":218},[145,1421,221],{"class":240},[145,1423,224],{"class":155},[145,1425,1426],{"class":188},"save",[145,1428,224],{"class":155},[145,1430,163],{"class":155},[145,1432,284],{"class":240},[145,1434,1435],{"class":159},"doc",[145,1437,294],{"class":240},[145,1439,163],{"class":155},[145,1441,156],{"class":155},[145,1443,668],{"class":240},[145,1445,244],{"class":155},[145,1447,1448],{"class":310}," 3000",[145,1450,179],{"class":155},[145,1452,356],{"class":240},[145,1454,1455,1457,1460,1463],{"class":147,"line":202},[145,1456,353],{"class":155},[145,1458,1459],{"class":151}," catch",[145,1461,1462],{"class":159}," (e) ",[145,1464,1465],{"class":155},"{\n",[145,1467,1468,1470,1472,1474,1476,1478,1480,1482,1484,1486,1488,1490,1493,1495,1497,1500],{"class":147,"line":237},[145,1469,839],{"class":151},[145,1471,386],{"class":240},[145,1473,828],{"class":159},[145,1475,846],{"class":155},[145,1477,176],{"class":849},[145,1479,852],{"class":155},[145,1481,855],{"class":159},[145,1483,370],{"class":155},[145,1485,860],{"class":159},[145,1487,863],{"class":155},[145,1489,185],{"class":155},[145,1491,1492],{"class":188},"AckTimeout",[145,1494,224],{"class":155},[145,1496,872],{"class":240},[145,1498,1499],{"class":218},"retry",[145,1501,1502],{"class":240},"()\n",[145,1504,1505],{"class":147,"line":260},[145,1506,1507],{"class":155},"}\n",[1509,1510,1511],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":140,"searchDepth":195,"depth":202,"links":1513},[1514,1515,1516,1517,1518,1519],{"id":681,"depth":195,"text":682},{"id":904,"depth":195,"text":905},{"id":367,"depth":195,"text":1081},{"id":1311,"depth":195,"text":1312},{"id":1335,"depth":195,"text":1336},{"id":1378,"depth":195,"text":54},"connect, attach, list and the Socket class of tauri-plugin-socketio-api.","md",null,{},{"title":76,"description":1520},"k3-RIPSBYo9YpGRurACsp3QEz72kXPmv1n0HpmjXvf4",[1527,1529],{"title":72,"path":73,"stem":74,"description":1528,"children":-1},"Install tauri-plugin-socketio and its JS API, register the plugin, grant the permissions.",{"title":80,"path":81,"stem":82,"description":1530,"children":-1},"[object Object]",1795285663955]