<const V>(
value: [V] extends [(...args: never) => Promise<unknown>] ? never : V
): DefaultMethod<V>Declare a single Tag-baked default in the contract — identical local and remote, no wire, no impl slot. Accepts a literal or a sync function (Promise-returning fns are a type error — async belongs in effect / effectFn or promise).
For multiple defaults, pipe defaults onto the Tag instead (bag keys
widen Service at construction — yield* Tag sees them).
Layer/serve may override a Spec default at the provide site only (see ImplWithDefaultOverrides); the remote client always installs the Tag-baked value.
class Counter extends Hyperlink.Tag<Counter>()("counter", {
current: Hyperlink.effect(Schema.Number),
label: Hyperlink.default((n: number) => `count=${n}`),
unit: Hyperlink.default("count"),
}) {}const const default_: <V>(
value: [V] extends [
(...args: never) => Promise<unknown>
]
? never
: V
) => DefaultMethod<V>
Declare a single Tag-baked default in the contract — identical local and remote, no wire,
no impl slot. Accepts a literal or a sync function (Promise-returning fns are a type error —
async belongs in
effect
/
effectFn
or
promise
).
For multiple defaults, pipe
defaults
onto the Tag instead (bag keys
widen Service at construction — yield* Tag sees them).
Layer/serve may override a Spec default at the provide site only (see
ImplWithDefaultOverrides
); the remote client always installs the Tag-baked value.
class Counter extends Hyperlink.Tag<Counter>()("counter", {
current: Hyperlink.effect(Schema.Number),
label: Hyperlink.default((n: number) => `count=${n}`),
unit: Hyperlink.default("count"),
}) {}
default_ = <const function (type parameter) V in <const V>(value: [V] extends [(...args: never) => Promise<unknown>] ? never : V): DefaultMethod<V>V>(
value: [V] extends [
(...args: never) => Promise<unknown>
]
? never
: V
value: [function (type parameter) V in <const V>(value: [V] extends [(...args: never) => Promise<unknown>] ? never : V): DefaultMethod<V>V] extends [(...args: neverargs: never) => interface Promise<T>Represents the completion of an asynchronous operation
Promise<unknown>] ? never : function (type parameter) V in <const V>(value: [V] extends [(...args: never) => Promise<unknown>] ? never : V): DefaultMethod<V>V,
): interface DefaultMethod<out V>A Tag-baked default on a HyperService contract — built by
default
. Lives on the Spec
(both local and remote install the same value); no impl, no RPC, no
Local
gate.
Literals or sync functions. For a bag of many defaults, see
defaults
.
DefaultMethod<function (type parameter) V in <const V>(value: [V] extends [(...args: never) => Promise<unknown>] ? never : V): DefaultMethod<V>V> => ({
[const DefaultMethodTypeId: "~hyperlink-ts/Hyperlink/DefaultMethod"Identity brand for a
DefaultMethod
— Tag-baked default value/fn, both sides, no wire.
DefaultMethodTypeId]: const DefaultMethodTypeId: "~hyperlink-ts/Hyperlink/DefaultMethod"Identity brand for a
DefaultMethod
— Tag-baked default value/fn, both sides, no wire.
DefaultMethodTypeId,
DefaultMethod<V>.value: const VThe Tag-baked payload — literal or sync function. Installed identically on local and
client handles. Layer/serve may override at the provide site only (does not travel
over the wire); see
ImplWithDefaultOverrides
.
value: value: [V] extends [
(...args: never) => Promise<unknown>
]
? never
: V
value as function (type parameter) V in <const V>(value: [V] extends [(...args: never) => Promise<unknown>] ? never : V): DefaultMethod<V>V,
});