@kform/react
Version:
React integration for KForm.
19 lines (18 loc) • 1.05 kB
TypeScript
import { File as KFormFile, Schema } from "@kform/core";
/**
* Formats a KForm file {@link value} as a [file list]{@link FileList}, given
* its {@link schema}.
* @param value KForm file value to format as a file list.
* @param schema Schema of the numeric {@link value}.
* @returns String representation of the numeric {@link value}.
*/
export declare function formatKFormFileAsFileList<T extends KFormFile | null = KFormFile | null>(value: T | undefined, schema: Schema<T>): FileList;
/**
* Parses a formatted file list [value]{@link formattedValue} as a KForm file
* value, given the {@link schema} of the expected KForm file value.
* @param formattedValue Formatted value to parse as a KForm file value.
* @param schema Schema of the expected KForm file value.
* @returns KForm file representation of the
* [formatted value]{@link formattedValue} according to {@link schema}.
*/
export declare function parseFileListAsKFormFile<T extends KFormFile | null = KFormFile | null>(formattedValue: FileList, schema: Schema<T>): T | Promise<T>;