diff options
-rw-r--r-- | src/Utils.ts | 4 | ||||
-rw-r--r-- | src/client/util/UndoManager.ts | 3 |
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 { |