{
	"name": "FileFacade",
	"doc": "filesystem-related operations. none of the methods writing files to disk guarantee a fixed file name or location, except for putFileIntoDownloadsFolder.",
	"type": "facade",
	"receivers": ["ios", "desktop", "android"],
	"senders": ["web"],
	"methods": {
		"open": {
			"doc": "Opens the file with the built-in viewer or external program.",
			"arg": [
				{
					"location": "string"
				},
				{
					"mimeType": "string"
				}
			],
			"ret": "void"
		},
		"openFileChooser": {
			"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>?"
				},
				{
					"isFileOnly": "boolean?"
				}
			],
			"ret": "List<string>"
		},
		"openFolderChooser": {
			"doc": "Opens OS file picker for selecting a folder. Only on desktop.",
			"arg": [],
			"ret": "string?"
		},
		"openMacImportFileChooser": {
			"doc": "Opens OS file picker for selecting either a file or folder for Email Import. Works only on macOS",
			"arg": [],
			"ret": "List<string>"
		},
		"deleteFile": {
			"arg": [
				{
					"file": "string"
				}
			],
			"ret": "void"
		},
		"getName": {
			"arg": [
				{
					"file": "string"
				}
			],
			"ret": "string"
		},
		"getMimeType": {
			"arg": [
				{
					"file": "string"
				}
			],
			"ret": "string"
		},
		"getSize": {
			"doc": "get the absolute size in bytes of the file at the given location",
			"arg": [
				{
					"file": "string"
				}
			],
			"ret": "number"
		},
		"putFileIntoDownloadsFolder": {
			"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",
			"arg": [
				{
					"localFileUri": "string"
				},
				{
					"fileNameToUse": "string"
				}
			],
			"ret": "string"
		},
		"upload": {
			"arg": [
				{
					"fileUrl": "string"
				},
				{
					"targetUrl": "string"
				},
				{
					"method": "string"
				},
				{
					"headers": "Map<string, string>"
				}
			],
			"ret": "UploadTaskResponse"
		},
		"download": {
			"doc": "download an encrypted file to the file system and return the location of the data",
			"arg": [
				{
					"sourceUrl": "string"
				},
				{
					"filename": "string"
				},
				{
					"headers": "Map<string, string>"
				}
			],
			"ret": "DownloadTaskResponse"
		},
		"hashFile": {
			"doc": "Calculates specified file hash (with SHA-256). Returns first 6 bytes of it as Base64.",
			"arg": [
				{
					"fileUri": "string"
				}
			],
			"ret": "string"
		},
		"clearFileData": {
			"arg": [],
			"ret": "void"
		},
		"joinFiles": {
			"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.",
			"arg": [
				{
					"filename": "string"
				},
				{
					"files": "List<string>"
				}
			],
			"ret": "string"
		},
		"splitFile": {
			"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.",
			"arg": [
				{
					"fileUri": "string"
				},
				{
					"maxChunkSizeBytes": "number"
				}
			],
			"ret": "List<string>"
		},
		"writeTempDataFile": {
			"doc": "Save the unencrypted data file to the disk into a fixed temporary location, not the user's preferred download dir.",
			"arg": [
				{
					"file": "DataFile"
				}
			],
			"ret": "string"
		},
		"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"
		},
		"readDataFile": {
			"doc": "read the file at the given location into a DataFile. Returns null if reading fails for any reason.",
			"arg": [
				{
					"filePath": "string"
				}
			],
			"ret": "DataFile?"
		}
	}
}
