feat: Add type coercion section with code example and styling

This commit is contained in:
2025-02-23 00:24:20 -06:00
parent aab2f7a546
commit ddfcfa798a
3 changed files with 102 additions and 1 deletions
+22
View File
@@ -67,6 +67,28 @@ export default function Home() {
</div>
</div>
</div>
<div className={styles.typeSection}>
<div className={styles.typeContainer}>
<div className={styles.typeText}>
<h2>Type Coercion</h2>
<p>
Unicord automatically handles type coercion for command arguments,
ensuring you always get the correct types in your handlers. Define your
command structure once, and get full type safety and autocompletion
throughout your codebase.
</p>
<p>
In this example, the <code>user</code> argument is automatically typed
as a <code>User</code> object, providing access to all user properties
with full TypeScript support.
</p>
</div>
<div className={styles.typeCode}>
<CodeExample code={typeCoercionExample} height={300} noScroll={true} />
</div>
</div>
</div>
</main>
</div>
);