@openshift-assisted/ui-lib
Version:
React component library for the Assisted Installer UI
26 lines • 1.67 kB
TypeScript
import filesize from 'filesize.js';
export declare const FILENAME_REGEX: RegExp;
export declare const FILE_TYPE_MESSAGE = "Unsupported file type. Please provide a valid YAML file.";
export declare const INCORRECT_TYPE_FILE_MESSAGE = "File type is not supported. File type must be yaml, yml ,json , yaml.patch. or yml.patch.";
export declare const getErrorMessage: (error: unknown) => string;
export declare const getRandomString: (length: number) => string;
export declare const getKeys: <T extends object>(obj: T) => (keyof T)[];
export declare const validateFileType: (value: string) => boolean;
export declare const isStringValidYAML: (input: string) => boolean;
export declare const isStringValidJSON: (input: string) => boolean;
export declare const validateFileSize: (value: string) => boolean;
export declare const fileSize: typeof filesize;
export declare const getMaxFileSizeMessage: string;
export declare const validateFileName: (fileName: string) => boolean;
export declare const stringToJSON: <T>(jsonString: string | undefined) => T | undefined;
export declare const downloadFile: (fileUrl?: string, dataBlob?: Blob, fileName?: string) => void;
export declare const getMajorMinorVersion: (version?: string) => string;
/**
* Handles version comparison for major and minor parts only.
*
* @param checkVersion the version we want to know about
* @param toVersion the version we want to test against
* @returns true if "checkVersion" is equal or greater than "toVersion" (major and minor only)
*/
export declare const isMajorMinorVersionEqualOrGreater: (checkVersion: string | undefined, toVersion: string) => boolean;
//# sourceMappingURL=utils.d.ts.map