Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ export type Stubify<T> =
// `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`.
// prettier-ignore
type UnstubifyInner<T> =
T extends StubBase<infer V> ? (T | V) // can provide either stub or local RpcTarget
// Keep local RpcTarget acceptance, but avoid `Stub | Value` unions when the stub
// is already assignable to the value type (needed for callback contextual typing).
T extends StubBase<infer V> ? (T extends V ? V : (T | V))
: T extends Map<infer K, infer V> ? Map<Unstubify<K>, Unstubify<V>>
: T extends Set<infer V> ? Set<Unstubify<V>>
: T extends [] ? []
Expand Down