feat: add bounded file byte reads
This commit is contained in:
Vendored
+4
-2
@@ -102,18 +102,20 @@ export function ReadPluginSetting(arg1:string,arg2:string):Promise<any>;
|
||||
|
||||
export function ReadPluginSettings(arg1:string):Promise<Record<string, any>|string>;
|
||||
|
||||
export function ReadVaultFileBytes(arg1:string,arg2:string):Promise<files.FileBytes|string>;
|
||||
|
||||
export function ReadVaultTextFile(arg1:string,arg2:string):Promise<string|string>;
|
||||
|
||||
export function RecordDesiredPlugin(arg1:string,arg2:string,arg3:string):Promise<string>;
|
||||
|
||||
export function ReloadPlugins():Promise<number|string>;
|
||||
|
||||
export function RestoreVaultTrash(arg1:string,arg2:string,arg3:files.RestoreOptions):Promise<string|string>;
|
||||
|
||||
export function RenameWorkspace(arg1:string,arg2:string):Promise<string>;
|
||||
|
||||
export function RenameWorkspaceNode(arg1:string,arg2:string):Promise<string>;
|
||||
|
||||
export function RestoreVaultTrash(arg1:string,arg2:string,arg3:files.RestoreOptions):Promise<string|string>;
|
||||
|
||||
export function SelectDirectory():Promise<string>;
|
||||
|
||||
export function SelectVaultForOpen():Promise<string>;
|
||||
|
||||
@@ -190,6 +190,10 @@ export function ReadPluginSettings(arg1) {
|
||||
return window['go']['api']['App']['ReadPluginSettings'](arg1);
|
||||
}
|
||||
|
||||
export function ReadVaultFileBytes(arg1, arg2) {
|
||||
return window['go']['api']['App']['ReadVaultFileBytes'](arg1, arg2);
|
||||
}
|
||||
|
||||
export function ReadVaultTextFile(arg1, arg2) {
|
||||
return window['go']['api']['App']['ReadVaultTextFile'](arg1, arg2);
|
||||
}
|
||||
@@ -202,10 +206,6 @@ export function ReloadPlugins() {
|
||||
return window['go']['api']['App']['ReloadPlugins']();
|
||||
}
|
||||
|
||||
export function RestoreVaultTrash(arg1, arg2, arg3) {
|
||||
return window['go']['api']['App']['RestoreVaultTrash'](arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
export function RenameWorkspace(arg1, arg2) {
|
||||
return window['go']['api']['App']['RenameWorkspace'](arg1, arg2);
|
||||
}
|
||||
@@ -214,6 +214,10 @@ export function RenameWorkspaceNode(arg1, arg2) {
|
||||
return window['go']['api']['App']['RenameWorkspaceNode'](arg1, arg2);
|
||||
}
|
||||
|
||||
export function RestoreVaultTrash(arg1, arg2, arg3) {
|
||||
return window['go']['api']['App']['RestoreVaultTrash'](arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
export function SelectDirectory() {
|
||||
return window['go']['api']['App']['SelectDirectory']();
|
||||
}
|
||||
|
||||
@@ -369,6 +369,24 @@ export namespace capability {
|
||||
|
||||
export namespace files {
|
||||
|
||||
export class FileBytes {
|
||||
relativePath: string;
|
||||
size: number;
|
||||
mimeHint: string;
|
||||
dataBase64: string;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new FileBytes(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.relativePath = source["relativePath"];
|
||||
this.size = source["size"];
|
||||
this.mimeHint = source["mimeHint"];
|
||||
this.dataBase64 = source["dataBase64"];
|
||||
}
|
||||
}
|
||||
export class FileEntry {
|
||||
name: string;
|
||||
relativePath: string;
|
||||
|
||||
Reference in New Issue
Block a user