Files
crawlab/frontend/crawlab-ui/typings/interfaces/services/file.d.ts

33 lines
1.1 KiB
Go

import { ComputedRef } from 'vue';
declare global {
interface FileServices<T> extends Services<T> {
listDir: (
id: string,
path: string
) => Promise<ResponseWithData<FileNavItem[]>>;
listRootDir: (id: string) => Promise<ResponseWithData<FileNavItem[]>>;
getFile: (id: string, path: string) => Promise<ResponseWithData<string>>;
getFileInfo: (
id: string,
path: string
) => Promise<ResponseWithData<FileNavItem>>;
saveFile: (id: string, path: string, data: string) => Promise<Response>;
saveFileBinary: (id: string, path: string, file: File) => Promise<Response>;
saveFilesBinary: (
id: string,
files: { path: string; file: File }[],
targetDirectory?: string
) => Promise<Response>;
saveDir: (id: string, path: string) => Promise<Response>;
renameFile: (
id: string,
path: string,
new_path: string
) => Promise<Response>;
deleteFile: (id: string, path: string) => Promise<Response>;
copyFile: (id: string, path: string, new_path: string) => Promise<Response>;
fileContent: ComputedRef<string>;
}
}