ez-common-ts/lib/commons/file-util.d.ts

44 lines
1.4 KiB
TypeScript
Raw Permalink Normal View History

2023-11-12 22:00:29 +08:00
/**
*
* @param fileName
* @returns
*/
export declare function getFileExt(fileName: string): string;
/**
2023-11-14 16:17:22 +08:00
*
2023-11-12 22:00:29 +08:00
*
*
* 使substring方法提取最后一个斜杠或反斜杠后面的字符串作为文件名并返回
* @param path
2023-11-14 16:17:22 +08:00
* @returns
2023-11-12 22:00:29 +08:00
*/
2023-11-14 16:17:22 +08:00
export declare function getFileFullName(path: string): string;
/**
*
*/
export declare function getFileNameWithoutExt(path: string): string;
/**
*
*/
export interface IFileInfo {
/** 文件名(包含扩展名) */
fileName: string;
/**
*
*/
fileNameNoExt: string;
/** 文件扩展名 */
fileExtName: string;
/** 路径仅包含文件夹 */
pathOnly: string;
/** 完整路径 */
fullPath: string;
}
/**
*
* @param path
* @param platform "win32"
* @returns
*/
export declare function getFileInfo(path: string, platform?: string): IFileInfo;