import { type EditorFieldOption, type EditorModelOptions, type ManifestDocument } from "./editor.js"; import { type ValidationResult } from "./validation.js"; import type { EditorFieldDescriptor, InspectorSelectOption, UsePersistentBlockIdentityOptions, UsePersistentBlockIdentityResult, TypedAttributeUpdater, UseEditorFieldsResult } from "./inspector-runtime-types.js"; export declare function toStringValue(value: unknown, fallback: string): string; export declare function toNumberValue(value: unknown, fallback: number): number; export declare function toBooleanValue(value: unknown, fallback: boolean): boolean; export declare function toSelectOptions(options: readonly EditorFieldOption[], labelMap?: Record): InspectorSelectOption[]; export declare function getFieldValue(field: EditorFieldDescriptor, source: object): unknown; /** * Build memoized editor-field helpers from one manifest document. * * @param manifest Manifest document that describes the editor field tree. * @param options Optional field-model overrides such as labels, hidden paths, and manual controls. * @returns Derived field collections plus helpers for reading typed field values from attribute objects. * @category React */ export declare function useEditorFields(manifest: ManifestDocument, options?: EditorModelOptions): UseEditorFieldsResult; /** * Create typed attribute update callbacks for manifest-driven editor UIs. * * @param attributes Current block attribute object. * @param setAttributes Callback that applies partial attribute updates. * @param validate Optional validator used before committing updates. * @returns Typed helpers for key-based and path-based attribute updates. * @category React */ export declare function useTypedAttributeUpdater(attributes: T, setAttributes: (attrs: Partial) => void, validate?: (value: T) => ValidationResult): TypedAttributeUpdater; /** * Keep one block attribute populated with a stable document-level id that * survives normal edits and repairs duplicates inside the current block tree. * * `autoRepair` defaults to enabled when omitted. Callers should pass a stable * or memoized `blocks` reference so equivalent renders can reuse cached repair * analysis instead of re-walking the full document tree. * * @param options Current block identity inputs including the attribute key, editor tree snapshot, and `setAttributes` callback. * @returns The current/pending persistent id plus a helper that can force the attribute repair immediately. `nextPersistentId` can stay `null` when no repair is pending yet, while `ensurePersistentId()` always returns a non-null string. * @category React */ export declare function usePersistentBlockIdentity(options: UsePersistentBlockIdentityOptions): UsePersistentBlockIdentityResult;