forked from swiftwasm/JavaScriptKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
523 lines (491 loc) · 30.8 KB
/
Copy pathindex.html
File metadata and controls
523 lines (491 loc) · 30.8 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JavaScriptKit - JSValue</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="#relationships">Relationships</a><ul><li><a href="#relationships">Conforms To</a></li></ul></li><li><a href="#initializers">Initializers</a><ul><li class="initializer"><a href="#jsvalue.init(stringliteral:)">init(stringLiteral:)</a></li><li class="initializer"><a href="#jsvalue.init(integerliteral:)">init(integerLiteral:)</a></li><li class="initializer"><a href="#jsvalue.init(floatliteral:)">init(floatLiteral:)</a></li><li class="initializer"><a href="#jsvalue.init(nilliteral:)">init(nilLiteral:)</a></li></ul></li><li><a href="#enumeration cases">Enumeration Cases</a><ul><li class="case"><a href="#jsvalue.boolean">boolean</a></li><li class="case"><a href="#jsvalue.string">string</a></li><li class="case"><a href="#jsvalue.number">number</a></li><li class="case"><a href="#jsvalue.object">object</a></li><li class="case"><a href="#jsvalue.null">null</a></li><li class="case"><a href="#jsvalue.undefined">undefined</a></li><li class="case"><a href="#jsvalue.function">function</a></li></ul></li><li><a href="#properties">Properties</a><ul><li class="variable"><a href="#jsvalue.array">array</a></li><li class="variable"><a href="#jsvalue.boolean">boolean</a></li><li class="variable"><a href="#jsvalue.string">string</a></li><li class="variable"><a href="#jsvalue.jsstring">jsString</a></li><li class="variable"><a href="#jsvalue.number">number</a></li><li class="variable"><a href="#jsvalue.object">object</a></li><li class="variable"><a href="#jsvalue.function">function</a></li><li class="variable"><a href="#jsvalue.isnull">isNull</a></li><li class="variable"><a href="#jsvalue.isundefined">isUndefined</a></li><li class="variable"><a href="#jsvalue.description">description</a></li></ul></li><li><a href="#methods">Methods</a><ul><li class="function"><a href="#jsvalue.construct(from:)">construct(from:)</a></li><li class="function"><a href="#jsvalue.jsvalue()">jsValue()</a></li><li class="function"><a href="#jsvalue.fromjsvalue()">fromJSValue()</a></li><li class="function"><a href="#jsvalue.string(_:)">string(_:)</a></li><li class="function"><a href="#jsvalue.function(_:)">function(_:)</a></li><li class="function"><a href="#jsvalue.function(_:)">function(_:)</a></li><li class="function"><a href="#jsvalue.isinstanceof(_:)">isInstanceOf(_:)</a></li></ul></li></ol>
</div>
</nav>
<main>
<article>
<h1>
<small>Enumeration</small>
<code class="name">JSValue</code>
</h1>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="attribute">@</span><span class="attribute">dynamicMemberLookup</span>
<span class="keyword">public</span> <span class="keyword">enum</span> <span class="type">JSValue</span>: <span class="type">Equatable</span> </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
<p><code>JSValue</code> represents a value in JavaScript.</p>
</div>
<section id="relationships">
<h2 hidden>Relationships</h2>
<figure>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.40.1 (20161225.0304)
-->
<!-- Title: %71 Pages: 1 -->
<svg width="1402pt" height="289pt"
viewBox="0.00 0.00 1401.75 288.69" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 284.6939)">
<title>%71</title>
<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-284.6939 1397.7457,-284.6939 1397.7457,4 -4,4"/>
<!-- JSValue -->
<g id="node1" class="node enumeration current">
<title>JSValue</title>
<g id="a_node1"><a xlink:href="/JavaScriptKit/JSValue" xlink:title="JSValue">
<path fill="none" stroke="#000000" stroke-width="3" d="M761.7356,-158.2802C761.7356,-158.2802 569.7356,-158.2802 569.7356,-158.2802 563.7356,-158.2802 557.7356,-152.2802 557.7356,-146.2802 557.7356,-146.2802 557.7356,-134.2802 557.7356,-134.2802 557.7356,-128.2802 563.7356,-122.2802 569.7356,-122.2802 569.7356,-122.2802 761.7356,-122.2802 761.7356,-122.2802 767.7356,-122.2802 773.7356,-128.2802 773.7356,-134.2802 773.7356,-134.2802 773.7356,-146.2802 773.7356,-146.2802 773.7356,-152.2802 767.7356,-158.2802 761.7356,-158.2802"/>
<text text-anchor="middle" x="665.7356" y="-136.5802" font-family="Menlo" font-size="14.00" fill="#000000">JSValue</text>
</a>
</g>
</g>
<!-- ExpressibleByFloatLiteral -->
<g id="node2" class="node unknown">
<title>ExpressibleByFloatLiteral</title>
<path fill="none" stroke="#000000" d="M1381.7457,-159.213C1381.7457,-159.213 1189.7457,-159.213 1189.7457,-159.213 1183.7457,-159.213 1177.7457,-153.213 1177.7457,-147.213 1177.7457,-147.213 1177.7457,-135.213 1177.7457,-135.213 1177.7457,-129.213 1183.7457,-123.213 1189.7457,-123.213 1189.7457,-123.213 1381.7457,-123.213 1381.7457,-123.213 1387.7457,-123.213 1393.7457,-129.213 1393.7457,-135.213 1393.7457,-135.213 1393.7457,-147.213 1393.7457,-147.213 1393.7457,-153.213 1387.7457,-159.213 1381.7457,-159.213"/>
<text text-anchor="middle" x="1285.7457" y="-137.513" font-family="Menlo" font-size="14.00" fill="#000000">ExpressibleByFloatLiteral</text>
</g>
<!-- JSValue->ExpressibleByFloatLiteral -->
<g id="edge4" class="edge conformsTo">
<title>JSValue->ExpressibleByFloatLiteral</title>
<path fill="none" stroke="#000000" d="M774.0877,-140.4432C884.103,-140.6087 1053.972,-140.8643 1167.439,-141.035"/>
<polygon fill="#000000" stroke="#000000" points="1167.5501,-144.5351 1177.5554,-141.0502 1167.5607,-137.5351 1167.5501,-144.5351"/>
</g>
<!-- ExpressibleByStringLiteral -->
<g id="node3" class="node unknown">
<title>ExpressibleByStringLiteral</title>
<path fill="none" stroke="#000000" d="M628.8677,-36C628.8677,-36 436.8677,-36 436.8677,-36 430.8677,-36 424.8677,-30 424.8677,-24 424.8677,-24 424.8677,-12 424.8677,-12 424.8677,-6 430.8677,0 436.8677,0 436.8677,0 628.8677,0 628.8677,0 634.8677,0 640.8677,-6 640.8677,-12 640.8677,-12 640.8677,-24 640.8677,-24 640.8677,-30 634.8677,-36 628.8677,-36"/>
<text text-anchor="middle" x="532.8677" y="-14.3" font-family="Menlo" font-size="14.00" fill="#000000">ExpressibleByStringLiteral</text>
</g>
<!-- JSValue->ExpressibleByStringLiteral -->
<g id="edge7" class="edge conformsTo">
<title>JSValue->ExpressibleByStringLiteral</title>
<path fill="none" stroke="#000000" d="M646.1305,-122.2374C623.3647,-101.2857 585.6713,-66.5958 560.0777,-43.0417"/>
<polygon fill="#000000" stroke="#000000" points="562.2816,-40.3134 552.5533,-36.1169 557.5413,-45.4641 562.2816,-40.3134"/>
</g>
<!-- Equatable -->
<g id="node4" class="node unknown">
<title>Equatable</title>
<path fill="none" stroke="#000000" d="M206.0791,-213.5604C206.0791,-213.5604 14.0791,-213.5604 14.0791,-213.5604 8.0791,-213.5604 2.0791,-207.5604 2.0791,-201.5604 2.0791,-201.5604 2.0791,-189.5604 2.0791,-189.5604 2.0791,-183.5604 8.0791,-177.5604 14.0791,-177.5604 14.0791,-177.5604 206.0791,-177.5604 206.0791,-177.5604 212.0791,-177.5604 218.0791,-183.5604 218.0791,-189.5604 218.0791,-189.5604 218.0791,-201.5604 218.0791,-201.5604 218.0791,-207.5604 212.0791,-213.5604 206.0791,-213.5604"/>
<text text-anchor="middle" x="110.0791" y="-191.8604" font-family="Menlo" font-size="14.00" fill="#000000">Equatable</text>
</g>
<!-- JSValue->Equatable -->
<g id="edge5" class="edge conformsTo">
<title>JSValue->Equatable</title>
<path fill="none" stroke="#000000" d="M557.6107,-151.0372C463.0835,-160.4413 326.0722,-174.0721 228.5885,-183.7704"/>
<polygon fill="#000000" stroke="#000000" points="227.9954,-180.312 218.3911,-184.7849 228.6885,-187.2776 227.9954,-180.312"/>
</g>
<!-- CustomStringConvertible -->
<g id="node5" class="node unknown">
<title>CustomStringConvertible</title>
<path fill="none" stroke="#000000" d="M1148.815,-256.2503C1148.815,-256.2503 956.815,-256.2503 956.815,-256.2503 950.815,-256.2503 944.815,-250.2503 944.815,-244.2503 944.815,-244.2503 944.815,-232.2503 944.815,-232.2503 944.815,-226.2503 950.815,-220.2503 956.815,-220.2503 956.815,-220.2503 1148.815,-220.2503 1148.815,-220.2503 1154.815,-220.2503 1160.815,-226.2503 1160.815,-232.2503 1160.815,-232.2503 1160.815,-244.2503 1160.815,-244.2503 1160.815,-250.2503 1154.815,-256.2503 1148.815,-256.2503"/>
<text text-anchor="middle" x="1052.815" y="-234.5503" font-family="Menlo" font-size="14.00" fill="#000000">CustomStringConvertible</text>
</g>
<!-- JSValue->CustomStringConvertible -->
<g id="edge6" class="edge conformsTo">
<title>JSValue->CustomStringConvertible</title>
<path fill="none" stroke="#000000" d="M737.183,-158.3636C803.4968,-175.1477 902.1325,-200.1124 971.45,-217.6567"/>
<polygon fill="#000000" stroke="#000000" points="970.904,-221.1288 981.4571,-220.1895 972.6216,-214.3428 970.904,-221.1288"/>
</g>
<!-- JSValueCompatible -->
<g id="node6" class="node unknown">
<title>JSValueCompatible</title>
<path fill="none" stroke="#000000" d="M628.5518,-280.6939C628.5518,-280.6939 436.5518,-280.6939 436.5518,-280.6939 430.5518,-280.6939 424.5518,-274.6939 424.5518,-268.6939 424.5518,-268.6939 424.5518,-256.6939 424.5518,-256.6939 424.5518,-250.6939 430.5518,-244.6939 436.5518,-244.6939 436.5518,-244.6939 628.5518,-244.6939 628.5518,-244.6939 634.5518,-244.6939 640.5518,-250.6939 640.5518,-256.6939 640.5518,-256.6939 640.5518,-268.6939 640.5518,-268.6939 640.5518,-274.6939 634.5518,-280.6939 628.5518,-280.6939"/>
<text text-anchor="middle" x="532.5518" y="-258.9939" font-family="Menlo" font-size="14.00" fill="#000000">JSValueCompatible</text>
</g>
<!-- JSValue->JSValueCompatible -->
<g id="edge3" class="edge conformsTo">
<title>JSValue->JSValueCompatible</title>
<path fill="none" stroke="#000000" d="M646.0839,-158.3428C623.264,-179.3173 585.4809,-214.045 559.8265,-237.6249"/>
<polygon fill="#000000" stroke="#000000" points="557.2782,-235.2133 552.2841,-244.5573 562.0152,-240.367 557.2782,-235.2133"/>
</g>
<!-- ExpressibleByIntegerLiteral -->
<g id="node7" class="node unknown">
<title>ExpressibleByIntegerLiteral</title>
<path fill="none" stroke="#000000" d="M204,-104.0006C204,-104.0006 12,-104.0006 12,-104.0006 6,-104.0006 0,-98.0006 0,-92.0006 0,-92.0006 0,-80.0006 0,-80.0006 0,-74.0006 6,-68.0006 12,-68.0006 12,-68.0006 204,-68.0006 204,-68.0006 210,-68.0006 216,-74.0006 216,-80.0006 216,-80.0006 216,-92.0006 216,-92.0006 216,-98.0006 210,-104.0006 204,-104.0006"/>
<text text-anchor="middle" x="108" y="-82.3006" font-family="Menlo" font-size="14.00" fill="#000000">ExpressibleByIntegerLiteral</text>
</g>
<!-- JSValue->ExpressibleByIntegerLiteral -->
<g id="edge1" class="edge conformsTo">
<title>JSValue->ExpressibleByIntegerLiteral</title>
<path fill="none" stroke="#000000" d="M557.5373,-129.7502C462.5383,-120.5048 324.604,-107.0808 226.6212,-97.545"/>
<polygon fill="#000000" stroke="#000000" points="226.6643,-94.0328 216.3723,-96.5476 225.9862,-100.9998 226.6643,-94.0328"/>
</g>
<!-- ExpressibleByNilLiteral -->
<g id="node8" class="node unknown">
<title>ExpressibleByNilLiteral</title>
<path fill="none" stroke="#000000" d="M1153.3483,-61.1937C1153.3483,-61.1937 961.3483,-61.1937 961.3483,-61.1937 955.3483,-61.1937 949.3483,-55.1937 949.3483,-49.1937 949.3483,-49.1937 949.3483,-37.1937 949.3483,-37.1937 949.3483,-31.1937 955.3483,-25.1937 961.3483,-25.1937 961.3483,-25.1937 1153.3483,-25.1937 1153.3483,-25.1937 1159.3483,-25.1937 1165.3483,-31.1937 1165.3483,-37.1937 1165.3483,-37.1937 1165.3483,-49.1937 1165.3483,-49.1937 1165.3483,-55.1937 1159.3483,-61.1937 1153.3483,-61.1937"/>
<text text-anchor="middle" x="1057.3483" y="-39.4937" font-family="Menlo" font-size="14.00" fill="#000000">ExpressibleByNilLiteral</text>
</g>
<!-- JSValue->ExpressibleByNilLiteral -->
<g id="edge2" class="edge conformsTo">
<title>JSValue->ExpressibleByNilLiteral</title>
<path fill="none" stroke="#000000" d="M738.4772,-122.2465C805.4144,-105.6518 904.6194,-81.0575 974.5647,-63.717"/>
<polygon fill="#000000" stroke="#000000" points="975.8009,-67.0166 984.6648,-61.213 974.1164,-60.2222 975.8009,-67.0166"/>
</g>
</g>
</svg>
<figcaption hidden>Inheritance graph for JSValue.</figcaption>
</figure>
<h3>Conforms To</h3>
<dl>
<dt class="unknown"><code>CustomStringConvertible</code></dt>
<dt class="unknown"><code>Equatable</code></dt>
<dt class="unknown"><code>ExpressibleByFloatLiteral</code></dt>
<dt class="unknown"><code>ExpressibleByIntegerLiteral</code></dt>
<dt class="unknown"><code>ExpressibleByNilLiteral</code></dt>
<dt class="unknown"><code>ExpressibleByStringLiteral</code></dt>
<dt class="unknown"><code>JSValueCompatible</code></dt>
</dl>
</section>
<section id="initializers">
<h2>Initializers</h2>
<div role="article" class="initializer" id="jsvalue.init(stringliteral:)">
<h3>
<code><a href="#jsvalue.init(stringliteral:)">init(stringLiteral:)</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">init</span>(<span class="variable">stringLiteral</span> <span class="variable">value</span>: <span class="type">String</span>) </body></html></code></pre>
</div>
</div>
<div role="article" class="initializer" id="jsvalue.init(integerliteral:)">
<h3>
<code><a href="#jsvalue.init(integerliteral:)">init(integerLiteral:)</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">init</span>(<span class="variable">integerLiteral</span> <span class="variable">value</span>: <span class="type">Int32</span>) </body></html></code></pre>
</div>
</div>
<div role="article" class="initializer" id="jsvalue.init(floatliteral:)">
<h3>
<code><a href="#jsvalue.init(floatliteral:)">init(floatLiteral:)</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">init</span>(<span class="variable">floatLiteral</span> <span class="variable">value</span>: <span class="type">Double</span>) </body></html></code></pre>
</div>
</div>
<div role="article" class="initializer" id="jsvalue.init(nilliteral:)">
<h3>
<code><a href="#jsvalue.init(nilliteral:)">init(nilLiteral:)</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">init</span>(<span class="variable">nilLiteral</span>: ()) </body></html></code></pre>
</div>
</div>
</section>
<section id="enumeration cases">
<h2>Enumeration Cases</h2>
<div role="article" class="case" id="jsvalue.boolean">
<h3>
<code><a href="#jsvalue.boolean">boolean</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">case</span> <span class="variable">boolean</span>(<span class="type">Bool</span>) </body></html></code></pre>
</div>
</div>
<div role="article" class="case" id="jsvalue.string">
<h3>
<code><a href="#jsvalue.string">string</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">case</span> <span class="variable">string</span>(<a href="/JavaScriptKit/JSString"><span class="type">JSString</span></a>) </body></html></code></pre>
</div>
</div>
<div role="article" class="case" id="jsvalue.number">
<h3>
<code><a href="#jsvalue.number">number</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">case</span> <span class="variable">number</span>(<span class="type">Double</span>) </body></html></code></pre>
</div>
</div>
<div role="article" class="case" id="jsvalue.object">
<h3>
<code><a href="#jsvalue.object">object</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">case</span> <span class="variable">object</span>(<a href="/JavaScriptKit/JSObject"><span class="type">JSObject</span></a>) </body></html></code></pre>
</div>
</div>
<div role="article" class="case" id="jsvalue.null">
<h3>
<code><a href="#jsvalue.null">null</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">case</span> <span class="variable">null</span></body></html></code></pre>
</div>
</div>
<div role="article" class="case" id="jsvalue.undefined">
<h3>
<code><a href="#jsvalue.undefined">undefined</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">case</span> <span class="variable">undefined</span></body></html></code></pre>
</div>
</div>
<div role="article" class="case" id="jsvalue.function">
<h3>
<code><a href="#jsvalue.function">function</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">case</span> <span class="variable">function</span>(<a href="/JavaScriptKit/JSFunction"><span class="type">JSFunction</span></a>) </body></html></code></pre>
</div>
</div>
</section>
<section id="properties">
<h2>Properties</h2>
<div role="article" class="variable" id="jsvalue.array">
<h3>
<code><a href="#jsvalue.array">array</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">array</span>: <a href="/JavaScriptKit/JSArray"><span class="type">JSArray</span></a>? </body></html></code></pre>
</div>
</div>
<div role="article" class="variable" id="jsvalue.boolean">
<h3>
<code><a href="#jsvalue.boolean">boolean</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">boolean</span>: <span class="type">Bool</span>? </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
<p>Returns the <code>Bool</code> value of this JS value if its type is boolean.
If not, returns <code>nil</code>.</p>
</div>
</div>
<div role="article" class="variable" id="jsvalue.string">
<h3>
<code><a href="#jsvalue.string">string</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">string</span>: <span class="type">String</span>? </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
<p>Returns the <code>String</code> value of this JS value if the type is string.
If not, returns <code>nil</code>.</p>
</div>
<div class="discussion">
<p>Note that this accessor may copy the JS string value into Swift side memory.</p>
<p>To avoid the copying, please consider the <code>jsString</code> instead.</p>
</div>
</div>
<div role="article" class="variable" id="jsvalue.jsstring">
<h3>
<code><a href="#jsvalue.jsstring">jsString</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">jsString</span>: <a href="/JavaScriptKit/JSString"><span class="type">JSString</span></a>? </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
<p>Returns the <code>JSString</code> value of this JS value if the type is string.
If not, returns <code>nil</code>.</p>
</div>
</div>
<div role="article" class="variable" id="jsvalue.number">
<h3>
<code><a href="#jsvalue.number">number</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">number</span>: <span class="type">Double</span>? </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
<p>Returns the <code>Double</code> value of this JS value if the type is number.
If not, returns <code>nil</code>.</p>
</div>
</div>
<div role="article" class="variable" id="jsvalue.object">
<h3>
<code><a href="#jsvalue.object">object</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">object</span>: <a href="/JavaScriptKit/JSObject"><span class="type">JSObject</span></a>? </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
<p>Returns the <code>JSObject</code> of this JS value if its type is object.
If not, returns <code>nil</code>.</p>
</div>
</div>
<div role="article" class="variable" id="jsvalue.function">
<h3>
<code><a href="#jsvalue.function">function</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">function</span>: <a href="/JavaScriptKit/JSFunction"><span class="type">JSFunction</span></a>? </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
<p>Returns the <code>JSFunction</code> of this JS value if its type is function.
If not, returns <code>nil</code>.</p>
</div>
</div>
<div role="article" class="variable" id="jsvalue.isnull">
<h3>
<code><a href="#jsvalue.isnull">isNull</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">isNull</span>: <span class="type">Bool</span> </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
<p>Returns the <code>true</code> if this JS value is null.
If not, returns <code>false</code>.</p>
</div>
</div>
<div role="article" class="variable" id="jsvalue.isundefined">
<h3>
<code><a href="#jsvalue.isundefined">isUndefined</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">isUndefined</span>: <span class="type">Bool</span> </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
<p>Returns the <code>true</code> if this JS value is undefined.
If not, returns <code>false</code>.</p>
</div>
</div>
<div role="article" class="variable" id="jsvalue.description">
<h3>
<code><a href="#jsvalue.description">description</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">description</span>: <span class="type">String</span> </body></html></code></pre>
</div>
</div>
</section>
<section id="methods">
<h2>Methods</h2>
<div role="article" class="function" id="jsvalue.construct(from:)">
<h3>
<code><a href="#jsvalue.construct(from:)">construct(from:)</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">func</span> <span class="function">construct</span>(<span class="variable">from</span> <span class="variable">value</span>: <a href="/JavaScriptKit/JSValue"><span class="type">JSValue</span></a>) -> <span class="keyword">Self</span>? </body></html></code></pre>
</div>
</div>
<div role="article" class="function" id="jsvalue.jsvalue()">
<h3>
<code><a href="#jsvalue.jsvalue()">jsValue()</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">jsValue</span>() -> <a href="/JavaScriptKit/JSValue"><span class="type">JSValue</span></a> </body></html></code></pre>
</div>
</div>
<div role="article" class="function" id="jsvalue.fromjsvalue()">
<h3>
<code><a href="#jsvalue.fromjsvalue()">fromJSValue()</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">fromJSValue</span><<span class="variable">Type</span>>() -> <span class="type">Type</span>? <span class="keyword">where</span> <span class="type">Type</span>: <a href="/JavaScriptKit/ConstructibleFromJSValue"><span class="type">ConstructibleFromJSValue</span></a> </body></html></code></pre>
</div>
</div>
<div role="article" class="function" id="jsvalue.string(_:)">
<h3>
<code><a href="#jsvalue.string(_:)">string(_:)</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">func</span> <span class="function">string</span>(<span class="keyword">_</span> <span class="variable">value</span>: <span class="type">String</span>) -> <a href="/JavaScriptKit/JSValue"><span class="type">JSValue</span></a> </body></html></code></pre>
</div>
</div>
<div role="article" class="function" id="jsvalue.function(_:)">
<h3>
<code><a href="#jsvalue.function(_:)">function(_:)</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="attribute">@</span><span class="attribute">available</span>(*, <span class="variable">deprecated</span>, <span class="variable">message</span>: <span class="string literal">"Please create JSClosure directly and manage its lifetime manually."</span>)
<span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">func</span> <span class="function">function</span>(<span class="keyword">_</span> <span class="variable">body</span>: <span class="attribute">@</span><span class="attribute">escaping</span> ([<a href="/JavaScriptKit/JSValue"><span class="type">JSValue</span></a>]) -> <a href="/JavaScriptKit/JSValue"><span class="type">JSValue</span></a>) -> <a href="/JavaScriptKit/JSValue"><span class="type">JSValue</span></a> </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
<p>Deprecated: Please create <code>JSClosure</code> directly and manage its lifetime manually.</p>
</div>
<div class="discussion">
<p>Migrate this usage</p>
<html><body><pre class="highlight"><code><span class="variable">button</span>.<span class="variable">addEventListener</span>!(<span class="string literal">"</span><span class="string literal">click</span><span class="string literal">"</span>, <span class="variable">JSValue</span>.<span class="variable">function</span> { <span class="keyword">_</span> <span class="keyword">in</span>
...
<span class="keyword">return</span> <span class="variable">JSValue</span>.<span class="variable">undefined</span>
})
</code></pre></body></html>
<p>into below code.</p>
<html><body><pre class="highlight"><code><span class="keyword">let</span> <span class="variable">eventListenter</span> = <span class="variable">JSClosure</span> { <span class="keyword">_</span> <span class="keyword">in</span>
...
<span class="keyword">return</span> <span class="variable">JSValue</span>.<span class="variable">undefined</span>
}
<span class="variable">button</span>.<span class="variable">addEventListener</span>!(<span class="string literal">"</span><span class="string literal">click</span><span class="string literal">"</span>, <span class="variable">JSValue</span>.<span class="variable">function</span>(<span class="variable">eventListenter</span>))
...
<span class="variable">button</span>.<span class="variable">removeEventListener</span>!(<span class="string literal">"</span><span class="string literal">click</span><span class="string literal">"</span>, <span class="variable">JSValue</span>.<span class="variable">function</span>(<span class="variable">eventListenter</span>))
<span class="variable">eventListenter</span>.<span class="variable">release</span>()
</code></pre></body></html>
</div>
</div>
<div role="article" class="function" id="jsvalue.function(_:)">
<h3>
<code><a href="#jsvalue.function(_:)">function(_:)</a></code>
</h3>
<div class="declaration">
<pre class="highlight"><code><html><body><span class="attribute">@</span><span class="attribute">available</span>(*, <span class="variable">deprecated</span>, <span class="variable">renamed</span>: <span class="string literal">"object"</span>, <span class="variable">message</span>: <span class="string literal">"JSClosure is no longer a subclass of JSFunction. Use .object(closure) instead."</span>)
<span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">func</span> <span class="function">function</span>(<span class="keyword">_</span> <span class="variable">closure</span>: <a href="/JavaScriptKit/JSClosure"><span class="type">JSClosure</span></a>) -> <a href="/JavaScriptKit/JSValue"><span class="type">JSValue</span></a> </body></html></code></pre>
</div>
</div>
<div role="article" class="function" id="jsvalue.isinstanceof(_:)">
<h3>
<code><a href="#jsvalue.isinstanceof(_:)">isInstanceOf(_:)</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">isInstanceOf</span>(<span class="keyword">_</span> <span class="variable">constructor</span>: <a href="/JavaScriptKit/JSFunction"><span class="type">JSFunction</span></a>) -> <span class="type">Bool</span> </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
<p>Return <code>true</code> if this value is an instance of the passed <code>constructor</code> function.
Returns <code>false</code> for everything except objects and functions.</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>constructor</th>
<td><code class="type">JSFunction</code></td>
<td><p>The constructor function to check.</p>
</td>
</tr>
</tbody>
</table>
<h4>Returns</h4>
<p>The result of <code>instanceof</code> in the JavaScript environment.</p>
</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>