Form work
Some checks failed
Lint / lint (push) Failing after 15s

This commit is contained in:
Julien Valverdé
2025-04-16 00:44:01 +02:00
parent ab0dce107d
commit fc4295894f
3 changed files with 38 additions and 31 deletions

View File

@@ -1,26 +1,6 @@
import { Schema } from "effect"
import type * as FormField from "./FormField.js"
export interface Form<A, I, R> {
readonly schema: Schema.Schema<A, I, R>
}
export type FormTree<S extends Schema.Schema<any>> = (
S extends Schema.Array$<any> ? FormField.ArrayFormField<S> :
S extends Schema.Struct<any> ? FormField.StructFormField<S> :
FormField.GenericFormField<S>
)
const MySchema = Schema.Struct({
name: Schema.String,
symbol: Schema.SymbolFromSelf,
values: Schema.Array(Schema.String),
})
type TestFormTree = FormTree<typeof MySchema>
declare const testFormTree: TestFormTree
testFormTree.fields.values.elements