import type { Component, Snippet } from 'svelte'; import type { ResolvedObjectFieldPolicy } from '../../types.js'; import type { FieldInputRegistry } from '../input-registry.js'; import { type ObjectFormFieldDefinition, type ObjectFormFieldSnippetProps } from '../types.js'; import { type FieldUsageReporter } from '../usage-capture.js'; export type ObjectFormSubmitAcknowledgement = boolean | void; export type ObjectFormSubmitHandler = (event: SubmitEvent) => ObjectFormSubmitAcknowledgement | Promise; export interface ObjectFormProps { /** Identifier for the object being edited. */ objectRef: string; /** * Generated browser-safe definitions — never pass raw server registry fields. * Omit with `policy` to resolve both through ObjectFormSourceProvider. */ fields?: Readonly>; /** Pre-resolved policy for the same objectRef. Omit with `fields` for a source. */ policy?: ResolvedObjectFieldPolicy; /** Mutable create/edit record. Bind this prop to retain values in the host. */ value?: Record; /** True for creates (defaults may prefill), false for loaded edits. */ isNewRecord?: boolean; /** * Optional identity for a create session. Change this when reusing a mounted * form for another new record; defaults then apply once to missing values. * With no key, replacing the bound record with an empty object starts a new * create session automatically. */ createSessionKey?: string | number; /** Blocks form input and submission. */ disabled?: boolean; /** Shows the mode toggle between basic and advanced fields. */ showModeSwitch?: boolean; /** Render a provider-registered policy gear next to the mode control. */ showPolicyGear?: boolean; /** Optional registry of custom field input components. */ inputRegistry?: FieldInputRegistry; /** Per-field custom widget snippets, keyed by field name. */ renderers?: Readonly>>; /** Optional controls rendered after the policy-ordered fields inside the form. */ actions?: Snippet; /** * Optional telemetry transport. It runs only when `onsubmit` explicitly * resolves `true` after persistence; identity and field sensitivity remain * server-derived. */ usageReporter?: FieldUsageReporter; /** CSS class forwarded to the form element. */ class?: string; /** Return true only after the host has persisted this record successfully. */ onsubmit?: ObjectFormSubmitHandler; } declare const ObjectForm: Component; type ObjectForm = ReturnType; export default ObjectForm; //# sourceMappingURL=ObjectForm.svelte.d.ts.map