import type { FormValue, Submission, SubmissionResult } from '@conform-to/dom/future';
import type { IntentHandler, IntentDispatcher, UnknownIntent } from './types';
/**
 * Serializes intent to string format: "type" or "type(payload)".
 */
export declare function serializeIntent<Intent extends UnknownIntent = UnknownIntent>(intent: Intent): string;
/**
 * Parses serialized intent string back to intent object.
 */
export declare function deserializeIntent(value: string): UnknownIntent;
/**
 * Applies intent transformation to submission payload.
 * Returns modified payload or null for reset intent.
 */
export declare function resolveIntent(submission: Submission, options?: {
    handlers?: Record<string, IntentHandler>;
}): Record<string, FormValue> | undefined;
/**
 * Resolves an intent after validation by calling the handler's onResolve.
 * Mutates the result with updated value/error and returns whether the intent was cancelled.
 */
export declare function applyIntent<ErrorShape>(result: SubmissionResult<ErrorShape>, intent: UnknownIntent | null, options?: {
    handlers?: Record<string, IntentHandler>;
}): SubmissionResult<ErrorShape>;
export declare function insertItem<Item>(list: Array<Item>, item: Item, index: number): void;
export declare function removeItem(list: Array<unknown>, index: number): void;
export declare function reorderItems(list: Array<unknown>, fromIndex: number, toIndex: number): void;
/**
 * Updates list keys by removing child keys and optionally transforming remaining keys.
 */
export declare function updateListKeys(keys: Record<string, string[]> | undefined, keyToBeRemoved: string, updateKey?: (key: string) => string | null): Record<string, string[]>;
/**
 * Built-in action handlers for form intents:
 * - reset: clears form data
 * - validate: marks fields as touched for validation display
 * - update: updates specific field values
 * - insert/remove/reorder: manages array field operations
 */
export declare const intentHandlers: {
    [Type in keyof IntentDispatcher]: IntentDispatcher[Type] extends (payload: any) => void ? IntentHandler<IntentDispatcher[Type]> : never;
};
//# sourceMappingURL=intent.d.ts.map