2022-06-09 08:58:56 +02:00
{
2022-12-27 15:37:40 +01:00
"name" : "FileFacade" ,
2023-10-12 17:54:38 +02:00
"doc" : "filesystem-related operations. none of the methods writing files to disk guarantee a fixed file name or location, except for putFileIntoDownloadsFolder." ,
2022-12-27 15:37:40 +01:00
"type" : "facade" ,
"receivers" : [ "ios" , "desktop" , "android" ] ,
"senders" : [ "web" ] ,
"methods" : {
"open" : {
"doc" : "Opens the file with the built-in viewer or external program." ,
2023-02-28 13:43:55 +01:00
"arg" : [
{
"location" : "string"
} ,
{
"mimeType" : "string"
}
] ,
2022-12-27 15:37:40 +01:00
"ret" : "void"
} ,
"openFileChooser" : {
2023-02-28 13:43:55 +01:00
"doc" : "Opens OS file picker. Returns the list of URIs for the selected files. add a list of extensions (without dot) to filter the options." ,
"arg" : [
{
"boundingRect" : "IpcClientRect"
} ,
{
"filter" : "List<string>?"
2024-10-08 13:53:04 +02:00
} ,
{
"isFileOnly" : "boolean?"
2023-02-28 13:43:55 +01:00
}
] ,
2022-12-27 15:37:40 +01:00
"ret" : "List<string>"
} ,
"openFolderChooser" : {
"doc" : "Opens OS file picker for selecting a folder. Only on desktop." ,
"arg" : [ ] ,
"ret" : "string?"
} ,
2025-10-27 11:53:52 +01:00
"openMacImportFileChooser" : {
"doc" : "Opens OS file picker for selecting either a file or folder for Email Import. Works only on macOS" ,
"arg" : [ ] ,
"ret" : "List<string>"
} ,
2022-12-27 15:37:40 +01:00
"deleteFile" : {
2023-02-28 13:43:55 +01:00
"arg" : [
{
"file" : "string"
}
] ,
2022-12-27 15:37:40 +01:00
"ret" : "void"
} ,
"getName" : {
2023-02-28 13:43:55 +01:00
"arg" : [
{
"file" : "string"
}
] ,
2022-12-27 15:37:40 +01:00
"ret" : "string"
} ,
"getMimeType" : {
2023-02-28 13:43:55 +01:00
"arg" : [
{
"file" : "string"
}
] ,
2022-12-27 15:37:40 +01:00
"ret" : "string"
} ,
"getSize" : {
2023-10-12 17:54:38 +02:00
"doc" : "get the absolute size in bytes of the file at the given location" ,
2023-02-28 13:43:55 +01:00
"arg" : [
{
"file" : "string"
}
] ,
2022-12-27 15:37:40 +01:00
"ret" : "number"
} ,
"putFileIntoDownloadsFolder" : {
2023-10-12 17:54:38 +02:00
"doc" : "move and rename a decrypted file from the decryption location to the download location preferred by the user and return the absolute path to the moved file" ,
2023-02-28 13:43:55 +01:00
"arg" : [
{
"localFileUri" : "string"
2023-10-12 17:54:38 +02:00
} ,
{
"fileNameToUse" : "string"
2023-02-28 13:43:55 +01:00
}
] ,
2022-12-27 15:37:40 +01:00
"ret" : "string"
} ,
"upload" : {
"arg" : [
2023-02-28 13:43:55 +01:00
{
"fileUrl" : "string"
} ,
{
"targetUrl" : "string"
} ,
{
"method" : "string"
} ,
{
"headers" : "Map<string, string>"
}
2022-12-27 15:37:40 +01:00
] ,
"ret" : "UploadTaskResponse"
} ,
"download" : {
2023-10-12 17:54:38 +02:00
"doc" : "download an encrypted file to the file system and return the location of the data" ,
2023-02-28 13:43:55 +01:00
"arg" : [
{
"sourceUrl" : "string"
} ,
{
"filename" : "string"
} ,
{
"headers" : "Map<string, string>"
}
] ,
2022-12-27 15:37:40 +01:00
"ret" : "DownloadTaskResponse"
} ,
"hashFile" : {
"doc" : "Calculates specified file hash (with SHA-256). Returns first 6 bytes of it as Base64." ,
2023-02-28 13:43:55 +01:00
"arg" : [
{
"fileUri" : "string"
}
] ,
2022-12-27 15:37:40 +01:00
"ret" : "string"
} ,
"clearFileData" : {
"arg" : [ ] ,
"ret" : "void"
} ,
"joinFiles" : {
2023-10-12 17:54:38 +02:00
"doc" : "given a list of chunk file locations, will re-join them in order to reconstruct a single file and returns the location of that file on disk." ,
2023-02-28 13:43:55 +01:00
"arg" : [
{
"filename" : "string"
} ,
{
"files" : "List<string>"
}
] ,
2022-12-27 15:37:40 +01:00
"ret" : "string"
} ,
"splitFile" : {
2023-10-12 17:54:38 +02:00
"doc" : "split a given file on disk into as many chunks as necessary to limit their size to the max byte size. returns the list of chunk file locations." ,
2023-02-28 13:43:55 +01:00
"arg" : [
{
"fileUri" : "string"
} ,
{
"maxChunkSizeBytes" : "number"
}
] ,
2022-12-27 15:37:40 +01:00
"ret" : "List<string>"
} ,
2025-03-10 16:19:11 +01:00
"writeTempDataFile" : {
2023-10-12 17:54:38 +02:00
"doc" : "Save the unencrypted data file to the disk into a fixed temporary location, not the user's preferred download dir." ,
2023-02-28 13:43:55 +01:00
"arg" : [
{
"file" : "DataFile"
}
] ,
2022-12-27 15:37:40 +01:00
"ret" : "string"
} ,
2025-03-10 16:19:11 +01:00
"writeToAppDir" : {
"doc" : "Save given file in given path relative to app data folder" ,
"arg" : [
{
"content" : "bytes"
} ,
{
"path" : "string"
}
] ,
"ret" : "void"
} ,
"readFromAppDir" : {
"doc" : "Read file from given path relative to app data folder" ,
"arg" : [
{
"path" : "string"
}
] ,
"ret" : "bytes"
} ,
2022-12-27 15:37:40 +01:00
"readDataFile" : {
2023-10-12 17:54:38 +02:00
"doc" : "read the file at the given location into a DataFile. Returns null if reading fails for any reason." ,
2023-02-28 13:43:55 +01:00
"arg" : [
{
"filePath" : "string"
}
] ,
2022-12-27 15:37:40 +01:00
"ret" : "DataFile?"
}
2022-06-09 08:58:56 +02:00
}
}