Fix coping and moving files around using the file tree (#568)
* Implement write/read buffers in electron fill This makes cutting and copy files from the file tree work. * Implement fs.createReadStream This is used by the file tree to copy files. * Allow passing proxies back from client to server This makes things like piping streams possible. * Synchronously bind to proxy events This eliminates any chance whatsoever of missing events due to binding too late. * Make it possible to bind some events on demand * Add some protocol documentation
This commit is contained in:
@ -171,8 +171,10 @@ const newCreateElement = <K extends keyof HTMLElementTagNameMap>(tagName: K): HT
|
||||
document.createElement = newCreateElement;
|
||||
|
||||
class Clipboard {
|
||||
public has(): boolean {
|
||||
return false;
|
||||
private readonly buffers = new Map<string, Buffer>();
|
||||
|
||||
public has(format: string): boolean {
|
||||
return this.buffers.has(format);
|
||||
}
|
||||
|
||||
public readFindText(): string {
|
||||
@ -190,6 +192,14 @@ class Clipboard {
|
||||
public readText(): Promise<string> {
|
||||
return clipboard.readText();
|
||||
}
|
||||
|
||||
public writeBuffer(format: string, buffer: Buffer): void {
|
||||
this.buffers.set(format, buffer);
|
||||
}
|
||||
|
||||
public readBuffer(format: string): Buffer | undefined {
|
||||
return this.buffers.get(format);
|
||||
}
|
||||
}
|
||||
|
||||
class Shell {
|
||||
|
Reference in New Issue
Block a user