WithDefaults<T>Handle shape including a piped defaults bag.
Prefer construction-time defaults (widens Service / yield* Tag).
Kept as an escape / migration alias when a Tag was built without the widen.
modelsdefaults
Source src/Hyperlink.ts:8451 lines
export type type WithDefaults<T> = ServiceOfTag<T> &
DefaultsOf<T>
WithDefaults<function (type parameter) T in type WithDefaults<T>T> = type ServiceOfTag<T> = T extends {
readonly Service: infer Svc
}
? Svc
: never
Service shape of a piped Tag before bag widen (from Service, else never).
ServiceOfTag<function (type parameter) T in type WithDefaults<T>T> & type DefaultsOf<T> = T extends {
readonly [defaultsSym]: infer D extends DefaultsBag
}
? D
: {}
Piped
defaults
bag on a Tag, or {} when absent.
DefaultsOf<function (type parameter) T in type WithDefaults<T>T>;