Sigil gate keeper: 20 levels of type-level TypeScript: keyof, mapped, conditional, infer, recursive and template literal types, checked by real tsc.
TypeScript tells a literal type apart from a wider type. "buka" holds one value; string holds every string. const, as const and annotations keep the literal; without them, TypeScript widens it to the primitive type.
From this door on, the relief is read off the prasasti. A carving read off the prasasti changes when the prasasti changes; a copied carving does not. That is why the gate turns the prasasti over and compares once more.
keyof takes the keys of an object type as a union of string literals: keyof { a: 1; b: 2 } is "a" | "b". When the shape of the type changes, its keyof changes too.
A conditional type looks like T extends U ? X : Y: if T fits in U, the result is X; if not, Y. Almost every utility type is built from this form.
A mapped type looks like { [K in U]: … }: one property for each K in the union U. With keyof and indexed access, Pick, Partial and their friends can be rebuilt by hand.
A type alias may call itself, as long as there is a stopping point. A common pattern: T extends object ? <call again> : T. A mapped type { [K in keyof T]: … } applied to a primitive type already stops by itself.
"buka". Write a type Result that is exactly that word, not every string; Bang Jaya carves it.Arca, the data of a statue in the temple. This door's relief is the type of nama on the prasasti: take it from Arca, do not copy it. The gate checks your carving against both faces of the prasasti, and its back face is different.Arca as a union. Read those names off the prasasti with one operator, so your carving follows when the prasasti changes.Uji: is it a string? Write IsString<T> that answers "ya" for a string and "tidak" for anything else. The Result line already calls it for all three.const juruKunci, written with as const. Take the type of that value without writing its shape again.Pasangan, a tuple. Its relief is the union of everything in that tuple. Read it off the tuple with one index, so your carving stays right even if the tuple grows longer.Arca, id and nama, with their types. Carve it by hand as a mapped type, without the lib's Pick: this gate wants to see you make it yourself.Arca without dipahat. Carve it by hand, without Omit or Pick: a mapped type that walks every key of Arca and drops one, so new keys on the prasasti come along.Arca may be missing. Carve it by hand as a mapped type, without Partial.Draf, whose keys are all optional. Its relief: every key required. Carve it by hand, without Required.Candi, objects inside objects. Its relief: everything readonly, all the way in. Write DeepReadonly<T>; the Result line already calls it for Candi.Peran records every role; drop "tamu" from that union with a utility from the lib.And more, 20 levels in all.