aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-03-20 05:01:42 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-03-20 05:01:42 -0400
commite418b10b4e515c6ebbe0b9be64e7bfd451ddd11f (patch)
tree51f364b1fde240205df6c855c05137c8b5b95dc0 /src
parent6cee1e69703463cd6410d24a96c1f9eb33e996a5 (diff)
Small tweak to UndoManager
Diffstat (limited to 'src')
-rw-r--r--src/Utils.ts4
-rw-r--r--src/client/util/UndoManager.ts3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index d4b7da52c..a4db94809 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -52,4 +52,6 @@ export class Utils {
public static AddServerHandlerCallback<T>(socket: Socket, message: Message<T>, handler: (args: [T, (res: any) => any]) => any) {
socket.on(message.Message, (arg: T, fn: (res: any) => any) => handler([arg, fn]));
}
-} \ No newline at end of file
+}
+
+export type Without<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; \ No newline at end of file
diff --git a/src/client/util/UndoManager.ts b/src/client/util/UndoManager.ts
index 3cbb994b7..6d1b2f1b8 100644
--- a/src/client/util/UndoManager.ts
+++ b/src/client/util/UndoManager.ts
@@ -1,5 +1,6 @@
import { observable, action } from "mobx";
import 'source-map-support/register'
+import { Without } from "../../Utils";
function getBatchName(target: any, key: string | symbol): string {
let keyName = key.toString();
@@ -80,7 +81,7 @@ export namespace UndoManager {
}
let openBatches: Batch[] = [];
- export function GetOpenBatches(): { batchName: string, cancel: () => void }[] {
+ export function GetOpenBatches(): Without<Batch, 'end'>[] {
return openBatches;
}
export class Batch {