57 lines
1.7 KiB
TypeScript
57 lines
1.7 KiB
TypeScript
/**
|
|
*/
|
|
export declare class FS {
|
|
/**
|
|
* 写出文件
|
|
*/
|
|
static WriteFile(fname: string, data: BlobPart): void;
|
|
private static chooserInput;
|
|
/**
|
|
* 选择文件
|
|
* filter ".json"
|
|
* @param { filter, multiple = false, callback }
|
|
*/
|
|
static ChooseFile({ filter, multiple, callback }: {
|
|
filter?: string;
|
|
multiple?: boolean;
|
|
callback: (filelist: FileList) => void;
|
|
}): void;
|
|
/**
|
|
* Used as an alternative to chooseFile for saving files in the browser.
|
|
*
|
|
* Uses a prompt to question the user the file name.
|
|
*
|
|
* @method chooseFileName
|
|
* @param {Function} onLoad onLoad callback
|
|
* @param {String} saveas File extension
|
|
*/
|
|
static chooseFileName: (onLoad: any, saveas: any, name: any) => void;
|
|
/**
|
|
* Get file name without extension from file path string.
|
|
*
|
|
* If input is a/b/c/abc.d output is abc.
|
|
*
|
|
* @method getFileName
|
|
* @param {String} filePath File path
|
|
* @return {String} File name without path and extension
|
|
*/
|
|
static getFileName: (filePath: string) => string;
|
|
/**
|
|
* Get file name without extension.
|
|
* If input is a/b/c/abc.d output is a/b/c/abc.
|
|
*/
|
|
static getNameWithoutExtension: (filePath: string) => string;
|
|
/**
|
|
* Get file directoty.
|
|
*
|
|
* If input is a/b/c/abc.d output is a/b/c/
|
|
*/
|
|
static getFilePath: (filePath: string) => string;
|
|
/**
|
|
* Get file extension from file path string (always in lowercase).
|
|
*
|
|
* If input is a/b/c/abc.d output is d.
|
|
*/
|
|
static getFileExtension: (filePath: string) => string;
|
|
}
|
|
//# sourceMappingURL=FileSystem.d.ts.map
|