<h1>Codec</h1>
<p>The Codec function applies a bi-directional transform codec to a type.</p>
<h2>Example</h2>
<p>The following creates a Codec that transforms a timestamp into a Date object.</p>
<pre><code class="language-typescript">const Timestamp = Type.Codec(Type.Integer())        // const Timestamp = {
  .Decode(value =&gt; new Date(value))                 //   type: &#39;integer&#39;,
  .Encode(value =&gt; value.getTime())                 //   &#39;~codec&#39;: {
                                      