import type { ComputedRef } from 'vue'; import type CwaFetch from './fetcher/cwa-fetch.js'; import type { ResourcesStore } from '../storage/stores/resources/resources-store.js'; export interface ViewVars { full_name: string; name: string; id: string; unique_block_prefix: string; valid: boolean; submitted: boolean; required: boolean; value: any; errors: string[]; action?: string; method?: string; block_prefixes: string[]; disabled: boolean; checked?: boolean; multiple?: boolean; attr: { [key: string]: any; }; label?: string; label_attr: { [key: string]: any; }; [key: string]: any; } export interface FormView { vars: ViewVars; prototype?: ApiFormView; } interface ApiFormView { vars: ViewVars; children: ApiFormView[]; prototype?: ApiFormView | null; } export interface KeyedFormView { [key: string]: FormView; } export default class Forms { private readonly cwaFetch; private readonly _resourcesStore; private readonly _submitAttempted; private readonly _fieldValues; private readonly _localEntries; constructor(resourcesStoreDefinition: ResourcesStore, cwaFetch: CwaFetch); isSubmitAttempted(iri: string): boolean; setSubmitAttempted(iri: string, attempted: boolean): void; setFieldValue(iri: string, fullName: string, value: any): void; clearFieldValue(iri: string, fullName: string): void; getFieldValues(iri: string): Record; private normalizeFormResponseId; validateField(endpoint: string, body: Record): Promise; submitForm(endpoint: string, body: Record, method: 'POST' | 'PATCH'): Promise<{ success: boolean; formErrors?: string[]; }>; registerLocalEntry(iri: string, entry: Record): string[]; unregisterLocalEntries(iri: string, keys: string[]): void; getForm(iri: string): ComputedRef; getFormViewErrors(formIri: string, field: string): ComputedRef; private get resourcesStore(); } export {};