@@ -15,7 +15,9 @@ extends Pipeable.Pipeable {
|
||||
readonly encodedValueRef: SubscriptionRef.SubscriptionRef<I>,
|
||||
readonly errorRef: SubscriptionRef.SubscriptionRef<Option.Option<ParseResult.ParseError>>,
|
||||
|
||||
makeFieldIssuesSubscribable<P extends PropertyPath.Paths<A>>(path: P): Subscribable.Subscribable<readonly ParseResult.ArrayFormatterIssue[]>
|
||||
makeFieldIssuesSubscribable<const P extends PropertyPath.Paths<A>>(
|
||||
path: P
|
||||
): Subscribable.Subscribable<readonly ParseResult.ArrayFormatterIssue[]>
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +34,7 @@ extends Pipeable.Class() implements Form<A, I, R> {
|
||||
super()
|
||||
}
|
||||
|
||||
makeFieldIssuesSubscribable<P extends PropertyPath.Paths<A>>(path: P) {
|
||||
makeFieldIssuesSubscribable<const P extends PropertyPath.Paths<A>>(path: P) {
|
||||
const filter = Option.match({
|
||||
onSome: (v: ParseResult.ParseError) => Effect.andThen(
|
||||
ParseResult.ArrayFormatter.formatError(v),
|
||||
@@ -82,7 +84,7 @@ export namespace useInput {
|
||||
}
|
||||
|
||||
export const useInput: {
|
||||
<A, I, R, const P extends PropertyPath.Paths<I>>(
|
||||
<A, I, R, const P extends PropertyPath.Paths<NoInfer<I>>>(
|
||||
self: Form<A, I, R>,
|
||||
path: P,
|
||||
options?: useInput.Options,
|
||||
|
||||
@@ -28,7 +28,7 @@ export type Paths<T, D extends number = 5, Seen = never> = readonly [] | (
|
||||
never
|
||||
)
|
||||
|
||||
export type ValueFromPath<T, P extends readonly any[]> = P extends [infer Head, ...infer Tail]
|
||||
export type ValueFromPath<T, P extends readonly any[]> = P extends readonly [infer Head, ...infer Tail]
|
||||
? Head extends keyof T
|
||||
? ValueFromPath<T[Head], Tail>
|
||||
: T extends readonly any[]
|
||||
|
||||
Reference in New Issue
Block a user