@selldone/sdk-storefront
Version:
A TypeScript SDK to connect to your shop and build a fully functional storefront and website by simply developing a frontend web application. All backend operations are seamlessly managed by the serverless Selldone solution.
28 lines (27 loc) • 1.4 kB
TypeScript
export declare class FileHelper {
static GetFileName(fullPath: string | null): string | null;
static GetFileExtension(fullPath: string | null): string | null | undefined;
static GetFileIcon(fullPath: string | null): string | null;
static DataURItoBlob(dataURI: string | null): Blob | null;
static DownloadBlobFile(data: any, headers: {
[key: string]: string;
}): void;
static LoadFile(event: Blob): Promise<unknown>;
/**
* Initiates a download of a text file with the specified filename and content.
*
* @param filename - The name of the file to be downloaded, including the file extension.
* @param text - The text content to be included in the file.
* @param data_uri - (Optional) The data URI prefix used to encode the text as a downloadable file.
* Defaults to "data:text/plain;charset=utf-8,".
*/
static DownloadText(filename: string, text: string, data_uri?: string): void;
/**
* Retrieves the image source URL for a file's extension, based on its filename.
*
* @param filename - The name of the file from which to extract the extension.
* @returns The URL of the image representing the file type based on its extension.
* If the extension is not found, a default image path is returned.
*/
static GetFileExtensionImage(filename: string): any;
}