From a14a8c3a07cbdbcf7b901e789a44ab0617e93132 Mon Sep 17 00:00:00 2001 From: R Midhun Suresh Date: Wed, 17 Nov 2021 19:40:21 +0530 Subject: [PATCH] Create interface IDisposable Co-authored-by: Bruno Windels --- src/utils/Disposables.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils/Disposables.ts b/src/utils/Disposables.ts index 0317825b..9671665f 100644 --- a/src/utils/Disposables.ts +++ b/src/utils/Disposables.ts @@ -15,7 +15,11 @@ limitations under the License. */ type Func = () => void; -type Disposable = { dispose: Func; [key: string]: any } | Func; +export interface IDisposable { + dispose(): void; +} + +type Disposable = IDisposable | (() => void); function disposeValue(value: Disposable): void { if (typeof value === "function") {