@ma3-pro-plugins/ma3-pro-plugins-lib
Version:
TSTL Library for grandMA3 plugins
40 lines (39 loc) • 1.54 kB
TypeScript
/// <reference types="@typescript-to-lua/language-extensions" />
/// <reference types="lua-types/5.3" />
declare function makeDir(path: string): LuaIterable<string, undefined>;
declare function path(...pathParts: string[]): string;
declare function readFile(filePath: string): string | undefined;
declare function openFileForWriting(fileName: string): LuaFile;
declare function writeBinaryFile(fileName: string, data: string): void;
declare function writeLine(fp: LuaFile, line: string): void;
declare function closeFile(fp: LuaFile): void;
declare function escapeObjNameForPath(name: string): string;
export declare function escapeFileName(name: string): any;
export interface FileEntry {
type: 'directory' | 'file';
fullPath: string;
name: string;
}
declare function exists(path: string): boolean;
declare function isDir(path: string): boolean;
/**
* Get directory content
* Taken from gma3_helpers.lua
*/
declare function getDirectoryContent(path: string): FileEntry[];
declare function removeDirectory(folder: string): void;
export declare const FileUtils: {
closeFile: typeof closeFile;
escapeObjNameForPath: typeof escapeObjNameForPath;
exists: typeof exists;
isDir: typeof isDir;
getDirectoryContent: typeof getDirectoryContent;
makeDir: typeof makeDir;
openFileForWriting: typeof openFileForWriting;
path: typeof path;
readFile: typeof readFile;
removeDirectory: typeof removeDirectory;
writeLine: typeof writeLine;
writeBinaryFile: typeof writeBinaryFile;
};
export {};