Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
120 lines (105 loc) · 4.02 KB
/
Copy pathindex.html
File metadata and controls
120 lines (105 loc) · 4.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JavaScriptKit - JSValueDecoder</title>
<link rel="stylesheet" type="text/css" href="/JavaScriptKit/all.css" media="all" />
</head>
<body>
<header>
<a href="/JavaScriptKit">
<strong>
JavaScriptKit
</strong>
<span>Documentation</span>
</a>
</header>
<!--
<form class="search">
<input type="search" placeholder="Search" />
</form>
-->
<nav>
<div class="wrapper">
<h2>On This Page</h2>
<ol><li><a href="#initializers">Initializers</a><ul><li class="initializer"><a href="#jsvaluedecoder.init()">init()</a></li></ul></li><li><a href="#methods">Methods</a><ul><li class="function"><a href="#jsvaluedecoder.decode(_:from:userinfo:)">decode(_:from:userInfo:)</a></li></ul></li></ol>
</div>
</nav>
<main>
<article>
<h1>
<small>Class</small>
<code class="name">JSValueDecoder</code>
</h1>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">class</span> <span class="type">JSValueDecoder</span> </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
<p><code>JSValueDecoder</code> facilitates the decoding of JavaScript value into semantic <code>Decodable</code> types.</p>
</div>
<section id="initializers">
<h2>Initializers</h2>
<div role="article" class="initializer" id="jsvaluedecoder.init()">
<h3>
<code><a href="#jsvaluedecoder.init()">init()</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">init</span>() </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
<p>Initializes a new <code>JSValueDecoder</code>.</p>
</div>
</div>
</section>
<section id="methods">
<h2>Methods</h2>
<div role="article" class="function" id="jsvaluedecoder.decode(_:from:userinfo:)">
<h3>
<code><a href="#jsvaluedecoder.decode(_:from:userinfo:)">decode(_:from:userInfo:)</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">func</span> <span class="function">decode</span><<span class="variable">T</span>>(
<span class="keyword">_</span>: <span class="type">T</span>.<span class="type">Type</span> = <span class="variable">T</span>.<span class="keyword">self</span>,
<span class="variable">from</span> <span class="variable">value</span>: <a href="/JavaScriptKit/JSValue"><span class="type">JSValue</span></a>,
<span class="variable">userInfo</span>: [<span class="type">CodingUserInfoKey</span>: <span class="keyword">Any</span>] = [:]
) <span class="keyword">throws</span> -> <span class="type">T</span> <span class="keyword">where</span> <span class="type">T</span>: <span class="type">Decodable</span> </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
<p>Decodes a top-level value of the given type from the given JavaScript value representation.</p>
</div>
<h4>Parameters</h4>
<table class="parameters">
<thead hidden>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<th>T</th>
<td></td>
<td><p>The type of the value to decode.</p>
</td>
</tr>
<tr>
<th>value</th>
<td><code class="type">JSValue</code></td>
<td><p>The <code>JSValue</code> to decode from.</p>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</article>
</main>
<footer>
<p>
Generated on <time datetime="2022-02-22T15:19:50+0000">February 22, 2022</time> using <a href="https://github.com/SwiftDocOrg/swift-doc">swift-doc</a> <span class="version">1.0.0-rc.1</span>.
</p>
</footer>
</body>
</html>