const result = Λ<string>("match")`${vector as Vector}
${{ x:1, y:1, z:1}} -> ${"vector3"}
${{ x:2, y:1}} -> ${"vector2"}
${{ x:1}} -> ${"vector1"}
`;
console.log(result);// "vector1"
Λ is unicode U+039B, it resembles caret and is used to introduce a new context where you can apply a DSL, and <string> is used to assert the output type. "match" is the name of the DSL. You can customize it in typedraft.config.ts.
It's hard to type Λ, thus we recommend that you can create code snippet in vscode so that you can type it in this way: