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

_utils_.html 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <!doctype html>
  2. <html class="default no-js">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <title>&quot;Utils&quot; | rpclibrary</title>
  7. <meta name="description" content="">
  8. <meta name="viewport" content="width=device-width, initial-scale=1">
  9. <link rel="stylesheet" href="../assets/css/main.css">
  10. </head>
  11. <body>
  12. <header>
  13. <div class="tsd-page-toolbar">
  14. <div class="container">
  15. <div class="table-wrap">
  16. <div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
  17. <div class="field">
  18. <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
  19. <input id="tsd-search-field" type="text" />
  20. </div>
  21. <ul class="results">
  22. <li class="state loading">Preparing search index...</li>
  23. <li class="state failure">The search index is not available</li>
  24. </ul>
  25. <a href="../index.html" class="title">rpclibrary</a>
  26. </div>
  27. <div class="table-cell" id="tsd-widgets">
  28. <div id="tsd-filter">
  29. <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
  30. <div class="tsd-filter-group">
  31. <div class="tsd-select" id="tsd-filter-visibility">
  32. <span class="tsd-select-label">All</span>
  33. <ul class="tsd-select-list">
  34. <li data-value="public">Public</li>
  35. <li data-value="protected">Public/Protected</li>
  36. <li data-value="private" class="selected">All</li>
  37. </ul>
  38. </div>
  39. <input type="checkbox" id="tsd-filter-inherited" checked />
  40. <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
  41. <input type="checkbox" id="tsd-filter-externals" checked />
  42. <label class="tsd-widget" for="tsd-filter-externals">Externals</label>
  43. <input type="checkbox" id="tsd-filter-only-exported" />
  44. <label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
  45. </div>
  46. </div>
  47. <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="tsd-page-title">
  53. <div class="container">
  54. <ul class="tsd-breadcrumb">
  55. <li>
  56. <a href="../index.html">Globals</a>
  57. </li>
  58. <li>
  59. <a href="_utils_.html">&quot;Utils&quot;</a>
  60. </li>
  61. </ul>
  62. <h1>External module &quot;Utils&quot;</h1>
  63. </div>
  64. </div>
  65. </header>
  66. <div class="container container-main">
  67. <div class="row">
  68. <div class="col-8 col-content">
  69. <section class="tsd-panel-group tsd-index-group">
  70. <h2>Index</h2>
  71. <section class="tsd-panel tsd-index-panel">
  72. <div class="tsd-index-content">
  73. <section class="tsd-index-section ">
  74. <h3>Functions</h3>
  75. <ul class="tsd-index-list">
  76. <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_utils_.html#extractargs" class="tsd-kind-icon">extract<wbr>Args</a></li>
  77. <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_utils_.html#hookgenerator" class="tsd-kind-icon">hook<wbr>Generator</a></li>
  78. <li class="tsd-kind-function tsd-parent-kind-external-module"><a href="_utils_.html#makesubresponse" class="tsd-kind-icon">make<wbr>Sub<wbr>Response</a></li>
  79. <li class="tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter"><a href="_utils_.html#rpchooker" class="tsd-kind-icon">rpc<wbr>Hooker</a></li>
  80. <li class="tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter"><a href="_utils_.html#rpctorpcinfo" class="tsd-kind-icon">rpc<wbr>ToRpcinfo</a></li>
  81. </ul>
  82. </section>
  83. </div>
  84. </section>
  85. </section>
  86. <section class="tsd-panel-group tsd-member-group ">
  87. <h2>Functions</h2>
  88. <section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported">
  89. <a name="extractargs" class="tsd-anchor"></a>
  90. <h3><span class="tsd-flag ts-flagConst">Const</span> extract<wbr>Args</h3>
  91. <ul class="tsd-signatures tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported">
  92. <li class="tsd-signature tsd-kind-icon">extract<wbr>Args<span class="tsd-signature-symbol">(</span>f<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">T.Arg</span><span class="tsd-signature-symbol">[]</span></li>
  93. </ul>
  94. <ul class="tsd-descriptions">
  95. <li class="tsd-description">
  96. <aside class="tsd-sources">
  97. <ul>
  98. <li>Defined in Utils.ts:91</li>
  99. </ul>
  100. </aside>
  101. <h4 class="tsd-parameters-title">Parameters</h4>
  102. <ul class="tsd-parameters">
  103. <li>
  104. <h5>f: <span class="tsd-signature-type">Function</span></h5>
  105. </li>
  106. </ul>
  107. <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">T.Arg</span><span class="tsd-signature-symbol">[]</span></h4>
  108. </li>
  109. </ul>
  110. </section>
  111. <section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported">
  112. <a name="hookgenerator" class="tsd-anchor"></a>
  113. <h3><span class="tsd-flag ts-flagConst">Const</span> hook<wbr>Generator</h3>
  114. <ul class="tsd-signatures tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported">
  115. <li class="tsd-signature tsd-kind-icon">hook<wbr>Generator<span class="tsd-signature-symbol">(</span>rpc<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">T.HookRPC</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span></li>
  116. </ul>
  117. <ul class="tsd-descriptions">
  118. <li class="tsd-description">
  119. <aside class="tsd-sources">
  120. <ul>
  121. <li>Defined in Utils.ts:70</li>
  122. </ul>
  123. </aside>
  124. <h4 class="tsd-parameters-title">Parameters</h4>
  125. <ul class="tsd-parameters">
  126. <li>
  127. <h5>rpc: <span class="tsd-signature-type">T.HookRPC</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></h5>
  128. </li>
  129. </ul>
  130. <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">function</span></h4>
  131. <ul class="tsd-parameters">
  132. <li class="tsd-parameter-siganture">
  133. <ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
  134. <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>socket<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">I.Socket</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_types_.html#hookfunction" class="tsd-signature-type">HookFunction</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">T</span><span class="tsd-signature-symbol">&gt;</span></li>
  135. </ul>
  136. <ul class="tsd-descriptions">
  137. <li class="tsd-description">
  138. <h4 class="tsd-parameters-title">Parameters</h4>
  139. <ul class="tsd-parameters">
  140. <li>
  141. <h5><span class="tsd-flag ts-flagOptional">Optional</span> socket: <span class="tsd-signature-type">I.Socket</span></h5>
  142. </li>
  143. </ul>
  144. <h4 class="tsd-returns-title">Returns <a href="_types_.html#hookfunction" class="tsd-signature-type">HookFunction</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">T</span><span class="tsd-signature-symbol">&gt;</span></h4>
  145. </li>
  146. </ul>
  147. </li>
  148. </ul>
  149. </li>
  150. </ul>
  151. </section>
  152. <section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-external-module">
  153. <a name="makesubresponse" class="tsd-anchor"></a>
  154. <h3>make<wbr>Sub<wbr>Response</h3>
  155. <ul class="tsd-signatures tsd-kind-function tsd-parent-kind-external-module">
  156. <li class="tsd-signature tsd-kind-icon">make<wbr>Sub<wbr>Response<span class="tsd-signature-symbol">(</span>uuid<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_types_.html#subscriptionresponse" class="tsd-signature-type">SubscriptionResponse</a></li>
  157. </ul>
  158. <ul class="tsd-descriptions">
  159. <li class="tsd-description">
  160. <aside class="tsd-sources">
  161. <ul>
  162. <li>Defined in Utils.ts:96</li>
  163. </ul>
  164. </aside>
  165. <h4 class="tsd-parameters-title">Parameters</h4>
  166. <ul class="tsd-parameters">
  167. <li>
  168. <h5><span class="tsd-flag ts-flagOptional">Optional</span> uuid: <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></h5>
  169. </li>
  170. </ul>
  171. <h4 class="tsd-returns-title">Returns <a href="_types_.html#subscriptionresponse" class="tsd-signature-type">SubscriptionResponse</a></h4>
  172. </li>
  173. </ul>
  174. </section>
  175. <section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter">
  176. <a name="rpchooker" class="tsd-anchor"></a>
  177. <h3>rpc<wbr>Hooker</h3>
  178. <ul class="tsd-signatures tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter">
  179. <li class="tsd-signature tsd-kind-icon">rpc<wbr>Hooker&lt;SubResT&gt;<span class="tsd-signature-symbol">(</span>socket<span class="tsd-signature-symbol">: </span><a href="../interfaces/_interfaces_.socket.html" class="tsd-signature-type">Socket</a>, exporter<span class="tsd-signature-symbol">: </span><a href="../interfaces/_interfaces_.exporter.html" class="tsd-signature-type">Exporter</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">SubResT</span><span class="tsd-signature-symbol">&gt;</span>, makeUnique<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">T.ExtendedRpcInfo</span><span class="tsd-signature-symbol">[]</span></li>
  180. </ul>
  181. <ul class="tsd-descriptions">
  182. <li class="tsd-description">
  183. <aside class="tsd-sources">
  184. <ul>
  185. <li>Defined in Utils.ts:48</li>
  186. </ul>
  187. </aside>
  188. <h4 class="tsd-type-parameters-title">Type parameters</h4>
  189. <ul class="tsd-type-parameters">
  190. <li>
  191. <h4>SubResT</h4>
  192. </li>
  193. </ul>
  194. <h4 class="tsd-parameters-title">Parameters</h4>
  195. <ul class="tsd-parameters">
  196. <li>
  197. <h5>socket: <a href="../interfaces/_interfaces_.socket.html" class="tsd-signature-type">Socket</a></h5>
  198. </li>
  199. <li>
  200. <h5>exporter: <a href="../interfaces/_interfaces_.exporter.html" class="tsd-signature-type">Exporter</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">SubResT</span><span class="tsd-signature-symbol">&gt;</span></h5>
  201. </li>
  202. <li>
  203. <h5><span class="tsd-flag ts-flagDefault value">Default value</span> makeUnique: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> =&nbsp;true</span></h5>
  204. </li>
  205. </ul>
  206. <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">T.ExtendedRpcInfo</span><span class="tsd-signature-symbol">[]</span></h4>
  207. </li>
  208. </ul>
  209. </section>
  210. <section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter">
  211. <a name="rpctorpcinfo" class="tsd-anchor"></a>
  212. <h3><span class="tsd-flag ts-flagConst">Const</span> rpc<wbr>ToRpcinfo</h3>
  213. <ul class="tsd-signatures tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter">
  214. <li class="tsd-signature tsd-kind-icon">rpc<wbr>ToRpcinfo&lt;SubResT&gt;<span class="tsd-signature-symbol">(</span>rpc<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">T.RPC</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">SubResT</span><span class="tsd-signature-symbol">&gt;</span>, owner<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">T.Owner</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">T.RpcInfo</span></li>
  215. </ul>
  216. <ul class="tsd-descriptions">
  217. <li class="tsd-description">
  218. <aside class="tsd-sources">
  219. <ul>
  220. <li>Defined in Utils.ts:8</li>
  221. </ul>
  222. </aside>
  223. <h4 class="tsd-type-parameters-title">Type parameters</h4>
  224. <ul class="tsd-type-parameters">
  225. <li>
  226. <h4>SubResT</h4>
  227. </li>
  228. </ul>
  229. <h4 class="tsd-parameters-title">Parameters</h4>
  230. <ul class="tsd-parameters">
  231. <li>
  232. <h5>rpc: <span class="tsd-signature-type">T.RPC</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">SubResT</span><span class="tsd-signature-symbol">&gt;</span></h5>
  233. </li>
  234. <li>
  235. <h5>owner: <span class="tsd-signature-type">T.Owner</span></h5>
  236. </li>
  237. </ul>
  238. <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">T.RpcInfo</span></h4>
  239. </li>
  240. </ul>
  241. </section>
  242. </section>
  243. </div>
  244. <div class="col-4 col-menu menu-sticky-wrap menu-highlight">
  245. <nav class="tsd-navigation primary">
  246. <ul>
  247. <li class="globals ">
  248. <a href="../index.html"><em>Globals</em></a>
  249. </li>
  250. <li class=" tsd-kind-external-module">
  251. <a href="_backend_.html">"<wbr>Backend"</a>
  252. </li>
  253. <li class=" tsd-kind-external-module">
  254. <a href="_frontend_.html">"<wbr>Frontend"</a>
  255. </li>
  256. <li class=" tsd-kind-external-module">
  257. <a href="_interfaces_.html">"<wbr>Interfaces"</a>
  258. </li>
  259. <li class=" tsd-kind-external-module">
  260. <a href="_types_.html">"<wbr>Types"</a>
  261. </li>
  262. <li class="current tsd-kind-external-module">
  263. <a href="_utils_.html">"<wbr>Utils"</a>
  264. </li>
  265. </ul>
  266. </nav>
  267. <nav class="tsd-navigation secondary menu-sticky">
  268. <ul class="before-current">
  269. <li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported">
  270. <a href="_utils_.html#extractargs" class="tsd-kind-icon">extract<wbr>Args</a>
  271. </li>
  272. <li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported">
  273. <a href="_utils_.html#hookgenerator" class="tsd-kind-icon">hook<wbr>Generator</a>
  274. </li>
  275. <li class=" tsd-kind-function tsd-parent-kind-external-module">
  276. <a href="_utils_.html#makesubresponse" class="tsd-kind-icon">make<wbr>Sub<wbr>Response</a>
  277. </li>
  278. <li class=" tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter">
  279. <a href="_utils_.html#rpchooker" class="tsd-kind-icon">rpc<wbr>Hooker</a>
  280. </li>
  281. <li class=" tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter">
  282. <a href="_utils_.html#rpctorpcinfo" class="tsd-kind-icon">rpc<wbr>ToRpcinfo</a>
  283. </li>
  284. </ul>
  285. </nav>
  286. </div>
  287. </div>
  288. </div>
  289. <footer class="with-border-bottom">
  290. <div class="container">
  291. <h2>Legend</h2>
  292. <div class="tsd-legend-group">
  293. <ul class="tsd-legend">
  294. <li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
  295. <li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
  296. <li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
  297. <li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
  298. <li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
  299. <li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
  300. <li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
  301. <li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li>
  302. </ul>
  303. <ul class="tsd-legend">
  304. <li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
  305. <li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
  306. <li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
  307. <li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
  308. </ul>
  309. <ul class="tsd-legend">
  310. <li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
  311. <li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
  312. <li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
  313. <li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
  314. <li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
  315. <li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
  316. </ul>
  317. <ul class="tsd-legend">
  318. <li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
  319. <li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
  320. <li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
  321. <li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
  322. <li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
  323. <li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
  324. <li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
  325. </ul>
  326. <ul class="tsd-legend">
  327. <li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
  328. <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
  329. <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
  330. <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
  331. </ul>
  332. <ul class="tsd-legend">
  333. <li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
  334. <li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
  335. <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
  336. </ul>
  337. <ul class="tsd-legend">
  338. <li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
  339. <li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
  340. <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
  341. </ul>
  342. <ul class="tsd-legend">
  343. <li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
  344. <li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
  345. </ul>
  346. </div>
  347. </div>
  348. </footer>
  349. <div class="container tsd-generator">
  350. <p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
  351. </div>
  352. <div class="overlay"></div>
  353. <script src="../assets/js/main.js"></script>
  354. <script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
  355. </body>
  356. </html>