Skip to content

Commit 622442e

Browse files
committed
Update docs
1 parent 68aa8c4 commit 622442e

File tree

58 files changed

+1160
-217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1160
-217
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ This project is somewhat similar to Google's [Protocol Buffers](https://develope
7474
- `Choice` (a fixed set of up to 255 types that values can take on)
7575
- `NamedChoice` (a fixed set of up to 255 named types that values can take on, each associated with a constructor)
7676
- `Recursive<Type>` (a type that can reference itself and be used to serialize circular data structures)
77+
- `Singleton<Type>` (a type that serializes only one value)
7778
- `Optional<Type>` (either `null` or `undefined` or an instance of `Type`)
7879
- `Pointer<Type>` (allows multiple instances of `Type` with the same serialization to be stored only once)
7980

@@ -564,6 +565,9 @@ In the following definitions, `type` means the binary type format.
564565
- `recursiveID` (an identifier unique to this recursive type in this type buffer) - `flexInt`
565566
- If this is the first instance of this recursive type in this buffer:
566567
- `recursiveType` (the type definition of this type) - `type`
568+
- `SingletonType`: identifier `0x59`, payload:
569+
- `valueType` - `type`
570+
- `value` - a value that conforms to `valueType`
567571
- `OptionalType`: identifier `0x60`, payload:
568572
- `typeIfNonNull` - `type`
569573
- `PointerType`: identifier `0x70`, payload:
@@ -634,6 +638,8 @@ In the following definitions, `type` means the binary type format.
634638
- `value` - value serialized by `recursiveType`
635639
- Else:
636640
- `offset` ([position of first byte of `offset` in buffer] - [position of `value` in buffer]) - `flexInt`
641+
- `SingletonType`:
642+
- No value bytes
637643
- `OptionalType`:
638644
- `valueIsNonNull` - byte containing either `0x00` or `0xFF`
639645
- If `valueIsNonNull`:

dist/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
* - [[ChoiceType]]
5757
* - [[NamedChoiceType]]
5858
* - [[RecursiveType]]
59+
* - [[SingletonType]]
5960
* - Modifier types
6061
* - [[OptionalType]]
6162
* - [[PointerType]]

dist/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
* - [[ChoiceType]]
5858
* - [[NamedChoiceType]]
5959
* - [[RecursiveType]]
60+
* - [[SingletonType]]
6061
* - Modifier types
6162
* - [[OptionalType]]
6263
* - [[PointerType]]

docs/classes/_types_absolute_.absolutetype.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> is<wbr>Buffer</h3>
353353
<aside class="tsd-sources">
354354
<p>Inherited from <a href="_types_abstract_.abstracttype.html">AbstractType</a>.<a href="_types_abstract_.abstracttype.html#isbuffer">isBuffer</a></p>
355355
<ul>
356-
<li>Defined in types/abstract.ts:93</li>
356+
<li>Defined in types/abstract.ts:91</li>
357357
</ul>
358358
</aside>
359359
<div class="tsd-comment tsd-typography">

