SpecOf<T>Recover the (possibly nested) Spec a tag was built from — for annotating an extracted impl
without hand-threading it: obj satisfies ImplOf<SpecOf<typeof MyTag>>. Usually you don't need it —
Hyperlink.make infers it.
Source src/Hyperlink.ts:19423 lines
export type type SpecOf<T> = T extends {
readonly [specTypeSym]?: infer S extends Spec
}
? S
: never
Recover the (possibly nested)
Spec
a tag was built from — for annotating an extracted impl
without hand-threading it: obj satisfies ImplOf<SpecOf<typeof MyTag>>. Usually you don't need it —
Hyperlink.make
infers it.
SpecOf<function (type parameter) T in type SpecOf<T>T> = function (type parameter) T in type SpecOf<T>T extends { readonly [const specTypeSym: typeof specTypeSymPhantom carrier of a tag's (possibly nested) spec type S, so functions can infer S from a tag —
specSym
holds the flat spec at runtime and can't carry the nested S. Type-only, never set at
runtime.
specTypeSym]?: infer function (type parameter) SS extends Spec }
? function (type parameter) SS
: never;