22 lines
668 B
TypeScript
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 {};
|