function bindField<TClient extends ViewClient, TValue>(element: FieldElement, client: TClient, field: BridgeField<NoInfer<TClient>, NoInfer<TClient>["snapshot"], TValue> | FieldDefinition<NoInfer<TClient>, NoInfer<TClient>["snapshot"], TValue>, options?: FieldOptions<TValue>): BoundField<TClient["snapshot"], TClient, TValue>; Binds an element to one member of a connected client: creates a createFieldController for a generated descriptor such as EditorFields.title (or any definition with read and write), follows the client's state and wires the element as attachField does.
const editor = await connectEditor();
const title = bindField(document.querySelector("#title")!, editor, EditorFields.title, { commit: "pause" });
save.onclick = async () => { if ((await title.commit()).error === undefined) await editor.save(); };A field bound to <input type="number">, "date", "time" or "datetime-local" without a locale option uses the invariant and ISO forms those inputs take (locale: null) instead of the window's locale. dispose() unwires the element and stops following the client; a value that waits to be written is still written. The client stays connected: its owner disposes it.