ode></pre>
<h2>Static</h2>
<p>Use the StaticDecode and StaticEncode types that infer the Decoded and Encoded state of a type.</p>
<pre><code class="language-typescript">import Type, { type StaticEncode, type StaticDecode } from &#39;typebox&#39;

const Timestamp = Type.Codec(Type.Integer())
  .Decode(value =&gt; new Date(value))
  .Encode(value =&gt; value.getTime())

type D = StaticDecode&lt;typeof Timestamp&gt;             // type D = Date

type E = StaticEncode&lt;typeof Timestamp&gt;             // type