Files
typebox/test/static/argument.ts
glm-5.1 bd758c2342 Fork from @sinclair/typebox 0.34.49 as @alkdev/typebox
- Rename package from @sinclair/typebox to @alkdev/typebox
- Update author, repository, and homepage to alkdev
- Remove GitHub workflows, .vscode config, and branding assets
- Update all source, test, example, changelog, and task imports
- Update tsconfig.json path mappings
- Clean up readme header (remove upstream badges/branding)
2026-04-23 13:22:31 +00:00

22 lines
447 B
TypeScript

import { Expect } from './assert'
import { Type } from '@alkdev/typebox'
const T = Type.Object({
x: Type.Argument(0),
y: Type.Argument(1),
z: Type.Argument(2),
})
const I = Type.Instantiate(T, [Type.Literal(1), Type.Literal(2), Type.Literal(3)])
// Infer as Broadest Type (Pending Generic Constraints)
Expect(T).ToStatic<{
x: unknown
y: unknown
z: unknown
}>()
// Infer as Narrowed Type
Expect(I).ToStatic<{
x: 1
y: 2
z: 3
}>()