forked from mildred/nclearseam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
svelte.html
553 lines (450 loc) · 57.8 KB
/
svelte.html
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
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- This file is generated by Nim. -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Favicon -->
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
<!-- Google fonts -->
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
<!-- CSS -->
<title>svelte</title>
<link rel="stylesheet" type="text/css" href="nimdoc.out.css">
<script type="text/javascript" src="dochack.js"></script>
<script type="text/javascript">
function main() {
var pragmaDots = document.getElementsByClassName("pragmadots");
for (var i = 0; i < pragmaDots.length; i++) {
pragmaDots[i].onclick = function(event) {
// Hide tease
event.target.parentNode.style.display = "none";
// Show actual
event.target.parentNode.nextElementSibling.style.display = "inline";
}
}
const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]');
function switchTheme(e) {
if (e.target.checked) {
document.documentElement.setAttribute('data-theme', 'dark');
localStorage.setItem('theme', 'dark');
} else {
document.documentElement.setAttribute('data-theme', 'light');
localStorage.setItem('theme', 'light');
}
}
toggleSwitch.addEventListener('change', switchTheme, false);
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute('data-theme', "dark");
toggleSwitch.checked = true;
} else if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) {
document.documentElement.setAttribute('data-theme', "light");
toggleSwitch.checked = false;
} else {
const currentTheme = localStorage.getItem('theme') ? localStorage.getItem('theme') : null;
if (currentTheme) {
document.documentElement.setAttribute('data-theme', currentTheme);
if (currentTheme === 'dark') {
toggleSwitch.checked = true;
}
}
}
}
</script>
</head>
<body onload="main()">
<div class="document" id="documentId">
<div class="container">
<h1 class="title">svelte</h1>
<div class="row">
<div class="three columns">
<div class="theme-switch-wrapper">
<label class="theme-switch" for="checkbox">
<input type="checkbox" id="checkbox" />
<div class="slider round"></div>
</label>
<em>Dark Mode</em>
</div>
<div id="global-links">
<ul class="simple">
</ul>
</div>
<div id="searchInputDiv">
Search: <input type="text" id="searchInput"
onkeyup="search()" />
</div>
<div>
Group by:
<select onchange="groupBy(this.value)">
<option value="section">Section</option>
<option value="type">Type</option>
</select>
</div>
<ul class="simple simple-toc" id="toc-list">
<li>
<a class="reference reference-toplevel" href="#6" id="56">Imports</a>
<ul class="simple simple-toc-section">
</ul>
</li>
<li>
<a class="reference reference-toplevel" href="#7" id="57">Types</a>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#CompileError"
title="CompileError = object of CatchableError"><wbr />Compile<wbr />Error<span class="attachedType"></span></a></li>
<li><a class="reference" href="#CompileSelectorError"
title="CompileSelectorError = object of CompileError"><wbr />Compile<wbr />Selector<wbr />Error<span class="attachedType"></span></a></li>
<li><a class="reference" href="#CompileLateError"
title="CompileLateError = object of CompileError"><wbr />Compile<wbr />Late<wbr />Error<span class="attachedType"></span></a></li>
<li><a class="reference" href="#ProcRefresh"
title="ProcRefresh[D] = proc (node: dom.Node; data: D)"><wbr />Proc<wbr />Refresh<span class="attachedType"></span></a></li>
<li><a class="reference" href="#ProcTypeConverter"
title="ProcTypeConverter[D1; D2] = proc (data: D1): D2"><wbr />Proc<wbr />Type<wbr />Converter<span class="attachedType"></span></a></li>
<li><a class="reference" href="#ProcIter"
title="ProcIter[D2] = proc (): tuple[ok: bool, data: D2]"><wbr />Proc<wbr />Iter<span class="attachedType"></span></a></li>
<li><a class="reference" href="#ProcIterator"
title="ProcIterator[D1; D2] = proc (d: D1): ProcIter[D2]"><wbr />Proc<wbr />Iterator<span class="attachedType"></span></a></li>
<li><a class="reference" href="#Config"
title="Config[D] = ref object
matches: seq[MatchConfigInterface[D]]"><wbr />Config<span class="attachedType"></span></a></li>
<li><a class="reference" href="#MatchConfig"
title="MatchConfig[D; D2] = ref object
selector: string
refresh: seq[ProcRefresh[D2]]
matches: seq[MatchConfigInterface[D2]]
mount: ComponentInterface[D2]
case iter: bool
of false:
convert: ProcTypeConverter[D, D2]
of true:
iterate: ProcIterator[D, D2]"><wbr />Match<wbr />Config<span class="attachedType"></span></a></li>
<li><a class="reference" href="#Component"
title="Component[D] = ref object
config: Config[D]
matches: seq[CompMatchInterface[D]]
node: dom.Node
original_node: dom.Node"><wbr />Component<span class="attachedType"></span></a></li>
<li><a class="reference" href="#ComponentInterface"
title="ComponentInterface[D] = ref object
node*: proc (): dom.Node
update*: proc (data: D; refresh: bool)
clone*: proc (): ComponentInterface[D]"><wbr />Component<wbr />Interface<span class="attachedType"></span></a></li>
</ul>
</li>
<li>
<a class="reference reference-toplevel" href="#12" id="62">Procs</a>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#create"
title="create[D](): Config[D]"><wbr />create<span class="attachedType">Config</span></a></li>
<li><a class="reference" href="#create%2Ctypedesc%5BD%5D%2Cproc%28Config%5BD%5D%29"
title="create[D](d: typedesc[D]; configurator: proc (c: Config[D])): Config[D]"><wbr />create<span class="attachedType">Config</span></a></li>
<li><a class="reference" href="#match%2CMatchConfig%5BX%2CD%5D%2Cstring%2CProcTypeConverter%5BD%2CD2%5D%2Cproc%28MatchConfig%5BD%2CD2%5D%29"
title="match[X, D, D2](c: MatchConfig[X, D]; selector: string;
convert: ProcTypeConverter[D, D2];
actions: proc (x: MatchConfig[D, D2]) = nil): MatchConfig[D, D2]"><wbr />match<span class="attachedType">MatchConfig</span></a></li>
<li><a class="reference" href="#match%2CConfig%5BD%5D%2Cstring%2CProcTypeConverter%5BD%2CD2%5D%2Cproc%28MatchConfig%5BD%2CD2%5D%29"
title="match[D, D2](c: Config[D]; selector: string; convert: ProcTypeConverter[D, D2];
actions: proc (x: MatchConfig[D, D2]) = nil): MatchConfig[D, D2]"><wbr />match<span class="attachedType">Config</span></a></li>
<li><a class="reference" href="#match%2CMatchConfig%5BX%2CD%5D%2Cstring%2Cproc%28MatchConfig%5BD%2CD%5D%29"
title="match[X, D](c: MatchConfig[X, D]; selector: string;
actions: proc (x: MatchConfig[D, D]) = nil): MatchConfig[D, D]"><wbr />match<span class="attachedType">MatchConfig</span></a></li>
<li><a class="reference" href="#match%2CConfig%5BD%5D%2Cstring%2Cproc%28MatchConfig%5BD%2CD%5D%29"
title="match[D](c: Config[D]; selector: string; actions: proc (x: MatchConfig[D, D]) = nil): MatchConfig[
D, D]"><wbr />match<span class="attachedType">Config</span></a></li>
<li><a class="reference" href="#refresh%2CMatchConfig%5BX%2CD%5D%2CProcRefresh%5BD%5D"
title="refresh[X, D](c: MatchConfig[X, D]; refresh: ProcRefresh[D])"><wbr />refresh<span class="attachedType">MatchConfig</span></a></li>
<li><a class="reference" href="#mount%2CMatchConfig%5BX%2CD%5D%2CConfig%5BD%5D%2C"
title="mount[X, D](c: MatchConfig[X, D]; conf: Config[D]; node: dom.Node)"><wbr />mount<span class="attachedType">MatchConfig</span></a></li>
<li><a class="reference" href="#mount%2CMatchConfig%5BX%2CD%5D%2CComponent%5BD%5D"
title="mount[X, D](c: MatchConfig[X, D]; comp: Component[D])"><wbr />mount<span class="attachedType">MatchConfig</span></a></li>
<li><a class="reference" href="#mount%2CMatchConfig%5BX%2CD%5D%2CComponentInterface%5BD%5D"
title="mount[X, D](c: MatchConfig[X, D]; comp: ComponentInterface[D])"><wbr />mount<span class="attachedType">MatchConfig</span></a></li>
<li><a class="reference" href="#mount%2CMatchConfig%5BX%2CD%5D%2CComponent%5BD2%5D%2CProcTypeConverter%5BD%2CD2%5D"
title="mount[X, D, D2](c: MatchConfig[X, D]; comp: Component[D2];
convert: ProcTypeConverter[D, D2])"><wbr />mount<span class="attachedType">MatchConfig</span></a></li>
<li><a class="reference" href="#iter%2CMatchConfig%5BX%2CD%5D%2Cstring%2CProcIterator%5BD%2CD2%5D%2Cproc%28MatchConfig%5BD%2CD2%5D%29"
title="iter[X, D, D2](c: MatchConfig[X, D]; selector: string; iter: ProcIterator[D, D2];
actions: proc (x: MatchConfig[D, D2]) = nil): MatchConfig[D, D2]"><wbr />iter<span class="attachedType">MatchConfig</span></a></li>
<li><a class="reference" href="#iter%2CConfig%5BD%5D%2Cstring%2CProcIterator%5BD%2CD2%5D%2Cproc%28MatchConfig%5BD%2CD2%5D%29"
title="iter[D, D2](c: Config[D]; selector: string; iter: ProcIterator[D, D2];
actions: proc (x: MatchConfig[D, D2]) = nil): MatchConfig[D, D2]"><wbr />iter<span class="attachedType">Config</span></a></li>
<li><a class="reference" href="#compile%2CConfig%5BD%5D%2C"
title="compile[D](cfg: Config[D]; node: dom.Node): Component[D]"><wbr />compile<span class="attachedType">Config</span></a></li>
<li><a class="reference" href="#compile%2C%2CConfig%5BD%5D"
title="compile[D](node: dom.Node; tf: Config[D]): Component[D]"><wbr />compile<span class="attachedType">Component</span></a></li>
<li><a class="reference" href="#compile%2Ctypedesc%5BD%5D%2C%2Cproc%28Config%5BD%5D%29"
title="compile[D](d: typedesc[D]; node: dom.Node; configurator: proc (c: Config[D])): Component[
D]"><wbr />compile<span class="attachedType">Component</span></a></li>
<li><a class="reference" href="#clone%2CComponent%5BD%5D"
title="clone[D](comp: Component[D]): Component[D]"><wbr />clone<span class="attachedType">Component</span></a></li>
<li><a class="reference" href="#update%2CComponent%5BD%5D%2CD%2Cbool"
title="update[D](t: Component[D]; data: D; refresh: bool = false)"><wbr />update<span class="attachedType">Component</span></a></li>
<li><a class="reference" href="#attach%2CComponent%5BD%5D%2C%2C%2CD"
title="attach[D](t: Component[D]; target, anchor: dom.Node; data: D)"><wbr />attach<span class="attachedType">Component</span></a></li>
<li><a class="reference" href="#detach%2CComponent"
title="detach(t: Component)"><wbr />detach<span class="attachedType">Component</span></a></li>
<li><a class="reference" href="#late%2Cproc%29"
title="late[D](lateComp: proc (): Component[D]): ComponentInterface[D]"><wbr />late<span class="attachedType">Component</span></a></li>
</ul>
</li>
<li>
<a class="reference reference-toplevel" href="#13" id="63">Funcs</a>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#asInterface%2CComponent%5BD%5D"
title="asInterface[D](comp: Component[D]): ComponentInterface[D]"><wbr />as<wbr />Interface<span class="attachedType">Component</span></a></li>
<li><a class="reference" href="#asInterface%2CComponent%5BD2%5D%2CProcTypeConverter%5BD%2CD2%5D"
title="asInterface[D, D2](comp: Component[D2]; convert: ProcTypeConverter[D, D2]): ComponentInterface[
D]"><wbr />as<wbr />Interface<span class="attachedType">Component</span></a></li>
</ul>
</li>
</ul>
</div>
<div class="nine columns" id="content">
<div id="tocRoot"></div>
<p class="module-desc"></p>
<div class="section" id="6">
<h1><a class="toc-backref" href="#6">Imports</a></h1>
<dl class="item">
<a class="reference external" href="dom.html">dom</a>
</dl></div>
<div class="section" id="7">
<h1><a class="toc-backref" href="#7">Types</a></h1>
<dl class="item">
<a id="CompileError"></a>
<dt><pre><a href="svelte.html#CompileError"><span class="Identifier">CompileError</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <span class="Identifier">CatchableError</span></pre></dt>
<dd>
Parent type for all errors
</dd>
<a id="CompileSelectorError"></a>
<dt><pre><a href="svelte.html#CompileSelectorError"><span class="Identifier">CompileSelectorError</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="svelte.html#CompileError"><span class="Identifier">CompileError</span></a></pre></dt>
<dd>
</dd>
<a id="CompileLateError"></a>
<dt><pre><a href="svelte.html#CompileLateError"><span class="Identifier">CompileLateError</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="svelte.html#CompileError"><span class="Identifier">CompileError</span></a></pre></dt>
<dd>
Represents an error wen a late binding fails.
</dd>
<a id="ProcRefresh"></a>
<dt><pre><a href="svelte.html#ProcRefresh"><span class="Identifier">ProcRefresh</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">node</span><span class="Other">:</span> <span class="Identifier">dom</span><span class="Other">.</span><span class="Identifier">Node</span><span class="Other">;</span> <span class="Identifier">data</span><span class="Other">:</span> <span class="Identifier">D</span><span class="Other">)</span></pre></dt>
<dd>
Procedure callback that is called whenever a part of a template needs to
be refreshed on data change.
</dd>
<a id="ProcTypeConverter"></a>
<dt><pre><a href="svelte.html#ProcTypeConverter"><span class="Identifier">ProcTypeConverter</span></a><span class="Other">[</span><span class="Identifier">D1</span><span class="Other">;</span> <span class="Identifier">D2</span><span class="Other">]</span> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">data</span><span class="Other">:</span> <span class="Identifier">D1</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">D2</span></pre></dt>
<dd>
Procedure that fetches a part of a larger data object and return a
smaller data set for sub-parts of the template.
</dd>
<a id="ProcIter"></a>
<dt><pre><a href="svelte.html#ProcIter"><span class="Identifier">ProcIter</span></a><span class="Other">[</span><span class="Identifier">D2</span><span class="Other">]</span> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Keyword">tuple</span><span class="Other">[</span><span class="Identifier">ok</span><span class="Other">:</span> <span class="Identifier">bool</span><span class="Other">,</span> <span class="Identifier">data</span><span class="Other">:</span> <span class="Identifier">D2</span><span class="Other">]</span></pre></dt>
<dd>
part of <tt class="docutils literal"><span class="pre">ProcIterator</span></tt>
</dd>
<a id="ProcIterator"></a>
<dt><pre><a href="svelte.html#ProcIterator"><span class="Identifier">ProcIterator</span></a><span class="Other">[</span><span class="Identifier">D1</span><span class="Other">;</span> <span class="Identifier">D2</span><span class="Other">]</span> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">d</span><span class="Other">:</span> <span class="Identifier">D1</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#ProcIter"><span class="Identifier">ProcIter</span></a><span class="Other">[</span><span class="Identifier">D2</span><span class="Other">]</span></pre></dt>
<dd>
Procedure performing an iteration (as iterators are not supported by Nim
JavaScript backend). Accepts a data set and returns a procedure that when
called, return the next item of the iteration, and a boolean indicating
the end of the iteration.
</dd>
<a id="Config"></a>
<dt><pre><a href="svelte.html#Config"><span class="Identifier">Config</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span> <span class="Other">=</span> <span class="Keyword">ref</span> <span class="Keyword">object</span>
<span class="Identifier">matches</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">MatchConfigInterface</span><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">]</span>
</pre></dt>
<dd>
Represents a template configuration, not yet associated with a DOM Node
</dd>
<a id="MatchConfig"></a>
<dt><pre><a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">;</span> <span class="Identifier">D2</span><span class="Other">]</span> <span class="Other">=</span> <span class="Keyword">ref</span> <span class="Keyword">object</span>
<span class="Identifier">selector</span><span class="Other">:</span> <span class="Identifier">string</span>
<span class="Identifier">refresh</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="svelte.html#ProcRefresh"><span class="Identifier">ProcRefresh</span></a><span class="Other">[</span><span class="Identifier">D2</span><span class="Other">]</span><span class="Other">]</span>
<span class="Identifier">matches</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">MatchConfigInterface</span><span class="Other">[</span><span class="Identifier">D2</span><span class="Other">]</span><span class="Other">]</span>
<span class="Identifier">mount</span><span class="Other">:</span> <a href="svelte.html#ComponentInterface"><span class="Identifier">ComponentInterface</span></a><span class="Other">[</span><span class="Identifier">D2</span><span class="Other">]</span>
<span class="Keyword">case</span> <span class="Identifier">iter</span><span class="Other">:</span> <span class="Identifier">bool</span>
<span class="Keyword">of</span> <span class="Identifier">false</span><span class="Other">:</span>
<span class="Identifier">convert</span><span class="Other">:</span> <a href="svelte.html#ProcTypeConverter"><span class="Identifier">ProcTypeConverter</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span>
<span class="Keyword">of</span> <span class="Identifier">true</span><span class="Other">:</span>
<span class="Identifier">iterate</span><span class="Other">:</span> <a href="svelte.html#ProcIterator"><span class="Identifier">ProcIterator</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span>
</pre></dt>
<dd>
Part of a template configuration, related to particular sub-section
represented by a CSS selector.
</dd>
<a id="Component"></a>
<dt><pre><a href="svelte.html#Component"><span class="Identifier">Component</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span> <span class="Other">=</span> <span class="Keyword">ref</span> <span class="Keyword">object</span>
<span class="Identifier">config</span><span class="Other">:</span> <a href="svelte.html#Config"><span class="Identifier">Config</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span>
<span class="Identifier">matches</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">CompMatchInterface</span><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">]</span>
<span class="Identifier">node</span><span class="Other">:</span> <span class="Identifier">dom</span><span class="Other">.</span><span class="Identifier">Node</span>
<span class="Identifier">original_node</span><span class="Other">:</span> <span class="Identifier">dom</span><span class="Other">.</span><span class="Identifier">Node</span>
</pre></dt>
<dd>
Represents an instanciated template, a <tt class="docutils literal"><span class="pre">Config</span></tt> that has been compiled
with a DOM node.
</dd>
<a id="ComponentInterface"></a>
<dt><pre><a href="svelte.html#ComponentInterface"><span class="Identifier">ComponentInterface</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span> <span class="Other">=</span> <span class="Keyword">ref</span> <span class="Keyword">object</span>
<span class="Identifier">node</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">dom</span><span class="Other">.</span><span class="Identifier">Node</span>
<span class="Identifier">update</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">data</span><span class="Other">:</span> <span class="Identifier">D</span><span class="Other">;</span> <span class="Identifier">refresh</span><span class="Other">:</span> <span class="Identifier">bool</span><span class="Other">)</span>
<span class="Identifier">clone</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#ComponentInterface"><span class="Identifier">ComponentInterface</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span>
</pre></dt>
<dd>
Wrapper around a <tt class="docutils literal"><span class="pre">Component</span></tt>, allowing the generic type to be converted.
</dd>
</dl></div>
<div class="section" id="12">
<h1><a class="toc-backref" href="#12">Procs</a></h1>
<dl class="item">
<a id="create"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#create"><span class="Identifier">create</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#Config"><span class="Identifier">Config</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span></pre></dt>
<dd>
Create a new empty configuration. Takes a dataset type as first argument
</dd>
<a id="create,typedesc[D],proc(Config[D])"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#create%2Ctypedesc%5BD%5D%2Cproc%28Config%5BD%5D%29"><span class="Identifier">create</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">d</span><span class="Other">:</span> <span class="Identifier">typedesc</span><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">configurator</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <a href="svelte.html#Config"><span class="Identifier">Config</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">)</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#Config"><span class="Identifier">Config</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span></pre></dt>
<dd>
Create a new empty configuration but allows to pass a procedure to modify the configuration
</dd>
<a id="match,MatchConfig[X,D],string,ProcTypeConverter[D,D2],proc(MatchConfig[D,D2])"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#match%2CMatchConfig%5BX%2CD%5D%2Cstring%2CProcTypeConverter%5BD%2CD2%5D%2Cproc%28MatchConfig%5BD%2CD2%5D%29"><span class="Identifier">match</span></a><span class="Other">[</span><span class="Identifier">X</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">X</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">selector</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span>
<span class="Identifier">convert</span><span class="Other">:</span> <a href="svelte.html#ProcTypeConverter"><span class="Identifier">ProcTypeConverter</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span><span class="Other">;</span>
<span class="Identifier">actions</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">x</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span><span class="Other">)</span> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma">
<span class="Identifier">discardable</span></span><span class="Other">.}</span></span></pre></dt>
<dd>
Declares a sub-match. The selector is run to find the DOM node that the sub-match will modify, and the convert procedure allows to refine the dataset when the sub-match only needs a portion of this dataset. The optional actions procedure can be used to further configure the sub-match.
</dd>
<a id="match,Config[D],string,ProcTypeConverter[D,D2],proc(MatchConfig[D,D2])"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#match%2CConfig%5BD%5D%2Cstring%2CProcTypeConverter%5BD%2CD2%5D%2Cproc%28MatchConfig%5BD%2CD2%5D%29"><span class="Identifier">match</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <a href="svelte.html#Config"><span class="Identifier">Config</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">selector</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">convert</span><span class="Other">:</span> <a href="svelte.html#ProcTypeConverter"><span class="Identifier">ProcTypeConverter</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span><span class="Other">;</span>
<span class="Identifier">actions</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">x</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span><span class="Other">)</span> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma">
<span class="Identifier">discardable</span></span><span class="Other">.}</span></span></pre></dt>
<dd>
Match variant for <tt class="docutils literal"><span class="pre">Config</span></tt>
</dd>
<a id="match,MatchConfig[X,D],string,proc(MatchConfig[D,D])"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#match%2CMatchConfig%5BX%2CD%5D%2Cstring%2Cproc%28MatchConfig%5BD%2CD%5D%29"><span class="Identifier">match</span></a><span class="Other">[</span><span class="Identifier">X</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">X</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">selector</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span>
<span class="Identifier">actions</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">x</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">]</span><span class="Other">)</span> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">]</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma">
<span class="Identifier">discardable</span></span><span class="Other">.}</span></span></pre></dt>
<dd>
Match variant with no data refinement
</dd>
<a id="match,Config[D],string,proc(MatchConfig[D,D])"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#match%2CConfig%5BD%5D%2Cstring%2Cproc%28MatchConfig%5BD%2CD%5D%29"><span class="Identifier">match</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <a href="svelte.html#Config"><span class="Identifier">Config</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">selector</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span>
<span class="Identifier">actions</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">x</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">]</span><span class="Other">)</span> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">]</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">discardable</span></span><span class="Other">.}</span></span></pre></dt>
<dd>
Match variant for <tt class="docutils literal"><span class="pre">Config</span></tt> with no data refinement
</dd>
<a id="refresh,MatchConfig[X,D],ProcRefresh[D]"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#refresh%2CMatchConfig%5BX%2CD%5D%2CProcRefresh%5BD%5D"><span class="Identifier">refresh</span></a><span class="Other">[</span><span class="Identifier">X</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">X</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">refresh</span><span class="Other">:</span> <a href="svelte.html#ProcRefresh"><span class="Identifier">ProcRefresh</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
<dd>
Add a <tt class="docutils literal"><span class="pre">ProcRefresh</span></tt> callback procedure to a match. The callback is called whenever the data associated with the match changes. It can be used to update the DOM node text contents, event handlers, ...
</dd>
<a id="mount,MatchConfig[X,D],Config[D],"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#mount%2CMatchConfig%5BX%2CD%5D%2CConfig%5BD%5D%2C"><span class="Identifier">mount</span></a><span class="Other">[</span><span class="Identifier">X</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">X</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">conf</span><span class="Other">:</span> <a href="svelte.html#Config"><span class="Identifier">Config</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">node</span><span class="Other">:</span> <span class="Identifier">dom</span><span class="Other">.</span><span class="Identifier">Node</span><span class="Other">)</span></pre></dt>
<dd>
mounts a sub-component at the specified match location of a parent component. The sub-component is specified as an uncompiled configuration and DOM Node
</dd>
<a id="mount,MatchConfig[X,D],Component[D]"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#mount%2CMatchConfig%5BX%2CD%5D%2CComponent%5BD%5D"><span class="Identifier">mount</span></a><span class="Other">[</span><span class="Identifier">X</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">X</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">comp</span><span class="Other">:</span> <a href="svelte.html#Component"><span class="Identifier">Component</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
<dd>
Mounts a sub-component specified as an already compiled <tt class="docutils literal"><span class="pre">Component</span></tt>. The given component is cloned to ensure that the mounted component does not modify the passed instance.
</dd>
<a id="mount,MatchConfig[X,D],ComponentInterface[D]"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#mount%2CMatchConfig%5BX%2CD%5D%2CComponentInterface%5BD%5D"><span class="Identifier">mount</span></a><span class="Other">[</span><span class="Identifier">X</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">X</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">comp</span><span class="Other">:</span> <a href="svelte.html#ComponentInterface"><span class="Identifier">ComponentInterface</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
<dd>
Mounts a sub-component specified as a <tt class="docutils literal"><span class="pre">ComponentInterface</span></tt> allowing to convert between generic types in case the sub-component does not have the same type as the parent component. The component is cloed to ensure the passed instance is not modified.
</dd>
<a id="mount,MatchConfig[X,D],Component[D2],ProcTypeConverter[D,D2]"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#mount%2CMatchConfig%5BX%2CD%5D%2CComponent%5BD2%5D%2CProcTypeConverter%5BD%2CD2%5D"><span class="Identifier">mount</span></a><span class="Other">[</span><span class="Identifier">X</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">X</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">comp</span><span class="Other">:</span> <a href="svelte.html#Component"><span class="Identifier">Component</span></a><span class="Other">[</span><span class="Identifier">D2</span><span class="Other">]</span><span class="Other">;</span>
<span class="Identifier">convert</span><span class="Other">:</span> <a href="svelte.html#ProcTypeConverter"><span class="Identifier">ProcTypeConverter</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
<dd>
Mounts a component and performs a type conversion between the mounted location and the mounted component. The passed component is cloned to ensure it is not modified.
</dd>
<a id="iter,MatchConfig[X,D],string,ProcIterator[D,D2],proc(MatchConfig[D,D2])"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#iter%2CMatchConfig%5BX%2CD%5D%2Cstring%2CProcIterator%5BD%2CD2%5D%2Cproc%28MatchConfig%5BD%2CD2%5D%29"><span class="Identifier">iter</span></a><span class="Other">[</span><span class="Identifier">X</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">X</span><span class="Other">,</span> <span class="Identifier">D</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">selector</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">iter</span><span class="Other">:</span> <a href="svelte.html#ProcIterator"><span class="Identifier">ProcIterator</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span><span class="Other">;</span>
<span class="Identifier">actions</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">x</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span><span class="Other">)</span> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma">
<span class="Identifier">discardable</span></span><span class="Other">.}</span></span></pre></dt>
<dd>
iterates over a specified DOM node. Works just like <tt class="docutils literal"><span class="pre">match</span></tt> but the selected DOM node is cloned as many times as necessary to fit the number of data items provided by the given iterator.
</dd>
<a id="iter,Config[D],string,ProcIterator[D,D2],proc(MatchConfig[D,D2])"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#iter%2CConfig%5BD%5D%2Cstring%2CProcIterator%5BD%2CD2%5D%2Cproc%28MatchConfig%5BD%2CD2%5D%29"><span class="Identifier">iter</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <a href="svelte.html#Config"><span class="Identifier">Config</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">selector</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">iter</span><span class="Other">:</span> <a href="svelte.html#ProcIterator"><span class="Identifier">ProcIterator</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span><span class="Other">;</span>
<span class="Identifier">actions</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">x</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span><span class="Other">)</span> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#MatchConfig"><span class="Identifier">MatchConfig</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma">
<span class="Identifier">discardable</span></span><span class="Other">.}</span></span></pre></dt>
<dd>
iter variant for <tt class="docutils literal"><span class="pre">Config</span></tt>
</dd>
<a id="compile,Config[D],"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#compile%2CConfig%5BD%5D%2C"><span class="Identifier">compile</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">cfg</span><span class="Other">:</span> <a href="svelte.html#Config"><span class="Identifier">Config</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">node</span><span class="Other">:</span> <span class="Identifier">dom</span><span class="Other">.</span><span class="Identifier">Node</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#Component"><span class="Identifier">Component</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span></pre></dt>
<dd>
Compiles a configuration by associating it with a DOM Node. Can raise <tt class="docutils literal"><span class="pre">CompileError</span></tt> in case the selectors in the configuration do not match.
</dd>
<a id="compile,,Config[D]"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#compile%2C%2CConfig%5BD%5D"><span class="Identifier">compile</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">node</span><span class="Other">:</span> <span class="Identifier">dom</span><span class="Other">.</span><span class="Identifier">Node</span><span class="Other">;</span> <span class="Identifier">tf</span><span class="Other">:</span> <a href="svelte.html#Config"><span class="Identifier">Config</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#Component"><span class="Identifier">Component</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span></pre></dt>
<dd>
Alternative compile procedure that can be used as a method on DOM Nodes
</dd>
<a id="compile,typedesc[D],,proc(Config[D])"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#compile%2Ctypedesc%5BD%5D%2C%2Cproc%28Config%5BD%5D%29"><span class="Identifier">compile</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">d</span><span class="Other">:</span> <span class="Identifier">typedesc</span><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">node</span><span class="Other">:</span> <span class="Identifier">dom</span><span class="Other">.</span><span class="Identifier">Node</span><span class="Other">;</span> <span class="Identifier">configurator</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <a href="svelte.html#Config"><span class="Identifier">Config</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">)</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#Component"><span class="Identifier">Component</span></a><span class="Other">[</span>
<span class="Identifier">D</span><span class="Other">]</span></pre></dt>
<dd>
Alternative compile procedure that creates the configuration and compiles it in one shot.
</dd>
<a id="clone,Component[D]"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#clone%2CComponent%5BD%5D"><span class="Identifier">clone</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">comp</span><span class="Other">:</span> <a href="svelte.html#Component"><span class="Identifier">Component</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#Component"><span class="Identifier">Component</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span></pre></dt>
<dd>
Clones a component, allows to operate them separately
</dd>
<a id="update,Component[D],D,bool"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#update%2CComponent%5BD%5D%2CD%2Cbool"><span class="Identifier">update</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">t</span><span class="Other">:</span> <a href="svelte.html#Component"><span class="Identifier">Component</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">data</span><span class="Other">:</span> <span class="Identifier">D</span><span class="Other">;</span> <span class="Identifier">refresh</span><span class="Other">:</span> <span class="Identifier">bool</span> <span class="Other">=</span> <span class="Identifier">false</span><span class="Other">)</span></pre></dt>
<dd>
Feeds data to a compiled component, calling the refresh callbacks when needed.
</dd>
<a id="attach,Component[D],,,D"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#attach%2CComponent%5BD%5D%2C%2C%2CD"><span class="Identifier">attach</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">t</span><span class="Other">:</span> <a href="svelte.html#Component"><span class="Identifier">Component</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">target</span><span class="Other">,</span> <span class="Identifier">anchor</span><span class="Other">:</span> <span class="Identifier">dom</span><span class="Other">.</span><span class="Identifier">Node</span><span class="Other">;</span> <span class="Identifier">data</span><span class="Other">:</span> <span class="Identifier">D</span><span class="Other">)</span></pre></dt>
<dd>
Attach a component to a parent DOM node. Insert the component as a child element of <tt class="docutils literal"><span class="pre">target</span></tt> and before <tt class="docutils literal"><span class="pre">anchor</span></tt> in the same way the <tt class="docutils literal"><span class="pre">insertBefore</span></tt> procedure works on DOM.
</dd>
<a id="detach,Component"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#detach%2CComponent"><span class="Identifier">detach</span></a><span class="Other">(</span><span class="Identifier">t</span><span class="Other">:</span> <a href="svelte.html#Component"><span class="Identifier">Component</span></a><span class="Other">)</span></pre></dt>
<dd>
Detach a component from its parent DOM Node
</dd>
<a id="late,proc)"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#late%2Cproc%29"><span class="Identifier">late</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">lateComp</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#Component"><span class="Identifier">Component</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#ComponentInterface"><span class="Identifier">ComponentInterface</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span></pre></dt>
<dd>
<p>Returns a component interface from a component where the component is not there yet. This can be used to recursively mount a component into itself. At compile time, the <tt class="docutils literal"><span class="pre">lateComp</span></tt> proc is going to be called and will resolve into a real component.</p>
<p>If when called, <tt class="docutils literal"><span class="pre">lateComp</span></tt> cannot resolve to a non nil component, an exception of type CompileLateError will be raised.</p>
</dd>
</dl></div>
<div class="section" id="13">
<h1><a class="toc-backref" href="#13">Funcs</a></h1>
<dl class="item">
<a id="asInterface,Component[D]"></a>
<dt><pre><span class="Keyword">func</span> <a href="#asInterface%2CComponent%5BD%5D"><span class="Identifier">asInterface</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">comp</span><span class="Other">:</span> <a href="svelte.html#Component"><span class="Identifier">Component</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#ComponentInterface"><span class="Identifier">ComponentInterface</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">]</span></pre></dt>
<dd>
Converts a component to a component interface
</dd>
<a id="asInterface,Component[D2],ProcTypeConverter[D,D2]"></a>
<dt><pre><span class="Keyword">func</span> <a href="#asInterface%2CComponent%5BD2%5D%2CProcTypeConverter%5BD%2CD2%5D"><span class="Identifier">asInterface</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">comp</span><span class="Other">:</span> <a href="svelte.html#Component"><span class="Identifier">Component</span></a><span class="Other">[</span><span class="Identifier">D2</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">convert</span><span class="Other">:</span> <a href="svelte.html#ProcTypeConverter"><span class="Identifier">ProcTypeConverter</span></a><span class="Other">[</span><span class="Identifier">D</span><span class="Other">,</span> <span class="Identifier">D2</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="svelte.html#ComponentInterface"><span class="Identifier">ComponentInterface</span></a><span class="Other">[</span>
<span class="Identifier">D</span><span class="Other">]</span></pre></dt>
<dd>
Converts a component to a component interface and convert its type
</dd>
</dl></div>
</div>
</div>
<div class="row">
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br/>
<small style="color: var(--hint);">Made with Nim. Generated: 2020-05-22 12:01:37 UTC</small>
</div>
</div>
</div>
</div>
</body>
</html>