docs/classes/_types_abstract_.abstracttype.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ <h3>Hierarchy</h3>
100100
<li>
101101
<a href="_types_enum_.enumtype.html" class="tsd-signature-type">EnumType</a>
102102
</li>
103+
<li>
104+
<a href="_types_singleton_.singletontype.html" class="tsd-signature-type">SingletonType</a>
105+
</li>
103106
<li>
104107
<a href="_types_pointer_.pointertype.html" class="tsd-signature-type">PointerType</a>
105108
</li>
@@ -234,7 +237,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _get<wbr>Hash</h3>
234237
<li class="tsd-description">
235238
<aside class="tsd-sources">
236239
<ul>
237-
<li>Defined in types/abstract.ts:111</li>
240+
<li>Defined in types/abstract.ts:109</li>
238241
</ul>
239242
</aside>
240243
<div class="tsd-comment tsd-typography">
@@ -257,7 +260,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _get<wbr>Signature</h3>
257260
<li class="tsd-description">
258261
<aside class="tsd-sources">
259262
<ul>
260-
<li>Defined in types/abstract.ts:121</li>
263+
<li>Defined in types/abstract.ts:119</li>
261264
</ul>
262265
</aside>
263266
<div class="tsd-comment tsd-typography">
@@ -281,7 +284,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _to<wbr>Buffer</h3>
281284
<li class="tsd-description">
282285
<aside class="tsd-sources">
283286
<ul>
284-
<li>Defined in types/abstract.ts:101</li>
287+
<li>Defined in types/abstract.ts:99</li>
285288
</ul>
286289
</aside>
287290
<div class="tsd-comment tsd-typography">
@@ -418,7 +421,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> is<wbr>Buffer</h3>
418421
<li class="tsd-description">
419422
<aside class="tsd-sources">
420423
<ul>
421-
<li>Defined in types/abstract.ts:93</li>
424+
<li>Defined in types/abstract.ts:91</li>
422425
</ul>
423426
</aside>
424427
<div class="tsd-comment tsd-typography">

docs/classes/_types_array_.arraytype.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> is<wbr>Buffer</h3>
374374
<aside class="tsd-sources">
375375
<p>Inherited from <a href="_types_abstract_.abstracttype.html">AbstractType</a>.<a href="_types_abstract_.abstracttype.html#isbuffer">isBuffer</a></p>
376376
<ul>
377-
<li>Defined in types/abstract.ts:93</li>
377+
<li>Defined in types/abstract.ts:91</li>
378378
</ul>
379379
</aside>
380380
<div class="tsd-comment tsd-typography">

docs/classes/_types_big_int_.biginttype.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> is<wbr>Buffer</h3>
276276
<aside class="tsd-sources">
277277
<p>Inherited from <a href="_types_abstract_.abstracttype.html">AbstractType</a>.<a href="_types_abstract_.abstracttype.html#isbuffer">isBuffer</a></p>
278278
<ul>
279-
<li>Defined in types/abstract.ts:93</li>
279+
<li>Defined in types/abstract.ts:91</li>
280280
</ul>
281281
</aside>
282282
<div class="tsd-comment tsd-typography">

docs/classes/_types_big_unsigned_int_.bigunsignedinttype.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> is<wbr>Buffer</h3>
276276
<aside class="tsd-sources">
277277
<p>Inherited from <a href="_types_abstract_.abstracttype.html">AbstractType</a>.<a href="_types_abstract_.abstracttype.html#isbuffer">isBuffer</a></p>
278278
<ul>
279-
<li>Defined in types/abstract.ts:93</li>
279+
<li>Defined in types/abstract.ts:91</li>
280280
</ul>
281281
</aside>
282282
<div class="tsd-comment tsd-typography">

docs/classes/_types_boolean_.booleantype.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> is<wbr>Buffer</h3>
282282
<aside class="tsd-sources">
283283
<p>Inherited from <a href="_types_abstract_.abstracttype.html">AbstractType</a>.<a href="_types_abstract_.abstracttype.html#isbuffer">isBuffer</a></p>
284284
<ul>
285-
<li>Defined in types/abstract.ts:93</li>
285+
<li>Defined in types/abstract.ts:91</li>
286286
</ul>
287287
</aside>
288288
<div class="tsd-comment tsd-typography">

docs/classes/_types_boolean_array_.booleanarraytype.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> is<wbr>Buffer</h3>
285285
<aside class="tsd-sources">
286286
<p>Inherited from <a href="_types_abstract_.abstracttype.html">AbstractType</a>.<a href="_types_abstract_.abstracttype.html#isbuffer">isBuffer</a></p>
287287
<ul>
288-
<li>Defined in types/abstract.ts:93</li>
288+
<li>Defined in types/abstract.ts:91</li>
289289
</ul>
290290
</aside>
291291
<div class="tsd-comment tsd-typography">

0 commit comments

Comments
 (0)