datasquirel/dist/client/media/inputFileToBase64.d.ts
Benjamin Toby a3561da53d Updates
2025-01-10 20:35:05 +01:00

22 lines
668 B
TypeScript

type FunctionReturn = {
fileBase64?: string;
fileBase64Full?: string;
fileName?: string;
fileSize?: number;
fileType?: string;
};
type Param = {
inputFile: File;
allowedRegex?: RegExp;
};
/**
* Input File to base64
* ==============================================================================
*
* @description This function takes in a *SINGLE* input file from a HTML file input element.
* HTML file input elements usually return an array of input objects, so be sure to select the target
* file from the array.
*/
export default function inputFileToBase64({ inputFile, allowedRegex, }: Param): Promise<FunctionReturn>;
export {};