import type { FieldValue, FormOptions, FormValue, Schema, UiSchema, UiSchemaRoot, ValidationError } from "@sjsf/form"; import type { RPath, SchemaDefinition, SchemaValue } from "@sjsf/form/core"; import type { DeepPartial, MaybePromise } from "@sjsf/form/lib/types"; import type { PickOptionalSerializable } from "./internal.js"; export declare const JSON_CHUNKS_KEY = "__sjsf_sveltekit_json_chunks"; export declare const FORM_DATA_FILE_PREFIX = "__sjsf_sveltekit_file__"; export type SerializableOptionalFormOptions = PickOptionalSerializable>; export type InitialFormData = SerializableOptionalFormOptions & { schema?: Schema; initialValue?: DeepPartial; initialErrors?: ValidationError[]; uiSchema?: UiSchemaRoot; }; export type SendData = boolean | "withoutClientSideUpdate"; export interface ValidFormData { isValid: true; data: SD extends false ? undefined : T; } export interface InvalidFormData { isValid: false; data: SD extends false ? undefined : FormValue; } export type ValidatedFormData = { idPrefix: string; updateData: boolean; errors: ReadonlyArray; } & (ValidFormData | InvalidFormData); export type Entry = [key: string, value: T]; export type Entries = Entry[]; export interface EntryConverterOptions { schema: SchemaDefinition; uiSchema: UiSchema; path: RPath; value: T | undefined; } export type EntryConverter = (signal: AbortSignal, options: EntryConverterOptions) => MaybePromise; export type EnumItemDecoder = (options: SchemaValue[], value: string) => SchemaValue | undefined; export interface Codec { encode: (str: string) => string; decode: (encodedStr: string) => string; }