@@ -11,33 +11,33 @@ import * as SubscriptionRef from "./SubscriptionRef.js"
|
||||
export const FormTypeId: unique symbol = Symbol.for("@effect-fc/Form/Form")
|
||||
export type FormTypeId = typeof FormTypeId
|
||||
|
||||
export interface Form<in out P extends readonly PropertyKey[], in out A, in out I = A>
|
||||
export interface Form<in out P extends readonly PropertyKey[], in out A, in out I = A, in out ER = never, in out EW = never>
|
||||
extends Pipeable.Pipeable {
|
||||
readonly [FormTypeId]: FormTypeId
|
||||
|
||||
readonly path: P
|
||||
readonly value: Subscribable.Subscribable<Option.Option<A>>
|
||||
readonly encodedValue: Lens.Lens<I>
|
||||
readonly error: Subscribable.Subscribable<Option.Option<ParseResult.ParseError>>
|
||||
readonly validationFiber: Subscribable.Subscribable<Option.Option<Fiber.Fiber<A, ParseResult.ParseError>>>
|
||||
readonly canSubmit: Subscribable.Subscribable<boolean>
|
||||
readonly value: Subscribable.Subscribable<Option.Option<A>, ER, never>
|
||||
readonly encodedValue: Lens.Lens<I, ER, EW, never, never>
|
||||
readonly error: Subscribable.Subscribable<Option.Option<ParseResult.ParseError>, ER, never>
|
||||
readonly validationFiber: Subscribable.Subscribable<Option.Option<Fiber.Fiber<A, ParseResult.ParseError>>, ER, never>
|
||||
readonly canSubmit: Subscribable.Subscribable<boolean, never, never>
|
||||
}
|
||||
|
||||
export const FormImplTypeId: unique symbol = Symbol.for("@effect-fc/Form/FormImpl")
|
||||
export type FormImplTypeId = typeof FormImplTypeId
|
||||
|
||||
export class FormImpl<in out P extends readonly PropertyKey[], in out A, in out I = A>
|
||||
extends Pipeable.Class() implements Form<P, A, I> {
|
||||
export class FormImpl<in out P extends readonly PropertyKey[], in out A, in out I = A, in out ER = never, in out EW = never>
|
||||
extends Pipeable.Class() implements Form<P, A, I, ER, EW> {
|
||||
readonly [FormTypeId]: FormTypeId = FormTypeId
|
||||
readonly [FormImplTypeId]: FormImplTypeId = FormImplTypeId
|
||||
|
||||
constructor(
|
||||
readonly path: P,
|
||||
readonly value: Lens.Lens<Option.Option<A>>,
|
||||
readonly encodedValue: Lens.Lens<I>,
|
||||
readonly error: Lens.Lens<Option.Option<ParseResult.ParseError>>,
|
||||
readonly validationFiber: Lens.Lens<Option.Option<Fiber.Fiber<A, ParseResult.ParseError>>>,
|
||||
readonly canSubmit: Subscribable.Subscribable<boolean>,
|
||||
readonly value: Lens.Lens<Option.Option<A>, ER, EW, never, never>,
|
||||
readonly encodedValue: Lens.Lens<I, ER, EW, never, never>,
|
||||
readonly error: Lens.Lens<Option.Option<ParseResult.ParseError>, ER, EW, never, never>,
|
||||
readonly validationFiber: Lens.Lens<Option.Option<Fiber.Fiber<A, ParseResult.ParseError>>, ER, EW, never, never>,
|
||||
readonly canSubmit: Subscribable.Subscribable<boolean, never, never>,
|
||||
) {
|
||||
super()
|
||||
}
|
||||
@@ -48,7 +48,7 @@ export const RootFormTypeId: unique symbol = Symbol.for("@effect-fc/Form/RootFor
|
||||
export type RootFormTypeId = typeof RootFormTypeId
|
||||
|
||||
export interface RootForm<in out A, in out I = A, in out R = never, in out MA = void, in out ME = never, in out MR = never, in out MP = never>
|
||||
extends Form<readonly [], A, I> {
|
||||
extends Form<readonly [], A, I, never, never> {
|
||||
readonly schema: Schema.Schema<A, I, R>
|
||||
readonly context: Context.Context<Scope.Scope | R>
|
||||
readonly mutation: Mutation.Mutation<
|
||||
@@ -74,11 +74,11 @@ extends FormImpl<readonly [], A, I> implements RootForm<A, I, R, MA, ME, MR, MP>
|
||||
>,
|
||||
readonly autosubmit: boolean,
|
||||
|
||||
value: Lens.Lens<Option.Option<A>>,
|
||||
encodedValue: Lens.Lens<I>,
|
||||
error: Lens.Lens<Option.Option<ParseResult.ParseError>>,
|
||||
validationFiber: Lens.Lens<Option.Option<Fiber.Fiber<A, ParseResult.ParseError>>>,
|
||||
canSubmit: Subscribable.Subscribable<boolean>,
|
||||
value: Lens.Lens<Option.Option<A>, never, never, never, never>,
|
||||
encodedValue: Lens.Lens<I, never, never, never, never>,
|
||||
error: Lens.Lens<Option.Option<ParseResult.ParseError>, never, never, never, never>,
|
||||
validationFiber: Lens.Lens<Option.Option<Fiber.Fiber<A, ParseResult.ParseError>>, never, never, never, never>,
|
||||
canSubmit: Subscribable.Subscribable<boolean, never, never>,
|
||||
|
||||
readonly runSemaphore: Effect.Semaphore,
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user