diff --git a/packages/effect-fc/src/Form.ts b/packages/effect-fc/src/Form.ts index 1a2196e..5c37310 100644 --- a/packages/effect-fc/src/Form.ts +++ b/packages/effect-fc/src/Form.ts @@ -1,4 +1,4 @@ -import { Array, Cause, Chunk, type Context, type Duration, Effect, Equal, Exit, Fiber, identity, Option, ParseResult, Pipeable, Predicate, Schema, type Scope, Stream } from "effect" +import { Array, Cause, Chunk, type Context, type Duration, Effect, Equal, Exit, Fiber, Function, identity, Option, ParseResult, Pipeable, Predicate, Schema, type Scope, Stream } from "effect" import type * as React from "react" import * as Component from "./Component.js" import * as Lens from "./Lens.js" @@ -246,7 +246,15 @@ const filterIssuesByPath = ( issue.path.length >= path.length && Array.every(path, (p, i) => p === issue.path[i]) ) -export const focusObjectField =

( +export const focusObjectField: { +

( + self: Form, + key: K, + ): Form +

( + key: K, + ): (self: Form) => Form +} = Function.dual(2,

( self: Form, key: K, ): Form => { @@ -262,9 +270,17 @@ export const focusObjectField =

( +export const focusArrayAt: { +

( + self: Form, + index: number, + ): Form +

( + index: number, + ): (self: Form) => Form +} = Function.dual(2,

( self: Form, index: number, ): Form => { @@ -280,7 +296,7 @@ export const focusArrayAt =