ShapeOf<S, Self>Materialized service shape from a Spec — Hyperlink.ShapeOf<typeof mySpec, MyTag>.
modelsSpec
Source src/Hyperlink.ts:23591 lines
export type type ShapeOf<S extends Spec, Self = unknown> = { [K in keyof { readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<T, never, Self> : S[K] extends {
readonly _tag: "constant";
} ? SuccessOf<AsMethod<S[K]>> : S[K] extends {
readonly _tag: "ref";
} ? Subscribable<SuccessOf<AsMethod<S[K]>>> : S[K] extends {
readonly kind: MethodKind;
} ? ClientMethod<...> : S[K] extends Spec ? Simplify<...> : never; }]: { readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<T, never, Self> : S[K] extends {
readonly _tag: "constant";
} ? SuccessOf<AsMethod<S[K]>> : S[K] extends {
readonly _tag: "ref";
} ? Subscribable<SuccessOf<AsMethod<S[K]>>> : S[K] extends {
readonly kind: MethodKind;
} ? ClientMethod<...> : S[K] extends Spec ? Simplify<...> : never; }[K]; } extends infer B ? B : never
Materialized service shape from a
Spec
— Hyperlink.ShapeOf<typeof mySpec, MyTag>.
ShapeOf<function (type parameter) S in type ShapeOf<S extends Spec, Self = unknown>S extends Spec, function (type parameter) Self in type ShapeOf<S extends Spec, Self = unknown>Self = unknown> = type ServiceOf<S extends Spec, Self = unknown> = { [K in keyof { readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<T, never, Self> : S[K] extends {
readonly _tag: "constant";
} ? SuccessOf<AsMethod<S[K]>> : S[K] extends {
readonly _tag: "ref";
} ? Subscribable<SuccessOf<AsMethod<S[K]>>> : S[K] extends {
readonly kind: MethodKind;
} ? ClientMethod<...> : S[K] extends Spec ? Simplify<...> : never; }]: { readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<T, never, Self> : S[K] extends {
readonly _tag: "constant";
} ? SuccessOf<AsMethod<S[K]>> : S[K] extends {
readonly _tag: "ref";
} ? Subscribable<SuccessOf<AsMethod<S[K]>>> : S[K] extends {
readonly kind: MethodKind;
} ? ClientMethod<...> : S[K] extends Spec ? Simplify<...> : never; }[K]; } extends infer B ? B : never
The full service interface inferred from a
Spec
. Wire
Method
s map to
Effect/function members; off-wire
LocalMethod
s surface as
Effect<T, never, Local<Self>> — yield* to obtain the value, requiring the local layer
(
Local
) (so they're uncallable through
Hyperlink.client
).
ServiceOf<function (type parameter) S in type ShapeOf<S extends Spec, Self = unknown>S, function (type parameter) Self in type ShapeOf<S extends Spec, Self = unknown>Self>;